id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
108,600 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java | LocationUtil.getLocationType | public static LocationType getLocationType(URI location) {
String scheme = location.getScheme();
if (EMODB_SCHEME.equals(scheme)) {
// If the host matches the locator pattern then assume host discovery, otherwise it's a
// direct URL to an EmoDB server
if (LOCATOR_PAT... | java | public static LocationType getLocationType(URI location) {
String scheme = location.getScheme();
if (EMODB_SCHEME.equals(scheme)) {
// If the host matches the locator pattern then assume host discovery, otherwise it's a
// direct URL to an EmoDB server
if (LOCATOR_PAT... | [
"public",
"static",
"LocationType",
"getLocationType",
"(",
"URI",
"location",
")",
"{",
"String",
"scheme",
"=",
"location",
".",
"getScheme",
"(",
")",
";",
"if",
"(",
"EMODB_SCHEME",
".",
"equals",
"(",
"scheme",
")",
")",
"{",
"// If the host matches the l... | Returns the location type from a location URI. | [
"Returns",
"the",
"location",
"type",
"from",
"a",
"location",
"URI",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java#L103-L118 |
108,601 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java | LocationUtil.getDataStoreIdentifier | public static String getDataStoreIdentifier(URI location, String apiKey) {
checkArgument(getLocationType(location) != LocationType.STASH, "Stash locations do not have a data source ID");
UriBuilder uriBuilder = UriBuilder.fromUri(location)
.userInfo(apiKey)
.replacePath(... | java | public static String getDataStoreIdentifier(URI location, String apiKey) {
checkArgument(getLocationType(location) != LocationType.STASH, "Stash locations do not have a data source ID");
UriBuilder uriBuilder = UriBuilder.fromUri(location)
.userInfo(apiKey)
.replacePath(... | [
"public",
"static",
"String",
"getDataStoreIdentifier",
"(",
"URI",
"location",
",",
"String",
"apiKey",
")",
"{",
"checkArgument",
"(",
"getLocationType",
"(",
"location",
")",
"!=",
"LocationType",
".",
"STASH",
",",
"\"Stash locations do not have a data source ID\"",... | Converts a location URI to a data source identifier. | [
"Converts",
"a",
"location",
"URI",
"to",
"a",
"data",
"source",
"identifier",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java#L127-L148 |
108,602 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java | LocationUtil.getCuratorForLocation | public static Optional<CuratorFramework> getCuratorForLocation(URI location) {
final String defaultConnectionString;
final String namespace;
if (getLocationType(location) != LocationType.EMO_HOST_DISCOVERY) {
// Only host discovery may require ZooKeeper
return Optional.a... | java | public static Optional<CuratorFramework> getCuratorForLocation(URI location) {
final String defaultConnectionString;
final String namespace;
if (getLocationType(location) != LocationType.EMO_HOST_DISCOVERY) {
// Only host discovery may require ZooKeeper
return Optional.a... | [
"public",
"static",
"Optional",
"<",
"CuratorFramework",
">",
"getCuratorForLocation",
"(",
"URI",
"location",
")",
"{",
"final",
"String",
"defaultConnectionString",
";",
"final",
"String",
"namespace",
";",
"if",
"(",
"getLocationType",
"(",
"location",
")",
"!=... | Returns a configured, started Curator for a given location, or absent if the location does not
use host discovery. | [
"Returns",
"a",
"configured",
"started",
"Curator",
"for",
"a",
"given",
"location",
"or",
"absent",
"if",
"the",
"location",
"does",
"not",
"use",
"host",
"discovery",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java#L198-L239 |
108,603 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java | LocationUtil.getClusterForLocation | public static String getClusterForLocation(URI location) {
Matcher matcher = getLocatorMatcher(location);
checkArgument(matcher.matches(), "Invalid location: %s", location);
final String clusterPrefix;
if (matcher.group("universe") != null) {
clusterPrefix = matcher.group("... | java | public static String getClusterForLocation(URI location) {
Matcher matcher = getLocatorMatcher(location);
checkArgument(matcher.matches(), "Invalid location: %s", location);
final String clusterPrefix;
if (matcher.group("universe") != null) {
clusterPrefix = matcher.group("... | [
"public",
"static",
"String",
"getClusterForLocation",
"(",
"URI",
"location",
")",
"{",
"Matcher",
"matcher",
"=",
"getLocatorMatcher",
"(",
"location",
")",
";",
"checkArgument",
"(",
"matcher",
".",
"matches",
"(",
")",
",",
"\"Invalid location: %s\"",
",",
"... | Returns the EmoDB cluster name associated with the given location. | [
"Returns",
"the",
"EmoDB",
"cluster",
"name",
"associated",
"with",
"the",
"given",
"location",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java#L244-L258 |
108,604 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java | LocationUtil.toLocation | public static URI toLocation(String source, String table) {
// Verify the source is a valid EmoDB URI
URI sourceUri = URI.create(source);
return toLocation(sourceUri, table);
} | java | public static URI toLocation(String source, String table) {
// Verify the source is a valid EmoDB URI
URI sourceUri = URI.create(source);
return toLocation(sourceUri, table);
} | [
"public",
"static",
"URI",
"toLocation",
"(",
"String",
"source",
",",
"String",
"table",
")",
"{",
"// Verify the source is a valid EmoDB URI",
"URI",
"sourceUri",
"=",
"URI",
".",
"create",
"(",
"source",
")",
";",
"return",
"toLocation",
"(",
"sourceUri",
","... | Returns a location URI from a source and table name. | [
"Returns",
"a",
"location",
"URI",
"from",
"a",
"source",
"and",
"table",
"name",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java#L300-L304 |
108,605 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java | LocationUtil.toLocation | public static URI toLocation(URI sourceUri, String table) {
getLocationType(sourceUri); // Raises an exception if the location type is invalid.
return UriBuilder.fromUri(sourceUri).path(table).build();
} | java | public static URI toLocation(URI sourceUri, String table) {
getLocationType(sourceUri); // Raises an exception if the location type is invalid.
return UriBuilder.fromUri(sourceUri).path(table).build();
} | [
"public",
"static",
"URI",
"toLocation",
"(",
"URI",
"sourceUri",
",",
"String",
"table",
")",
"{",
"getLocationType",
"(",
"sourceUri",
")",
";",
"// Raises an exception if the location type is invalid.",
"return",
"UriBuilder",
".",
"fromUri",
"(",
"sourceUri",
")",... | Returns a Location URI from a source URI and table name. | [
"Returns",
"a",
"Location",
"URI",
"from",
"a",
"source",
"URI",
"and",
"table",
"name",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java#L309-L312 |
108,606 | bazaarvoice/emodb | databus-client-common/src/main/java/com/bazaarvoice/emodb/databus/client/DatabusClient.java | DatabusClient.replayAsync | @Override
public String replayAsync(String apiKey, String subscription) {
return replayAsyncSince(apiKey, subscription, null);
} | java | @Override
public String replayAsync(String apiKey, String subscription) {
return replayAsyncSince(apiKey, subscription, null);
} | [
"@",
"Override",
"public",
"String",
"replayAsync",
"(",
"String",
"apiKey",
",",
"String",
"subscription",
")",
"{",
"return",
"replayAsyncSince",
"(",
"apiKey",
",",
"subscription",
",",
"null",
")",
";",
"}"
] | Any server can initiate a replay request, no need for @PartitionKey | [
"Any",
"server",
"can",
"initiate",
"a",
"replay",
"request",
"no",
"need",
"for"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus-client-common/src/main/java/com/bazaarvoice/emodb/databus/client/DatabusClient.java#L289-L292 |
108,607 | bazaarvoice/emodb | databus-client-common/src/main/java/com/bazaarvoice/emodb/databus/client/DatabusClient.java | DatabusClient.moveAsync | @Override
public String moveAsync(String apiKey, String from, String to) {
checkNotNull(from, "from");
checkNotNull(to, "to");
try {
URI uri = _databus.clone()
.segment("_move")
.queryParam("from", from)
.queryParam("to"... | java | @Override
public String moveAsync(String apiKey, String from, String to) {
checkNotNull(from, "from");
checkNotNull(to, "to");
try {
URI uri = _databus.clone()
.segment("_move")
.queryParam("from", from)
.queryParam("to"... | [
"@",
"Override",
"public",
"String",
"moveAsync",
"(",
"String",
"apiKey",
",",
"String",
"from",
",",
"String",
"to",
")",
"{",
"checkNotNull",
"(",
"from",
",",
"\"from\"",
")",
";",
"checkNotNull",
"(",
"to",
",",
"\"to\"",
")",
";",
"try",
"{",
"UR... | Any server can initiate a move request, no need for @PartitionKey | [
"Any",
"server",
"can",
"initiate",
"a",
"move",
"request",
"no",
"need",
"for"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus-client-common/src/main/java/com/bazaarvoice/emodb/databus/client/DatabusClient.java#L332-L349 |
108,608 | bazaarvoice/emodb | databus-client-common/src/main/java/com/bazaarvoice/emodb/databus/client/DatabusClient.java | DatabusClient.getMoveStatus | @Override
public MoveSubscriptionStatus getMoveStatus(String apiKey, String reference) {
checkNotNull(reference, "reference");
try {
URI uri = _databus.clone()
.segment("_move")
.segment(reference)
.build();
return _... | java | @Override
public MoveSubscriptionStatus getMoveStatus(String apiKey, String reference) {
checkNotNull(reference, "reference");
try {
URI uri = _databus.clone()
.segment("_move")
.segment(reference)
.build();
return _... | [
"@",
"Override",
"public",
"MoveSubscriptionStatus",
"getMoveStatus",
"(",
"String",
"apiKey",
",",
"String",
"reference",
")",
"{",
"checkNotNull",
"(",
"reference",
",",
"\"reference\"",
")",
";",
"try",
"{",
"URI",
"uri",
"=",
"_databus",
".",
"clone",
"(",... | Any server can get the move status, no need for @PartitionKey | [
"Any",
"server",
"can",
"get",
"the",
"move",
"status",
"no",
"need",
"for"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus-client-common/src/main/java/com/bazaarvoice/emodb/databus/client/DatabusClient.java#L352-L366 |
108,609 | bazaarvoice/emodb | common/json/src/main/java/com/bazaarvoice/emodb/common/json/deferred/LazyJsonMap.java | LazyJsonMap.deserialized | private Map<String, Object> deserialized() {
// Written as a loop to prevent the need for locking
DeserializationState deserState;
while (!(deserState = _deserState.get()).isDeserialized()) {
Map<String, Object> deserialized = JsonHelper.fromJson(deserState.json, new TypeReference<Ma... | java | private Map<String, Object> deserialized() {
// Written as a loop to prevent the need for locking
DeserializationState deserState;
while (!(deserState = _deserState.get()).isDeserialized()) {
Map<String, Object> deserialized = JsonHelper.fromJson(deserState.json, new TypeReference<Ma... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"deserialized",
"(",
")",
"{",
"// Written as a loop to prevent the need for locking",
"DeserializationState",
"deserState",
";",
"while",
"(",
"!",
"(",
"deserState",
"=",
"_deserState",
".",
"get",
"(",
")",
"... | Returns the JSON as a Map. If necessary the JSON is converted to a Map as a result of this call. | [
"Returns",
"the",
"JSON",
"as",
"a",
"Map",
".",
"If",
"necessary",
"the",
"JSON",
"is",
"converted",
"to",
"a",
"Map",
"as",
"a",
"result",
"of",
"this",
"call",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/json/src/main/java/com/bazaarvoice/emodb/common/json/deferred/LazyJsonMap.java#L122-L132 |
108,610 | bazaarvoice/emodb | common/json/src/main/java/com/bazaarvoice/emodb/common/json/deferred/LazyJsonMap.java | LazyJsonMap.put | @Override
public Object put(String key, Object value) {
DeserializationState deserializationState = _deserState.get();
if (deserializationState.isDeserialized()) {
return deserializationState.deserialized.put(key, value);
}
return deserializationState.overrides.put(key, v... | java | @Override
public Object put(String key, Object value) {
DeserializationState deserializationState = _deserState.get();
if (deserializationState.isDeserialized()) {
return deserializationState.deserialized.put(key, value);
}
return deserializationState.overrides.put(key, v... | [
"@",
"Override",
"public",
"Object",
"put",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"DeserializationState",
"deserializationState",
"=",
"_deserState",
".",
"get",
"(",
")",
";",
"if",
"(",
"deserializationState",
".",
"isDeserialized",
"(",
")... | For efficiency this method breaks the contract that the old value is returned. Otherwise common operations such
as adding intrinsics and template attributes would require deserializing the object. | [
"For",
"efficiency",
"this",
"method",
"breaks",
"the",
"contract",
"that",
"the",
"old",
"value",
"is",
"returned",
".",
"Otherwise",
"common",
"operations",
"such",
"as",
"adding",
"intrinsics",
"and",
"template",
"attributes",
"would",
"require",
"deserializing... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/json/src/main/java/com/bazaarvoice/emodb/common/json/deferred/LazyJsonMap.java#L183-L190 |
108,611 | bazaarvoice/emodb | common/json/src/main/java/com/bazaarvoice/emodb/common/json/deferred/LazyJsonMap.java | LazyJsonMap.writeTo | void writeTo(JsonGenerator generator) throws IOException {
DeserializationState deserState = _deserState.get();
if (deserState.isDeserialized()) {
// Object has already been deserialized, use standard writer
generator.writeObject(deserState.deserialized);
return;
... | java | void writeTo(JsonGenerator generator) throws IOException {
DeserializationState deserState = _deserState.get();
if (deserState.isDeserialized()) {
// Object has already been deserialized, use standard writer
generator.writeObject(deserState.deserialized);
return;
... | [
"void",
"writeTo",
"(",
"JsonGenerator",
"generator",
")",
"throws",
"IOException",
"{",
"DeserializationState",
"deserState",
"=",
"_deserState",
".",
"get",
"(",
")",
";",
"if",
"(",
"deserState",
".",
"isDeserialized",
"(",
")",
")",
"{",
"// Object has alrea... | Writes this record to the provided generator in the most efficient manner possible in the current state. | [
"Writes",
"this",
"record",
"to",
"the",
"provided",
"generator",
"in",
"the",
"most",
"efficient",
"manner",
"possible",
"in",
"the",
"current",
"state",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/json/src/main/java/com/bazaarvoice/emodb/common/json/deferred/LazyJsonMap.java#L243-L318 |
108,612 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/dedup/DefaultDedupEventStore.java | DefaultDedupEventStore.getQueueReadOnly | private SortedQueue getQueueReadOnly(String queueName, Duration waitDuration) {
DedupQueue service = getQueueReadWrite(queueName, waitDuration);
if (service != null) {
try {
return service.getQueue();
} catch (ReadOnlyQueueException e) {
// Fall th... | java | private SortedQueue getQueueReadOnly(String queueName, Duration waitDuration) {
DedupQueue service = getQueueReadWrite(queueName, waitDuration);
if (service != null) {
try {
return service.getQueue();
} catch (ReadOnlyQueueException e) {
// Fall th... | [
"private",
"SortedQueue",
"getQueueReadOnly",
"(",
"String",
"queueName",
",",
"Duration",
"waitDuration",
")",
"{",
"DedupQueue",
"service",
"=",
"getQueueReadWrite",
"(",
"queueName",
",",
"waitDuration",
")",
";",
"if",
"(",
"service",
"!=",
"null",
")",
"{",... | Returns the persistent sorted queue managed by this JVM, or a stub that supports only read-only operations if
not managed by this JVM. | [
"Returns",
"the",
"persistent",
"sorted",
"queue",
"managed",
"by",
"this",
"JVM",
"or",
"a",
"stub",
"that",
"supports",
"only",
"read",
"-",
"only",
"operations",
"if",
"not",
"managed",
"by",
"this",
"JVM",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/dedup/DefaultDedupEventStore.java#L171-L181 |
108,613 | bazaarvoice/emodb | uac-api/src/main/java/com/bazaarvoice/emodb/uac/api/UserAccessControlRequest.java | UserAccessControlRequest.setCustomRequestParameter | public void setCustomRequestParameter(String param, String... values) {
_customRequestParameters.putAll(param, Arrays.asList(values));
} | java | public void setCustomRequestParameter(String param, String... values) {
_customRequestParameters.putAll(param, Arrays.asList(values));
} | [
"public",
"void",
"setCustomRequestParameter",
"(",
"String",
"param",
",",
"String",
"...",
"values",
")",
"{",
"_customRequestParameters",
".",
"putAll",
"(",
"param",
",",
"Arrays",
".",
"asList",
"(",
"values",
")",
")",
";",
"}"
] | Sets custom request parameters. Custom parameters may include new features not yet officially supported or
additional parameters to existing calls not intended for widespread use. As such this method is not typically
used by most clients. Furthermore, adding additional parameters may cause the request to fail. | [
"Sets",
"custom",
"request",
"parameters",
".",
"Custom",
"parameters",
"may",
"include",
"new",
"features",
"not",
"yet",
"officially",
"supported",
"or",
"additional",
"parameters",
"to",
"existing",
"calls",
"not",
"intended",
"for",
"widespread",
"use",
".",
... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/uac-api/src/main/java/com/bazaarvoice/emodb/uac/api/UserAccessControlRequest.java#L21-L23 |
108,614 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/sortedq/core/SplitQueue.java | SplitQueue.remove | void remove(T obj) {
_queue.remove(obj);
if (_prioritize == obj) {
_prioritize = null;
}
} | java | void remove(T obj) {
_queue.remove(obj);
if (_prioritize == obj) {
_prioritize = null;
}
} | [
"void",
"remove",
"(",
"T",
"obj",
")",
"{",
"_queue",
".",
"remove",
"(",
"obj",
")",
";",
"if",
"(",
"_prioritize",
"==",
"obj",
")",
"{",
"_prioritize",
"=",
"null",
";",
"}",
"}"
] | Removes an object from the queue. | [
"Removes",
"an",
"object",
"from",
"the",
"queue",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/sortedq/core/SplitQueue.java#L30-L35 |
108,615 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/sortedq/core/SplitQueue.java | SplitQueue.cycle | T cycle() {
if (_prioritize != null) {
return _prioritize;
}
if (!_queue.isEmpty()) {
T first = _queue.keySet().iterator().next();
_queue.get(first); // Access the object so it gets bumped to the back of the queue.
return first;
}
... | java | T cycle() {
if (_prioritize != null) {
return _prioritize;
}
if (!_queue.isEmpty()) {
T first = _queue.keySet().iterator().next();
_queue.get(first); // Access the object so it gets bumped to the back of the queue.
return first;
}
... | [
"T",
"cycle",
"(",
")",
"{",
"if",
"(",
"_prioritize",
"!=",
"null",
")",
"{",
"return",
"_prioritize",
";",
"}",
"if",
"(",
"!",
"_queue",
".",
"isEmpty",
"(",
")",
")",
"{",
"T",
"first",
"=",
"_queue",
".",
"keySet",
"(",
")",
".",
"iterator",... | Returns the head of the queue, then cycles it to the back of the queue. | [
"Returns",
"the",
"head",
"of",
"the",
"queue",
"then",
"cycles",
"it",
"to",
"the",
"back",
"of",
"the",
"queue",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/sortedq/core/SplitQueue.java#L47-L57 |
108,616 | bazaarvoice/emodb | auth/auth-store/src/main/java/com/bazaarvoice/emodb/auth/permissions/TablePermissionManagerDAO.java | TablePermissionManagerDAO.createDelta | private Delta createDelta(PermissionUpdateRequest request) {
MapDeltaBuilder builder = Deltas.mapBuilder();
for (String permissionString : request.getPermitted()) {
builder.put("perm_" + validated(permissionString), 1);
}
for (String permissionString : request.getRevoked()) ... | java | private Delta createDelta(PermissionUpdateRequest request) {
MapDeltaBuilder builder = Deltas.mapBuilder();
for (String permissionString : request.getPermitted()) {
builder.put("perm_" + validated(permissionString), 1);
}
for (String permissionString : request.getRevoked()) ... | [
"private",
"Delta",
"createDelta",
"(",
"PermissionUpdateRequest",
"request",
")",
"{",
"MapDeltaBuilder",
"builder",
"=",
"Deltas",
".",
"mapBuilder",
"(",
")",
";",
"for",
"(",
"String",
"permissionString",
":",
"request",
".",
"getPermitted",
"(",
")",
")",
... | Returns a delta constructed from this request, or null if the request contained no changes. | [
"Returns",
"a",
"delta",
"constructed",
"from",
"this",
"request",
"or",
"null",
"if",
"the",
"request",
"contained",
"no",
"changes",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-store/src/main/java/com/bazaarvoice/emodb/auth/permissions/TablePermissionManagerDAO.java#L93-L106 |
108,617 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/ScanPlan.java | ScanPlan.addTokenRangeToCurrentBatchForCluster | public void addTokenRangeToCurrentBatchForCluster(String cluster, String placement, Collection<ScanRange> ranges) {
PlanBatch batch = _clusterTails.get(cluster);
if (batch == null) {
batch = new PlanBatch();
_clusterHeads.put(cluster, batch);
_clusterTails.put(cluster... | java | public void addTokenRangeToCurrentBatchForCluster(String cluster, String placement, Collection<ScanRange> ranges) {
PlanBatch batch = _clusterTails.get(cluster);
if (batch == null) {
batch = new PlanBatch();
_clusterHeads.put(cluster, batch);
_clusterTails.put(cluster... | [
"public",
"void",
"addTokenRangeToCurrentBatchForCluster",
"(",
"String",
"cluster",
",",
"String",
"placement",
",",
"Collection",
"<",
"ScanRange",
">",
"ranges",
")",
"{",
"PlanBatch",
"batch",
"=",
"_clusterTails",
".",
"get",
"(",
"cluster",
")",
";",
"if",... | Adds a collection of scan ranges to the plan for a specific placement. The range collection should all belong
to a single token range in the ring.
@param cluster An identifier for the underlying resources used to scan the placement (typically an identifier for the Cassandra ring)
@param placement The name of the place... | [
"Adds",
"a",
"collection",
"of",
"scan",
"ranges",
"to",
"the",
"plan",
"for",
"a",
"specific",
"placement",
".",
"The",
"range",
"collection",
"should",
"all",
"belong",
"to",
"a",
"single",
"token",
"range",
"in",
"the",
"ring",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/ScanPlan.java#L81-L89 |
108,618 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/ScanPlan.java | ScanPlan.toScanStatus | public ScanStatus toScanStatus() {
List<ScanRangeStatus> pendingRangeStatuses = Lists.newArrayList();
// Unique identifier for each scan task
int taskId = 0;
// Unique identifier for each batch
int batchId = 0;
// Unique identifier which identifies all tasks which affect... | java | public ScanStatus toScanStatus() {
List<ScanRangeStatus> pendingRangeStatuses = Lists.newArrayList();
// Unique identifier for each scan task
int taskId = 0;
// Unique identifier for each batch
int batchId = 0;
// Unique identifier which identifies all tasks which affect... | [
"public",
"ScanStatus",
"toScanStatus",
"(",
")",
"{",
"List",
"<",
"ScanRangeStatus",
">",
"pendingRangeStatuses",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"// Unique identifier for each scan task",
"int",
"taskId",
"=",
"0",
";",
"// Unique identifier for e... | Creates a ScanStatus based on the current state of the plan. All scan ranges are added as pending tasks. | [
"Creates",
"a",
"ScanStatus",
"based",
"on",
"the",
"current",
"state",
"of",
"the",
"plan",
".",
"All",
"scan",
"ranges",
"are",
"added",
"as",
"pending",
"tasks",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/ScanPlan.java#L94-L133 |
108,619 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/ScanDestination.java | ScanDestination.getDestinationWithSubpath | public ScanDestination getDestinationWithSubpath(String path) {
if (isDiscarding()) {
return discard();
}
if (path == null) {
return new ScanDestination(_uri);
}
return new ScanDestination(UriBuilder.fromUri(_uri).path(path).build());
} | java | public ScanDestination getDestinationWithSubpath(String path) {
if (isDiscarding()) {
return discard();
}
if (path == null) {
return new ScanDestination(_uri);
}
return new ScanDestination(UriBuilder.fromUri(_uri).path(path).build());
} | [
"public",
"ScanDestination",
"getDestinationWithSubpath",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"isDiscarding",
"(",
")",
")",
"{",
"return",
"discard",
"(",
")",
";",
"}",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"return",
"new",
"ScanDestination"... | Creates a new scan destination at the given path rooted at the current scan destination. | [
"Creates",
"a",
"new",
"scan",
"destination",
"at",
"the",
"given",
"path",
"rooted",
"at",
"the",
"current",
"scan",
"destination",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/ScanDestination.java#L60-L68 |
108,620 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/CassandraConfiguration.java | CassandraConfiguration.performHostDiscovery | synchronized public void performHostDiscovery(MetricRegistry metricRegistry) {
// Host discovery is not idempotent; only take action if it hasn't been performed.
if (_hostDiscoveryPerformed) {
return;
}
Iterable<String> hosts = null;
// Statically configured list of... | java | synchronized public void performHostDiscovery(MetricRegistry metricRegistry) {
// Host discovery is not idempotent; only take action if it hasn't been performed.
if (_hostDiscoveryPerformed) {
return;
}
Iterable<String> hosts = null;
// Statically configured list of... | [
"synchronized",
"public",
"void",
"performHostDiscovery",
"(",
"MetricRegistry",
"metricRegistry",
")",
"{",
"// Host discovery is not idempotent; only take action if it hasn't been performed.",
"if",
"(",
"_hostDiscoveryPerformed",
")",
"{",
"return",
";",
"}",
"Iterable",
"<"... | Discover Cassandra seeds and partitioner, if not statically configured. | [
"Discover",
"Cassandra",
"seeds",
"and",
"partitioner",
"if",
"not",
"statically",
"configured",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/CassandraConfiguration.java#L413-L459 |
108,621 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/jersey/AuthenticationResourceFilter.java | AuthenticationResourceFilter.setJettyAuthentication | private void setJettyAuthentication(Subject subject) {
// In unit test environments there may not be a current connection. If any nulls are encountered
// then, by definition, there is no container to update.
HttpConnection connection = HttpConnection.getCurrentConnection();
if (connect... | java | private void setJettyAuthentication(Subject subject) {
// In unit test environments there may not be a current connection. If any nulls are encountered
// then, by definition, there is no container to update.
HttpConnection connection = HttpConnection.getCurrentConnection();
if (connect... | [
"private",
"void",
"setJettyAuthentication",
"(",
"Subject",
"subject",
")",
"{",
"// In unit test environments there may not be a current connection. If any nulls are encountered",
"// then, by definition, there is no container to update.",
"HttpConnection",
"connection",
"=",
"HttpConne... | Certain aspects of the container, such as logging, need the authentication information to behave properly.
This method updates the request with the necessary objects to recognize the authenticated user. | [
"Certain",
"aspects",
"of",
"the",
"container",
"such",
"as",
"logging",
"need",
"the",
"authentication",
"information",
"to",
"behave",
"properly",
".",
"This",
"method",
"updates",
"the",
"request",
"with",
"the",
"necessary",
"objects",
"to",
"recognize",
"th... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/jersey/AuthenticationResourceFilter.java#L79-L96 |
108,622 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/util/CredentialEncrypter.java | CredentialEncrypter.isPotentiallyEncryptedBytes | public static boolean isPotentiallyEncryptedBytes(byte[] bytes) {
checkNotNull(bytes, "bytes");
// The number of bytes is a non-zero multiple of the block size.
try {
return bytes.length != 0 && bytes.length % Cipher.getInstance(CIPHER).getBlockSize() == 0;
} catch (Throwabl... | java | public static boolean isPotentiallyEncryptedBytes(byte[] bytes) {
checkNotNull(bytes, "bytes");
// The number of bytes is a non-zero multiple of the block size.
try {
return bytes.length != 0 && bytes.length % Cipher.getInstance(CIPHER).getBlockSize() == 0;
} catch (Throwabl... | [
"public",
"static",
"boolean",
"isPotentiallyEncryptedBytes",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"checkNotNull",
"(",
"bytes",
",",
"\"bytes\"",
")",
";",
"// The number of bytes is a non-zero multiple of the block size.",
"try",
"{",
"return",
"bytes",
".",
"l... | Returns true if the provided bytes _could_ be encrypted credentials, even if they can't be decrypted
by a specific instance. | [
"Returns",
"true",
"if",
"the",
"provided",
"bytes",
"_could_",
"be",
"encrypted",
"credentials",
"even",
"if",
"they",
"can",
"t",
"be",
"decrypted",
"by",
"a",
"specific",
"instance",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/util/CredentialEncrypter.java#L148-L158 |
108,623 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/util/CredentialEncrypter.java | CredentialEncrypter.isPotentiallyEncryptedString | public static boolean isPotentiallyEncryptedString(String string) {
checkNotNull(string, "string");
// String is base64 encoded
byte[] encryptedBytes;
try {
encryptedBytes = BaseEncoding.base64().omitPadding().decode(string);
} catch (IllegalArgumentException e) {
... | java | public static boolean isPotentiallyEncryptedString(String string) {
checkNotNull(string, "string");
// String is base64 encoded
byte[] encryptedBytes;
try {
encryptedBytes = BaseEncoding.base64().omitPadding().decode(string);
} catch (IllegalArgumentException e) {
... | [
"public",
"static",
"boolean",
"isPotentiallyEncryptedString",
"(",
"String",
"string",
")",
"{",
"checkNotNull",
"(",
"string",
",",
"\"string\"",
")",
";",
"// String is base64 encoded",
"byte",
"[",
"]",
"encryptedBytes",
";",
"try",
"{",
"encryptedBytes",
"=",
... | Returns true if the provided String _could_ be encrypted credentials, even if it can't be decrypted
by a specific instance. | [
"Returns",
"true",
"if",
"the",
"provided",
"String",
"_could_",
"be",
"encrypted",
"credentials",
"even",
"if",
"it",
"can",
"t",
"be",
"decrypted",
"by",
"a",
"specific",
"instance",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/util/CredentialEncrypter.java#L164-L176 |
108,624 | bazaarvoice/emodb | common/zookeeper/src/main/java/com/bazaarvoice/emodb/common/zookeeper/leader/PartitionedLeaderService.java | PartitionedLeaderService.getPartitionLeaderServices | public List<LeaderService> getPartitionLeaderServices() {
return _partitionLeaders.stream()
.map(PartitionLeader::getLeaderService)
.collect(Collectors.toList());
} | java | public List<LeaderService> getPartitionLeaderServices() {
return _partitionLeaders.stream()
.map(PartitionLeader::getLeaderService)
.collect(Collectors.toList());
} | [
"public",
"List",
"<",
"LeaderService",
">",
"getPartitionLeaderServices",
"(",
")",
"{",
"return",
"_partitionLeaders",
".",
"stream",
"(",
")",
".",
"map",
"(",
"PartitionLeader",
"::",
"getLeaderService",
")",
".",
"collect",
"(",
"Collectors",
".",
"toList",... | Returns the underlying leader services for each partition. The services are guaranteed to be returned
ordered by partition number. | [
"Returns",
"the",
"underlying",
"leader",
"services",
"for",
"each",
"partition",
".",
"The",
"services",
"are",
"guaranteed",
"to",
"be",
"returned",
"ordered",
"by",
"partition",
"number",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/zookeeper/src/main/java/com/bazaarvoice/emodb/common/zookeeper/leader/PartitionedLeaderService.java#L137-L141 |
108,625 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxDataReaderDAO.java | AstyanaxDataReaderDAO.decodeRows | private Iterator<Record> decodeRows(Iterator<Row<ByteBuffer, UUID>> iter, final AstyanaxTable table,
final int largeRowThreshold, final ReadConsistency consistency) {
// Avoiding pinning multiple decoded rows into memory at once.
return Iterators.transform(iter, n... | java | private Iterator<Record> decodeRows(Iterator<Row<ByteBuffer, UUID>> iter, final AstyanaxTable table,
final int largeRowThreshold, final ReadConsistency consistency) {
// Avoiding pinning multiple decoded rows into memory at once.
return Iterators.transform(iter, n... | [
"private",
"Iterator",
"<",
"Record",
">",
"decodeRows",
"(",
"Iterator",
"<",
"Row",
"<",
"ByteBuffer",
",",
"UUID",
">",
">",
"iter",
",",
"final",
"AstyanaxTable",
"table",
",",
"final",
"int",
"largeRowThreshold",
",",
"final",
"ReadConsistency",
"consiste... | Decodes rows returned by scanning a table. | [
"Decodes",
"rows",
"returned",
"by",
"scanning",
"a",
"table",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxDataReaderDAO.java#L1024-L1035 |
108,626 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/jersey/AuthResourceFilterFactory.java | AuthResourceFilterFactory.createSubstitutionMap | private Map<String,Function<HttpRequestContext, String>> createSubstitutionMap(String[] permissions, AbstractMethod am) {
Map<String, Function<HttpRequestContext, String>> map = Maps.newLinkedHashMap();
for (String permission : permissions) {
Matcher matcher = SUBSTITUTION_MATCHER.matcher(p... | java | private Map<String,Function<HttpRequestContext, String>> createSubstitutionMap(String[] permissions, AbstractMethod am) {
Map<String, Function<HttpRequestContext, String>> map = Maps.newLinkedHashMap();
for (String permission : permissions) {
Matcher matcher = SUBSTITUTION_MATCHER.matcher(p... | [
"private",
"Map",
"<",
"String",
",",
"Function",
"<",
"HttpRequestContext",
",",
"String",
">",
">",
"createSubstitutionMap",
"(",
"String",
"[",
"]",
"permissions",
",",
"AbstractMethod",
"am",
")",
"{",
"Map",
"<",
"String",
",",
"Function",
"<",
"HttpReq... | Returns a mapping from permissions found in the annotations to functions which can perform any necessary
substitutions based on actual values in the request. | [
"Returns",
"a",
"mapping",
"from",
"permissions",
"found",
"in",
"the",
"annotations",
"to",
"functions",
"which",
"can",
"perform",
"any",
"necessary",
"substitutions",
"based",
"on",
"actual",
"values",
"in",
"the",
"request",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/jersey/AuthResourceFilterFactory.java#L98-L123 |
108,627 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/core/DefaultClaimStore.java | DefaultClaimStore.removeEmptyClaimSets | private synchronized void removeEmptyClaimSets() {
Iterables.removeIf(_map.values(), new Predicate<Handle>() {
@Override
public boolean apply(Handle handle) {
handle.getClaimSet().pump();
return handle.getRefCount().get() == 0 && handle.getClaimSet().size(... | java | private synchronized void removeEmptyClaimSets() {
Iterables.removeIf(_map.values(), new Predicate<Handle>() {
@Override
public boolean apply(Handle handle) {
handle.getClaimSet().pump();
return handle.getRefCount().get() == 0 && handle.getClaimSet().size(... | [
"private",
"synchronized",
"void",
"removeEmptyClaimSets",
"(",
")",
"{",
"Iterables",
".",
"removeIf",
"(",
"_map",
".",
"values",
"(",
")",
",",
"new",
"Predicate",
"<",
"Handle",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"apply",
"(",
... | Cleans up old claim sets for subscriptions that have become inactive. Ensures the map of claim sets doesn't
grow forever. | [
"Cleans",
"up",
"old",
"claim",
"sets",
"for",
"subscriptions",
"that",
"have",
"become",
"inactive",
".",
"Ensures",
"the",
"map",
"of",
"claim",
"sets",
"doesn",
"t",
"grow",
"forever",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/core/DefaultClaimStore.java#L111-L119 |
108,628 | bazaarvoice/emodb | mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java | EmoSerDe.getObjectInspectorForType | private ObjectInspector getObjectInspectorForType(TypeInfo type)
throws SerDeException {
switch (type.getCategory()) {
case PRIMITIVE:
PrimitiveTypeInfo primitiveType = (PrimitiveTypeInfo) type;
if (isSupportedPrimitive(primitiveType)) {
... | java | private ObjectInspector getObjectInspectorForType(TypeInfo type)
throws SerDeException {
switch (type.getCategory()) {
case PRIMITIVE:
PrimitiveTypeInfo primitiveType = (PrimitiveTypeInfo) type;
if (isSupportedPrimitive(primitiveType)) {
... | [
"private",
"ObjectInspector",
"getObjectInspectorForType",
"(",
"TypeInfo",
"type",
")",
"throws",
"SerDeException",
"{",
"switch",
"(",
"type",
".",
"getCategory",
"(",
")",
")",
"{",
"case",
"PRIMITIVE",
":",
"PrimitiveTypeInfo",
"primitiveType",
"=",
"(",
"Prim... | Returns the associated ObjectInspector for a type. This most delegates the to Hive java implementations but filters
out primitives not supported by EmoDB. | [
"Returns",
"the",
"associated",
"ObjectInspector",
"for",
"a",
"type",
".",
"This",
"most",
"delegates",
"the",
"to",
"Hive",
"java",
"implementations",
"but",
"filters",
"out",
"primitives",
"not",
"supported",
"by",
"EmoDB",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java#L105-L139 |
108,629 | bazaarvoice/emodb | mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java | EmoSerDe.getRawValue | private Object getRawValue(String columnName, Map<String, Object> content)
throws ColumnNotFoundException {
String field = columnName;
Object value = content;
while (field != null) {
// If at any point in the path a null is encountered stop
if (value == null)... | java | private Object getRawValue(String columnName, Map<String, Object> content)
throws ColumnNotFoundException {
String field = columnName;
Object value = content;
while (field != null) {
// If at any point in the path a null is encountered stop
if (value == null)... | [
"private",
"Object",
"getRawValue",
"(",
"String",
"columnName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"content",
")",
"throws",
"ColumnNotFoundException",
"{",
"String",
"field",
"=",
"columnName",
";",
"Object",
"value",
"=",
"content",
";",
"while"... | Returns the raw value for a given Map. If the value was found is and is null then null is returned. If no
value is present then ColumnNotFoundException is thrown.
@throws ColumnNotFoundException The column was not found in the map | [
"Returns",
"the",
"raw",
"value",
"for",
"a",
"given",
"Map",
".",
"If",
"the",
"value",
"was",
"found",
"is",
"and",
"is",
"null",
"then",
"null",
"is",
"returned",
".",
"If",
"no",
"value",
"is",
"present",
"then",
"ColumnNotFoundException",
"is",
"thr... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java#L222-L273 |
108,630 | bazaarvoice/emodb | mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java | EmoSerDe.deserialize | private Object deserialize(TypeInfo type, Object rawValue)
throws SerDeException {
Object value = null;
if (rawValue != null) {
switch (type.getCategory()) {
case PRIMITIVE:
value = deserializePrimitive((PrimitiveTypeInfo) type, rawValue);
... | java | private Object deserialize(TypeInfo type, Object rawValue)
throws SerDeException {
Object value = null;
if (rawValue != null) {
switch (type.getCategory()) {
case PRIMITIVE:
value = deserializePrimitive((PrimitiveTypeInfo) type, rawValue);
... | [
"private",
"Object",
"deserialize",
"(",
"TypeInfo",
"type",
",",
"Object",
"rawValue",
")",
"throws",
"SerDeException",
"{",
"Object",
"value",
"=",
"null",
";",
"if",
"(",
"rawValue",
"!=",
"null",
")",
"{",
"switch",
"(",
"type",
".",
"getCategory",
"("... | Deserializes a raw value to the provided type. | [
"Deserializes",
"a",
"raw",
"value",
"to",
"the",
"provided",
"type",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java#L290-L315 |
108,631 | bazaarvoice/emodb | mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java | EmoSerDe.isSupportedPrimitive | private boolean isSupportedPrimitive(PrimitiveTypeInfo type) {
switch (type.getPrimitiveCategory()) {
case VOID:
case STRING:
case BOOLEAN:
case BYTE:
case SHORT:
case INT:
case LONG:
case FLOAT:
case DOU... | java | private boolean isSupportedPrimitive(PrimitiveTypeInfo type) {
switch (type.getPrimitiveCategory()) {
case VOID:
case STRING:
case BOOLEAN:
case BYTE:
case SHORT:
case INT:
case LONG:
case FLOAT:
case DOU... | [
"private",
"boolean",
"isSupportedPrimitive",
"(",
"PrimitiveTypeInfo",
"type",
")",
"{",
"switch",
"(",
"type",
".",
"getPrimitiveCategory",
"(",
")",
")",
"{",
"case",
"VOID",
":",
"case",
"STRING",
":",
"case",
"BOOLEAN",
":",
"case",
"BYTE",
":",
"case",... | Determines if the given primitive is supported by this deserializer. At this time the only exclusions are
BINARY, DECIMAL, VARCHAR, CHAR, and UNKNOWN. | [
"Determines",
"if",
"the",
"given",
"primitive",
"is",
"supported",
"by",
"this",
"deserializer",
".",
"At",
"this",
"time",
"the",
"only",
"exclusions",
"are",
"BINARY",
"DECIMAL",
"VARCHAR",
"CHAR",
"and",
"UNKNOWN",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java#L321-L338 |
108,632 | bazaarvoice/emodb | mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java | EmoSerDe.deserializePrimitive | private Object deserializePrimitive(PrimitiveTypeInfo type, Object value)
throws SerDeException {
switch (type.getPrimitiveCategory()) {
case VOID:
return null;
case STRING:
return deserializeString(value);
case BOOLEAN:
... | java | private Object deserializePrimitive(PrimitiveTypeInfo type, Object value)
throws SerDeException {
switch (type.getPrimitiveCategory()) {
case VOID:
return null;
case STRING:
return deserializeString(value);
case BOOLEAN:
... | [
"private",
"Object",
"deserializePrimitive",
"(",
"PrimitiveTypeInfo",
"type",
",",
"Object",
"value",
")",
"throws",
"SerDeException",
"{",
"switch",
"(",
"type",
".",
"getPrimitiveCategory",
"(",
")",
")",
"{",
"case",
"VOID",
":",
"return",
"null",
";",
"ca... | Deserializes a primitive to its corresponding Java type, doing a best-effort conversion when necessary. | [
"Deserializes",
"a",
"primitive",
"to",
"its",
"corresponding",
"Java",
"type",
"doing",
"a",
"best",
"-",
"effort",
"conversion",
"when",
"necessary",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/EmoSerDe.java#L343-L365 |
108,633 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java | AdaptiveResultSet.executeAdaptiveQueryAsync | public static ListenableFuture<ResultSet> executeAdaptiveQueryAsync(Session session, Statement statement, int fetchSize) {
return executeAdaptiveQueryAsync(session, statement, fetchSize, MAX_ADAPTATIONS);
} | java | public static ListenableFuture<ResultSet> executeAdaptiveQueryAsync(Session session, Statement statement, int fetchSize) {
return executeAdaptiveQueryAsync(session, statement, fetchSize, MAX_ADAPTATIONS);
} | [
"public",
"static",
"ListenableFuture",
"<",
"ResultSet",
">",
"executeAdaptiveQueryAsync",
"(",
"Session",
"session",
",",
"Statement",
"statement",
",",
"int",
"fetchSize",
")",
"{",
"return",
"executeAdaptiveQueryAsync",
"(",
"session",
",",
"statement",
",",
"fe... | Executes a query asychronously, dynamically adjusting the fetch size down if necessary. | [
"Executes",
"a",
"query",
"asychronously",
"dynamically",
"adjusting",
"the",
"fetch",
"size",
"down",
"if",
"necessary",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java#L51-L53 |
108,634 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java | AdaptiveResultSet.executeAdaptiveQuery | public static ResultSet executeAdaptiveQuery(Session session, Statement statement, int fetchSize) {
int remainingAdaptations = MAX_ADAPTATIONS;
while (true) {
try {
statement.setFetchSize(fetchSize);
ResultSet resultSet = session.execute(statement);
... | java | public static ResultSet executeAdaptiveQuery(Session session, Statement statement, int fetchSize) {
int remainingAdaptations = MAX_ADAPTATIONS;
while (true) {
try {
statement.setFetchSize(fetchSize);
ResultSet resultSet = session.execute(statement);
... | [
"public",
"static",
"ResultSet",
"executeAdaptiveQuery",
"(",
"Session",
"session",
",",
"Statement",
"statement",
",",
"int",
"fetchSize",
")",
"{",
"int",
"remainingAdaptations",
"=",
"MAX_ADAPTATIONS",
";",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"stateme... | Executes a query sychronously, dynamically adjusting the fetch size down if necessary. | [
"Executes",
"a",
"query",
"sychronously",
"dynamically",
"adjusting",
"the",
"fetch",
"size",
"down",
"if",
"necessary",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java#L84-L101 |
108,635 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java | AdaptiveResultSet.isAdaptiveException | private static boolean isAdaptiveException(Throwable t) {
if (t instanceof FrameTooLongException) {
return true;
}
if (t instanceof NoHostAvailableException) {
// If the issue on every host is adaptive then the exception is adaptive
Collection<Throwable> host... | java | private static boolean isAdaptiveException(Throwable t) {
if (t instanceof FrameTooLongException) {
return true;
}
if (t instanceof NoHostAvailableException) {
// If the issue on every host is adaptive then the exception is adaptive
Collection<Throwable> host... | [
"private",
"static",
"boolean",
"isAdaptiveException",
"(",
"Throwable",
"t",
")",
"{",
"if",
"(",
"t",
"instanceof",
"FrameTooLongException",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"t",
"instanceof",
"NoHostAvailableException",
")",
"{",
"// If the is... | Returns true if the exception is one which indicates that the frame size may be too large, false otherwise. | [
"Returns",
"true",
"if",
"the",
"exception",
"is",
"one",
"which",
"indicates",
"that",
"the",
"frame",
"size",
"may",
"be",
"too",
"large",
"false",
"otherwise",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java#L106-L118 |
108,636 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java | AdaptiveResultSet.reduceFetchSize | private boolean reduceFetchSize(Throwable reason) {
if (!isAdaptiveException(reason) || --_remainingAdaptations == 0) {
return false;
}
ExecutionInfo executionInfo = _delegate.getExecutionInfo();
Statement statement = executionInfo.getStatement();
PagingState pagingS... | java | private boolean reduceFetchSize(Throwable reason) {
if (!isAdaptiveException(reason) || --_remainingAdaptations == 0) {
return false;
}
ExecutionInfo executionInfo = _delegate.getExecutionInfo();
Statement statement = executionInfo.getStatement();
PagingState pagingS... | [
"private",
"boolean",
"reduceFetchSize",
"(",
"Throwable",
"reason",
")",
"{",
"if",
"(",
"!",
"isAdaptiveException",
"(",
"reason",
")",
"||",
"--",
"_remainingAdaptations",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"ExecutionInfo",
"executionInfo",
"... | Reduces the fetch size and retries the query. Returns true if the query succeeded, false if the root cause
of the exception does not indicate a frame size issue, if the frame size cannot be adjusted down any further,
or if the retried query fails for an unrelated reason. | [
"Reduces",
"the",
"fetch",
"size",
"and",
"retries",
"the",
"query",
".",
"Returns",
"true",
"if",
"the",
"query",
"succeeded",
"false",
"if",
"the",
"root",
"cause",
"of",
"the",
"exception",
"does",
"not",
"indicate",
"a",
"frame",
"size",
"issue",
"if",... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/cqldriver/AdaptiveResultSet.java#L184-L211 |
108,637 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/DAOUtils.java | DAOUtils.skipPrefix | public ByteBuffer skipPrefix(ByteBuffer value) {
value.position(value.position() + _prefixLength);
return value;
} | java | public ByteBuffer skipPrefix(ByteBuffer value) {
value.position(value.position() + _prefixLength);
return value;
} | [
"public",
"ByteBuffer",
"skipPrefix",
"(",
"ByteBuffer",
"value",
")",
"{",
"value",
".",
"position",
"(",
"value",
".",
"position",
"(",
")",
"+",
"_prefixLength",
")",
";",
"return",
"value",
";",
"}"
] | removes the hex prefix that indicates the number of blocks in the delta | [
"removes",
"the",
"hex",
"prefix",
"that",
"indicates",
"the",
"number",
"of",
"blocks",
"in",
"the",
"delta"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/DAOUtils.java#L86-L89 |
108,638 | bazaarvoice/emodb | databus/src/main/java/com/bazaarvoice/emodb/databus/repl/ReplicationClientFactory.java | ReplicationClientFactory.usingApiKey | public ReplicationClientFactory usingApiKey(String apiKey) {
if (Objects.equal(_apiKey, apiKey)) {
return this;
}
return new ReplicationClientFactory(_jerseyClient, apiKey);
} | java | public ReplicationClientFactory usingApiKey(String apiKey) {
if (Objects.equal(_apiKey, apiKey)) {
return this;
}
return new ReplicationClientFactory(_jerseyClient, apiKey);
} | [
"public",
"ReplicationClientFactory",
"usingApiKey",
"(",
"String",
"apiKey",
")",
"{",
"if",
"(",
"Objects",
".",
"equal",
"(",
"_apiKey",
",",
"apiKey",
")",
")",
"{",
"return",
"this",
";",
"}",
"return",
"new",
"ReplicationClientFactory",
"(",
"_jerseyClie... | Creates a view of this instance using the given API Key and sharing the same underlying resources.
Note that this method may return a new instance so the caller must use the returned value. | [
"Creates",
"a",
"view",
"of",
"this",
"instance",
"using",
"the",
"given",
"API",
"Key",
"and",
"sharing",
"the",
"same",
"underlying",
"resources",
".",
"Note",
"that",
"this",
"method",
"may",
"return",
"a",
"new",
"instance",
"so",
"the",
"caller",
"mus... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus/src/main/java/com/bazaarvoice/emodb/databus/repl/ReplicationClientFactory.java#L38-L43 |
108,639 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/core/DefaultDataStore.java | DefaultDataStore.resolveAnnotated | private AnnotatedContent resolveAnnotated(Record record, final ReadConsistency consistency) {
final Resolved resolved = resolve(record, consistency);
final Table table = record.getKey().getTable();
return new AnnotatedContent() {
@Override
public Map<String, Object> getC... | java | private AnnotatedContent resolveAnnotated(Record record, final ReadConsistency consistency) {
final Resolved resolved = resolve(record, consistency);
final Table table = record.getKey().getTable();
return new AnnotatedContent() {
@Override
public Map<String, Object> getC... | [
"private",
"AnnotatedContent",
"resolveAnnotated",
"(",
"Record",
"record",
",",
"final",
"ReadConsistency",
"consistency",
")",
"{",
"final",
"Resolved",
"resolved",
"=",
"resolve",
"(",
"record",
",",
"consistency",
")",
";",
"final",
"Table",
"table",
"=",
"r... | Resolve a set of changes, returning an interface that includes info about specific change IDs. | [
"Resolve",
"a",
"set",
"of",
"changes",
"returning",
"an",
"interface",
"that",
"includes",
"info",
"about",
"specific",
"change",
"IDs",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/core/DefaultDataStore.java#L435-L456 |
108,640 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/core/DefaultDataStore.java | DefaultDataStore.createFacade | @Override
public void createFacade(String table, FacadeOptions facadeOptions, Audit audit) {
checkLegalTableName(table);
checkNotNull(facadeOptions, "facadeDefinition");
checkNotNull(audit, "audit");
_tableDao.createFacade(table, facadeOptions, audit);
} | java | @Override
public void createFacade(String table, FacadeOptions facadeOptions, Audit audit) {
checkLegalTableName(table);
checkNotNull(facadeOptions, "facadeDefinition");
checkNotNull(audit, "audit");
_tableDao.createFacade(table, facadeOptions, audit);
} | [
"@",
"Override",
"public",
"void",
"createFacade",
"(",
"String",
"table",
",",
"FacadeOptions",
"facadeOptions",
",",
"Audit",
"audit",
")",
"{",
"checkLegalTableName",
"(",
"table",
")",
";",
"checkNotNull",
"(",
"facadeOptions",
",",
"\"facadeDefinition\"",
")"... | Facade related methods | [
"Facade",
"related",
"methods"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/core/DefaultDataStore.java#L775-L781 |
108,641 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/owner/OstrichOwnerGroup.java | OstrichOwnerGroup.startIfOwner | @Nullable
@Override
public T startIfOwner(String name, Duration waitDuration) {
long timeoutAt = System.currentTimeMillis() + waitDuration.toMillis();
LeaderService leaderService = _leaderMap.getUnchecked(name).orNull();
if (leaderService == null || !awaitRunning(leaderService, timeoutAt... | java | @Nullable
@Override
public T startIfOwner(String name, Duration waitDuration) {
long timeoutAt = System.currentTimeMillis() + waitDuration.toMillis();
LeaderService leaderService = _leaderMap.getUnchecked(name).orNull();
if (leaderService == null || !awaitRunning(leaderService, timeoutAt... | [
"@",
"Nullable",
"@",
"Override",
"public",
"T",
"startIfOwner",
"(",
"String",
"name",
",",
"Duration",
"waitDuration",
")",
"{",
"long",
"timeoutAt",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"waitDuration",
".",
"toMillis",
"(",
")",
";",
... | Returns the specified managed service if this server is responsible for the specified object and has won a
ZooKeeper-managed leader election.
@param name object name. Whether this server owns the object is computed by Ostrich using consistent hashing.
@param waitDuration the amount of time to wait for this server to w... | [
"Returns",
"the",
"specified",
"managed",
"service",
"if",
"this",
"server",
"is",
"responsible",
"for",
"the",
"specified",
"object",
"and",
"has",
"won",
"a",
"ZooKeeper",
"-",
"managed",
"leader",
"election",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/owner/OstrichOwnerGroup.java#L115-L144 |
108,642 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/owner/OstrichOwnerGroup.java | OstrichOwnerGroup.awaitRunning | private boolean awaitRunning(Service service, long timeoutAt) {
if (service.isRunning()) {
return true;
}
long waitMillis = timeoutAt - System.currentTimeMillis();
if (waitMillis <= 0) {
return false;
}
try {
service.start().get(waitMil... | java | private boolean awaitRunning(Service service, long timeoutAt) {
if (service.isRunning()) {
return true;
}
long waitMillis = timeoutAt - System.currentTimeMillis();
if (waitMillis <= 0) {
return false;
}
try {
service.start().get(waitMil... | [
"private",
"boolean",
"awaitRunning",
"(",
"Service",
"service",
",",
"long",
"timeoutAt",
")",
"{",
"if",
"(",
"service",
".",
"isRunning",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"long",
"waitMillis",
"=",
"timeoutAt",
"-",
"System",
".",
"curr... | Returns true if the Guava service entered the RUNNING state within the specified time period. | [
"Returns",
"true",
"if",
"the",
"Guava",
"service",
"entered",
"the",
"RUNNING",
"state",
"within",
"the",
"specified",
"time",
"period",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/owner/OstrichOwnerGroup.java#L241-L255 |
108,643 | bazaarvoice/emodb | common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/TimeUUIDs.java | TimeUUIDs.compare | public static int compare(UUID uuid1, UUID uuid2) {
int timeResult = Longs.compare(uuid1.timestamp(), uuid2.timestamp());
if (timeResult != 0) {
return timeResult;
}
// if the time component is identical, break ties using the clockSeqAndNode
// component (the 64 least... | java | public static int compare(UUID uuid1, UUID uuid2) {
int timeResult = Longs.compare(uuid1.timestamp(), uuid2.timestamp());
if (timeResult != 0) {
return timeResult;
}
// if the time component is identical, break ties using the clockSeqAndNode
// component (the 64 least... | [
"public",
"static",
"int",
"compare",
"(",
"UUID",
"uuid1",
",",
"UUID",
"uuid2",
")",
"{",
"int",
"timeResult",
"=",
"Longs",
".",
"compare",
"(",
"uuid1",
".",
"timestamp",
"(",
")",
",",
"uuid2",
".",
"timestamp",
"(",
")",
")",
";",
"if",
"(",
... | Compare two time UUIDs deterministically, first by their embedded timestamp,
next by their node-specific sequence number, finally breaking ties using
their embedded node identifier.\
@throws UnsupportedOperationException if either uuid is not a timestamp UUID | [
"Compare",
"two",
"time",
"UUIDs",
"deterministically",
"first",
"by",
"their",
"embedded",
"timestamp",
"next",
"by",
"their",
"node",
"-",
"specific",
"sequence",
"number",
"finally",
"breaking",
"ties",
"using",
"their",
"embedded",
"node",
"identifier",
".",
... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/TimeUUIDs.java#L158-L169 |
108,644 | bazaarvoice/emodb | common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/TimeUUIDs.java | TimeUUIDs.compareTimestamps | public static int compareTimestamps(UUID uuid1, UUID uuid2) {
return Longs.compare(uuid1.timestamp(), uuid2.timestamp());
} | java | public static int compareTimestamps(UUID uuid1, UUID uuid2) {
return Longs.compare(uuid1.timestamp(), uuid2.timestamp());
} | [
"public",
"static",
"int",
"compareTimestamps",
"(",
"UUID",
"uuid1",
",",
"UUID",
"uuid2",
")",
"{",
"return",
"Longs",
".",
"compare",
"(",
"uuid1",
".",
"timestamp",
"(",
")",
",",
"uuid2",
".",
"timestamp",
"(",
")",
")",
";",
"}"
] | Compare the embedded timestamps of the given UUIDs. This is used when it is OK to return
an equality based on timestamps alone
@throws UnsupportedOperationException if either uuid is not a timestamp UUID | [
"Compare",
"the",
"embedded",
"timestamps",
"of",
"the",
"given",
"UUIDs",
".",
"This",
"is",
"used",
"when",
"it",
"is",
"OK",
"to",
"return",
"an",
"equality",
"based",
"on",
"timestamps",
"alone"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/TimeUUIDs.java#L176-L178 |
108,645 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/BaseInputFormat.java | BaseInputFormat.getSplits | public static Iterable<SplitPath> getSplits(final Configuration config, Path[] paths) {
final int splitSize = getSplitSize(config);
return FluentIterable.from(Arrays.asList(paths))
.transformAndConcat(new Function<Path, Iterable<? extends SplitPath>>() {
@Override
... | java | public static Iterable<SplitPath> getSplits(final Configuration config, Path[] paths) {
final int splitSize = getSplitSize(config);
return FluentIterable.from(Arrays.asList(paths))
.transformAndConcat(new Function<Path, Iterable<? extends SplitPath>>() {
@Override
... | [
"public",
"static",
"Iterable",
"<",
"SplitPath",
">",
"getSplits",
"(",
"final",
"Configuration",
"config",
",",
"Path",
"[",
"]",
"paths",
")",
"{",
"final",
"int",
"splitSize",
"=",
"getSplitSize",
"(",
"config",
")",
";",
"return",
"FluentIterable",
".",... | Gets the splits for a given list of EmoDB paths. | [
"Gets",
"the",
"splits",
"for",
"a",
"given",
"list",
"of",
"EmoDB",
"paths",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/BaseInputFormat.java#L40-L55 |
108,646 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/BaseInputFormat.java | BaseInputFormat.createRecordReader | public static BaseRecordReader createRecordReader(Configuration config, Path path)
throws IOException {
EmoInputSplittable emoFs = (EmoInputSplittable) path.getFileSystem(config);
return emoFs.getBaseRecordReader(config, path, getSplitSize(config));
} | java | public static BaseRecordReader createRecordReader(Configuration config, Path path)
throws IOException {
EmoInputSplittable emoFs = (EmoInputSplittable) path.getFileSystem(config);
return emoFs.getBaseRecordReader(config, path, getSplitSize(config));
} | [
"public",
"static",
"BaseRecordReader",
"createRecordReader",
"(",
"Configuration",
"config",
",",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"EmoInputSplittable",
"emoFs",
"=",
"(",
"EmoInputSplittable",
")",
"path",
".",
"getFileSystem",
"(",
"config",
")"... | Gets a record reader for a given split. | [
"Gets",
"a",
"record",
"reader",
"for",
"a",
"given",
"split",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/BaseInputFormat.java#L60-L64 |
108,647 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTable.java | AstyanaxTable.hasUUID | boolean hasUUID(long uuid) {
if (_readStorage.hasUUID(uuid)) {
return true;
}
for (AstyanaxStorage storage : _writeStorage) {
if (storage.hasUUID(uuid)) {
return true;
}
}
return false;
} | java | boolean hasUUID(long uuid) {
if (_readStorage.hasUUID(uuid)) {
return true;
}
for (AstyanaxStorage storage : _writeStorage) {
if (storage.hasUUID(uuid)) {
return true;
}
}
return false;
} | [
"boolean",
"hasUUID",
"(",
"long",
"uuid",
")",
"{",
"if",
"(",
"_readStorage",
".",
"hasUUID",
"(",
"uuid",
")",
")",
"{",
"return",
"true",
";",
"}",
"for",
"(",
"AstyanaxStorage",
"storage",
":",
"_writeStorage",
")",
"{",
"if",
"(",
"storage",
".",... | Test if a given UUID matches this table. | [
"Test",
"if",
"a",
"given",
"UUID",
"matches",
"this",
"table",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTable.java#L93-L103 |
108,648 | JodaOrg/joda-convert | src/main/java/org/joda/convert/TypeUtils.java | TypeUtils.parse | static Type parse(String str) {
try {
return doParse(str);
} catch (RuntimeException ex) {
throw ex;
} catch (Exception ex) {
throw new RuntimeException(ex);
}
} | java | static Type parse(String str) {
try {
return doParse(str);
} catch (RuntimeException ex) {
throw ex;
} catch (Exception ex) {
throw new RuntimeException(ex);
}
} | [
"static",
"Type",
"parse",
"(",
"String",
"str",
")",
"{",
"try",
"{",
"return",
"doParse",
"(",
"str",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"ex",
")",
"{",
"throw",
"ex",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"throw",
"n... | Parses the TypeToken string format.
@param str the string
@return the token | [
"Parses",
"the",
"TypeToken",
"string",
"format",
"."
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/TypeUtils.java#L71-L79 |
108,649 | JodaOrg/joda-convert | src/main/java/org/joda/convert/TypeUtils.java | TypeUtils.doParse | private static Type doParse(String str) throws Exception {
Class<?> token = PRIMITIVES.get(str);
if (token != null) {
return token;
}
int first = str.indexOf('<');
if (first < 0) {
return StringConvert.loadType(str);
}
int last = str.lastIn... | java | private static Type doParse(String str) throws Exception {
Class<?> token = PRIMITIVES.get(str);
if (token != null) {
return token;
}
int first = str.indexOf('<');
if (first < 0) {
return StringConvert.loadType(str);
}
int last = str.lastIn... | [
"private",
"static",
"Type",
"doParse",
"(",
"String",
"str",
")",
"throws",
"Exception",
"{",
"Class",
"<",
"?",
">",
"token",
"=",
"PRIMITIVES",
".",
"get",
"(",
"str",
")",
";",
"if",
"(",
"token",
"!=",
"null",
")",
"{",
"return",
"token",
";",
... | parse an element | [
"parse",
"an",
"element"
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/TypeUtils.java#L82-L121 |
108,650 | JodaOrg/joda-convert | src/main/java/org/joda/convert/TypeUtils.java | TypeUtils.split | private static List<String> split(String str) {
List<String> result = new ArrayList<String>();
int genericCount = 0;
int startPos = 0;
for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) == ',' && genericCount == 0) {
result.add(str.substring(startPos, ... | java | private static List<String> split(String str) {
List<String> result = new ArrayList<String>();
int genericCount = 0;
int startPos = 0;
for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) == ',' && genericCount == 0) {
result.add(str.substring(startPos, ... | [
"private",
"static",
"List",
"<",
"String",
">",
"split",
"(",
"String",
"str",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"int",
"genericCount",
"=",
"0",
";",
"int",
"startPos",
"=",
... | split by comma, handling nested generified types | [
"split",
"by",
"comma",
"handling",
"nested",
"generified",
"types"
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/TypeUtils.java#L124-L140 |
108,651 | JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.tryRegisterGuava | private void tryRegisterGuava() {
try {
// Guava is not a direct dependency, which is significant in the Java 9 module system
// to access Guava this module must add a read edge to the module graph
// but since this code is written for Java 6, we have to do this by reflec... | java | private void tryRegisterGuava() {
try {
// Guava is not a direct dependency, which is significant in the Java 9 module system
// to access Guava this module must add a read edge to the module graph
// but since this code is written for Java 6, we have to do this by reflec... | [
"private",
"void",
"tryRegisterGuava",
"(",
")",
"{",
"try",
"{",
"// Guava is not a direct dependency, which is significant in the Java 9 module system\r",
"// to access Guava this module must add a read edge to the module graph\r",
"// but since this code is written for Java 6, we have to do t... | Tries to register the Guava converters class. | [
"Tries",
"to",
"register",
"the",
"Guava",
"converters",
"class",
"."
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L196-L233 |
108,652 | JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.tryRegisterJava8Optionals | private void tryRegisterJava8Optionals() {
try {
loadType("java.util.OptionalInt");
@SuppressWarnings("unchecked")
Class<?> cls1 = (Class<TypedStringConverter<?>>) loadType("org.joda.convert.OptionalIntStringConverter");
TypedStringConverter<?> conv1 = (Typed... | java | private void tryRegisterJava8Optionals() {
try {
loadType("java.util.OptionalInt");
@SuppressWarnings("unchecked")
Class<?> cls1 = (Class<TypedStringConverter<?>>) loadType("org.joda.convert.OptionalIntStringConverter");
TypedStringConverter<?> conv1 = (Typed... | [
"private",
"void",
"tryRegisterJava8Optionals",
"(",
")",
"{",
"try",
"{",
"loadType",
"(",
"\"java.util.OptionalInt\"",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Class",
"<",
"?",
">",
"cls1",
"=",
"(",
"Class",
"<",
"TypedStringConverter",... | Tries to register the Java 8 optional classes. | [
"Tries",
"to",
"register",
"the",
"Java",
"8",
"optional",
"classes",
"."
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L238-L261 |
108,653 | JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.tryRegisterTimeZone | private void tryRegisterTimeZone() {
try {
registered.put(SimpleTimeZone.class, JDKStringConverter.TIME_ZONE);
} catch (Throwable ex) {
if (LOG) {
System.err.println("tryRegisterTimeZone1: " + ex);
}
}
try {
TimeZ... | java | private void tryRegisterTimeZone() {
try {
registered.put(SimpleTimeZone.class, JDKStringConverter.TIME_ZONE);
} catch (Throwable ex) {
if (LOG) {
System.err.println("tryRegisterTimeZone1: " + ex);
}
}
try {
TimeZ... | [
"private",
"void",
"tryRegisterTimeZone",
"(",
")",
"{",
"try",
"{",
"registered",
".",
"put",
"(",
"SimpleTimeZone",
".",
"class",
",",
"JDKStringConverter",
".",
"TIME_ZONE",
")",
";",
"}",
"catch",
"(",
"Throwable",
"ex",
")",
"{",
"if",
"(",
"LOG",
"... | Tries to register the subclasses of TimeZone.
Try various things, doesn't matter if the map entry gets overwritten. | [
"Tries",
"to",
"register",
"the",
"subclasses",
"of",
"TimeZone",
".",
"Try",
"various",
"things",
"doesn",
"t",
"matter",
"if",
"the",
"map",
"entry",
"gets",
"overwritten",
"."
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L267-L294 |
108,654 | JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.tryRegisterJava8 | private void tryRegisterJava8() {
try {
tryRegister("java.time.Instant", "parse");
tryRegister("java.time.Duration", "parse");
tryRegister("java.time.LocalDate", "parse");
tryRegister("java.time.LocalTime", "parse");
tryRegister("java.time.LocalD... | java | private void tryRegisterJava8() {
try {
tryRegister("java.time.Instant", "parse");
tryRegister("java.time.Duration", "parse");
tryRegister("java.time.LocalDate", "parse");
tryRegister("java.time.LocalTime", "parse");
tryRegister("java.time.LocalD... | [
"private",
"void",
"tryRegisterJava8",
"(",
")",
"{",
"try",
"{",
"tryRegister",
"(",
"\"java.time.Instant\"",
",",
"\"parse\"",
")",
";",
"tryRegister",
"(",
"\"java.time.Duration\"",
",",
"\"parse\"",
")",
";",
"tryRegister",
"(",
"\"java.time.LocalDate\"",
",",
... | Tries to register Java 8 classes. | [
"Tries",
"to",
"register",
"Java",
"8",
"classes",
"."
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L299-L322 |
108,655 | JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.tryRegisterThreeTenBackport | private void tryRegisterThreeTenBackport() {
try {
tryRegister("org.threeten.bp.Instant", "parse");
tryRegister("org.threeten.bp.Duration", "parse");
tryRegister("org.threeten.bp.LocalDate", "parse");
tryRegister("org.threeten.bp.LocalTime", "parse");
... | java | private void tryRegisterThreeTenBackport() {
try {
tryRegister("org.threeten.bp.Instant", "parse");
tryRegister("org.threeten.bp.Duration", "parse");
tryRegister("org.threeten.bp.LocalDate", "parse");
tryRegister("org.threeten.bp.LocalTime", "parse");
... | [
"private",
"void",
"tryRegisterThreeTenBackport",
"(",
")",
"{",
"try",
"{",
"tryRegister",
"(",
"\"org.threeten.bp.Instant\"",
",",
"\"parse\"",
")",
";",
"tryRegister",
"(",
"\"org.threeten.bp.Duration\"",
",",
"\"parse\"",
")",
";",
"tryRegister",
"(",
"\"org.three... | Tries to register ThreeTen backport classes. | [
"Tries",
"to",
"register",
"ThreeTen",
"backport",
"classes",
"."
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L327-L350 |
108,656 | JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.loadType | static Class<?> loadType(String fullName) throws ClassNotFoundException {
try {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
return loader != null ? loader.loadClass(fullName) : Class.forName(fullName);
} catch (ClassNotFoundException ex) {
... | java | static Class<?> loadType(String fullName) throws ClassNotFoundException {
try {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
return loader != null ? loader.loadClass(fullName) : Class.forName(fullName);
} catch (ClassNotFoundException ex) {
... | [
"static",
"Class",
"<",
"?",
">",
"loadType",
"(",
"String",
"fullName",
")",
"throws",
"ClassNotFoundException",
"{",
"try",
"{",
"ClassLoader",
"loader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"return",
... | loads a type avoiding nulls, context class loader if available | [
"loads",
"a",
"type",
"avoiding",
"nulls",
"context",
"class",
"loader",
"if",
"available"
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L854-L861 |
108,657 | JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.loadPrimitiveType | private static Class<?> loadPrimitiveType(String fullName, ClassNotFoundException ex) throws ClassNotFoundException {
if (fullName.equals("int")) {
return int.class;
} else if (fullName.equals("long")) {
return long.class;
} else if (fullName.equals("double")) {
... | java | private static Class<?> loadPrimitiveType(String fullName, ClassNotFoundException ex) throws ClassNotFoundException {
if (fullName.equals("int")) {
return int.class;
} else if (fullName.equals("long")) {
return long.class;
} else if (fullName.equals("double")) {
... | [
"private",
"static",
"Class",
"<",
"?",
">",
"loadPrimitiveType",
"(",
"String",
"fullName",
",",
"ClassNotFoundException",
"ex",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"fullName",
".",
"equals",
"(",
"\"int\"",
")",
")",
"{",
"return",
"int"... | handle primitive types | [
"handle",
"primitive",
"types"
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L864-L885 |
108,658 | JodaOrg/joda-convert | src/main/java/org/joda/convert/AnnotationStringConverterFactory.java | AnnotationStringConverterFactory.findAnnotatedConverter | private <T> StringConverter<T> findAnnotatedConverter(final Class<T> cls) {
Method toString = findToStringMethod(cls); // checks superclasses
if (toString == null) {
return null;
}
MethodConstructorStringConverter<T> con = findFromStringConstructor(cls, toString);
Me... | java | private <T> StringConverter<T> findAnnotatedConverter(final Class<T> cls) {
Method toString = findToStringMethod(cls); // checks superclasses
if (toString == null) {
return null;
}
MethodConstructorStringConverter<T> con = findFromStringConstructor(cls, toString);
Me... | [
"private",
"<",
"T",
">",
"StringConverter",
"<",
"T",
">",
"findAnnotatedConverter",
"(",
"final",
"Class",
"<",
"T",
">",
"cls",
")",
"{",
"Method",
"toString",
"=",
"findToStringMethod",
"(",
"cls",
")",
";",
"// checks superclasses",
"if",
"(",
"toString... | Finds a converter searching annotated.
@param <T> the type of the converter
@param cls the class to find a method for, not null
@return the converter, not null
@throws RuntimeException if none found | [
"Finds",
"a",
"converter",
"searching",
"annotated",
"."
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/AnnotationStringConverterFactory.java#L62-L76 |
108,659 | JodaOrg/joda-convert | src/main/java/org/joda/convert/AnnotationStringConverterFactory.java | AnnotationStringConverterFactory.eliminateEnumSubclass | private Class<?> eliminateEnumSubclass(Class<?> cls) {
Class<?> sup = cls.getSuperclass();
if (sup != null && sup.getSuperclass() == Enum.class) {
return sup;
}
return cls;
} | java | private Class<?> eliminateEnumSubclass(Class<?> cls) {
Class<?> sup = cls.getSuperclass();
if (sup != null && sup.getSuperclass() == Enum.class) {
return sup;
}
return cls;
} | [
"private",
"Class",
"<",
"?",
">",
"eliminateEnumSubclass",
"(",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"Class",
"<",
"?",
">",
"sup",
"=",
"cls",
".",
"getSuperclass",
"(",
")",
";",
"if",
"(",
"sup",
"!=",
"null",
"&&",
"sup",
".",
"getSupercla... | eliminates enum subclass as they are pesky | [
"eliminates",
"enum",
"subclass",
"as",
"they",
"are",
"pesky"
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/AnnotationStringConverterFactory.java#L239-L245 |
108,660 | JodaOrg/joda-convert | src/main/java/org/joda/convert/RenameHandler.java | RenameHandler.createInstance | private static RenameHandler createInstance() {
// log errors to System.err, as problems in static initializers can be troublesome to diagnose
RenameHandler instance = create(false);
try {
// calling loadFromClasspath() is the best option even though it mutates INSTANCE
/... | java | private static RenameHandler createInstance() {
// log errors to System.err, as problems in static initializers can be troublesome to diagnose
RenameHandler instance = create(false);
try {
// calling loadFromClasspath() is the best option even though it mutates INSTANCE
/... | [
"private",
"static",
"RenameHandler",
"createInstance",
"(",
")",
"{",
"// log errors to System.err, as problems in static initializers can be troublesome to diagnose",
"RenameHandler",
"instance",
"=",
"create",
"(",
"false",
")",
";",
"try",
"{",
"// calling loadFromClasspath()... | this is a method to aid IDE debugging of class initialization | [
"this",
"is",
"a",
"method",
"to",
"aid",
"IDE",
"debugging",
"of",
"class",
"initialization"
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/RenameHandler.java#L80-L96 |
108,661 | JodaOrg/joda-convert | src/main/java/org/joda/convert/RenameHandler.java | RenameHandler.lookupType | public Class<?> lookupType(String name) throws ClassNotFoundException {
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
Class<?> type = typeRenames.get(name);
if (type == null) {
type = StringConvert.loadType(name);
}
... | java | public Class<?> lookupType(String name) throws ClassNotFoundException {
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
Class<?> type = typeRenames.get(name);
if (type == null) {
type = StringConvert.loadType(name);
}
... | [
"public",
"Class",
"<",
"?",
">",
"lookupType",
"(",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"name must not be null\"",
")",
";",
"}",
"Class"... | Lookup a type from a name, handling renames.
@param name the name of the type to lookup, not null
@return the type, not null
@throws ClassNotFoundException if the name is not a valid type | [
"Lookup",
"a",
"type",
"from",
"a",
"name",
"handling",
"renames",
"."
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/RenameHandler.java#L191-L200 |
108,662 | JodaOrg/joda-convert | src/main/java/org/joda/convert/RenameHandler.java | RenameHandler.lookupEnum | public <T extends Enum<T>> T lookupEnum(Class<T> type, String name) {
if (type == null) {
throw new IllegalArgumentException("type must not be null");
}
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
Map<String, Enum<?>>... | java | public <T extends Enum<T>> T lookupEnum(Class<T> type, String name) {
if (type == null) {
throw new IllegalArgumentException("type must not be null");
}
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
Map<String, Enum<?>>... | [
"public",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"lookupEnum",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"name",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"type mu... | Lookup an enum from a name, handling renames.
@param <T> the type of the desired enum
@param type the enum type, not null
@param name the name of the enum to lookup, not null
@return the enum value, not null
@throws IllegalArgumentException if the name is not a valid enum constant | [
"Lookup",
"an",
"enum",
"from",
"a",
"name",
"handling",
"renames",
"."
] | 266bd825f4550590d5dafdf4225c548559e0633b | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/RenameHandler.java#L267-L280 |
108,663 | bazaarvoice/jersey-hmac-auth | client/src/main/java/com/bazaarvoice/auth/hmac/client/RequestEncoder.java | RequestEncoder.getSerializedEntity | private byte[] getSerializedEntity(ClientRequest request) {
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
// By using the RequestWriter parent class, we match the behavior of entity writing from
// for example, com.sun.jersey.client.urlconnection.... | java | private byte[] getSerializedEntity(ClientRequest request) {
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
// By using the RequestWriter parent class, we match the behavior of entity writing from
// for example, com.sun.jersey.client.urlconnection.... | [
"private",
"byte",
"[",
"]",
"getSerializedEntity",
"(",
"ClientRequest",
"request",
")",
"{",
"final",
"ByteArrayOutputStream",
"outputStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"try",
"{",
"// By using the RequestWriter parent class, we match the behavio... | Get the serialized representation of the request entity. This is used when generating the client
signature, because this is the representation that the server will receive and use when it generates
the server-side signature to compare to the client-side signature.
@see com.sun.jersey.client.urlconnection.URLConnection... | [
"Get",
"the",
"serialized",
"representation",
"of",
"the",
"request",
"entity",
".",
"This",
"is",
"used",
"when",
"generating",
"the",
"client",
"signature",
"because",
"this",
"is",
"the",
"representation",
"that",
"the",
"server",
"will",
"receive",
"and",
... | 17e2a40a4b7b783de4d77ad97f8a623af6baf688 | https://github.com/bazaarvoice/jersey-hmac-auth/blob/17e2a40a4b7b783de4d77ad97f8a623af6baf688/client/src/main/java/com/bazaarvoice/auth/hmac/client/RequestEncoder.java#L98-L118 |
108,664 | bazaarvoice/jersey-hmac-auth | common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractCachingAuthenticator.java | AbstractCachingAuthenticator.cachePrincipal | protected void cachePrincipal(String apiKey, Principal principal) {
cache.put(apiKey, Optional.fromNullable(principal));
} | java | protected void cachePrincipal(String apiKey, Principal principal) {
cache.put(apiKey, Optional.fromNullable(principal));
} | [
"protected",
"void",
"cachePrincipal",
"(",
"String",
"apiKey",
",",
"Principal",
"principal",
")",
"{",
"cache",
".",
"put",
"(",
"apiKey",
",",
"Optional",
".",
"fromNullable",
"(",
"principal",
")",
")",
";",
"}"
] | Put this principal directly into cache. This can avoid lookup on
user request and "prepay" the lookup cost.
@param apiKey the api key
@param principal the principal | [
"Put",
"this",
"principal",
"directly",
"into",
"cache",
".",
"This",
"can",
"avoid",
"lookup",
"on",
"user",
"request",
"and",
"prepay",
"the",
"lookup",
"cost",
"."
] | 17e2a40a4b7b783de4d77ad97f8a623af6baf688 | https://github.com/bazaarvoice/jersey-hmac-auth/blob/17e2a40a4b7b783de4d77ad97f8a623af6baf688/common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractCachingAuthenticator.java#L67-L69 |
108,665 | bazaarvoice/jersey-hmac-auth | common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractAuthenticator.java | AbstractAuthenticator.validateTimestamp | private boolean validateTimestamp(String timestamp) {
DateTime requestTime = TimeUtils.parse(timestamp);
long difference = Math.abs(new Duration(requestTime, nowInUTC()).getMillis());
return difference <= allowedTimestampRange;
} | java | private boolean validateTimestamp(String timestamp) {
DateTime requestTime = TimeUtils.parse(timestamp);
long difference = Math.abs(new Duration(requestTime, nowInUTC()).getMillis());
return difference <= allowedTimestampRange;
} | [
"private",
"boolean",
"validateTimestamp",
"(",
"String",
"timestamp",
")",
"{",
"DateTime",
"requestTime",
"=",
"TimeUtils",
".",
"parse",
"(",
"timestamp",
")",
";",
"long",
"difference",
"=",
"Math",
".",
"abs",
"(",
"new",
"Duration",
"(",
"requestTime",
... | To protect against replay attacks, make sure the timestamp on the request is valid
by ensuring that the difference between the request time and the current time on the
server does not fall outside the acceptable time range. Note that the request time
may have been generated on a different machine and so it may be ahead... | [
"To",
"protect",
"against",
"replay",
"attacks",
"make",
"sure",
"the",
"timestamp",
"on",
"the",
"request",
"is",
"valid",
"by",
"ensuring",
"that",
"the",
"difference",
"between",
"the",
"request",
"time",
"and",
"the",
"current",
"time",
"on",
"the",
"ser... | 17e2a40a4b7b783de4d77ad97f8a623af6baf688 | https://github.com/bazaarvoice/jersey-hmac-auth/blob/17e2a40a4b7b783de4d77ad97f8a623af6baf688/common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractAuthenticator.java#L101-L105 |
108,666 | bazaarvoice/jersey-hmac-auth | common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractAuthenticator.java | AbstractAuthenticator.validateSignature | private boolean validateSignature(Credentials credentials, String secretKey) {
String clientSignature = credentials.getSignature();
String serverSignature = createSignature(credentials, secretKey);
return MessageDigest.isEqual(clientSignature.getBytes(), serverSignature.getBytes());
} | java | private boolean validateSignature(Credentials credentials, String secretKey) {
String clientSignature = credentials.getSignature();
String serverSignature = createSignature(credentials, secretKey);
return MessageDigest.isEqual(clientSignature.getBytes(), serverSignature.getBytes());
} | [
"private",
"boolean",
"validateSignature",
"(",
"Credentials",
"credentials",
",",
"String",
"secretKey",
")",
"{",
"String",
"clientSignature",
"=",
"credentials",
".",
"getSignature",
"(",
")",
";",
"String",
"serverSignature",
"=",
"createSignature",
"(",
"creden... | Validate the signature on the request by generating a new signature here and making sure
they match. The only way for them to match is if both signature are generated using the
same secret key. If they match, this means that the requester has a valid secret key and
can be a trusted source.
@param credentials the crede... | [
"Validate",
"the",
"signature",
"on",
"the",
"request",
"by",
"generating",
"a",
"new",
"signature",
"here",
"and",
"making",
"sure",
"they",
"match",
".",
"The",
"only",
"way",
"for",
"them",
"to",
"match",
"is",
"if",
"both",
"signature",
"are",
"generat... | 17e2a40a4b7b783de4d77ad97f8a623af6baf688 | https://github.com/bazaarvoice/jersey-hmac-auth/blob/17e2a40a4b7b783de4d77ad97f8a623af6baf688/common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractAuthenticator.java#L117-L121 |
108,667 | bazaarvoice/jersey-hmac-auth | common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractAuthenticator.java | AbstractAuthenticator.createSignature | private String createSignature(Credentials credentials, String secretKey) {
return new SignatureGenerator().generate(
secretKey,
credentials.getMethod(),
credentials.getTimestamp(),
credentials.getPath(),
credentials.getContent());
... | java | private String createSignature(Credentials credentials, String secretKey) {
return new SignatureGenerator().generate(
secretKey,
credentials.getMethod(),
credentials.getTimestamp(),
credentials.getPath(),
credentials.getContent());
... | [
"private",
"String",
"createSignature",
"(",
"Credentials",
"credentials",
",",
"String",
"secretKey",
")",
"{",
"return",
"new",
"SignatureGenerator",
"(",
")",
".",
"generate",
"(",
"secretKey",
",",
"credentials",
".",
"getMethod",
"(",
")",
",",
"credentials... | Create a signature given the set of request credentials and a secret key.
@param credentials the credentials specified on the request
@param secretKey the secret key that will be used to generate the signature
@return the signature | [
"Create",
"a",
"signature",
"given",
"the",
"set",
"of",
"request",
"credentials",
"and",
"a",
"secret",
"key",
"."
] | 17e2a40a4b7b783de4d77ad97f8a623af6baf688 | https://github.com/bazaarvoice/jersey-hmac-auth/blob/17e2a40a4b7b783de4d77ad97f8a623af6baf688/common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractAuthenticator.java#L130-L137 |
108,668 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinView.java | PinView.clear | public void clear() {
for (int i = 0; i < mNumberPinBoxes; i++) {
getPinBox(i).getText().clear();
}
checkPinBoxesAvailableOrder();
} | java | public void clear() {
for (int i = 0; i < mNumberPinBoxes; i++) {
getPinBox(i).getText().clear();
}
checkPinBoxesAvailableOrder();
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mNumberPinBoxes",
";",
"i",
"++",
")",
"{",
"getPinBox",
"(",
"i",
")",
".",
"getText",
"(",
")",
".",
"clear",
"(",
")",
";",
"}",
"checkPinBoxesAvailabl... | Clear PinBoxes values | [
"Clear",
"PinBoxes",
"values"
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinView.java#L176-L182 |
108,669 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinView.java | PinView.resetChildrenFocus | public void resetChildrenFocus() {
for (int pinBoxesId : pinBoxesIds) {
EditText pin = (EditText) findViewById(pinBoxesId);
pin.setOnFocusChangeListener(this);
}
} | java | public void resetChildrenFocus() {
for (int pinBoxesId : pinBoxesIds) {
EditText pin = (EditText) findViewById(pinBoxesId);
pin.setOnFocusChangeListener(this);
}
} | [
"public",
"void",
"resetChildrenFocus",
"(",
")",
"{",
"for",
"(",
"int",
"pinBoxesId",
":",
"pinBoxesIds",
")",
"{",
"EditText",
"pin",
"=",
"(",
"EditText",
")",
"findViewById",
"(",
"pinBoxesId",
")",
";",
"pin",
".",
"setOnFocusChangeListener",
"(",
"thi... | Clear PinBoxes focus | [
"Clear",
"PinBoxes",
"focus"
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinView.java#L187-L192 |
108,670 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinViewUtils.java | PinViewUtils.convertPixelToDp | public static float convertPixelToDp(Context context, float px) {
Resources resources = context.getResources();
DisplayMetrics metrics = resources.getDisplayMetrics();
return px / (metrics.densityDpi / 160f);
} | java | public static float convertPixelToDp(Context context, float px) {
Resources resources = context.getResources();
DisplayMetrics metrics = resources.getDisplayMetrics();
return px / (metrics.densityDpi / 160f);
} | [
"public",
"static",
"float",
"convertPixelToDp",
"(",
"Context",
"context",
",",
"float",
"px",
")",
"{",
"Resources",
"resources",
"=",
"context",
".",
"getResources",
"(",
")",
";",
"DisplayMetrics",
"metrics",
"=",
"resources",
".",
"getDisplayMetrics",
"(",
... | This method converts device specific pixels to density independent pixels.
@param px A value in px (pixels) unit. Which we need to convert into db
@param context Context to get resources and device specific display metrics
@return A float value to represent dp equivalent to px value | [
"This",
"method",
"converts",
"device",
"specific",
"pixels",
"to",
"density",
"independent",
"pixels",
"."
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinViewUtils.java#L83-L87 |
108,671 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinViewUtils.java | PinViewUtils.hideKeyboard | public static void hideKeyboard(Context context) {
try {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
View currentFocus = ((Activity) context).getCurrentFocus();
if (imm != null && currentFocus != null) {
... | java | public static void hideKeyboard(Context context) {
try {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
View currentFocus = ((Activity) context).getCurrentFocus();
if (imm != null && currentFocus != null) {
... | [
"public",
"static",
"void",
"hideKeyboard",
"(",
"Context",
"context",
")",
"{",
"try",
"{",
"InputMethodManager",
"imm",
"=",
"(",
"InputMethodManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"INPUT_METHOD_SERVICE",
")",
";",
"View",
"cur... | Hides the already popped up keyboard from the screen.
@param context Context to get current focus. | [
"Hides",
"the",
"already",
"popped",
"up",
"keyboard",
"from",
"the",
"screen",
"."
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinViewUtils.java#L94-L107 |
108,672 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java | PinViewBaseHelper.createEditModeView | private void createEditModeView(Context context) {
((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
.inflate(R.layout.pin_view_edit_mode, this,
true);
} | java | private void createEditModeView(Context context) {
((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
.inflate(R.layout.pin_view_edit_mode, this,
true);
} | [
"private",
"void",
"createEditModeView",
"(",
"Context",
"context",
")",
"{",
"(",
"(",
"LayoutInflater",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"LAYOUT_INFLATER_SERVICE",
")",
")",
".",
"inflate",
"(",
"R",
".",
"layout",
".",
"pin_view... | This method inflates the PinView to be visible from Preview Layout
@param context {@link PinViewBaseHelper} needs a context to inflate Edit layout | [
"This",
"method",
"inflates",
"the",
"PinView",
"to",
"be",
"visible",
"from",
"Preview",
"Layout"
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java#L91-L95 |
108,673 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java | PinViewBaseHelper.createView | private void createView(Context context) {
((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.pin_view, this,
true);
inputMethodManager = (InputMethodManager) getContext().getSystemService(Service.INPUT_METHOD_SERVICE);
mLinearLayoutPinT... | java | private void createView(Context context) {
((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.pin_view, this,
true);
inputMethodManager = (InputMethodManager) getContext().getSystemService(Service.INPUT_METHOD_SERVICE);
mLinearLayoutPinT... | [
"private",
"void",
"createView",
"(",
"Context",
"context",
")",
"{",
"(",
"(",
"LayoutInflater",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"LAYOUT_INFLATER_SERVICE",
")",
")",
".",
"inflate",
"(",
"R",
".",
"layout",
".",
"pin_view",
","... | This method inflates the PinView
@param context {@link PinViewBaseHelper} needs a context to inflate the layout | [
"This",
"method",
"inflates",
"the",
"PinView"
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java#L102-L108 |
108,674 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java | PinViewBaseHelper.getAttributes | private void getAttributes(Context context, AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.PinView);
if (typedArray != null) {
try {
mNumberPinBoxes = typedArray
.getInteger(R.styleable.PinView_numberPi... | java | private void getAttributes(Context context, AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.PinView);
if (typedArray != null) {
try {
mNumberPinBoxes = typedArray
.getInteger(R.styleable.PinView_numberPi... | [
"private",
"void",
"getAttributes",
"(",
"Context",
"context",
",",
"AttributeSet",
"attrs",
")",
"{",
"TypedArray",
"typedArray",
"=",
"context",
".",
"obtainStyledAttributes",
"(",
"attrs",
",",
"R",
".",
"styleable",
".",
"PinView",
")",
";",
"if",
"(",
"... | Retrieve styles attributes | [
"Retrieve",
"styles",
"attributes"
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java#L113-L168 |
108,675 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java | PinViewBaseHelper.setStylePinBox | private void setStylePinBox(EditText editText) {
editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(mNumberCharacters)});
if (mMaskPassword) {
editText.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
else{
editText.setTransf... | java | private void setStylePinBox(EditText editText) {
editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(mNumberCharacters)});
if (mMaskPassword) {
editText.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
else{
editText.setTransf... | [
"private",
"void",
"setStylePinBox",
"(",
"EditText",
"editText",
")",
"{",
"editText",
".",
"setFilters",
"(",
"new",
"InputFilter",
"[",
"]",
"{",
"new",
"InputFilter",
".",
"LengthFilter",
"(",
"mNumberCharacters",
")",
"}",
")",
";",
"if",
"(",
"mMaskPas... | Set a PinBox with all attributes
@param editText to set attributes | [
"Set",
"a",
"PinBox",
"with",
"all",
"attributes"
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java#L200-L225 |
108,676 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java | PinViewBaseHelper.setStylesPinTitle | private void setStylesPinTitle(TextView pinTitle) {
if (mColorTextTitles != PinViewSettings.DEFAULT_TEXT_COLOR_TITLES) {
pinTitle.setTextColor(mColorTextTitles);
}
pinTitle.setTextSize(PinViewUtils.convertPixelToDp(getContext(), mTextSizeTitles));
} | java | private void setStylesPinTitle(TextView pinTitle) {
if (mColorTextTitles != PinViewSettings.DEFAULT_TEXT_COLOR_TITLES) {
pinTitle.setTextColor(mColorTextTitles);
}
pinTitle.setTextSize(PinViewUtils.convertPixelToDp(getContext(), mTextSizeTitles));
} | [
"private",
"void",
"setStylesPinTitle",
"(",
"TextView",
"pinTitle",
")",
"{",
"if",
"(",
"mColorTextTitles",
"!=",
"PinViewSettings",
".",
"DEFAULT_TEXT_COLOR_TITLES",
")",
"{",
"pinTitle",
".",
"setTextColor",
"(",
"mColorTextTitles",
")",
";",
"}",
"pinTitle",
... | Set a Title with all attributes
@param pinTitle to set attributes | [
"Set",
"a",
"Title",
"with",
"all",
"attributes"
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java#L264-L269 |
108,677 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java | PinViewBaseHelper.setStylesSplit | private void setStylesSplit(TextView split) {
if(split!=null){
split.setText(mSplit);
split.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT));
split.setGravity(Gravity.CENTER_VERTICAL);
... | java | private void setStylesSplit(TextView split) {
if(split!=null){
split.setText(mSplit);
split.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT));
split.setGravity(Gravity.CENTER_VERTICAL);
... | [
"private",
"void",
"setStylesSplit",
"(",
"TextView",
"split",
")",
"{",
"if",
"(",
"split",
"!=",
"null",
")",
"{",
"split",
".",
"setText",
"(",
"mSplit",
")",
";",
"split",
".",
"setLayoutParams",
"(",
"new",
"LayoutParams",
"(",
"ViewGroup",
".",
"La... | Set a Split with all attributes
@param split to set attributes | [
"Set",
"a",
"Split",
"with",
"all",
"attributes"
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java#L303-L314 |
108,678 | DavidPizarro/PinView | library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java | PinViewBaseHelper.dispatchKeyEventPreIme | @Override
public boolean dispatchKeyEventPreIme(KeyEvent event) {
if (mKeyboardMandatory) {
if (getContext() != null) {
InputMethodManager imm = (InputMethodManager) getContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.is... | java | @Override
public boolean dispatchKeyEventPreIme(KeyEvent event) {
if (mKeyboardMandatory) {
if (getContext() != null) {
InputMethodManager imm = (InputMethodManager) getContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.is... | [
"@",
"Override",
"public",
"boolean",
"dispatchKeyEventPreIme",
"(",
"KeyEvent",
"event",
")",
"{",
"if",
"(",
"mKeyboardMandatory",
")",
"{",
"if",
"(",
"getContext",
"(",
")",
"!=",
"null",
")",
"{",
"InputMethodManager",
"imm",
"=",
"(",
"InputMethodManager... | Keyboard back button | [
"Keyboard",
"back",
"button"
] | b171a89694921475b5442585810b8475ef1cfe35 | https://github.com/DavidPizarro/PinView/blob/b171a89694921475b5442585810b8475ef1cfe35/library/src/main/java/com/dpizarro/pinview/library/PinViewBaseHelper.java#L452-L467 |
108,679 | jxnet/Jxnet | jxnet-core/src/main/java/com/ardikars/jxnet/DataLinkType.java | DataLinkType.valueOf | public static DataLinkType valueOf(short value) {
for (Map.Entry<DataLinkType, Short> entry : registry.entrySet()) {
if (entry.getValue() == value) {
return entry.getKey();
}
}
return new DataLinkType((short) -1, "Unknown");
} | java | public static DataLinkType valueOf(short value) {
for (Map.Entry<DataLinkType, Short> entry : registry.entrySet()) {
if (entry.getValue() == value) {
return entry.getKey();
}
}
return new DataLinkType((short) -1, "Unknown");
} | [
"public",
"static",
"DataLinkType",
"valueOf",
"(",
"short",
"value",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"DataLinkType",
",",
"Short",
">",
"entry",
":",
"registry",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
"entry",
".",
"getValue",... | Get datalink type from value.
@param value value.
@return returns datalink type. | [
"Get",
"datalink",
"type",
"from",
"value",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-core/src/main/java/com/ardikars/jxnet/DataLinkType.java#L73-L80 |
108,680 | jxnet/Jxnet | jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java | JxnetAutoConfiguration.netmask | @ConditionalOnClass({Inet4Address.class, PcapIf.class})
//ConditionalOnBean({PcapIf.class})
@Bean(NETMASK_BEAN_NAME)
public Inet4Address netmask(@Qualifier(PCAP_IF_BEAN_NAME) PcapIf pcapIf) {
Iterator<PcapAddr> iterator = pcapIf.getAddresses().iterator();
while (iterator.hasNext()) {
... | java | @ConditionalOnClass({Inet4Address.class, PcapIf.class})
//ConditionalOnBean({PcapIf.class})
@Bean(NETMASK_BEAN_NAME)
public Inet4Address netmask(@Qualifier(PCAP_IF_BEAN_NAME) PcapIf pcapIf) {
Iterator<PcapAddr> iterator = pcapIf.getAddresses().iterator();
while (iterator.hasNext()) {
... | [
"@",
"ConditionalOnClass",
"(",
"{",
"Inet4Address",
".",
"class",
",",
"PcapIf",
".",
"class",
"}",
")",
"//ConditionalOnBean({PcapIf.class})",
"@",
"Bean",
"(",
"NETMASK_BEAN_NAME",
")",
"public",
"Inet4Address",
"netmask",
"(",
"@",
"Qualifier",
"(",
"PCAP_IF_B... | Default netmask.
@param pcapIf default {@link PcapIf} object.
@return returns default netmask specified by {@link PcapIf} object. | [
"Default",
"netmask",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java#L153-L171 |
108,681 | jxnet/Jxnet | jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java | JxnetAutoConfiguration.macAddress | @ConditionalOnClass({MacAddress.class, PcapIf.class, PcapAddr.class, SockAddr.class,
DeviceNotFoundException.class, PlatformNotSupportedException.class})
//@ConditionalOnBean(PcapIf.class)
@Bean(MAC_ADDRESS_BEAN_NAME)
public MacAddress macAddress(@Qualifier(PCAP_IF_BEAN_NAME) PcapIf pcapIf)
... | java | @ConditionalOnClass({MacAddress.class, PcapIf.class, PcapAddr.class, SockAddr.class,
DeviceNotFoundException.class, PlatformNotSupportedException.class})
//@ConditionalOnBean(PcapIf.class)
@Bean(MAC_ADDRESS_BEAN_NAME)
public MacAddress macAddress(@Qualifier(PCAP_IF_BEAN_NAME) PcapIf pcapIf)
... | [
"@",
"ConditionalOnClass",
"(",
"{",
"MacAddress",
".",
"class",
",",
"PcapIf",
".",
"class",
",",
"PcapAddr",
".",
"class",
",",
"SockAddr",
".",
"class",
",",
"DeviceNotFoundException",
".",
"class",
",",
"PlatformNotSupportedException",
".",
"class",
"}",
"... | Default mac address specified by pcapIf.
@param pcapIf pcapIf.
@return returns mac address.
@throws PlatformNotSupportedException platform not supported exception.
@throws DeviceNotFoundException device not found exception.
@throws SocketException socket exception. | [
"Default",
"mac",
"address",
"specified",
"by",
"pcapIf",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java#L181-L209 |
108,682 | jxnet/Jxnet | jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java | JxnetAutoConfiguration.dataLinkType | @ConditionalOnClass({Context.class, DataLinkType.class})
//@ConditionalOnBean(Context.class)
@Bean(DATALINK_TYPE_BEAN_NAME)
public DataLinkType dataLinkType(@Qualifier(CONTEXT_BEAN_NAME) Context context) {
DataLinkType dataLinkType = context.pcapDataLink();
if (LOGGER.isDebugEnabled()) {
... | java | @ConditionalOnClass({Context.class, DataLinkType.class})
//@ConditionalOnBean(Context.class)
@Bean(DATALINK_TYPE_BEAN_NAME)
public DataLinkType dataLinkType(@Qualifier(CONTEXT_BEAN_NAME) Context context) {
DataLinkType dataLinkType = context.pcapDataLink();
if (LOGGER.isDebugEnabled()) {
... | [
"@",
"ConditionalOnClass",
"(",
"{",
"Context",
".",
"class",
",",
"DataLinkType",
".",
"class",
"}",
")",
"//@ConditionalOnBean(Context.class)",
"@",
"Bean",
"(",
"DATALINK_TYPE_BEAN_NAME",
")",
"public",
"DataLinkType",
"dataLinkType",
"(",
"@",
"Qualifier",
"(",
... | A handle link type.
@param context application context.
@return returns {@link com.ardikars.jxpacket.common.layer.DataLinkLayer}. | [
"A",
"handle",
"link",
"type",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java#L216-L225 |
108,683 | jxnet/Jxnet | jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java | JxnetAutoConfiguration.errbuf | @Bean(ERRBUF_BEAN_NAME)
public StringBuilder errbuf() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Create error buffer with size: {}.", PCAP_ERRBUF_SIZE);
}
return new StringBuilder(PCAP_ERRBUF_SIZE);
} | java | @Bean(ERRBUF_BEAN_NAME)
public StringBuilder errbuf() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Create error buffer with size: {}.", PCAP_ERRBUF_SIZE);
}
return new StringBuilder(PCAP_ERRBUF_SIZE);
} | [
"@",
"Bean",
"(",
"ERRBUF_BEAN_NAME",
")",
"public",
"StringBuilder",
"errbuf",
"(",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Create error buffer with size: {}.\"",
",",
"PCAP_ERRBUF_SIZE",
")",
... | Error buffer.
@return error buffer. | [
"Error",
"buffer",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java#L231-L237 |
108,684 | jxnet/Jxnet | jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java | JxnetAutoConfiguration.executorService | @Bean(EXECUTOR_SERVICE_BEAN_NAME)
public ExecutorService executorService() {
if (this.properties.getNumberOfThread() == 0) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Use cached thread pool.");
}
return Executors.newCachedThreadPool();
}
... | java | @Bean(EXECUTOR_SERVICE_BEAN_NAME)
public ExecutorService executorService() {
if (this.properties.getNumberOfThread() == 0) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Use cached thread pool.");
}
return Executors.newCachedThreadPool();
}
... | [
"@",
"Bean",
"(",
"EXECUTOR_SERVICE_BEAN_NAME",
")",
"public",
"ExecutorService",
"executorService",
"(",
")",
"{",
"if",
"(",
"this",
".",
"properties",
".",
"getNumberOfThread",
"(",
")",
"==",
"0",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"("... | Thread pool.
@return returns {@link ExecutorService} object. | [
"Thread",
"pool",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java#L243-L255 |
108,685 | jxnet/Jxnet | jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java | JxnetAutoConfiguration.pcapBuilder | @ConditionalOnClass({PcapIf.class})
//@ConditionalOnBean({PcapIf.class, StringBuilder.class})
@Bean(PCAP_BUILDER_BEAN_NAME)
public Pcap.Builder pcapBuilder(@Qualifier(PCAP_IF_BEAN_NAME) PcapIf pcapIf,
@Qualifier(ERRBUF_BEAN_NAME) StringBuilder errbuf) {
String sou... | java | @ConditionalOnClass({PcapIf.class})
//@ConditionalOnBean({PcapIf.class, StringBuilder.class})
@Bean(PCAP_BUILDER_BEAN_NAME)
public Pcap.Builder pcapBuilder(@Qualifier(PCAP_IF_BEAN_NAME) PcapIf pcapIf,
@Qualifier(ERRBUF_BEAN_NAME) StringBuilder errbuf) {
String sou... | [
"@",
"ConditionalOnClass",
"(",
"{",
"PcapIf",
".",
"class",
"}",
")",
"//@ConditionalOnBean({PcapIf.class, StringBuilder.class})",
"@",
"Bean",
"(",
"PCAP_BUILDER_BEAN_NAME",
")",
"public",
"Pcap",
".",
"Builder",
"pcapBuilder",
"(",
"@",
"Qualifier",
"(",
"PCAP_IF_B... | Pcap builder.
@param pcapIf pcap if.
@param errbuf error buffer.
@return returns pcap builder. | [
"Pcap",
"builder",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java#L263-L284 |
108,686 | jxnet/Jxnet | jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java | JxnetAutoConfiguration.context | @ConditionalOnClass({Pcap.class, Inet4Address.class, Context.class})
//@ConditionalOnBean({Pcap.Builder.class, Inet4Address.class})
@Bean(CONTEXT_BEAN_NAME)
public Context context(@Qualifier(PCAP_BUILDER_BEAN_NAME) Pcap.Builder builder,
@Qualifier(NETMASK_BEAN_NAME) Inet4Address n... | java | @ConditionalOnClass({Pcap.class, Inet4Address.class, Context.class})
//@ConditionalOnBean({Pcap.Builder.class, Inet4Address.class})
@Bean(CONTEXT_BEAN_NAME)
public Context context(@Qualifier(PCAP_BUILDER_BEAN_NAME) Pcap.Builder builder,
@Qualifier(NETMASK_BEAN_NAME) Inet4Address n... | [
"@",
"ConditionalOnClass",
"(",
"{",
"Pcap",
".",
"class",
",",
"Inet4Address",
".",
"class",
",",
"Context",
".",
"class",
"}",
")",
"//@ConditionalOnBean({Pcap.Builder.class, Inet4Address.class})",
"@",
"Bean",
"(",
"CONTEXT_BEAN_NAME",
")",
"public",
"Context",
"... | Jxnet application context.
@param builder pcap builder.
@param netmask netmask.
@return returns application context. | [
"Jxnet",
"application",
"context",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-spring-boot-autoconfigure/src/main/java/com/ardikars/jxnet/spring/boot/autoconfigure/JxnetAutoConfiguration.java#L292-L342 |
108,687 | jxnet/Jxnet | jxnet-context/src/main/java/com/ardikars/jxnet/Application.java | Application.getApplicationContext | public static Context getApplicationContext() {
com.ardikars.jxnet.context.Context context = com.ardikars.jxnet.context.Application.getApplicationContext();
return new ApplicationContext(context);
} | java | public static Context getApplicationContext() {
com.ardikars.jxnet.context.Context context = com.ardikars.jxnet.context.Application.getApplicationContext();
return new ApplicationContext(context);
} | [
"public",
"static",
"Context",
"getApplicationContext",
"(",
")",
"{",
"com",
".",
"ardikars",
".",
"jxnet",
".",
"context",
".",
"Context",
"context",
"=",
"com",
".",
"ardikars",
".",
"jxnet",
".",
"context",
".",
"Application",
".",
"getApplicationContext",... | Get application context.
@return application context. | [
"Get",
"application",
"context",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-context/src/main/java/com/ardikars/jxnet/Application.java#L50-L53 |
108,688 | jxnet/Jxnet | jxnet-core/src/main/java/com/ardikars/jxnet/util/DefaultLibraryLoader.java | DefaultLibraryLoader.load | @Override
public void load(Callback<Void> callback, Class[] loadClasses) {
boolean doNotLoad = false;
for (Class clazzes : loadClasses) {
try {
Class.forName(clazzes.getName());
} catch (ClassNotFoundException e) {
callback.onFailure(e);
... | java | @Override
public void load(Callback<Void> callback, Class[] loadClasses) {
boolean doNotLoad = false;
for (Class clazzes : loadClasses) {
try {
Class.forName(clazzes.getName());
} catch (ClassNotFoundException e) {
callback.onFailure(e);
... | [
"@",
"Override",
"public",
"void",
"load",
"(",
"Callback",
"<",
"Void",
">",
"callback",
",",
"Class",
"[",
"]",
"loadClasses",
")",
"{",
"boolean",
"doNotLoad",
"=",
"false",
";",
"for",
"(",
"Class",
"clazzes",
":",
"loadClasses",
")",
"{",
"try",
"... | Load classes then perform load native library. | [
"Load",
"classes",
"then",
"perform",
"load",
"native",
"library",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-core/src/main/java/com/ardikars/jxnet/util/DefaultLibraryLoader.java#L62-L76 |
108,689 | jxnet/Jxnet | jxnet-example/src/main/java/com/ardikars/jxnet/example/Application.java | Application.pcapIf | public static PcapIf pcapIf(StringBuilder errbuf) throws DeviceNotFoundException {
String source = Application.source;
List<PcapIf> alldevsp = new ArrayList<PcapIf>();
if (PcapFindAllDevs(alldevsp, errbuf) != OK && LOGGER.isLoggable(Level.WARNING)) {
LOGGER.warning("Error: {}" + errb... | java | public static PcapIf pcapIf(StringBuilder errbuf) throws DeviceNotFoundException {
String source = Application.source;
List<PcapIf> alldevsp = new ArrayList<PcapIf>();
if (PcapFindAllDevs(alldevsp, errbuf) != OK && LOGGER.isLoggable(Level.WARNING)) {
LOGGER.warning("Error: {}" + errb... | [
"public",
"static",
"PcapIf",
"pcapIf",
"(",
"StringBuilder",
"errbuf",
")",
"throws",
"DeviceNotFoundException",
"{",
"String",
"source",
"=",
"Application",
".",
"source",
";",
"List",
"<",
"PcapIf",
">",
"alldevsp",
"=",
"new",
"ArrayList",
"<",
"PcapIf",
"... | Get default pcap interface.
@param errbuf error buffer.
@return returns PcapIf.
@throws DeviceNotFoundException device not found exception. | [
"Get",
"default",
"pcap",
"interface",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-example/src/main/java/com/ardikars/jxnet/example/Application.java#L189-L214 |
108,690 | jxnet/Jxnet | jxnet-core/src/main/java/com/ardikars/jxnet/SockAddr.java | SockAddr.getData | public byte[] getData() {
if (this.data == null) {
return new byte[] { };
}
if (this.data.length == 0) {
Family family = getSaFamily();
if (family == Family.AF_INET6) {
this.data = new byte[Inet6Address.IPV6_ADDRESS_LENGTH];
} else ... | java | public byte[] getData() {
if (this.data == null) {
return new byte[] { };
}
if (this.data.length == 0) {
Family family = getSaFamily();
if (family == Family.AF_INET6) {
this.data = new byte[Inet6Address.IPV6_ADDRESS_LENGTH];
} else ... | [
"public",
"byte",
"[",
"]",
"getData",
"(",
")",
"{",
"if",
"(",
"this",
".",
"data",
"==",
"null",
")",
"{",
"return",
"new",
"byte",
"[",
"]",
"{",
"}",
";",
"}",
"if",
"(",
"this",
".",
"data",
".",
"length",
"==",
"0",
")",
"{",
"Family",... | Returns bytes address of SockAddr.
@return returns bytes address. | [
"Returns",
"bytes",
"address",
"of",
"SockAddr",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-core/src/main/java/com/ardikars/jxnet/SockAddr.java#L79-L94 |
108,691 | jxnet/Jxnet | jxnet-core/src/main/java/com/ardikars/jxnet/PcapAddr.java | PcapAddr.getAddr | public SockAddr getAddr() {
SockAddr sockAddr = null;
if (this.addr != null) {
sockAddr = new SockAddr(this.addr.getSaFamily().getValue(), this.addr.getData());
}
return sockAddr;
} | java | public SockAddr getAddr() {
SockAddr sockAddr = null;
if (this.addr != null) {
sockAddr = new SockAddr(this.addr.getSaFamily().getValue(), this.addr.getData());
}
return sockAddr;
} | [
"public",
"SockAddr",
"getAddr",
"(",
")",
"{",
"SockAddr",
"sockAddr",
"=",
"null",
";",
"if",
"(",
"this",
".",
"addr",
"!=",
"null",
")",
"{",
"sockAddr",
"=",
"new",
"SockAddr",
"(",
"this",
".",
"addr",
".",
"getSaFamily",
"(",
")",
".",
"getVal... | Getting interface address.
@return returns interface address. | [
"Getting",
"interface",
"address",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-core/src/main/java/com/ardikars/jxnet/PcapAddr.java#L67-L73 |
108,692 | jxnet/Jxnet | jxnet-core/src/main/java/com/ardikars/jxnet/PcapAddr.java | PcapAddr.getNetmask | public SockAddr getNetmask() {
SockAddr sockAddr = null;
if (this.netmask != null) {
sockAddr = new SockAddr(this.netmask.getSaFamily().getValue(), this.netmask.getData());
}
return sockAddr;
} | java | public SockAddr getNetmask() {
SockAddr sockAddr = null;
if (this.netmask != null) {
sockAddr = new SockAddr(this.netmask.getSaFamily().getValue(), this.netmask.getData());
}
return sockAddr;
} | [
"public",
"SockAddr",
"getNetmask",
"(",
")",
"{",
"SockAddr",
"sockAddr",
"=",
"null",
";",
"if",
"(",
"this",
".",
"netmask",
"!=",
"null",
")",
"{",
"sockAddr",
"=",
"new",
"SockAddr",
"(",
"this",
".",
"netmask",
".",
"getSaFamily",
"(",
")",
".",
... | Getting interface netmask.
@return returns interface netmask. | [
"Getting",
"interface",
"netmask",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-core/src/main/java/com/ardikars/jxnet/PcapAddr.java#L79-L85 |
108,693 | jxnet/Jxnet | jxnet-core/src/main/java/com/ardikars/jxnet/PcapAddr.java | PcapAddr.getBroadAddr | public SockAddr getBroadAddr() {
SockAddr sockAddr = null;
if (this.broadaddr != null) {
sockAddr = new SockAddr(this.broadaddr.getSaFamily().getValue(), this.broadaddr.getData());
}
return sockAddr;
} | java | public SockAddr getBroadAddr() {
SockAddr sockAddr = null;
if (this.broadaddr != null) {
sockAddr = new SockAddr(this.broadaddr.getSaFamily().getValue(), this.broadaddr.getData());
}
return sockAddr;
} | [
"public",
"SockAddr",
"getBroadAddr",
"(",
")",
"{",
"SockAddr",
"sockAddr",
"=",
"null",
";",
"if",
"(",
"this",
".",
"broadaddr",
"!=",
"null",
")",
"{",
"sockAddr",
"=",
"new",
"SockAddr",
"(",
"this",
".",
"broadaddr",
".",
"getSaFamily",
"(",
")",
... | Getting interface broadcast address.
@return returns interface broadcast address. | [
"Getting",
"interface",
"broadcast",
"address",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-core/src/main/java/com/ardikars/jxnet/PcapAddr.java#L91-L97 |
108,694 | jxnet/Jxnet | jxnet-core/src/main/java/com/ardikars/jxnet/PcapAddr.java | PcapAddr.getDstAddr | public SockAddr getDstAddr() {
SockAddr sockAddr = null;
if (this.dstaddr != null) {
sockAddr = new SockAddr(this.dstaddr.getSaFamily().getValue(), this.dstaddr.getData());
}
return sockAddr;
} | java | public SockAddr getDstAddr() {
SockAddr sockAddr = null;
if (this.dstaddr != null) {
sockAddr = new SockAddr(this.dstaddr.getSaFamily().getValue(), this.dstaddr.getData());
}
return sockAddr;
} | [
"public",
"SockAddr",
"getDstAddr",
"(",
")",
"{",
"SockAddr",
"sockAddr",
"=",
"null",
";",
"if",
"(",
"this",
".",
"dstaddr",
"!=",
"null",
")",
"{",
"sockAddr",
"=",
"new",
"SockAddr",
"(",
"this",
".",
"dstaddr",
".",
"getSaFamily",
"(",
")",
".",
... | Getting interface destination address.
@return returns interface destination address. | [
"Getting",
"interface",
"destination",
"address",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-core/src/main/java/com/ardikars/jxnet/PcapAddr.java#L103-L109 |
108,695 | jxnet/Jxnet | jxnet-core/src/main/java/com/ardikars/jxnet/PcapPktHdr.java | PcapPktHdr.newInstance | public static PcapPktHdr newInstance(final int caplen, final int len, final int tvSec, final long tvUsec) {
return new PcapPktHdr(caplen, len, tvSec, tvUsec);
} | java | public static PcapPktHdr newInstance(final int caplen, final int len, final int tvSec, final long tvUsec) {
return new PcapPktHdr(caplen, len, tvSec, tvUsec);
} | [
"public",
"static",
"PcapPktHdr",
"newInstance",
"(",
"final",
"int",
"caplen",
",",
"final",
"int",
"len",
",",
"final",
"int",
"tvSec",
",",
"final",
"long",
"tvUsec",
")",
"{",
"return",
"new",
"PcapPktHdr",
"(",
"caplen",
",",
"len",
",",
"tvSec",
",... | Create new PcapPktHdr instance.
@param caplen capture length.
@param len length.
@param tvSec tv_sec.
@param tvUsec tv_usec.
@return returns PcapPktHdr. | [
"Create",
"new",
"PcapPktHdr",
"instance",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-core/src/main/java/com/ardikars/jxnet/PcapPktHdr.java#L67-L69 |
108,696 | jxnet/Jxnet | jxnet-core/src/main/java/com/ardikars/jxnet/PcapPktHdr.java | PcapPktHdr.copy | public PcapPktHdr copy() {
PcapPktHdr pktHdr = new PcapPktHdr();
pktHdr.caplen = this.caplen;
pktHdr.len = this.len;
pktHdr.tv_sec = this.tv_sec;
pktHdr.tv_usec = this.tv_usec;
return pktHdr;
} | java | public PcapPktHdr copy() {
PcapPktHdr pktHdr = new PcapPktHdr();
pktHdr.caplen = this.caplen;
pktHdr.len = this.len;
pktHdr.tv_sec = this.tv_sec;
pktHdr.tv_usec = this.tv_usec;
return pktHdr;
} | [
"public",
"PcapPktHdr",
"copy",
"(",
")",
"{",
"PcapPktHdr",
"pktHdr",
"=",
"new",
"PcapPktHdr",
"(",
")",
";",
"pktHdr",
".",
"caplen",
"=",
"this",
".",
"caplen",
";",
"pktHdr",
".",
"len",
"=",
"this",
".",
"len",
";",
"pktHdr",
".",
"tv_sec",
"="... | Copy this instance.
@return returns new {@link PcapPktHdr} instance. | [
"Copy",
"this",
"instance",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-core/src/main/java/com/ardikars/jxnet/PcapPktHdr.java#L144-L151 |
108,697 | jxnet/Jxnet | jxnet-benchmark/src/main/java/com/ardikars/jxnet/benchmark/BenchmarkApplication.java | BenchmarkApplication.run | public void run(String... args) {
int maxIteration = 10;
int totalMoreFast = 0;
int totalMoreFastWithThreadPool = 0;
int totalMoreFastPacketThreadPool = 0;
for (int i = 0; i < maxIteration; i++) {
LOGGER.info("**********************************");
long jxn... | java | public void run(String... args) {
int maxIteration = 10;
int totalMoreFast = 0;
int totalMoreFastWithThreadPool = 0;
int totalMoreFastPacketThreadPool = 0;
for (int i = 0; i < maxIteration; i++) {
LOGGER.info("**********************************");
long jxn... | [
"public",
"void",
"run",
"(",
"String",
"...",
"args",
")",
"{",
"int",
"maxIteration",
"=",
"10",
";",
"int",
"totalMoreFast",
"=",
"0",
";",
"int",
"totalMoreFastWithThreadPool",
"=",
"0",
";",
"int",
"totalMoreFastPacketThreadPool",
"=",
"0",
";",
"for",
... | Run bencmarking test.
@param args args. | [
"Run",
"bencmarking",
"test",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-benchmark/src/main/java/com/ardikars/jxnet/benchmark/BenchmarkApplication.java#L72-L113 |
108,698 | xwiki/xwiki-rendering | xwiki-rendering-syntaxes/xwiki-rendering-syntax-wikimodel/src/main/java/org/xwiki/rendering/internal/parser/wikimodel/DefaultXWikiGeneratorListener.java | DefaultXWikiGeneratorListener.convertParameters | protected Map<String, String> convertParameters(WikiParameters params)
{
Map<String, String> xwikiParams;
if (params.getSize() > 0) {
xwikiParams = new LinkedHashMap<String, String>();
for (WikiParameter wikiParameter : params.toList()) {
xwikiParams.put(wiki... | java | protected Map<String, String> convertParameters(WikiParameters params)
{
Map<String, String> xwikiParams;
if (params.getSize() > 0) {
xwikiParams = new LinkedHashMap<String, String>();
for (WikiParameter wikiParameter : params.toList()) {
xwikiParams.put(wiki... | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"convertParameters",
"(",
"WikiParameters",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"xwikiParams",
";",
"if",
"(",
"params",
".",
"getSize",
"(",
")",
">",
"0",
")",
"{",
"xwi... | Convert Wikimodel parameters to XWiki parameters format.
@param params the wikimodel parameters to convert
@return the parameters in XWiki format | [
"Convert",
"Wikimodel",
"parameters",
"to",
"XWiki",
"parameters",
"format",
"."
] | a21cdfcb64ef5b76872e3eedf78c530f26d7beb0 | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-syntaxes/xwiki-rendering-syntax-wikimodel/src/main/java/org/xwiki/rendering/internal/parser/wikimodel/DefaultXWikiGeneratorListener.java#L194-L208 |
108,699 | xwiki/xwiki-rendering | xwiki-rendering-syntaxes/xwiki-rendering-syntax-wikimodel/src/main/java/org/xwiki/rendering/internal/parser/wikimodel/DefaultXWikiGeneratorListener.java | DefaultXWikiGeneratorListener.convertAndSeparateParameters | protected Pair<Map<String, String>, Map<String, String>> convertAndSeparateParameters(WikiParameters params)
{
Map<String, String> resourceParameters;
Map<String, String> genericParameters;
if (params.getSize() > 0) {
resourceParameters = new LinkedHashMap<String, String>();
... | java | protected Pair<Map<String, String>, Map<String, String>> convertAndSeparateParameters(WikiParameters params)
{
Map<String, String> resourceParameters;
Map<String, String> genericParameters;
if (params.getSize() > 0) {
resourceParameters = new LinkedHashMap<String, String>();
... | [
"protected",
"Pair",
"<",
"Map",
"<",
"String",
",",
"String",
">",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"convertAndSeparateParameters",
"(",
"WikiParameters",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"resourceParameters",... | Convert Wikimodel parameters to XWiki parameters format, separating anchor and query string parameters which we
consider ResourceReference parameters from the rest which we consider generic event parameters.
@param params the wikimodel parameters to convert
@return the parameters in XWiki format, the left side of the ... | [
"Convert",
"Wikimodel",
"parameters",
"to",
"XWiki",
"parameters",
"format",
"separating",
"anchor",
"and",
"query",
"string",
"parameters",
"which",
"we",
"consider",
"ResourceReference",
"parameters",
"from",
"the",
"rest",
"which",
"we",
"consider",
"generic",
"e... | a21cdfcb64ef5b76872e3eedf78c530f26d7beb0 | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-syntaxes/xwiki-rendering-syntax-wikimodel/src/main/java/org/xwiki/rendering/internal/parser/wikimodel/DefaultXWikiGeneratorListener.java#L218-L242 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.