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,500 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java | FileSystemUtil.qualified | private static Path qualified(Path rootPath, Path path) {
URI rootUri = rootPath.toUri();
return path.makeQualified(rootUri, new Path(rootUri.getPath()));
} | java | private static Path qualified(Path rootPath, Path path) {
URI rootUri = rootPath.toUri();
return path.makeQualified(rootUri, new Path(rootUri.getPath()));
} | [
"private",
"static",
"Path",
"qualified",
"(",
"Path",
"rootPath",
",",
"Path",
"path",
")",
"{",
"URI",
"rootUri",
"=",
"rootPath",
".",
"toUri",
"(",
")",
";",
"return",
"path",
".",
"makeQualified",
"(",
"rootUri",
",",
"new",
"Path",
"(",
"rootUri",
... | Qualifies a path so it includes the schema and authority from the root path. | [
"Qualifies",
"a",
"path",
"so",
"it",
"includes",
"the",
"schema",
"and",
"authority",
"from",
"the",
"root",
"path",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java#L110-L113 |
108,501 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java | FileSystemUtil.getTablePath | public static Path getTablePath(Path rootPath, String table) {
return new Path(rootPath, encode(table));
} | java | public static Path getTablePath(Path rootPath, String table) {
return new Path(rootPath, encode(table));
} | [
"public",
"static",
"Path",
"getTablePath",
"(",
"Path",
"rootPath",
",",
"String",
"table",
")",
"{",
"return",
"new",
"Path",
"(",
"rootPath",
",",
"encode",
"(",
"table",
")",
")",
";",
"}"
] | Gets the path for a table from the given root. | [
"Gets",
"the",
"path",
"for",
"a",
"table",
"from",
"the",
"given",
"root",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java#L118-L120 |
108,502 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java | FileSystemUtil.getSplitPath | public static Path getSplitPath(Path rootPath, String table, String split) {
return new Path(getTablePath(rootPath, table), encode(split));
} | java | public static Path getSplitPath(Path rootPath, String table, String split) {
return new Path(getTablePath(rootPath, table), encode(split));
} | [
"public",
"static",
"Path",
"getSplitPath",
"(",
"Path",
"rootPath",
",",
"String",
"table",
",",
"String",
"split",
")",
"{",
"return",
"new",
"Path",
"(",
"getTablePath",
"(",
"rootPath",
",",
"table",
")",
",",
"encode",
"(",
"split",
")",
")",
";",
... | Gets the path for a split from the given root. | [
"Gets",
"the",
"path",
"for",
"a",
"split",
"from",
"the",
"given",
"root",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java#L125-L127 |
108,503 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java | FileSystemUtil.encode | private static String encode(String pathElement) {
try {
return URLEncoder.encode(pathElement, Charsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw Throwables.propagate(e); // Should never happen
}
} | java | private static String encode(String pathElement) {
try {
return URLEncoder.encode(pathElement, Charsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw Throwables.propagate(e); // Should never happen
}
} | [
"private",
"static",
"String",
"encode",
"(",
"String",
"pathElement",
")",
"{",
"try",
"{",
"return",
"URLEncoder",
".",
"encode",
"(",
"pathElement",
",",
"Charsets",
".",
"UTF_8",
".",
"name",
"(",
")",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingE... | URL encodes a path element | [
"URL",
"encodes",
"a",
"path",
"element"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java#L166-L172 |
108,504 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java | FileSystemUtil.decode | private static String decode(String pathElement) {
try {
return URLDecoder.decode(pathElement, Charsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw Throwables.propagate(e); // Should never happen
}
} | java | private static String decode(String pathElement) {
try {
return URLDecoder.decode(pathElement, Charsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw Throwables.propagate(e); // Should never happen
}
} | [
"private",
"static",
"String",
"decode",
"(",
"String",
"pathElement",
")",
"{",
"try",
"{",
"return",
"URLDecoder",
".",
"decode",
"(",
"pathElement",
",",
"Charsets",
".",
"UTF_8",
".",
"name",
"(",
")",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingE... | URL decodes a path element | [
"URL",
"decodes",
"a",
"path",
"element"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java#L177-L183 |
108,505 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/PlacementCache.java | PlacementCache.getLocalPlacements | public Collection<String> getLocalPlacements() {
List<String> placements = Lists.newArrayList();
for (String placementName : _placementFactory.getValidPlacements()) {
Placement placement;
try {
placement = get(placementName);
} catch (UnknownPlacementE... | java | public Collection<String> getLocalPlacements() {
List<String> placements = Lists.newArrayList();
for (String placementName : _placementFactory.getValidPlacements()) {
Placement placement;
try {
placement = get(placementName);
} catch (UnknownPlacementE... | [
"public",
"Collection",
"<",
"String",
">",
"getLocalPlacements",
"(",
")",
"{",
"List",
"<",
"String",
">",
"placements",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"String",
"placementName",
":",
"_placementFactory",
".",
"getValidPlacemen... | Returns all placements accessible in the local data center, including internal placements. | [
"Returns",
"all",
"placements",
"accessible",
"in",
"the",
"local",
"data",
"center",
"including",
"internal",
"placements",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/PlacementCache.java#L44-L56 |
108,506 | bazaarvoice/emodb | job/src/main/java/com/bazaarvoice/emodb/job/service/DefaultJobService.java | DefaultJobService.recordFinalStatus | private <Q, R> void recordFinalStatus(JobIdentifier<Q, R> jobId, JobStatus<Q, R> jobStatus) {
try {
_jobStatusDAO.updateJobStatus(jobId, jobStatus);
} catch (Exception e) {
_log.error("Failed to record final status for job: [id={}, status={}]", jobId, jobStatus.getStatus(), e);
... | java | private <Q, R> void recordFinalStatus(JobIdentifier<Q, R> jobId, JobStatus<Q, R> jobStatus) {
try {
_jobStatusDAO.updateJobStatus(jobId, jobStatus);
} catch (Exception e) {
_log.error("Failed to record final status for job: [id={}, status={}]", jobId, jobStatus.getStatus(), e);
... | [
"private",
"<",
"Q",
",",
"R",
">",
"void",
"recordFinalStatus",
"(",
"JobIdentifier",
"<",
"Q",
",",
"R",
">",
"jobId",
",",
"JobStatus",
"<",
"Q",
",",
"R",
">",
"jobStatus",
")",
"{",
"try",
"{",
"_jobStatusDAO",
".",
"updateJobStatus",
"(",
"jobId"... | Attempts to record the final status for a job. Logs any errors, but always returns without throwing an
exception.
@param jobId The job ID
@param jobStatus The job's status
@param <Q> The job's request type
@param <R> The job's result type. | [
"Attempts",
"to",
"record",
"the",
"final",
"status",
"for",
"a",
"job",
".",
"Logs",
"any",
"errors",
"but",
"always",
"returns",
"without",
"throwing",
"an",
"exception",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/job/src/main/java/com/bazaarvoice/emodb/job/service/DefaultJobService.java#L337-L343 |
108,507 | bazaarvoice/emodb | job/src/main/java/com/bazaarvoice/emodb/job/service/DefaultJobService.java | DefaultJobService.acknowledgeQueueMessage | private void acknowledgeQueueMessage(String messageId) {
try {
_queueService.acknowledge(_queueName, ImmutableList.of(messageId));
} catch (Exception e) {
_log.error("Failed to acknowledge message: [messageId={}]", messageId, e);
}
} | java | private void acknowledgeQueueMessage(String messageId) {
try {
_queueService.acknowledge(_queueName, ImmutableList.of(messageId));
} catch (Exception e) {
_log.error("Failed to acknowledge message: [messageId={}]", messageId, e);
}
} | [
"private",
"void",
"acknowledgeQueueMessage",
"(",
"String",
"messageId",
")",
"{",
"try",
"{",
"_queueService",
".",
"acknowledge",
"(",
"_queueName",
",",
"ImmutableList",
".",
"of",
"(",
"messageId",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")"... | Attempts to acknowledge a message on the queue. Logs any errors, but always returns without throwing an
exception.
@param messageId The message ID | [
"Attempts",
"to",
"acknowledge",
"a",
"message",
"on",
"the",
"queue",
".",
"Logs",
"any",
"errors",
"but",
"always",
"returns",
"without",
"throwing",
"an",
"exception",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/job/src/main/java/com/bazaarvoice/emodb/job/service/DefaultJobService.java#L350-L356 |
108,508 | bazaarvoice/emodb | mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/schema/RefreshSchema.java | RefreshSchema.encode | private String encode(String str) {
if (str == null) {
return null;
}
try {
return URLEncoder.encode(str, Charsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
// Should never happen
throw Throwables.propagate(e);
}
... | java | private String encode(String str) {
if (str == null) {
return null;
}
try {
return URLEncoder.encode(str, Charsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
// Should never happen
throw Throwables.propagate(e);
}
... | [
"private",
"String",
"encode",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"URLEncoder",
".",
"encode",
"(",
"str",
",",
"Charsets",
".",
"UTF_8",
".",
"name",
"(",
")"... | URL encodes the given string. | [
"URL",
"encodes",
"the",
"given",
"string",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/schema/RefreshSchema.java#L263-L273 |
108,509 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/scanstatus/DataStoreScanStatusDAO.java | DataStoreScanStatusDAO.getTable | private String getTable() {
if (!_tableChecked) {
if (!_dataStore.getTableExists(_tableName)) {
_dataStore.createTable(
_tableName,
new TableOptionsBuilder().setPlacement(_tablePlacement).build(),
ImmutableMap.<S... | java | private String getTable() {
if (!_tableChecked) {
if (!_dataStore.getTableExists(_tableName)) {
_dataStore.createTable(
_tableName,
new TableOptionsBuilder().setPlacement(_tablePlacement).build(),
ImmutableMap.<S... | [
"private",
"String",
"getTable",
"(",
")",
"{",
"if",
"(",
"!",
"_tableChecked",
")",
"{",
"if",
"(",
"!",
"_dataStore",
".",
"getTableExists",
"(",
"_tableName",
")",
")",
"{",
"_dataStore",
".",
"createTable",
"(",
"_tableName",
",",
"new",
"TableOptions... | Returns the scan status table name. On the first call it also verifies that the table exists, then skips this
check on future calls. | [
"Returns",
"the",
"scan",
"status",
"table",
"name",
".",
"On",
"the",
"first",
"call",
"it",
"also",
"verifies",
"that",
"the",
"table",
"exists",
"then",
"skips",
"this",
"check",
"on",
"future",
"calls",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/scanstatus/DataStoreScanStatusDAO.java#L53-L67 |
108,510 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/scanstatus/DataStoreScanStatusDAO.java | DataStoreScanStatusDAO.extrapolateStartTimeFromScanRanges | private Date extrapolateStartTimeFromScanRanges(List<ScanRangeStatus> pendingScanRanges,
List<ScanRangeStatus> activeScanRanges,
List<ScanRangeStatus> completeScanRanges) {
Date startTime = null;
for... | java | private Date extrapolateStartTimeFromScanRanges(List<ScanRangeStatus> pendingScanRanges,
List<ScanRangeStatus> activeScanRanges,
List<ScanRangeStatus> completeScanRanges) {
Date startTime = null;
for... | [
"private",
"Date",
"extrapolateStartTimeFromScanRanges",
"(",
"List",
"<",
"ScanRangeStatus",
">",
"pendingScanRanges",
",",
"List",
"<",
"ScanRangeStatus",
">",
"activeScanRanges",
",",
"List",
"<",
"ScanRangeStatus",
">",
"completeScanRanges",
")",
"{",
"Date",
"sta... | For grandfathered in ScanStatuses that did not include a startTime attribute extrapolate it as the earliest
time a scan range was queued. | [
"For",
"grandfathered",
"in",
"ScanStatuses",
"that",
"did",
"not",
"include",
"a",
"startTime",
"attribute",
"extrapolate",
"it",
"as",
"the",
"earliest",
"time",
"a",
"scan",
"range",
"was",
"queued",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/scanstatus/DataStoreScanStatusDAO.java#L209-L228 |
108,511 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/AstyanaxEventId.java | AstyanaxEventId.computeChecksum | private static int computeChecksum(byte[] buf, int offset, int length, String channel) {
Hasher hasher = Hashing.murmur3_32().newHasher();
hasher.putBytes(buf, offset, length);
hasher.putUnencodedChars(channel);
return hasher.hash().asInt() & 0xffff;
} | java | private static int computeChecksum(byte[] buf, int offset, int length, String channel) {
Hasher hasher = Hashing.murmur3_32().newHasher();
hasher.putBytes(buf, offset, length);
hasher.putUnencodedChars(channel);
return hasher.hash().asInt() & 0xffff;
} | [
"private",
"static",
"int",
"computeChecksum",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
",",
"String",
"channel",
")",
"{",
"Hasher",
"hasher",
"=",
"Hashing",
".",
"murmur3_32",
"(",
")",
".",
"newHasher",
"(",
")",
";... | Computes a 16-bit checksum of the contents of the specific ByteBuffer and channel name. | [
"Computes",
"a",
"16",
"-",
"bit",
"checksum",
"of",
"the",
"contents",
"of",
"the",
"specific",
"ByteBuffer",
"and",
"channel",
"name",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/AstyanaxEventId.java#L75-L80 |
108,512 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/auth/OwnerDatabusAuthorizer.java | OwnerDatabusAuthorizer.ownerCanReadTable | private boolean ownerCanReadTable(String ownerId, String table) {
return _internalAuthorizer.hasPermissionById(ownerId, getReadPermission(table));
} | java | private boolean ownerCanReadTable(String ownerId, String table) {
return _internalAuthorizer.hasPermissionById(ownerId, getReadPermission(table));
} | [
"private",
"boolean",
"ownerCanReadTable",
"(",
"String",
"ownerId",
",",
"String",
"table",
")",
"{",
"return",
"_internalAuthorizer",
".",
"hasPermissionById",
"(",
"ownerId",
",",
"getReadPermission",
"(",
"table",
")",
")",
";",
"}"
] | Determines if an owner has read permission on a table. This always calls back to the authorizer and will not
return a cached value. | [
"Determines",
"if",
"an",
"owner",
"has",
"read",
"permission",
"on",
"a",
"table",
".",
"This",
"always",
"calls",
"back",
"to",
"the",
"authorizer",
"and",
"will",
"not",
"return",
"a",
"cached",
"value",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/auth/OwnerDatabusAuthorizer.java#L187-L189 |
108,513 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/auth/OwnerDatabusAuthorizer.java | OwnerDatabusAuthorizer.getReadPermission | private Permission getReadPermission(String table) {
return _readPermissionCache != null ?
_readPermissionCache.getUnchecked(table) :
createReadPermission(table);
} | java | private Permission getReadPermission(String table) {
return _readPermissionCache != null ?
_readPermissionCache.getUnchecked(table) :
createReadPermission(table);
} | [
"private",
"Permission",
"getReadPermission",
"(",
"String",
"table",
")",
"{",
"return",
"_readPermissionCache",
"!=",
"null",
"?",
"_readPermissionCache",
".",
"getUnchecked",
"(",
"table",
")",
":",
"createReadPermission",
"(",
"table",
")",
";",
"}"
] | Gets the Permission instance for read permission on a table. If caching is enabled the result is either returned
from or added to the cache. | [
"Gets",
"the",
"Permission",
"instance",
"for",
"read",
"permission",
"on",
"a",
"table",
".",
"If",
"caching",
"is",
"enabled",
"the",
"result",
"is",
"either",
"returned",
"from",
"or",
"added",
"to",
"the",
"cache",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/auth/OwnerDatabusAuthorizer.java#L195-L199 |
108,514 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/auth/OwnerDatabusAuthorizer.java | OwnerDatabusAuthorizer.createReadPermission | private Permission createReadPermission(String table) {
return _permissionResolver.resolvePermission(Permissions.readSorTable(new NamedResource(table)));
} | java | private Permission createReadPermission(String table) {
return _permissionResolver.resolvePermission(Permissions.readSorTable(new NamedResource(table)));
} | [
"private",
"Permission",
"createReadPermission",
"(",
"String",
"table",
")",
"{",
"return",
"_permissionResolver",
".",
"resolvePermission",
"(",
"Permissions",
".",
"readSorTable",
"(",
"new",
"NamedResource",
"(",
"table",
")",
")",
")",
";",
"}"
] | Creates a Permission instance for read permission on a table. This always resolves a new instance and will
not return a cached value. | [
"Creates",
"a",
"Permission",
"instance",
"for",
"read",
"permission",
"on",
"a",
"table",
".",
"This",
"always",
"resolves",
"a",
"new",
"instance",
"and",
"will",
"not",
"return",
"a",
"cached",
"value",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/auth/OwnerDatabusAuthorizer.java#L205-L207 |
108,515 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/EmoFileSystem.java | EmoFileSystem.splitNameWithoutGzipExtension | private String splitNameWithoutGzipExtension(String split)
throws IOException {
if (split == null) {
throw new IOException("Path is not a split");
}
if (split.endsWith(".gz")) {
return split.substring(0, split.length() - 3);
}
return split;
... | java | private String splitNameWithoutGzipExtension(String split)
throws IOException {
if (split == null) {
throw new IOException("Path is not a split");
}
if (split.endsWith(".gz")) {
return split.substring(0, split.length() - 3);
}
return split;
... | [
"private",
"String",
"splitNameWithoutGzipExtension",
"(",
"String",
"split",
")",
"throws",
"IOException",
"{",
"if",
"(",
"split",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Path is not a split\"",
")",
";",
"}",
"if",
"(",
"split",
".",
... | Since we appended a gzip extension to the split file name we need to take it off to get the actual split. | [
"Since",
"we",
"appended",
"a",
"gzip",
"extension",
"to",
"the",
"split",
"file",
"name",
"we",
"need",
"to",
"take",
"it",
"off",
"to",
"get",
"the",
"actual",
"split",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/EmoFileSystem.java#L265-L274 |
108,516 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/EmoFileSystem.java | EmoFileSystem.open | @Override
public FSDataInputStream open(Path path, int bufferSize)
throws IOException {
String table = getTableName(_rootPath, path);
String split = getSplitName(_rootPath, path);
split = splitNameWithoutGzipExtension(split);
return new FSDataInputStream(new EmoSplitInput... | java | @Override
public FSDataInputStream open(Path path, int bufferSize)
throws IOException {
String table = getTableName(_rootPath, path);
String split = getSplitName(_rootPath, path);
split = splitNameWithoutGzipExtension(split);
return new FSDataInputStream(new EmoSplitInput... | [
"@",
"Override",
"public",
"FSDataInputStream",
"open",
"(",
"Path",
"path",
",",
"int",
"bufferSize",
")",
"throws",
"IOException",
"{",
"String",
"table",
"=",
"getTableName",
"(",
"_rootPath",
",",
"path",
")",
";",
"String",
"split",
"=",
"getSplitName",
... | Opens a split for reading. Note that the preferred and more efficient way to do this is by using an
EmoInputFormat. However, if using a MapReduce framework which does not support custom input formats,
such as Presto, the splits can be opened directly using this method. | [
"Opens",
"a",
"split",
"for",
"reading",
".",
"Note",
"that",
"the",
"preferred",
"and",
"more",
"efficient",
"way",
"to",
"do",
"this",
"is",
"by",
"using",
"an",
"EmoInputFormat",
".",
"However",
"if",
"using",
"a",
"MapReduce",
"framework",
"which",
"do... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/EmoFileSystem.java#L281-L288 |
108,517 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/EmoFileSystem.java | EmoFileSystem.create | @Override
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress)
throws IOException {
throw new IOException("Create not supported for EmoFileSystem: " + f);
} | java | @Override
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress)
throws IOException {
throw new IOException("Create not supported for EmoFileSystem: " + f);
} | [
"@",
"Override",
"public",
"FSDataOutputStream",
"create",
"(",
"Path",
"f",
",",
"FsPermission",
"permission",
",",
"boolean",
"overwrite",
",",
"int",
"bufferSize",
",",
"short",
"replication",
",",
"long",
"blockSize",
",",
"Progressable",
"progress",
")",
"t... | All remaining FileSystem operations are not supported and will throw exceptions. | [
"All",
"remaining",
"FileSystem",
"operations",
"are",
"not",
"supported",
"and",
"will",
"throw",
"exceptions",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/EmoFileSystem.java#L483-L487 |
108,518 | bazaarvoice/emodb | common/dropwizard-client/src/main/java/com/bazaarvoice/emodb/common/jersey/dropwizard/JerseyEmoResource.java | JerseyEmoResource.asEmoClientException | private EmoClientException asEmoClientException(UniformInterfaceException e)
throws EmoClientException {
throw new EmoClientException(e.getMessage(), e, toEmoResponse(e.getResponse()));
} | java | private EmoClientException asEmoClientException(UniformInterfaceException e)
throws EmoClientException {
throw new EmoClientException(e.getMessage(), e, toEmoResponse(e.getResponse()));
} | [
"private",
"EmoClientException",
"asEmoClientException",
"(",
"UniformInterfaceException",
"e",
")",
"throws",
"EmoClientException",
"{",
"throw",
"new",
"EmoClientException",
"(",
"e",
".",
"getMessage",
"(",
")",
",",
"e",
",",
"toEmoResponse",
"(",
"e",
".",
"g... | Returns an EmoClientException with a thin wrapper around the Jersey exception response. | [
"Returns",
"an",
"EmoClientException",
"with",
"a",
"thin",
"wrapper",
"around",
"the",
"Jersey",
"exception",
"response",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/dropwizard-client/src/main/java/com/bazaarvoice/emodb/common/jersey/dropwizard/JerseyEmoResource.java#L138-L141 |
108,519 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/core/AbstractBatchReader.java | AbstractBatchReader.loadNextBatch | private boolean loadNextBatch() {
if (!hasNextBatch()) {
// No batches remaining to load
_batch = Iterators.emptyIterator();
return true;
}
Exception batchFetchException = null;
_timer.start();
try {
_batch = nextBatch(_currentBat... | java | private boolean loadNextBatch() {
if (!hasNextBatch()) {
// No batches remaining to load
_batch = Iterators.emptyIterator();
return true;
}
Exception batchFetchException = null;
_timer.start();
try {
_batch = nextBatch(_currentBat... | [
"private",
"boolean",
"loadNextBatch",
"(",
")",
"{",
"if",
"(",
"!",
"hasNextBatch",
"(",
")",
")",
"{",
"// No batches remaining to load",
"_batch",
"=",
"Iterators",
".",
"emptyIterator",
"(",
")",
";",
"return",
"true",
";",
"}",
"Exception",
"batchFetchEx... | Loads the next batch from the underlying resource.
@return True if a non-empty batch was read or all data has already been read, false if the batch was
empty or the batch read timed out. | [
"Loads",
"the",
"next",
"batch",
"from",
"the",
"underlying",
"resource",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/core/AbstractBatchReader.java#L91-L153 |
108,520 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/audit/s3/AthenaAuditWriter.java | AthenaAuditWriter.prepareClosedLogFilesForTransfer | private void prepareClosedLogFilesForTransfer() {
for (final File logFile : _stagingDir.listFiles((dir, name) -> name.startsWith(_logFilePrefix) && name.endsWith(CLOSED_FILE_SUFFIX))) {
boolean moved;
String fileName = logFile.getName().substring(0, logFile.getName().length() - CLOSED_FI... | java | private void prepareClosedLogFilesForTransfer() {
for (final File logFile : _stagingDir.listFiles((dir, name) -> name.startsWith(_logFilePrefix) && name.endsWith(CLOSED_FILE_SUFFIX))) {
boolean moved;
String fileName = logFile.getName().substring(0, logFile.getName().length() - CLOSED_FI... | [
"private",
"void",
"prepareClosedLogFilesForTransfer",
"(",
")",
"{",
"for",
"(",
"final",
"File",
"logFile",
":",
"_stagingDir",
".",
"listFiles",
"(",
"(",
"dir",
",",
"name",
")",
"->",
"name",
".",
"startsWith",
"(",
"_logFilePrefix",
")",
"&&",
"name",
... | This method takes all closed log files and GZIPs and renames them in preparation for transfer. If the operation
fails the original file is unmodified so the next call should attempt to prepare the file again. This means
the same file may be transferred more than once, but this guarantees that so long as the host rema... | [
"This",
"method",
"takes",
"all",
"closed",
"log",
"files",
"and",
"GZIPs",
"and",
"renames",
"them",
"in",
"preparation",
"for",
"transfer",
".",
"If",
"the",
"operation",
"fails",
"the",
"original",
"file",
"is",
"unmodified",
"so",
"the",
"next",
"call",
... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/audit/s3/AthenaAuditWriter.java#L280-L301 |
108,521 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/audit/s3/AthenaAuditWriter.java | AthenaAuditWriter.processQueuedAudits | private void processQueuedAudits(boolean interruptable) {
QueuedAudit audit;
try {
while (!(_auditService.isShutdown() && interruptable) && ((audit = _auditQueue.poll()) != null)) {
boolean written = false;
while (!written) {
AuditOutput au... | java | private void processQueuedAudits(boolean interruptable) {
QueuedAudit audit;
try {
while (!(_auditService.isShutdown() && interruptable) && ((audit = _auditQueue.poll()) != null)) {
boolean written = false;
while (!written) {
AuditOutput au... | [
"private",
"void",
"processQueuedAudits",
"(",
"boolean",
"interruptable",
")",
"{",
"QueuedAudit",
"audit",
";",
"try",
"{",
"while",
"(",
"!",
"(",
"_auditService",
".",
"isShutdown",
"(",
")",
"&&",
"interruptable",
")",
"&&",
"(",
"(",
"audit",
"=",
"_... | This method is run at regular intervals to remove audits from the audit queue and write them to a local file. | [
"This",
"method",
"is",
"run",
"at",
"regular",
"intervals",
"to",
"remove",
"audits",
"from",
"the",
"audit",
"queue",
"and",
"write",
"them",
"to",
"a",
"local",
"file",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/audit/s3/AthenaAuditWriter.java#L341-L354 |
108,522 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java | ApiKeyRealm.prepareCacheManager | private CacheManager prepareCacheManager(CacheManager cacheManager) {
if (cacheManager == null || !(cacheManager instanceof InvalidatableCacheManager)) {
return cacheManager;
}
return new ValidatingCacheManager(cacheManager) {
@Nullable
@Override
... | java | private CacheManager prepareCacheManager(CacheManager cacheManager) {
if (cacheManager == null || !(cacheManager instanceof InvalidatableCacheManager)) {
return cacheManager;
}
return new ValidatingCacheManager(cacheManager) {
@Nullable
@Override
... | [
"private",
"CacheManager",
"prepareCacheManager",
"(",
"CacheManager",
"cacheManager",
")",
"{",
"if",
"(",
"cacheManager",
"==",
"null",
"||",
"!",
"(",
"cacheManager",
"instanceof",
"InvalidatableCacheManager",
")",
")",
"{",
"return",
"cacheManager",
";",
"}",
... | If necessary, wraps the raw cache manager with a validating facade. | [
"If",
"necessary",
"wraps",
"the",
"raw",
"cache",
"manager",
"with",
"a",
"validating",
"facade",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java#L94-L167 |
108,523 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java | ApiKeyRealm.supports | @Override
public boolean supports(AuthenticationToken token) {
return super.supports(token) || (_anonymousId != null && AnonymousToken.isAnonymous(token));
} | java | @Override
public boolean supports(AuthenticationToken token) {
return super.supports(token) || (_anonymousId != null && AnonymousToken.isAnonymous(token));
} | [
"@",
"Override",
"public",
"boolean",
"supports",
"(",
"AuthenticationToken",
"token",
")",
"{",
"return",
"super",
".",
"supports",
"(",
"token",
")",
"||",
"(",
"_anonymousId",
"!=",
"null",
"&&",
"AnonymousToken",
".",
"isAnonymous",
"(",
"token",
")",
")... | Override the parent method to also accept anonymous tokens | [
"Override",
"the",
"parent",
"method",
"to",
"also",
"accept",
"anonymous",
"tokens"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java#L181-L184 |
108,524 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java | ApiKeyRealm.doGetAuthenticationInfo | @SuppressWarnings("unchecked")
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
throws AuthenticationException {
String id;
if (AnonymousToken.isAnonymous(token)) {
// Only continue if an anonymous identity has been set
... | java | @SuppressWarnings("unchecked")
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
throws AuthenticationException {
String id;
if (AnonymousToken.isAnonymous(token)) {
// Only continue if an anonymous identity has been set
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"protected",
"AuthenticationInfo",
"doGetAuthenticationInfo",
"(",
"AuthenticationToken",
"token",
")",
"throws",
"AuthenticationException",
"{",
"String",
"id",
";",
"if",
"(",
"AnonymousToken",
".",
... | Gets the AuthenticationInfo that matches a token. This method is only called if the info is not already
cached by the realm, so this method does not need to perform any further caching. | [
"Gets",
"the",
"AuthenticationInfo",
"that",
"matches",
"a",
"token",
".",
"This",
"method",
"is",
"only",
"called",
"if",
"the",
"info",
"is",
"not",
"already",
"cached",
"by",
"the",
"realm",
"so",
"this",
"method",
"does",
"not",
"need",
"to",
"perform"... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java#L190-L208 |
108,525 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java | ApiKeyRealm.createAuthenticationInfo | private ApiKeyAuthenticationInfo createAuthenticationInfo(String authenticationId, ApiKey apiKey) {
return new ApiKeyAuthenticationInfo(authenticationId, apiKey, getName());
} | java | private ApiKeyAuthenticationInfo createAuthenticationInfo(String authenticationId, ApiKey apiKey) {
return new ApiKeyAuthenticationInfo(authenticationId, apiKey, getName());
} | [
"private",
"ApiKeyAuthenticationInfo",
"createAuthenticationInfo",
"(",
"String",
"authenticationId",
",",
"ApiKey",
"apiKey",
")",
"{",
"return",
"new",
"ApiKeyAuthenticationInfo",
"(",
"authenticationId",
",",
"apiKey",
",",
"getName",
"(",
")",
")",
";",
"}"
] | Simple method to build and AuthenticationInfo instance from an API key. | [
"Simple",
"method",
"to",
"build",
"and",
"AuthenticationInfo",
"instance",
"from",
"an",
"API",
"key",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java#L225-L227 |
108,526 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java | ApiKeyRealm.doGetAuthorizationInfo | @Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
AuthorizationInfo authorizationInfo = getUncachedAuthorizationInfoFromPrincipals(principals);
Cache<String, AuthorizationInfo> idAuthorizationCache = getAvailableIdAuthorizationCache();
if (idAut... | java | @Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
AuthorizationInfo authorizationInfo = getUncachedAuthorizationInfoFromPrincipals(principals);
Cache<String, AuthorizationInfo> idAuthorizationCache = getAvailableIdAuthorizationCache();
if (idAut... | [
"@",
"Override",
"protected",
"AuthorizationInfo",
"doGetAuthorizationInfo",
"(",
"PrincipalCollection",
"principals",
")",
"{",
"AuthorizationInfo",
"authorizationInfo",
"=",
"getUncachedAuthorizationInfoFromPrincipals",
"(",
"principals",
")",
";",
"Cache",
"<",
"String",
... | Gets the AuthorizationInfo that matches a token. This method is only called if the info is not already
cached by the realm, so this method does not need to perform any further caching. | [
"Gets",
"the",
"AuthorizationInfo",
"that",
"matches",
"a",
"token",
".",
"This",
"method",
"is",
"only",
"called",
"if",
"the",
"info",
"is",
"not",
"already",
"cached",
"by",
"the",
"realm",
"so",
"this",
"method",
"does",
"not",
"need",
"to",
"perform",... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java#L233-L249 |
108,527 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java | ApiKeyRealm.getRolePermissions | protected Collection<Permission> getRolePermissions(String role) {
if (role == null) {
return null;
}
Cache<String, RolePermissionSet> cache = getAvailableRolesCache();
if (cache == null) {
return _permissionReader.getPermissions(PermissionIDs.forRole(role));
... | java | protected Collection<Permission> getRolePermissions(String role) {
if (role == null) {
return null;
}
Cache<String, RolePermissionSet> cache = getAvailableRolesCache();
if (cache == null) {
return _permissionReader.getPermissions(PermissionIDs.forRole(role));
... | [
"protected",
"Collection",
"<",
"Permission",
">",
"getRolePermissions",
"(",
"String",
"role",
")",
"{",
"if",
"(",
"role",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Cache",
"<",
"String",
",",
"RolePermissionSet",
">",
"cache",
"=",
"getAvaila... | Gets the permissions for a role. If possible the permissions are cached for efficiency. | [
"Gets",
"the",
"permissions",
"for",
"a",
"role",
".",
"If",
"possible",
"the",
"permissions",
"are",
"cached",
"for",
"efficiency",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java#L331-L350 |
108,528 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java | ApiKeyRealm.getAuthorizationInfoById | @Nullable
private AuthorizationInfo getAuthorizationInfoById(String id) {
AuthorizationInfo authorizationInfo;
// Search the cache first
Cache<String, AuthorizationInfo> idAuthorizationCache = getAvailableIdAuthorizationCache();
if (idAuthorizationCache != null) {
autho... | java | @Nullable
private AuthorizationInfo getAuthorizationInfoById(String id) {
AuthorizationInfo authorizationInfo;
// Search the cache first
Cache<String, AuthorizationInfo> idAuthorizationCache = getAvailableIdAuthorizationCache();
if (idAuthorizationCache != null) {
autho... | [
"@",
"Nullable",
"private",
"AuthorizationInfo",
"getAuthorizationInfoById",
"(",
"String",
"id",
")",
"{",
"AuthorizationInfo",
"authorizationInfo",
";",
"// Search the cache first",
"Cache",
"<",
"String",
",",
"AuthorizationInfo",
">",
"idAuthorizationCache",
"=",
"get... | Gets the authorization info for a user by their ID. If possible the value is cached for efficient lookup. | [
"Gets",
"the",
"authorization",
"info",
"for",
"a",
"user",
"by",
"their",
"ID",
".",
"If",
"possible",
"the",
"value",
"is",
"cached",
"for",
"efficient",
"lookup",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java#L375-L400 |
108,529 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java | ApiKeyRealm.cacheAuthorizationInfoById | private void cacheAuthorizationInfoById(String id, AuthorizationInfo authorizationInfo) {
Cache<String, AuthorizationInfo> idAuthorizationCache = getAvailableIdAuthorizationCache();
if (idAuthorizationCache != null) {
idAuthorizationCache.put(id, authorizationInfo);
}
} | java | private void cacheAuthorizationInfoById(String id, AuthorizationInfo authorizationInfo) {
Cache<String, AuthorizationInfo> idAuthorizationCache = getAvailableIdAuthorizationCache();
if (idAuthorizationCache != null) {
idAuthorizationCache.put(id, authorizationInfo);
}
} | [
"private",
"void",
"cacheAuthorizationInfoById",
"(",
"String",
"id",
",",
"AuthorizationInfo",
"authorizationInfo",
")",
"{",
"Cache",
"<",
"String",
",",
"AuthorizationInfo",
">",
"idAuthorizationCache",
"=",
"getAvailableIdAuthorizationCache",
"(",
")",
";",
"if",
... | If possible, this method caches the authorization info for an API key by its ID. This may be called
either by an explicit call to get the authorization info by ID or as a side effect of loading the
authorization info by API key and proactive caching by ID. | [
"If",
"possible",
"this",
"method",
"caches",
"the",
"authorization",
"info",
"for",
"an",
"API",
"key",
"by",
"its",
"ID",
".",
"This",
"may",
"be",
"called",
"either",
"by",
"an",
"explicit",
"call",
"to",
"get",
"the",
"authorization",
"info",
"by",
"... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java#L407-L413 |
108,530 | bazaarvoice/emodb | sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/deser/JsonTokener.java | JsonTokener.nextClean | public char nextClean(char c) {
char n = nextClean();
if (n != c) {
throw syntaxError("Expected '" + c + "' and instead saw '" + n + "'");
}
return n;
} | java | public char nextClean(char c) {
char n = nextClean();
if (n != c) {
throw syntaxError("Expected '" + c + "' and instead saw '" + n + "'");
}
return n;
} | [
"public",
"char",
"nextClean",
"(",
"char",
"c",
")",
"{",
"char",
"n",
"=",
"nextClean",
"(",
")",
";",
"if",
"(",
"n",
"!=",
"c",
")",
"{",
"throw",
"syntaxError",
"(",
"\"Expected '\"",
"+",
"c",
"+",
"\"' and instead saw '\"",
"+",
"n",
"+",
"\"'... | Consume the next character, skipping whitespace, and check that it matches a
specified character.
@param c The character to match.
@return The character. | [
"Consume",
"the",
"next",
"character",
"skipping",
"whitespace",
"and",
"check",
"that",
"it",
"matches",
"a",
"specified",
"character",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/deser/JsonTokener.java#L143-L149 |
108,531 | bazaarvoice/emodb | sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/deser/JsonTokener.java | JsonTokener.nextString | public String nextString() {
nextClean('"');
StringBuilder sb = new StringBuilder();
for (;;) {
char c = next();
switch (c) {
case 0:
case '\n':
case '\r':
throw syntaxError("Unterminated string");
... | java | public String nextString() {
nextClean('"');
StringBuilder sb = new StringBuilder();
for (;;) {
char c = next();
switch (c) {
case 0:
case '\n':
case '\r':
throw syntaxError("Unterminated string");
... | [
"public",
"String",
"nextString",
"(",
")",
"{",
"nextClean",
"(",
"'",
"'",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
";",
";",
")",
"{",
"char",
"c",
"=",
"next",
"(",
")",
";",
"switch",
"(",
"c",... | Return the characters up to the next close quote character.
Backslash processing is done. The formal JSON format does not
allow strings in single quotes, but an implementation is allowed to
accept them.
@return A String. | [
"Return",
"the",
"characters",
"up",
"to",
"the",
"next",
"close",
"quote",
"character",
".",
"Backslash",
"processing",
"is",
"done",
".",
"The",
"formal",
"JSON",
"format",
"does",
"not",
"allow",
"strings",
"in",
"single",
"quotes",
"but",
"an",
"implemen... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/deser/JsonTokener.java#L170-L215 |
108,532 | bazaarvoice/emodb | sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/deser/JsonTokener.java | JsonTokener.nextValue | public Object nextValue() {
char c = lookAhead();
switch (c) {
case '"':
return nextString();
case '{':
return nextObject();
case '[':
return nextArray();
}
/*
* Handle unquoted text. This could... | java | public Object nextValue() {
char c = lookAhead();
switch (c) {
case '"':
return nextString();
case '{':
return nextObject();
case '[':
return nextArray();
}
/*
* Handle unquoted text. This could... | [
"public",
"Object",
"nextValue",
"(",
")",
"{",
"char",
"c",
"=",
"lookAhead",
"(",
")",
";",
"switch",
"(",
"c",
")",
"{",
"case",
"'",
"'",
":",
"return",
"nextString",
"(",
")",
";",
"case",
"'",
"'",
":",
"return",
"nextObject",
"(",
")",
";"... | Get the next value. The value can be a Boolean, Double, Integer,
List, Map, Long, or String, or null.
@return An object. | [
"Get",
"the",
"next",
"value",
".",
"The",
"value",
"can",
"be",
"a",
"Boolean",
"Double",
"Integer",
"List",
"Map",
"Long",
"or",
"String",
"or",
"null",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/deser/JsonTokener.java#L224-L244 |
108,533 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/core/RowVersionUtils.java | RowVersionUtils.getVersionRetroactively | public static long getVersionRetroactively(PendingCompaction pendingCompaction) {
Compaction compaction = pendingCompaction.getCompaction();
// Calculate the version and create a dummy compaction record for the resolver
return compaction.getCount() - (long)pendingCompaction.getDeltasToArchive().... | java | public static long getVersionRetroactively(PendingCompaction pendingCompaction) {
Compaction compaction = pendingCompaction.getCompaction();
// Calculate the version and create a dummy compaction record for the resolver
return compaction.getCount() - (long)pendingCompaction.getDeltasToArchive().... | [
"public",
"static",
"long",
"getVersionRetroactively",
"(",
"PendingCompaction",
"pendingCompaction",
")",
"{",
"Compaction",
"compaction",
"=",
"pendingCompaction",
".",
"getCompaction",
"(",
")",
";",
"// Calculate the version and create a dummy compaction record for the resolv... | Find the version of the first delta of a pending compaction retroactively | [
"Find",
"the",
"version",
"of",
"the",
"first",
"delta",
"of",
"a",
"pending",
"compaction",
"retroactively"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/core/RowVersionUtils.java#L10-L14 |
108,534 | bazaarvoice/emodb | sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java | DataStoreStreaming.listTables | public static Iterable<Table> listTables(DataStore dataStore) {
return listTables(dataStore, null, Long.MAX_VALUE);
} | java | public static Iterable<Table> listTables(DataStore dataStore) {
return listTables(dataStore, null, Long.MAX_VALUE);
} | [
"public",
"static",
"Iterable",
"<",
"Table",
">",
"listTables",
"(",
"DataStore",
"dataStore",
")",
"{",
"return",
"listTables",
"(",
"dataStore",
",",
"null",
",",
"Long",
".",
"MAX_VALUE",
")",
";",
"}"
] | Retrieves metadata about all DataStore tables. | [
"Retrieves",
"metadata",
"about",
"all",
"DataStore",
"tables",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java#L33-L35 |
108,535 | bazaarvoice/emodb | sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java | DataStoreStreaming.scan | public static Iterable<Map<String, Object>> scan(DataStore dataStore,
String table,
boolean includeDeletes,
ReadConsistency consistency) {
return scan(da... | java | public static Iterable<Map<String, Object>> scan(DataStore dataStore,
String table,
boolean includeDeletes,
ReadConsistency consistency) {
return scan(da... | [
"public",
"static",
"Iterable",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"scan",
"(",
"DataStore",
"dataStore",
",",
"String",
"table",
",",
"boolean",
"includeDeletes",
",",
"ReadConsistency",
"consistency",
")",
"{",
"return",
"scan",
"(",
"data... | Retrieves all records from the specified table. | [
"Retrieves",
"all",
"records",
"from",
"the",
"specified",
"table",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java#L40-L45 |
108,536 | bazaarvoice/emodb | sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java | DataStoreStreaming.updateAll | public static void updateAll(DataStore dataStore, Iterable<Update> updates) {
updateAll(dataStore, updates.iterator(), ImmutableSet.<String>of());
} | java | public static void updateAll(DataStore dataStore, Iterable<Update> updates) {
updateAll(dataStore, updates.iterator(), ImmutableSet.<String>of());
} | [
"public",
"static",
"void",
"updateAll",
"(",
"DataStore",
"dataStore",
",",
"Iterable",
"<",
"Update",
">",
"updates",
")",
"{",
"updateAll",
"(",
"dataStore",
",",
"updates",
".",
"iterator",
"(",
")",
",",
"ImmutableSet",
".",
"<",
"String",
">",
"of",
... | Creates, updates or deletes zero or more pieces of content in the data store. | [
"Creates",
"updates",
"or",
"deletes",
"zero",
"or",
"more",
"pieces",
"of",
"content",
"in",
"the",
"data",
"store",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java#L135-L137 |
108,537 | bazaarvoice/emodb | sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java | DataStoreStreaming.updateAll | public static void updateAll(DataStore dataStore, Iterable<Update> updates, Set<String> tags) {
updateAll(dataStore, updates.iterator(), tags);
} | java | public static void updateAll(DataStore dataStore, Iterable<Update> updates, Set<String> tags) {
updateAll(dataStore, updates.iterator(), tags);
} | [
"public",
"static",
"void",
"updateAll",
"(",
"DataStore",
"dataStore",
",",
"Iterable",
"<",
"Update",
">",
"updates",
",",
"Set",
"<",
"String",
">",
"tags",
")",
"{",
"updateAll",
"(",
"dataStore",
",",
"updates",
".",
"iterator",
"(",
")",
",",
"tags... | Creates, updates or deletes zero or more pieces of content in the data store.
You can attach a set of databus event tags for these updates | [
"Creates",
"updates",
"or",
"deletes",
"zero",
"or",
"more",
"pieces",
"of",
"content",
"in",
"the",
"data",
"store",
".",
"You",
"can",
"attach",
"a",
"set",
"of",
"databus",
"event",
"tags",
"for",
"these",
"updates"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java#L143-L145 |
108,538 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java | RoleResource1.getAllRoles | @GET
public Iterator<EmoRole> getAllRoles(final @Authenticated Subject subject) {
return _uac.getAllRoles(subject);
} | java | @GET
public Iterator<EmoRole> getAllRoles(final @Authenticated Subject subject) {
return _uac.getAllRoles(subject);
} | [
"@",
"GET",
"public",
"Iterator",
"<",
"EmoRole",
">",
"getAllRoles",
"(",
"final",
"@",
"Authenticated",
"Subject",
"subject",
")",
"{",
"return",
"_uac",
".",
"getAllRoles",
"(",
"subject",
")",
";",
"}"
] | Returns all roles for which the caller has read access. Since the number of roles is typically low
this call does not support "from" or "limit" parameters similar to the system or record. | [
"Returns",
"all",
"roles",
"for",
"which",
"the",
"caller",
"has",
"read",
"access",
".",
"Since",
"the",
"number",
"of",
"roles",
"is",
"typically",
"low",
"this",
"call",
"does",
"not",
"support",
"from",
"or",
"limit",
"parameters",
"similar",
"to",
"th... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java#L52-L55 |
108,539 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java | RoleResource1.getAllRolesInGroup | @GET
@Path("{group}")
public Iterator<EmoRole> getAllRolesInGroup(@PathParam("group") String group,
final @Authenticated Subject subject) {
return _uac.getAllRolesInGroup(subject, group);
} | java | @GET
@Path("{group}")
public Iterator<EmoRole> getAllRolesInGroup(@PathParam("group") String group,
final @Authenticated Subject subject) {
return _uac.getAllRolesInGroup(subject, group);
} | [
"@",
"GET",
"@",
"Path",
"(",
"\"{group}\"",
")",
"public",
"Iterator",
"<",
"EmoRole",
">",
"getAllRolesInGroup",
"(",
"@",
"PathParam",
"(",
"\"group\"",
")",
"String",
"group",
",",
"final",
"@",
"Authenticated",
"Subject",
"subject",
")",
"{",
"return",
... | Returns all roles in the specified group for which the caller has read access. Since the number of roles is
typically low this call does not support "from" or "limit" parameters similar to the system or record. | [
"Returns",
"all",
"roles",
"in",
"the",
"specified",
"group",
"for",
"which",
"the",
"caller",
"has",
"read",
"access",
".",
"Since",
"the",
"number",
"of",
"roles",
"is",
"typically",
"low",
"this",
"call",
"does",
"not",
"support",
"from",
"or",
"limit",... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java#L61-L66 |
108,540 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java | RoleResource1.getRole | @GET
@Path("{group}/{id}")
public EmoRole getRole(@PathParam("group") String group, @PathParam("id") String id,
final @Authenticated Subject subject) {
return _uac.getRole(subject, new EmoRoleKey(group, id));
} | java | @GET
@Path("{group}/{id}")
public EmoRole getRole(@PathParam("group") String group, @PathParam("id") String id,
final @Authenticated Subject subject) {
return _uac.getRole(subject, new EmoRoleKey(group, id));
} | [
"@",
"GET",
"@",
"Path",
"(",
"\"{group}/{id}\"",
")",
"public",
"EmoRole",
"getRole",
"(",
"@",
"PathParam",
"(",
"\"group\"",
")",
"String",
"group",
",",
"@",
"PathParam",
"(",
"\"id\"",
")",
"String",
"id",
",",
"final",
"@",
"Authenticated",
"Subject"... | RESTful endpoint for viewing a role. | [
"RESTful",
"endpoint",
"for",
"viewing",
"a",
"role",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java#L71-L76 |
108,541 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java | RoleResource1.createRole | @POST
@Path("{group}/{id}")
@Consumes(MediaType.APPLICATION_JSON)
public Response createRole(@PathParam("group") String group, @PathParam("id") String id, EmoRole role,
final @Authenticated Subject subject) {
checkArgument(role.getId().equals(new EmoRoleKey(grou... | java | @POST
@Path("{group}/{id}")
@Consumes(MediaType.APPLICATION_JSON)
public Response createRole(@PathParam("group") String group, @PathParam("id") String id, EmoRole role,
final @Authenticated Subject subject) {
checkArgument(role.getId().equals(new EmoRoleKey(grou... | [
"@",
"POST",
"@",
"Path",
"(",
"\"{group}/{id}\"",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"createRole",
"(",
"@",
"PathParam",
"(",
"\"group\"",
")",
"String",
"group",
",",
"@",
"PathParam",
"(",
"\"id\""... | RESTful endpoint for creating a role. | [
"RESTful",
"endpoint",
"for",
"creating",
"a",
"role",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java#L81-L94 |
108,542 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java | RoleResource1.updateRole | @PUT
@Path("{group}/{id}")
@Consumes(MediaType.APPLICATION_JSON)
public SuccessResponse updateRole(@PathParam("group") String group, @PathParam("id") String id,
EmoRole role, final @Authenticated Subject subject) {
checkArgument(role.getId().equals(new EmoRoleKe... | java | @PUT
@Path("{group}/{id}")
@Consumes(MediaType.APPLICATION_JSON)
public SuccessResponse updateRole(@PathParam("group") String group, @PathParam("id") String id,
EmoRole role, final @Authenticated Subject subject) {
checkArgument(role.getId().equals(new EmoRoleKe... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"{group}/{id}\"",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"SuccessResponse",
"updateRole",
"(",
"@",
"PathParam",
"(",
"\"group\"",
")",
"String",
"group",
",",
"@",
"PathParam",
"(",
"\... | RESTful endpoint for updating a role. Note that all attributes of the role will be updated to match the
provided object. | [
"RESTful",
"endpoint",
"for",
"updating",
"a",
"role",
".",
"Note",
"that",
"all",
"attributes",
"of",
"the",
"role",
"will",
"be",
"updated",
"to",
"match",
"the",
"provided",
"object",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java#L116-L131 |
108,543 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java | RoleResource1.deleteRole | @DELETE
@Path("{group}/{id}")
public SuccessResponse deleteRole(@PathParam("group") String group, @PathParam("id") String id,
final @Authenticated Subject subject) {
_uac.deleteRole(subject, new EmoRoleKey(group, id));
return SuccessResponse.instance();
... | java | @DELETE
@Path("{group}/{id}")
public SuccessResponse deleteRole(@PathParam("group") String group, @PathParam("id") String id,
final @Authenticated Subject subject) {
_uac.deleteRole(subject, new EmoRoleKey(group, id));
return SuccessResponse.instance();
... | [
"@",
"DELETE",
"@",
"Path",
"(",
"\"{group}/{id}\"",
")",
"public",
"SuccessResponse",
"deleteRole",
"(",
"@",
"PathParam",
"(",
"\"group\"",
")",
"String",
"group",
",",
"@",
"PathParam",
"(",
"\"id\"",
")",
"String",
"id",
",",
"final",
"@",
"Authenticated... | RESTful endpoint for deleting a role. | [
"RESTful",
"endpoint",
"for",
"deleting",
"a",
"role",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/resources/uac/RoleResource1.java#L149-L155 |
108,544 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/AstyanaxEventReaderDAO.java | AstyanaxEventReaderDAO.readManifestForChannel | private Iterator<Column<ByteBuffer>> readManifestForChannel(final String channel, final boolean weak) {
final ByteBuffer oldestSlab = weak ? _oldestSlab.getIfPresent(channel) : null;
final ConsistencyLevel consistency;
RangeBuilder range = new RangeBuilder().setLimit(50);
if (oldestSlab... | java | private Iterator<Column<ByteBuffer>> readManifestForChannel(final String channel, final boolean weak) {
final ByteBuffer oldestSlab = weak ? _oldestSlab.getIfPresent(channel) : null;
final ConsistencyLevel consistency;
RangeBuilder range = new RangeBuilder().setLimit(50);
if (oldestSlab... | [
"private",
"Iterator",
"<",
"Column",
"<",
"ByteBuffer",
">",
">",
"readManifestForChannel",
"(",
"final",
"String",
"channel",
",",
"final",
"boolean",
"weak",
")",
"{",
"final",
"ByteBuffer",
"oldestSlab",
"=",
"weak",
"?",
"_oldestSlab",
".",
"getIfPresent",
... | Reads the ordered manifest for a channel. The read can either be weak or strong. A weak read will use CL1
and may use the cached oldest slab from a previous strong call to improve performance. A strong read will use
CL local_quorum and will always read the entire manifest row. This makes a weak read significantly f... | [
"Reads",
"the",
"ordered",
"manifest",
"for",
"a",
"channel",
".",
"The",
"read",
"can",
"either",
"be",
"weak",
"or",
"strong",
".",
"A",
"weak",
"read",
"will",
"use",
"CL1",
"and",
"may",
"use",
"the",
"cached",
"oldest",
"slab",
"from",
"a",
"previ... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/AstyanaxEventReaderDAO.java#L339-L373 |
108,545 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/AstyanaxEventReaderDAO.java | AstyanaxEventReaderDAO.readSlab | private boolean readSlab(String channel, ByteBuffer slabId, SlabCursor cursor, boolean open, EventSink sink) {
int start = cursor.get();
if (start == SlabCursor.END) {
return true;
}
boolean recent = isRecent(slabId);
// Event add and delete write with local quorum,... | java | private boolean readSlab(String channel, ByteBuffer slabId, SlabCursor cursor, boolean open, EventSink sink) {
int start = cursor.get();
if (start == SlabCursor.END) {
return true;
}
boolean recent = isRecent(slabId);
// Event add and delete write with local quorum,... | [
"private",
"boolean",
"readSlab",
"(",
"String",
"channel",
",",
"ByteBuffer",
"slabId",
",",
"SlabCursor",
"cursor",
",",
"boolean",
"open",
",",
"EventSink",
"sink",
")",
"{",
"int",
"start",
"=",
"cursor",
".",
"get",
"(",
")",
";",
"if",
"(",
"start"... | Returns true to keep searching for more events, false to stop searching for events. | [
"Returns",
"true",
"to",
"keep",
"searching",
"for",
"more",
"events",
"false",
"to",
"stop",
"searching",
"for",
"events",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/AstyanaxEventReaderDAO.java#L389-L462 |
108,546 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/ScanRangeSplits.java | ScanRangeSplits.combineGroups | public ScanRangeSplits combineGroups() {
return new ScanRangeSplits(ImmutableList.of(new SplitGroup(
FluentIterable.from(_splitGroups)
.transformAndConcat(new Function<SplitGroup, Iterable<TokenRange>>() {
@Override
... | java | public ScanRangeSplits combineGroups() {
return new ScanRangeSplits(ImmutableList.of(new SplitGroup(
FluentIterable.from(_splitGroups)
.transformAndConcat(new Function<SplitGroup, Iterable<TokenRange>>() {
@Override
... | [
"public",
"ScanRangeSplits",
"combineGroups",
"(",
")",
"{",
"return",
"new",
"ScanRangeSplits",
"(",
"ImmutableList",
".",
"of",
"(",
"new",
"SplitGroup",
"(",
"FluentIterable",
".",
"from",
"(",
"_splitGroups",
")",
".",
"transformAndConcat",
"(",
"new",
"Func... | Returns a new ScanRangeSplits where all of the token ranges from all groups are combined into a single group.
This is useful when the caller is going to perform an operation on all token ranges and is not concerned about
creating hot spots. | [
"Returns",
"a",
"new",
"ScanRangeSplits",
"where",
"all",
"of",
"the",
"token",
"ranges",
"from",
"all",
"groups",
"are",
"combined",
"into",
"a",
"single",
"group",
".",
"This",
"is",
"useful",
"when",
"the",
"caller",
"is",
"going",
"to",
"perform",
"an"... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/ScanRangeSplits.java#L45-L55 |
108,547 | bazaarvoice/emodb | common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/UUIDs.java | UUIDs.asByteArray | public static byte[] asByteArray(UUID uuid) {
long msb = uuid.getMostSignificantBits();
long lsb = uuid.getLeastSignificantBits();
byte[] buf = new byte[16];
for (int i = 0; i < 8; i++) {
buf[i] = (byte) (msb >>> 8 * (7 - i));
buf[i + 8] = (byte) (lsb >>> 8 * ... | java | public static byte[] asByteArray(UUID uuid) {
long msb = uuid.getMostSignificantBits();
long lsb = uuid.getLeastSignificantBits();
byte[] buf = new byte[16];
for (int i = 0; i < 8; i++) {
buf[i] = (byte) (msb >>> 8 * (7 - i));
buf[i + 8] = (byte) (lsb >>> 8 * ... | [
"public",
"static",
"byte",
"[",
"]",
"asByteArray",
"(",
"UUID",
"uuid",
")",
"{",
"long",
"msb",
"=",
"uuid",
".",
"getMostSignificantBits",
"(",
")",
";",
"long",
"lsb",
"=",
"uuid",
".",
"getLeastSignificantBits",
"(",
")",
";",
"byte",
"[",
"]",
"... | Returns the byte-array equivalent of the specified UUID in big-endian order. | [
"Returns",
"the",
"byte",
"-",
"array",
"equivalent",
"of",
"the",
"specified",
"UUID",
"in",
"big",
"-",
"endian",
"order",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/uuid/src/main/java/com/bazaarvoice/emodb/common/uuid/UUIDs.java#L13-L22 |
108,548 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/writer/TemporaryFileScanWriter.java | TemporaryFileScanWriter.closeShardFiles | private void closeShardFiles(ShardFiles shardFiles) {
shardFiles.deleteAllShardFiles();
_lock.lock();
try {
_openShardFiles.remove(shardFiles.getKey());
_shardFilesClosedOrExceptionCaught.signalAll();
} finally {
_lock.unlock();
}
} | java | private void closeShardFiles(ShardFiles shardFiles) {
shardFiles.deleteAllShardFiles();
_lock.lock();
try {
_openShardFiles.remove(shardFiles.getKey());
_shardFilesClosedOrExceptionCaught.signalAll();
} finally {
_lock.unlock();
}
} | [
"private",
"void",
"closeShardFiles",
"(",
"ShardFiles",
"shardFiles",
")",
"{",
"shardFiles",
".",
"deleteAllShardFiles",
"(",
")",
";",
"_lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"_openShardFiles",
".",
"remove",
"(",
"shardFiles",
".",
"getKey",
"("... | Cleans up any files associated with the ShardFiles instance and removes it from then open set of ShardFiles. | [
"Cleans",
"up",
"any",
"files",
"associated",
"with",
"the",
"ShardFiles",
"instance",
"and",
"removes",
"it",
"from",
"then",
"open",
"set",
"of",
"ShardFiles",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/writer/TemporaryFileScanWriter.java#L183-L192 |
108,549 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/writer/TemporaryFileScanWriter.java | TemporaryFileScanWriter.transferComplete | private void transferComplete(ShardFiles shardFiles) {
_log.debug("Transfer complete: id={}, file={}", _taskId, shardFiles.getFirstFile());
closeShardFiles(shardFiles);
_openTransfers.dec();
} | java | private void transferComplete(ShardFiles shardFiles) {
_log.debug("Transfer complete: id={}, file={}", _taskId, shardFiles.getFirstFile());
closeShardFiles(shardFiles);
_openTransfers.dec();
} | [
"private",
"void",
"transferComplete",
"(",
"ShardFiles",
"shardFiles",
")",
"{",
"_log",
".",
"debug",
"(",
"\"Transfer complete: id={}, file={}\"",
",",
"_taskId",
",",
"shardFiles",
".",
"getFirstFile",
"(",
")",
")",
";",
"closeShardFiles",
"(",
"shardFiles",
... | Called when a shard file has been transferred, successfully or otherwise. This also closes the ShardFiles. | [
"Called",
"when",
"a",
"shard",
"file",
"has",
"been",
"transferred",
"successfully",
"or",
"otherwise",
".",
"This",
"also",
"closes",
"the",
"ShardFiles",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/writer/TemporaryFileScanWriter.java#L195-L199 |
108,550 | bazaarvoice/emodb | sor-api/src/main/java/com/bazaarvoice/emodb/sor/api/Coordinate.java | Coordinate.asJson | public Map<String, Object> asJson() {
return ImmutableMap.<String, Object>of(
Intrinsic.TABLE, _table,
Intrinsic.ID, _id);
} | java | public Map<String, Object> asJson() {
return ImmutableMap.<String, Object>of(
Intrinsic.TABLE, _table,
Intrinsic.ID, _id);
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"asJson",
"(",
")",
"{",
"return",
"ImmutableMap",
".",
"<",
"String",
",",
"Object",
">",
"of",
"(",
"Intrinsic",
".",
"TABLE",
",",
"_table",
",",
"Intrinsic",
".",
"ID",
",",
"_id",
")",
";",
"... | Returns a Json map with two entries, one for "~table" and one for "~id", similar to all System of Record objects. | [
"Returns",
"a",
"Json",
"map",
"with",
"two",
"entries",
"one",
"for",
"~table",
"and",
"one",
"for",
"~id",
"similar",
"to",
"all",
"System",
"of",
"Record",
"objects",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-api/src/main/java/com/bazaarvoice/emodb/sor/api/Coordinate.java#L58-L62 |
108,551 | bazaarvoice/emodb | databus/src/main/java/com/bazaarvoice/emodb/databus/core/EventKeyFormat.java | EventKeyFormat.encode | static String encode(List<String> eventIds) {
checkArgument(!eventIds.isEmpty(), "Empty event ID list.");
if (eventIds.size() == 1) {
return checkValid(eventIds.get(0));
}
// Concatenate the event IDs using a simple scheme that efficiently encodes events that are the same len... | java | static String encode(List<String> eventIds) {
checkArgument(!eventIds.isEmpty(), "Empty event ID list.");
if (eventIds.size() == 1) {
return checkValid(eventIds.get(0));
}
// Concatenate the event IDs using a simple scheme that efficiently encodes events that are the same len... | [
"static",
"String",
"encode",
"(",
"List",
"<",
"String",
">",
"eventIds",
")",
"{",
"checkArgument",
"(",
"!",
"eventIds",
".",
"isEmpty",
"(",
")",
",",
"\"Empty event ID list.\"",
")",
";",
"if",
"(",
"eventIds",
".",
"size",
"(",
")",
"==",
"1",
")... | Combine multiple EventStore event IDs into a single Databus event key. To get the most compact encoded string,
sort the event ID list before encoding it. | [
"Combine",
"multiple",
"EventStore",
"event",
"IDs",
"into",
"a",
"single",
"Databus",
"event",
"key",
".",
"To",
"get",
"the",
"most",
"compact",
"encoded",
"string",
"sort",
"the",
"event",
"ID",
"list",
"before",
"encoding",
"it",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus/src/main/java/com/bazaarvoice/emodb/databus/core/EventKeyFormat.java#L37-L62 |
108,552 | bazaarvoice/emodb | databus/src/main/java/com/bazaarvoice/emodb/databus/core/EventKeyFormat.java | EventKeyFormat.decodeAll | static List<String> decodeAll(Collection<String> eventKeys) {
List<String> eventIds = Lists.newArrayList();
for (String eventKey : eventKeys) {
decodeTo(eventKey, eventIds);
}
return eventIds;
} | java | static List<String> decodeAll(Collection<String> eventKeys) {
List<String> eventIds = Lists.newArrayList();
for (String eventKey : eventKeys) {
decodeTo(eventKey, eventIds);
}
return eventIds;
} | [
"static",
"List",
"<",
"String",
">",
"decodeAll",
"(",
"Collection",
"<",
"String",
">",
"eventKeys",
")",
"{",
"List",
"<",
"String",
">",
"eventIds",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"String",
"eventKey",
":",
"eventKeys",... | Split Databus event keys into EventStore event IDs. | [
"Split",
"Databus",
"event",
"keys",
"into",
"EventStore",
"event",
"IDs",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus/src/main/java/com/bazaarvoice/emodb/databus/core/EventKeyFormat.java#L65-L71 |
108,553 | bazaarvoice/emodb | databus/src/main/java/com/bazaarvoice/emodb/databus/core/EventKeyFormat.java | EventKeyFormat.decodeTo | static void decodeTo(String eventKey, Collection<String> eventIds) {
int startIdx = 0;
String prevId = null;
for (int i = 0; i < eventKey.length(); i++) {
char ch = eventKey.charAt(i);
if (ch == DELIM_REGULAR || ch == DELIM_SHARED_PREFIX) {
String eventId ... | java | static void decodeTo(String eventKey, Collection<String> eventIds) {
int startIdx = 0;
String prevId = null;
for (int i = 0; i < eventKey.length(); i++) {
char ch = eventKey.charAt(i);
if (ch == DELIM_REGULAR || ch == DELIM_SHARED_PREFIX) {
String eventId ... | [
"static",
"void",
"decodeTo",
"(",
"String",
"eventKey",
",",
"Collection",
"<",
"String",
">",
"eventIds",
")",
"{",
"int",
"startIdx",
"=",
"0",
";",
"String",
"prevId",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"eventKey",... | Split a Databus event key into EventStore event IDs. | [
"Split",
"a",
"Databus",
"event",
"key",
"into",
"EventStore",
"event",
"IDs",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus/src/main/java/com/bazaarvoice/emodb/databus/core/EventKeyFormat.java#L74-L88 |
108,554 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/BaseRecordReader.java | BaseRecordReader.setNextKeyValue | public boolean setNextKeyValue(Text key, Row value)
throws IOException {
if (!_rows.hasNext()) {
Closeables.close(this, true);
return false;
}
try {
Map<String, Object> content = _rows.next();
key.set(Coordinate.fromJson(content).toStr... | java | public boolean setNextKeyValue(Text key, Row value)
throws IOException {
if (!_rows.hasNext()) {
Closeables.close(this, true);
return false;
}
try {
Map<String, Object> content = _rows.next();
key.set(Coordinate.fromJson(content).toStr... | [
"public",
"boolean",
"setNextKeyValue",
"(",
"Text",
"key",
",",
"Row",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"_rows",
".",
"hasNext",
"(",
")",
")",
"{",
"Closeables",
".",
"close",
"(",
"this",
",",
"true",
")",
";",
"return",
... | Read the next row from the split, storing the coordinate in "key" and the content in "value". If there are no
more rows then false is returned and "key" and "value" are not modified.
@return true if a row was read, false if there were no more rows | [
"Read",
"the",
"next",
"row",
"from",
"the",
"split",
"storing",
"the",
"coordinate",
"in",
"key",
"and",
"the",
"content",
"in",
"value",
".",
"If",
"there",
"are",
"no",
"more",
"rows",
"then",
"false",
"is",
"returned",
"and",
"key",
"and",
"value",
... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/BaseRecordReader.java#L52-L71 |
108,555 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/BaseRecordReader.java | BaseRecordReader.getProgress | public float getProgress()
throws IOException {
if (!_rows.hasNext()) {
return 1;
} else if (_rowsRead < _approximateSize) {
return (float) _rowsRead / _approximateSize;
} else {
// We've already read the expected number of rows.
return... | java | public float getProgress()
throws IOException {
if (!_rows.hasNext()) {
return 1;
} else if (_rowsRead < _approximateSize) {
return (float) _rowsRead / _approximateSize;
} else {
// We've already read the expected number of rows.
return... | [
"public",
"float",
"getProgress",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"_rows",
".",
"hasNext",
"(",
")",
")",
"{",
"return",
"1",
";",
"}",
"else",
"if",
"(",
"_rowsRead",
"<",
"_approximateSize",
")",
"{",
"return",
"(",
"float",
... | Returns a rough approximate of the progress on a scale from 0 to 1 | [
"Returns",
"a",
"rough",
"approximate",
"of",
"the",
"progress",
"on",
"a",
"scale",
"from",
"0",
"to",
"1"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/BaseRecordReader.java#L76-L86 |
108,556 | bazaarvoice/emodb | auth/auth-store/src/main/java/com/bazaarvoice/emodb/auth/role/DeferringRoleManager.java | DeferringRoleManager.getPermissionsForRole | @Override
public Set<String> getPermissionsForRole(RoleIdentifier id) {
checkNotNull(id, "id");
return _delegate.getPermissionsForRole(id);
} | java | @Override
public Set<String> getPermissionsForRole(RoleIdentifier id) {
checkNotNull(id, "id");
return _delegate.getPermissionsForRole(id);
} | [
"@",
"Override",
"public",
"Set",
"<",
"String",
">",
"getPermissionsForRole",
"(",
"RoleIdentifier",
"id",
")",
"{",
"checkNotNull",
"(",
"id",
",",
"\"id\"",
")",
";",
"return",
"_delegate",
".",
"getPermissionsForRole",
"(",
"id",
")",
";",
"}"
] | Although this implementation overrides specific roles the permissions associated with them are
still managed by the permission manager, so always defer to the delegate to read permissions. | [
"Although",
"this",
"implementation",
"overrides",
"specific",
"roles",
"the",
"permissions",
"associated",
"with",
"them",
"are",
"still",
"managed",
"by",
"the",
"permission",
"manager",
"so",
"always",
"defer",
"to",
"the",
"delegate",
"to",
"read",
"permission... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-store/src/main/java/com/bazaarvoice/emodb/auth/role/DeferringRoleManager.java#L61-L65 |
108,557 | bazaarvoice/emodb | databus/src/main/java/com/bazaarvoice/emodb/databus/core/UpdateRefSerializer.java | UpdateRefSerializer.trim | private static ByteBuffer trim(ByteBuffer buf) {
if (buf.capacity() <= 4 * buf.remaining()) {
return buf;
} else {
ByteBuffer clone = ByteBuffer.allocate(buf.remaining());
buf.get(clone.array());
return clone;
}
} | java | private static ByteBuffer trim(ByteBuffer buf) {
if (buf.capacity() <= 4 * buf.remaining()) {
return buf;
} else {
ByteBuffer clone = ByteBuffer.allocate(buf.remaining());
buf.get(clone.array());
return clone;
}
} | [
"private",
"static",
"ByteBuffer",
"trim",
"(",
"ByteBuffer",
"buf",
")",
"{",
"if",
"(",
"buf",
".",
"capacity",
"(",
")",
"<=",
"4",
"*",
"buf",
".",
"remaining",
"(",
")",
")",
"{",
"return",
"buf",
";",
"}",
"else",
"{",
"ByteBuffer",
"clone",
... | Serialized Astyanax Composite objects use a lot of memory. Trim it down. | [
"Serialized",
"Astyanax",
"Composite",
"objects",
"use",
"a",
"lot",
"of",
"memory",
".",
"Trim",
"it",
"down",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus/src/main/java/com/bazaarvoice/emodb/databus/core/UpdateRefSerializer.java#L63-L71 |
108,558 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/uac/LocalSubjectUserAccessControl.java | LocalSubjectUserAccessControl.verifyPermission | private void verifyPermission(Subject subject, String permission)
throws UnauthorizedException {
if (!subject.hasPermission(permission)) {
throw new UnauthorizedException();
}
} | java | private void verifyPermission(Subject subject, String permission)
throws UnauthorizedException {
if (!subject.hasPermission(permission)) {
throw new UnauthorizedException();
}
} | [
"private",
"void",
"verifyPermission",
"(",
"Subject",
"subject",
",",
"String",
"permission",
")",
"throws",
"UnauthorizedException",
"{",
"if",
"(",
"!",
"subject",
".",
"hasPermission",
"(",
"permission",
")",
")",
"{",
"throw",
"new",
"UnauthorizedException",
... | Verifies whether the user has a specific permission. If not it throws a standard UnauthorizedException.
@throws UnauthorizedException User did not have the permission | [
"Verifies",
"whether",
"the",
"user",
"has",
"a",
"specific",
"permission",
".",
"If",
"not",
"it",
"throws",
"a",
"standard",
"UnauthorizedException",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/uac/LocalSubjectUserAccessControl.java#L583-L588 |
108,559 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/uac/LocalSubjectUserAccessControl.java | LocalSubjectUserAccessControl.verifyPermissionToGrantRoles | private void verifyPermissionToGrantRoles(Subject subject, Iterable<RoleIdentifier> roleIds) {
Set<RoleIdentifier> unauthorizedIds = Sets.newTreeSet();
boolean anyAuthorized = false;
for (RoleIdentifier roleId : roleIds) {
// Verify the caller has permission to grant this role
... | java | private void verifyPermissionToGrantRoles(Subject subject, Iterable<RoleIdentifier> roleIds) {
Set<RoleIdentifier> unauthorizedIds = Sets.newTreeSet();
boolean anyAuthorized = false;
for (RoleIdentifier roleId : roleIds) {
// Verify the caller has permission to grant this role
... | [
"private",
"void",
"verifyPermissionToGrantRoles",
"(",
"Subject",
"subject",
",",
"Iterable",
"<",
"RoleIdentifier",
">",
"roleIds",
")",
"{",
"Set",
"<",
"RoleIdentifier",
">",
"unauthorizedIds",
"=",
"Sets",
".",
"newTreeSet",
"(",
")",
";",
"boolean",
"anyAu... | Verifies whether the user has permission to grant all of the provided roles. If not it throws an UnauthorizedException.
@throws UnauthorizedException User did not have the permission to grant at least one role. | [
"Verifies",
"whether",
"the",
"user",
"has",
"permission",
"to",
"grant",
"all",
"of",
"the",
"provided",
"roles",
".",
"If",
"not",
"it",
"throws",
"an",
"UnauthorizedException",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/uac/LocalSubjectUserAccessControl.java#L594-L618 |
108,560 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/uac/LocalSubjectUserAccessControl.java | LocalSubjectUserAccessControl.convertUncheckedException | private RuntimeException convertUncheckedException(Exception e) {
if (Throwables.getRootCause(e) instanceof TimeoutException) {
_lockTimeoutMeter.mark();
throw new ServiceUnavailableException("Failed to acquire update lock, try again later", new Random().nextInt(5) + 1);
}
... | java | private RuntimeException convertUncheckedException(Exception e) {
if (Throwables.getRootCause(e) instanceof TimeoutException) {
_lockTimeoutMeter.mark();
throw new ServiceUnavailableException("Failed to acquire update lock, try again later", new Random().nextInt(5) + 1);
}
... | [
"private",
"RuntimeException",
"convertUncheckedException",
"(",
"Exception",
"e",
")",
"{",
"if",
"(",
"Throwables",
".",
"getRootCause",
"(",
"e",
")",
"instanceof",
"TimeoutException",
")",
"{",
"_lockTimeoutMeter",
".",
"mark",
"(",
")",
";",
"throw",
"new",... | Converts unchecked exceptions to appropriate API exceptions. Specifically, if the subsystem fails to acquire
the synchronization lock for a non-read operation it will throw a TimeoutException. This method converts
that to a ServiceUnavailableException. All other exceptions are rethrown as-is.
This method never retu... | [
"Converts",
"unchecked",
"exceptions",
"to",
"appropriate",
"API",
"exceptions",
".",
"Specifically",
"if",
"the",
"subsystem",
"fails",
"to",
"acquire",
"the",
"synchronization",
"lock",
"for",
"a",
"non",
"-",
"read",
"operation",
"it",
"will",
"throw",
"a",
... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/uac/LocalSubjectUserAccessControl.java#L628-L634 |
108,561 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/Row.java | Row.ensureTextSet | private void ensureTextSet() {
if (_text.limit() == 0) {
checkState(_map != null, "Neither JSON text nor map has been set");
_text.clear();
// First try reading the JSON directly into be buffer.
try {
JsonHelper.writeJson(new ByteBufferOutputStream... | java | private void ensureTextSet() {
if (_text.limit() == 0) {
checkState(_map != null, "Neither JSON text nor map has been set");
_text.clear();
// First try reading the JSON directly into be buffer.
try {
JsonHelper.writeJson(new ByteBufferOutputStream... | [
"private",
"void",
"ensureTextSet",
"(",
")",
"{",
"if",
"(",
"_text",
".",
"limit",
"(",
")",
"==",
"0",
")",
"{",
"checkState",
"(",
"_map",
"!=",
"null",
",",
"\"Neither JSON text nor map has been set\"",
")",
";",
"_text",
".",
"clear",
"(",
")",
";"... | Ensures that either the UTF-8 text has been set directly or by indirectly converting the Map contents to JSON. | [
"Ensures",
"that",
"either",
"the",
"UTF",
"-",
"8",
"text",
"has",
"been",
"set",
"directly",
"or",
"by",
"indirectly",
"converting",
"the",
"Map",
"contents",
"to",
"JSON",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/Row.java#L104-L123 |
108,562 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/Row.java | Row.readFields | @Override
public void readFields(DataInput in)
throws IOException {
// Read the length as a variable int
int length = WritableUtils.readVInt(in);
// If necessary increase the buffer capacity
if (length > _text.capacity()) {
_text = ByteBuffer.allocate(length);... | java | @Override
public void readFields(DataInput in)
throws IOException {
// Read the length as a variable int
int length = WritableUtils.readVInt(in);
// If necessary increase the buffer capacity
if (length > _text.capacity()) {
_text = ByteBuffer.allocate(length);... | [
"@",
"Override",
"public",
"void",
"readFields",
"(",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"// Read the length as a variable int",
"int",
"length",
"=",
"WritableUtils",
".",
"readVInt",
"(",
"in",
")",
";",
"// If necessary increase the buffer capacity... | Sets this instance's content from the input. | [
"Sets",
"this",
"instance",
"s",
"content",
"from",
"the",
"input",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/Row.java#L202-L218 |
108,563 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/Row.java | Row.write | @Override
public void write(DataOutput out)
throws IOException {
ensureTextSet();
// Write a variable int with the length
WritableUtils.writeVInt(out, _text.limit());
// Write the bytes. For efficiency directly access the buffer's array.
out.write(_text.array(), ... | java | @Override
public void write(DataOutput out)
throws IOException {
ensureTextSet();
// Write a variable int with the length
WritableUtils.writeVInt(out, _text.limit());
// Write the bytes. For efficiency directly access the buffer's array.
out.write(_text.array(), ... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"ensureTextSet",
"(",
")",
";",
"// Write a variable int with the length",
"WritableUtils",
".",
"writeVInt",
"(",
"out",
",",
"_text",
".",
"limit",
"(",
")... | Writes this instance's content to the output. Note that the format for Row is identical to Text, so even though
the classes are unrelated a Text object can read the bytes written by a Row as a JSON string. | [
"Writes",
"this",
"instance",
"s",
"content",
"to",
"the",
"output",
".",
"Note",
"that",
"the",
"format",
"for",
"Row",
"is",
"identical",
"to",
"Text",
"so",
"even",
"though",
"the",
"classes",
"are",
"unrelated",
"a",
"Text",
"object",
"can",
"read",
... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/Row.java#L224-L232 |
108,564 | bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StandardStashReader.java | StandardStashReader.getLockedView | public StashReader getLockedView() {
return new FixedStashReader(URI.create(String.format("s3://%s/%s", _bucket, getRootPath())), _s3);
} | java | public StashReader getLockedView() {
return new FixedStashReader(URI.create(String.format("s3://%s/%s", _bucket, getRootPath())), _s3);
} | [
"public",
"StashReader",
"getLockedView",
"(",
")",
"{",
"return",
"new",
"FixedStashReader",
"(",
"URI",
".",
"create",
"(",
"String",
".",
"format",
"(",
"\"s3://%s/%s\"",
",",
"_bucket",
",",
"getRootPath",
"(",
")",
")",
")",
",",
"_s3",
")",
";",
"}... | Returns a new StashReader that is locked to the same stash time the instance is currently using. Future calls to
lock or unlock the stash time on this instance will not affect the returned instance. | [
"Returns",
"a",
"new",
"StashReader",
"that",
"is",
"locked",
"to",
"the",
"same",
"stash",
"time",
"the",
"instance",
"is",
"currently",
"using",
".",
"Future",
"calls",
"to",
"lock",
"or",
"unlock",
"the",
"stash",
"time",
"on",
"this",
"instance",
"will... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StandardStashReader.java#L194-L196 |
108,565 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/ScanUploader.java | ScanUploader.createPlan | private ScanPlan createPlan(String scanId, ScanOptions options) {
ScanPlan plan = new ScanPlan(scanId, options);
for (String placement : options.getPlacements()) {
String cluster = _dataTools.getPlacementCluster(placement);
ScanRangeSplits scanRangeSplits = _dataTools.getScanRan... | java | private ScanPlan createPlan(String scanId, ScanOptions options) {
ScanPlan plan = new ScanPlan(scanId, options);
for (String placement : options.getPlacements()) {
String cluster = _dataTools.getPlacementCluster(placement);
ScanRangeSplits scanRangeSplits = _dataTools.getScanRan... | [
"private",
"ScanPlan",
"createPlan",
"(",
"String",
"scanId",
",",
"ScanOptions",
"options",
")",
"{",
"ScanPlan",
"plan",
"=",
"new",
"ScanPlan",
"(",
"scanId",
",",
"options",
")",
";",
"for",
"(",
"String",
"placement",
":",
"options",
".",
"getPlacements... | Returns a ScanPlan based on the Cassandra rings and token ranges. | [
"Returns",
"a",
"ScanPlan",
"based",
"on",
"the",
"Cassandra",
"rings",
"and",
"token",
"ranges",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/ScanUploader.java#L134-L159 |
108,566 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/ScanUploader.java | ScanUploader.resubmitWorkflowTasks | public ScanStatus resubmitWorkflowTasks(String scanId) {
ScanStatus status = _scanStatusDAO.getScanStatus(scanId);
if (status == null) {
return null;
}
if (status.getCompleteTime() == null) {
// Resubmit any active tasks
for (ScanRangeStatus active : ... | java | public ScanStatus resubmitWorkflowTasks(String scanId) {
ScanStatus status = _scanStatusDAO.getScanStatus(scanId);
if (status == null) {
return null;
}
if (status.getCompleteTime() == null) {
// Resubmit any active tasks
for (ScanRangeStatus active : ... | [
"public",
"ScanStatus",
"resubmitWorkflowTasks",
"(",
"String",
"scanId",
")",
"{",
"ScanStatus",
"status",
"=",
"_scanStatusDAO",
".",
"getScanStatus",
"(",
"scanId",
")",
";",
"if",
"(",
"status",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
... | Sometimes due to unexpected errors while submitting scan ranges to the underlying queues a scan can get stuck.
This method takes all available tasks for a scan and resubmits them. This method is safe because
the underlying system is resilient to task resubmissions and concurrent work on the same task. | [
"Sometimes",
"due",
"to",
"unexpected",
"errors",
"while",
"submitting",
"scan",
"ranges",
"to",
"the",
"underlying",
"queues",
"a",
"scan",
"can",
"get",
"stuck",
".",
"This",
"method",
"takes",
"all",
"available",
"tasks",
"for",
"a",
"scan",
"and",
"resub... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/ScanUploader.java#L253-L270 |
108,567 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/scheduling/ScheduledDailyScanUpload.java | ScheduledDailyScanUpload.getNextExecutionTimeAfter | public Instant getNextExecutionTimeAfter(Instant now) {
OffsetTime timeOfDay = OffsetTime.from(TIME_OF_DAY_FORMAT.parse(getTimeOfDay()));
// The time of the next run is based on the time past midnight UTC relative to the current time
Instant nextExecTime = now.atOffset(ZoneOffset.UTC).with(time... | java | public Instant getNextExecutionTimeAfter(Instant now) {
OffsetTime timeOfDay = OffsetTime.from(TIME_OF_DAY_FORMAT.parse(getTimeOfDay()));
// The time of the next run is based on the time past midnight UTC relative to the current time
Instant nextExecTime = now.atOffset(ZoneOffset.UTC).with(time... | [
"public",
"Instant",
"getNextExecutionTimeAfter",
"(",
"Instant",
"now",
")",
"{",
"OffsetTime",
"timeOfDay",
"=",
"OffsetTime",
".",
"from",
"(",
"TIME_OF_DAY_FORMAT",
".",
"parse",
"(",
"getTimeOfDay",
"(",
")",
")",
")",
";",
"// The time of the next run is based... | Gets the first execution time for the given scan and upload which is at or after "now". | [
"Gets",
"the",
"first",
"execution",
"time",
"for",
"the",
"given",
"scan",
"and",
"upload",
"which",
"is",
"at",
"or",
"after",
"now",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/scheduling/ScheduledDailyScanUpload.java#L93-L105 |
108,568 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/writer/ScanWriterGenerator.java | ScanWriterGenerator.createScanWriter | public ScanWriter createScanWriter(final int taskId, Set<ScanDestination> destinations) {
checkArgument(!destinations.isEmpty(), "destinations.isEmpty()");
if (destinations.size() == 1) {
return createScanWriter(taskId, Iterables.getOnlyElement(destinations));
}
return new M... | java | public ScanWriter createScanWriter(final int taskId, Set<ScanDestination> destinations) {
checkArgument(!destinations.isEmpty(), "destinations.isEmpty()");
if (destinations.size() == 1) {
return createScanWriter(taskId, Iterables.getOnlyElement(destinations));
}
return new M... | [
"public",
"ScanWriter",
"createScanWriter",
"(",
"final",
"int",
"taskId",
",",
"Set",
"<",
"ScanDestination",
">",
"destinations",
")",
"{",
"checkArgument",
"(",
"!",
"destinations",
".",
"isEmpty",
"(",
")",
",",
"\"destinations.isEmpty()\"",
")",
";",
"if",
... | Creates a scan writer from the given desintations. | [
"Creates",
"a",
"scan",
"writer",
"from",
"the",
"given",
"desintations",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/writer/ScanWriterGenerator.java#L30-L44 |
108,569 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/writer/ScanWriterGenerator.java | ScanWriterGenerator.createScanWriter | public ScanWriter createScanWriter(int taskId, ScanDestination destination) {
if (destination.isDiscarding()) {
return _scanWriterFactory.createDiscardingScanWriter(taskId, Optional.<Integer>absent());
}
URI uri = destination.getUri();
String scheme = uri.getScheme();
... | java | public ScanWriter createScanWriter(int taskId, ScanDestination destination) {
if (destination.isDiscarding()) {
return _scanWriterFactory.createDiscardingScanWriter(taskId, Optional.<Integer>absent());
}
URI uri = destination.getUri();
String scheme = uri.getScheme();
... | [
"public",
"ScanWriter",
"createScanWriter",
"(",
"int",
"taskId",
",",
"ScanDestination",
"destination",
")",
"{",
"if",
"(",
"destination",
".",
"isDiscarding",
"(",
")",
")",
"{",
"return",
"_scanWriterFactory",
".",
"createDiscardingScanWriter",
"(",
"taskId",
... | Creates a scan writer for the given destination. | [
"Creates",
"a",
"scan",
"writer",
"for",
"the",
"given",
"destination",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/writer/ScanWriterGenerator.java#L49-L66 |
108,570 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/CassandraKeyspace.java | CassandraKeyspace.prepareColumnMutation | public <K, C> ColumnMutation prepareColumnMutation(ColumnFamily<K, C> cf, K rowKey, C column, ConsistencyLevel consistency) {
return _astyanaxKeyspace.prepareColumnMutation(cf, rowKey, column).setConsistencyLevel(clamp(consistency));
} | java | public <K, C> ColumnMutation prepareColumnMutation(ColumnFamily<K, C> cf, K rowKey, C column, ConsistencyLevel consistency) {
return _astyanaxKeyspace.prepareColumnMutation(cf, rowKey, column).setConsistencyLevel(clamp(consistency));
} | [
"public",
"<",
"K",
",",
"C",
">",
"ColumnMutation",
"prepareColumnMutation",
"(",
"ColumnFamily",
"<",
"K",
",",
"C",
">",
"cf",
",",
"K",
"rowKey",
",",
"C",
"column",
",",
"ConsistencyLevel",
"consistency",
")",
"{",
"return",
"_astyanaxKeyspace",
".",
... | Mutation for a single column. | [
"Mutation",
"for",
"a",
"single",
"column",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/CassandraKeyspace.java#L110-L112 |
108,571 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/CassandraKeyspace.java | CassandraKeyspace.getMismatchedPartitioner | private String getMismatchedPartitioner(Class<? extends IPartitioner> expectedPartitioner) {
String partitioner = null;
try {
partitioner = _astyanaxKeyspace.describePartitioner();
boolean matches = CassandraPartitioner.fromClass(partitioner).matches(expectedPartitioner.getName()... | java | private String getMismatchedPartitioner(Class<? extends IPartitioner> expectedPartitioner) {
String partitioner = null;
try {
partitioner = _astyanaxKeyspace.describePartitioner();
boolean matches = CassandraPartitioner.fromClass(partitioner).matches(expectedPartitioner.getName()... | [
"private",
"String",
"getMismatchedPartitioner",
"(",
"Class",
"<",
"?",
"extends",
"IPartitioner",
">",
"expectedPartitioner",
")",
"{",
"String",
"partitioner",
"=",
"null",
";",
"try",
"{",
"partitioner",
"=",
"_astyanaxKeyspace",
".",
"describePartitioner",
"(",... | Returns the actual partitioner in use by Cassandra if it does not match the expected partitioner, null if it matches. | [
"Returns",
"the",
"actual",
"partitioner",
"in",
"use",
"by",
"Cassandra",
"if",
"it",
"does",
"not",
"match",
"the",
"expected",
"partitioner",
"null",
"if",
"it",
"matches",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/CassandraKeyspace.java#L164-L181 |
108,572 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/ChannelAllocationState.java | ChannelAllocationState.attachAndAllocate | public synchronized SlabAllocation attachAndAllocate(SlabRef slab, PeekingIterator<Integer> eventSizes) {
attach(slab);
return allocate(eventSizes);
} | java | public synchronized SlabAllocation attachAndAllocate(SlabRef slab, PeekingIterator<Integer> eventSizes) {
attach(slab);
return allocate(eventSizes);
} | [
"public",
"synchronized",
"SlabAllocation",
"attachAndAllocate",
"(",
"SlabRef",
"slab",
",",
"PeekingIterator",
"<",
"Integer",
">",
"eventSizes",
")",
"{",
"attach",
"(",
"slab",
")",
";",
"return",
"allocate",
"(",
"eventSizes",
")",
";",
"}"
] | Attaches a slab and allocates from it in a single atomic operation. | [
"Attaches",
"a",
"slab",
"and",
"allocates",
"from",
"it",
"in",
"a",
"single",
"atomic",
"operation",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/ChannelAllocationState.java#L32-L35 |
108,573 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/ChannelAllocationState.java | ChannelAllocationState.attach | public synchronized void attach(SlabRef slab) {
// Assume ownership of the caller's ref. No need to call slab.addRef().
checkState(!isAttached());
_slab = slab;
_slabConsumed = 0;
_slabBytesConsumed = 0;
_slabExpiresAt = System.currentTimeMillis() + Constants.SLAB_ROTAT... | java | public synchronized void attach(SlabRef slab) {
// Assume ownership of the caller's ref. No need to call slab.addRef().
checkState(!isAttached());
_slab = slab;
_slabConsumed = 0;
_slabBytesConsumed = 0;
_slabExpiresAt = System.currentTimeMillis() + Constants.SLAB_ROTAT... | [
"public",
"synchronized",
"void",
"attach",
"(",
"SlabRef",
"slab",
")",
"{",
"// Assume ownership of the caller's ref. No need to call slab.addRef().",
"checkState",
"(",
"!",
"isAttached",
"(",
")",
")",
";",
"_slab",
"=",
"slab",
";",
"_slabConsumed",
"=",
"0",
... | Attaches a new slab to the channel with the specified capacity. | [
"Attaches",
"a",
"new",
"slab",
"to",
"the",
"channel",
"with",
"the",
"specified",
"capacity",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/ChannelAllocationState.java#L38-L46 |
108,574 | bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/ChannelAllocationState.java | ChannelAllocationState.detach | public synchronized SlabRef detach() {
if (!isAttached()) {
return null;
}
// Pass ownership of the slab ref to the caller. No need to call slab.release().
SlabRef slab = _slab;
_slab = null;
_slabExpiresAt = 0;
return slab;
} | java | public synchronized SlabRef detach() {
if (!isAttached()) {
return null;
}
// Pass ownership of the slab ref to the caller. No need to call slab.release().
SlabRef slab = _slab;
_slab = null;
_slabExpiresAt = 0;
return slab;
} | [
"public",
"synchronized",
"SlabRef",
"detach",
"(",
")",
"{",
"if",
"(",
"!",
"isAttached",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"// Pass ownership of the slab ref to the caller. No need to call slab.release().",
"SlabRef",
"slab",
"=",
"_slab",
";",
"_s... | Detaches a slab from the channel and returns it to the caller to dispose of. | [
"Detaches",
"a",
"slab",
"from",
"the",
"channel",
"and",
"returns",
"it",
"to",
"the",
"caller",
"to",
"dispose",
"of",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/ChannelAllocationState.java#L49-L59 |
108,575 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java | AstyanaxTableDAO.getNextMaintenanceOp | @Nullable
private MaintenanceOp getNextMaintenanceOp(final TableJson json, boolean includeTask) {
if (json.isDeleted() || json.getStorages().isEmpty()) {
return null;
}
// Loop through the table uuids and pick the MaintenanceOp that should execute first, with the minimum "when".... | java | @Nullable
private MaintenanceOp getNextMaintenanceOp(final TableJson json, boolean includeTask) {
if (json.isDeleted() || json.getStorages().isEmpty()) {
return null;
}
// Loop through the table uuids and pick the MaintenanceOp that should execute first, with the minimum "when".... | [
"@",
"Nullable",
"private",
"MaintenanceOp",
"getNextMaintenanceOp",
"(",
"final",
"TableJson",
"json",
",",
"boolean",
"includeTask",
")",
"{",
"if",
"(",
"json",
".",
"isDeleted",
"(",
")",
"||",
"json",
".",
"getStorages",
"(",
")",
".",
"isEmpty",
"(",
... | Returns the next maintenance operation that should be performed on the specified table. | [
"Returns",
"the",
"next",
"maintenance",
"operation",
"that",
"should",
"be",
"performed",
"on",
"the",
"specified",
"table",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java#L325-L344 |
108,576 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java | AstyanaxTableDAO.checkFacadeAllowed | @Override
public boolean checkFacadeAllowed(String table, FacadeOptions options)
throws FacadeExistsException {
return checkFacadeAllowed(readTableJson(table, true), options.getPlacement(), null);
} | java | @Override
public boolean checkFacadeAllowed(String table, FacadeOptions options)
throws FacadeExistsException {
return checkFacadeAllowed(readTableJson(table, true), options.getPlacement(), null);
} | [
"@",
"Override",
"public",
"boolean",
"checkFacadeAllowed",
"(",
"String",
"table",
",",
"FacadeOptions",
"options",
")",
"throws",
"FacadeExistsException",
"{",
"return",
"checkFacadeAllowed",
"(",
"readTableJson",
"(",
"table",
",",
"true",
")",
",",
"options",
... | Returns true if facade may be created for the specified table and placement.
Throws an exception if a facade is not allowed because of a conflict with the master or another facade.
Returns false if there is already a facade at the specified placement, so facade creation would be idempotent. | [
"Returns",
"true",
"if",
"facade",
"may",
"be",
"created",
"for",
"the",
"specified",
"table",
"and",
"placement",
".",
"Throws",
"an",
"exception",
"if",
"a",
"facade",
"is",
"not",
"allowed",
"because",
"of",
"a",
"conflict",
"with",
"the",
"master",
"or... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java#L644-L648 |
108,577 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java | AstyanaxTableDAO.purgeData | private void purgeData(TableJson json, Storage storage, int iteration, Runnable progress) {
_log.info("Purging data for table '{}' and table uuid '{}' (facade={}, iteration={}).",
json.getTable(), storage.getUuidString(), storage.isFacade(), iteration);
// Cap the # of writes-per-second... | java | private void purgeData(TableJson json, Storage storage, int iteration, Runnable progress) {
_log.info("Purging data for table '{}' and table uuid '{}' (facade={}, iteration={}).",
json.getTable(), storage.getUuidString(), storage.isFacade(), iteration);
// Cap the # of writes-per-second... | [
"private",
"void",
"purgeData",
"(",
"TableJson",
"json",
",",
"Storage",
"storage",
",",
"int",
"iteration",
",",
"Runnable",
"progress",
")",
"{",
"_log",
".",
"info",
"(",
"\"Purging data for table '{}' and table uuid '{}' (facade={}, iteration={}).\"",
",",
"json",
... | Purge a dropped table or facade. Executed twice, once for fast cleanup and again much later for stragglers. | [
"Purge",
"a",
"dropped",
"table",
"or",
"facade",
".",
"Executed",
"twice",
"once",
"for",
"fast",
"cleanup",
"and",
"again",
"much",
"later",
"for",
"stragglers",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java#L746-L759 |
108,578 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java | AstyanaxTableDAO.deleteFinal | private void deleteFinal(TableJson json, Storage storage) {
// Remove the uuid and storage--we no longer need it. Leave the uuid in _systemTableUuid so it isn't reused.
Delta delta = json.newDeleteStorage(storage);
Audit audit = new AuditBuilder()
.set("_op", "doDeleteFinal")
... | java | private void deleteFinal(TableJson json, Storage storage) {
// Remove the uuid and storage--we no longer need it. Leave the uuid in _systemTableUuid so it isn't reused.
Delta delta = json.newDeleteStorage(storage);
Audit audit = new AuditBuilder()
.set("_op", "doDeleteFinal")
... | [
"private",
"void",
"deleteFinal",
"(",
"TableJson",
"json",
",",
"Storage",
"storage",
")",
"{",
"// Remove the uuid and storage--we no longer need it. Leave the uuid in _systemTableUuid so it isn't reused.",
"Delta",
"delta",
"=",
"json",
".",
"newDeleteStorage",
"(",
"storag... | Last step in dropping a table or facade. | [
"Last",
"step",
"in",
"dropping",
"a",
"table",
"or",
"facade",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java#L764-L773 |
108,579 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java | AstyanaxTableDAO.moveCancel | private void moveCancel(TableJson json, Storage src, Storage dest) {
Delta delta = json.newMoveCancel(src);
Audit audit = new AuditBuilder()
.set("_op", "doMoveCancel")
.set("_srcUuid", src.getUuidString())
.set("_srcPlacement", src.getPlacement())
... | java | private void moveCancel(TableJson json, Storage src, Storage dest) {
Delta delta = json.newMoveCancel(src);
Audit audit = new AuditBuilder()
.set("_op", "doMoveCancel")
.set("_srcUuid", src.getUuidString())
.set("_srcPlacement", src.getPlacement())
... | [
"private",
"void",
"moveCancel",
"(",
"TableJson",
"json",
",",
"Storage",
"src",
",",
"Storage",
"dest",
")",
"{",
"Delta",
"delta",
"=",
"json",
".",
"newMoveCancel",
"(",
"src",
")",
";",
"Audit",
"audit",
"=",
"new",
"AuditBuilder",
"(",
")",
".",
... | Cancel a move before mirror promotion has taken place. | [
"Cancel",
"a",
"move",
"before",
"mirror",
"promotion",
"has",
"taken",
"place",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java#L941-L951 |
108,580 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java | AstyanaxTableDAO.newUnpublishedDatabusEventUpdate | Delta newUnpublishedDatabusEventUpdate(String tableName, String updateType, String datetime) {
return Deltas.mapBuilder()
.update("tables", Deltas.setBuilder().add(ImmutableMap.of("table", tableName, "date", datetime, "event", updateType)).build())
.build();
} | java | Delta newUnpublishedDatabusEventUpdate(String tableName, String updateType, String datetime) {
return Deltas.mapBuilder()
.update("tables", Deltas.setBuilder().add(ImmutableMap.of("table", tableName, "date", datetime, "event", updateType)).build())
.build();
} | [
"Delta",
"newUnpublishedDatabusEventUpdate",
"(",
"String",
"tableName",
",",
"String",
"updateType",
",",
"String",
"datetime",
")",
"{",
"return",
"Deltas",
".",
"mapBuilder",
"(",
")",
".",
"update",
"(",
"\"tables\"",
",",
"Deltas",
".",
"setBuilder",
"(",
... | Delta for storing the unpublished databus events. | [
"Delta",
"for",
"storing",
"the",
"unpublished",
"databus",
"events",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java#L1533-L1537 |
108,581 | bazaarvoice/emodb | sor-api/src/main/java/com/bazaarvoice/emodb/sor/condition/impl/AndConditionImpl.java | AndConditionImpl.conditionsEqual | private boolean conditionsEqual(Collection<Condition> conditions) {
if (conditions.size() != _conditions.size()) {
return false;
}
List<Condition> unvalidatedConditions = new ArrayList<>(conditions);
for (Condition condition : _conditions) {
if (!unvalidatedCondit... | java | private boolean conditionsEqual(Collection<Condition> conditions) {
if (conditions.size() != _conditions.size()) {
return false;
}
List<Condition> unvalidatedConditions = new ArrayList<>(conditions);
for (Condition condition : _conditions) {
if (!unvalidatedCondit... | [
"private",
"boolean",
"conditionsEqual",
"(",
"Collection",
"<",
"Condition",
">",
"conditions",
")",
"{",
"if",
"(",
"conditions",
".",
"size",
"(",
")",
"!=",
"_conditions",
".",
"size",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"List",
"<",
"... | The order of the conditions is irrelevant, just check the set is the same. | [
"The",
"order",
"of",
"the",
"conditions",
"is",
"irrelevant",
"just",
"check",
"the",
"set",
"is",
"the",
"same",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-api/src/main/java/com/bazaarvoice/emodb/sor/condition/impl/AndConditionImpl.java#L74-L85 |
108,582 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/HadoopDataStoreManager.java | HadoopDataStoreManager.getDataStore | public CloseableDataStore getDataStore(URI location, String apiKey, MetricRegistry metricRegistry)
throws IOException {
String id = LocationUtil.getDataStoreIdentifier(location, apiKey);
CloseableDataStore dataStore = null;
while (dataStore == null) {
// Get the cached Da... | java | public CloseableDataStore getDataStore(URI location, String apiKey, MetricRegistry metricRegistry)
throws IOException {
String id = LocationUtil.getDataStoreIdentifier(location, apiKey);
CloseableDataStore dataStore = null;
while (dataStore == null) {
// Get the cached Da... | [
"public",
"CloseableDataStore",
"getDataStore",
"(",
"URI",
"location",
",",
"String",
"apiKey",
",",
"MetricRegistry",
"metricRegistry",
")",
"throws",
"IOException",
"{",
"String",
"id",
"=",
"LocationUtil",
".",
"getDataStoreIdentifier",
"(",
"location",
",",
"ap... | Returns a DataStore for a given location. If a cached instance already exists its reference count is incremented
and returned, otherwise a new instance is created and cached. | [
"Returns",
"a",
"DataStore",
"for",
"a",
"given",
"location",
".",
"If",
"a",
"cached",
"instance",
"already",
"exists",
"its",
"reference",
"count",
"is",
"incremented",
"and",
"returned",
"otherwise",
"a",
"new",
"instance",
"is",
"created",
"and",
"cached",... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/HadoopDataStoreManager.java#L61-L96 |
108,583 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/HadoopDataStoreManager.java | HadoopDataStoreManager.createDataStoreServiceFactory | private MultiThreadedServiceFactory<AuthDataStore> createDataStoreServiceFactory(String cluster, MetricRegistry metricRegistry) {
HttpClientConfiguration clientConfig = new HttpClientConfiguration();
clientConfig.setKeepAlive(Duration.seconds(1));
clientConfig.setConnectionTimeout(Duration.secon... | java | private MultiThreadedServiceFactory<AuthDataStore> createDataStoreServiceFactory(String cluster, MetricRegistry metricRegistry) {
HttpClientConfiguration clientConfig = new HttpClientConfiguration();
clientConfig.setKeepAlive(Duration.seconds(1));
clientConfig.setConnectionTimeout(Duration.secon... | [
"private",
"MultiThreadedServiceFactory",
"<",
"AuthDataStore",
">",
"createDataStoreServiceFactory",
"(",
"String",
"cluster",
",",
"MetricRegistry",
"metricRegistry",
")",
"{",
"HttpClientConfiguration",
"clientConfig",
"=",
"new",
"HttpClientConfiguration",
"(",
")",
";"... | Creates a ServiceFactory for a cluster with reasonable configurations. | [
"Creates",
"a",
"ServiceFactory",
"for",
"a",
"cluster",
"with",
"reasonable",
"configurations",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/HadoopDataStoreManager.java#L164-L171 |
108,584 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlBlockedDataReaderDAO.java | CqlBlockedDataReaderDAO.columnScan | private ResultSet columnScan(DeltaPlacement placement, TableDDL tableDDL, ByteBuffer rowKey, Range<RangeTimeUUID> columnRange,
boolean ascending, ConsistencyLevel consistency) {
Select.Where where = (tableDDL == placement.getBlockedDeltaTableDDL() ? selectDeltaFrom(placement.ge... | java | private ResultSet columnScan(DeltaPlacement placement, TableDDL tableDDL, ByteBuffer rowKey, Range<RangeTimeUUID> columnRange,
boolean ascending, ConsistencyLevel consistency) {
Select.Where where = (tableDDL == placement.getBlockedDeltaTableDDL() ? selectDeltaFrom(placement.ge... | [
"private",
"ResultSet",
"columnScan",
"(",
"DeltaPlacement",
"placement",
",",
"TableDDL",
"tableDDL",
",",
"ByteBuffer",
"rowKey",
",",
"Range",
"<",
"RangeTimeUUID",
">",
"columnRange",
",",
"boolean",
"ascending",
",",
"ConsistencyLevel",
"consistency",
")",
"{",... | Reads columns from the delta or delta history table. The range of columns, order, and limit can be
parameterized. | [
"Reads",
"columns",
"from",
"the",
"delta",
"or",
"delta",
"history",
"table",
".",
"The",
"range",
"of",
"columns",
"order",
"and",
"limit",
"can",
"be",
"parameterized",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlBlockedDataReaderDAO.java#L740-L767 |
108,585 | bazaarvoice/emodb | mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/udf/AbstractEmoFieldUDF.java | AbstractEmoFieldUDF.moveParserToField | private boolean moveParserToField(JsonParser parser, String path)
throws IOException {
List<String> segments = getFieldPath(path);
for (String segment : segments) {
if (parser.getCurrentToken() != JsonToken.START_OBJECT) {
// Always expect the path to be fields i... | java | private boolean moveParserToField(JsonParser parser, String path)
throws IOException {
List<String> segments = getFieldPath(path);
for (String segment : segments) {
if (parser.getCurrentToken() != JsonToken.START_OBJECT) {
// Always expect the path to be fields i... | [
"private",
"boolean",
"moveParserToField",
"(",
"JsonParser",
"parser",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"segments",
"=",
"getFieldPath",
"(",
"path",
")",
";",
"for",
"(",
"String",
"segment",
":",
"segme... | Don't materialize the entire parser content, do a targeted search for the value that matches the path. | [
"Don",
"t",
"materialize",
"the",
"entire",
"parser",
"content",
"do",
"a",
"targeted",
"search",
"for",
"the",
"value",
"that",
"matches",
"the",
"path",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hive/src/main/java/com/bazaarvoice/emodb/hive/udf/AbstractEmoFieldUDF.java#L71-L108 |
108,586 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/RowKeyUtils.java | RowKeyUtils.getRowKeyRaw | static ByteBuffer getRowKeyRaw(int shardId, long tableUuid, byte[] contentKeyBytes) {
checkArgument(shardId >= 0 && shardId < 256);
// Assemble a single array which is "1 byte shard id + 8 byte table uuid + n-byte content key".
ByteBuffer rowKey = ByteBuffer.allocate(9 + contentKeyBytes.length)... | java | static ByteBuffer getRowKeyRaw(int shardId, long tableUuid, byte[] contentKeyBytes) {
checkArgument(shardId >= 0 && shardId < 256);
// Assemble a single array which is "1 byte shard id + 8 byte table uuid + n-byte content key".
ByteBuffer rowKey = ByteBuffer.allocate(9 + contentKeyBytes.length)... | [
"static",
"ByteBuffer",
"getRowKeyRaw",
"(",
"int",
"shardId",
",",
"long",
"tableUuid",
",",
"byte",
"[",
"]",
"contentKeyBytes",
")",
"{",
"checkArgument",
"(",
"shardId",
">=",
"0",
"&&",
"shardId",
"<",
"256",
")",
";",
"// Assemble a single array which is \... | Constructs a row key when the row's shard ID is already known, which is rare. Generally this is used for
range queries to construct the lower or upper bound for a query, so it doesn't necessarily need to produce
a valid row key. | [
"Constructs",
"a",
"row",
"key",
"when",
"the",
"row",
"s",
"shard",
"ID",
"is",
"already",
"known",
"which",
"is",
"rare",
".",
"Generally",
"this",
"is",
"used",
"for",
"range",
"queries",
"to",
"construct",
"the",
"lower",
"or",
"upper",
"bound",
"for... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/RowKeyUtils.java#L82-L93 |
108,587 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/migrator/DistributedMigratorRangeMonitor.java | DistributedMigratorRangeMonitor.claimMigrationRangeTasks | private List<ClaimedTask> claimMigrationRangeTasks(int max) {
try {
Date claimTime = new Date();
List<ScanRangeTask> migrationRangeTasks = _workflow.claimScanRangeTasks(max, QUEUE_CLAIM_TTL);
if (migrationRangeTasks.isEmpty()) {
return ImmutableList.of();
... | java | private List<ClaimedTask> claimMigrationRangeTasks(int max) {
try {
Date claimTime = new Date();
List<ScanRangeTask> migrationRangeTasks = _workflow.claimScanRangeTasks(max, QUEUE_CLAIM_TTL);
if (migrationRangeTasks.isEmpty()) {
return ImmutableList.of();
... | [
"private",
"List",
"<",
"ClaimedTask",
">",
"claimMigrationRangeTasks",
"(",
"int",
"max",
")",
"{",
"try",
"{",
"Date",
"claimTime",
"=",
"new",
"Date",
"(",
")",
";",
"List",
"<",
"ScanRangeTask",
">",
"migrationRangeTasks",
"=",
"_workflow",
".",
"claimSc... | Claims migration range tasks that have been queued by the leader and are ready to scan. | [
"Claims",
"migration",
"range",
"tasks",
"that",
"have",
"been",
"queued",
"by",
"the",
"leader",
"and",
"are",
"ready",
"to",
"scan",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/migrator/DistributedMigratorRangeMonitor.java#L141-L182 |
108,588 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/Storage.java | Storage.initializeGroup | static Storage initializeGroup(Collection<Storage> group) {
List<Storage> sorted = Ordering.natural().immutableSortedCopy(group);
Storage primary = sorted.get(0); // After sorting, the first storage in each group is the primary.
if (!primary.isConsistent()) {
// Dropping the primary... | java | static Storage initializeGroup(Collection<Storage> group) {
List<Storage> sorted = Ordering.natural().immutableSortedCopy(group);
Storage primary = sorted.get(0); // After sorting, the first storage in each group is the primary.
if (!primary.isConsistent()) {
// Dropping the primary... | [
"static",
"Storage",
"initializeGroup",
"(",
"Collection",
"<",
"Storage",
">",
"group",
")",
"{",
"List",
"<",
"Storage",
">",
"sorted",
"=",
"Ordering",
".",
"natural",
"(",
")",
".",
"immutableSortedCopy",
"(",
"group",
")",
";",
"Storage",
"primary",
"... | Post-construction initialization links all non-dropped members of group together. Returns the primary member
of the group, other members are mirrors. | [
"Post",
"-",
"construction",
"initialization",
"links",
"all",
"non",
"-",
"dropped",
"members",
"of",
"group",
"together",
".",
"Returns",
"the",
"primary",
"member",
"of",
"the",
"group",
"other",
"members",
"are",
"mirrors",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/Storage.java#L108-L120 |
108,589 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/Storage.java | Storage.getMoveTo | Storage getMoveTo() {
String destUuid = get(MOVE_TO);
return destUuid != null ? find(getMirrors(), destUuid) : null;
} | java | Storage getMoveTo() {
String destUuid = get(MOVE_TO);
return destUuid != null ? find(getMirrors(), destUuid) : null;
} | [
"Storage",
"getMoveTo",
"(",
")",
"{",
"String",
"destUuid",
"=",
"get",
"(",
"MOVE_TO",
")",
";",
"return",
"destUuid",
"!=",
"null",
"?",
"find",
"(",
"getMirrors",
"(",
")",
",",
"destUuid",
")",
":",
"null",
";",
"}"
] | Move-related properties | [
"Move",
"-",
"related",
"properties"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/Storage.java#L206-L209 |
108,590 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/Storage.java | Storage.compareTo | @Override
public int compareTo(Storage o) {
return ComparisonChain.start()
.compareTrueFirst(isConsistent(), o.isConsistent()) // Primaries *must* be consistent.
.compareTrueFirst(_masterPrimary, o._masterPrimary) // Master primary sorts first
.compare(o.get... | java | @Override
public int compareTo(Storage o) {
return ComparisonChain.start()
.compareTrueFirst(isConsistent(), o.isConsistent()) // Primaries *must* be consistent.
.compareTrueFirst(_masterPrimary, o._masterPrimary) // Master primary sorts first
.compare(o.get... | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"Storage",
"o",
")",
"{",
"return",
"ComparisonChain",
".",
"start",
"(",
")",
".",
"compareTrueFirst",
"(",
"isConsistent",
"(",
")",
",",
"o",
".",
"isConsistent",
"(",
")",
")",
"// Primaries *must* be c... | Storage objects sort such that primaries sort first, mirrors after. | [
"Storage",
"objects",
"sort",
"such",
"that",
"primaries",
"sort",
"first",
"mirrors",
"after",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/Storage.java#L241-L249 |
108,591 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/DistributedScanRangeMonitor.java | DistributedScanRangeMonitor.renewClaimedTasks | private void renewClaimedTasks() {
try {
List<ClaimedTask> claimedTasks = ImmutableList.copyOf(_claimedTasks.values());
List<ScanRangeTask> tasks = Lists.newArrayList();
for (ClaimedTask claimedTask : claimedTasks) {
if (claimedTask.isComplete()) {
... | java | private void renewClaimedTasks() {
try {
List<ClaimedTask> claimedTasks = ImmutableList.copyOf(_claimedTasks.values());
List<ScanRangeTask> tasks = Lists.newArrayList();
for (ClaimedTask claimedTask : claimedTasks) {
if (claimedTask.isComplete()) {
... | [
"private",
"void",
"renewClaimedTasks",
"(",
")",
"{",
"try",
"{",
"List",
"<",
"ClaimedTask",
">",
"claimedTasks",
"=",
"ImmutableList",
".",
"copyOf",
"(",
"_claimedTasks",
".",
"values",
"(",
")",
")",
";",
"List",
"<",
"ScanRangeTask",
">",
"tasks",
"=... | Renews all claimed scan range tasks that have not been released. Unless this is called periodically the
scan workflow will make this task available to be claimed again. | [
"Renews",
"all",
"claimed",
"scan",
"range",
"tasks",
"that",
"have",
"not",
"been",
"released",
".",
"Unless",
"this",
"is",
"called",
"periodically",
"the",
"scan",
"workflow",
"will",
"make",
"this",
"task",
"available",
"to",
"be",
"claimed",
"again",
".... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/DistributedScanRangeMonitor.java#L225-L251 |
108,592 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/DistributedScanRangeMonitor.java | DistributedScanRangeMonitor.unclaimTask | private void unclaimTask(ClaimedTask claimedTask, boolean releaseTask) {
_claimedTasks.remove(claimedTask.getTaskId());
claimedTask.setComplete(true);
if (releaseTask) {
try {
_scanWorkflow.releaseScanRangeTask(claimedTask.getTask());
_log.info("Relea... | java | private void unclaimTask(ClaimedTask claimedTask, boolean releaseTask) {
_claimedTasks.remove(claimedTask.getTaskId());
claimedTask.setComplete(true);
if (releaseTask) {
try {
_scanWorkflow.releaseScanRangeTask(claimedTask.getTask());
_log.info("Relea... | [
"private",
"void",
"unclaimTask",
"(",
"ClaimedTask",
"claimedTask",
",",
"boolean",
"releaseTask",
")",
"{",
"_claimedTasks",
".",
"remove",
"(",
"claimedTask",
".",
"getTaskId",
"(",
")",
")",
";",
"claimedTask",
".",
"setComplete",
"(",
"true",
")",
";",
... | Unclaims a previously claimed task. Effectively this stops the renewing the task and, if releaseTask is true,
removes the task permanently from the workflow queue. | [
"Unclaims",
"a",
"previously",
"claimed",
"task",
".",
"Effectively",
"this",
"stops",
"the",
"renewing",
"the",
"task",
"and",
"if",
"releaseTask",
"is",
"true",
"removes",
"the",
"task",
"permanently",
"from",
"the",
"workflow",
"queue",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/DistributedScanRangeMonitor.java#L257-L269 |
108,593 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/DistributedScanRangeMonitor.java | DistributedScanRangeMonitor.asyncRangeScan | private boolean asyncRangeScan(ScanRangeTask task) {
final String scanId = task.getScanId();
final int taskId = task.getId();
final String placement = task.getPlacement();
final ScanRange range = task.getRange();
RangeScanUploaderResult result;
try {
// Verif... | java | private boolean asyncRangeScan(ScanRangeTask task) {
final String scanId = task.getScanId();
final int taskId = task.getId();
final String placement = task.getPlacement();
final ScanRange range = task.getRange();
RangeScanUploaderResult result;
try {
// Verif... | [
"private",
"boolean",
"asyncRangeScan",
"(",
"ScanRangeTask",
"task",
")",
"{",
"final",
"String",
"scanId",
"=",
"task",
".",
"getScanId",
"(",
")",
";",
"final",
"int",
"taskId",
"=",
"task",
".",
"getId",
"(",
")",
";",
"final",
"String",
"placement",
... | Performs a range scan and updates the global scan status with the scan result.
@return true if the system state is consistent and the task can be released, false otherwise | [
"Performs",
"a",
"range",
"scan",
"and",
"updates",
"the",
"global",
"scan",
"status",
"with",
"the",
"scan",
"result",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/DistributedScanRangeMonitor.java#L300-L367 |
108,594 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/identity/AuthIdentityModification.java | AuthIdentityModification.getUpdatedRolesFrom | protected Set<String> getUpdatedRolesFrom(Set<String> roles) {
Set<String> updatedRoles = Sets.newHashSet(roles);
updatedRoles.addAll(_rolesAdded);
updatedRoles.removeAll(_rolesRemoved);
return updatedRoles;
} | java | protected Set<String> getUpdatedRolesFrom(Set<String> roles) {
Set<String> updatedRoles = Sets.newHashSet(roles);
updatedRoles.addAll(_rolesAdded);
updatedRoles.removeAll(_rolesRemoved);
return updatedRoles;
} | [
"protected",
"Set",
"<",
"String",
">",
"getUpdatedRolesFrom",
"(",
"Set",
"<",
"String",
">",
"roles",
")",
"{",
"Set",
"<",
"String",
">",
"updatedRoles",
"=",
"Sets",
".",
"newHashSet",
"(",
"roles",
")",
";",
"updatedRoles",
".",
"addAll",
"(",
"_rol... | Helper method for subclasses which, given a set of roles, returns a new set of roles with all added and removed
roles from this modification applied. | [
"Helper",
"method",
"for",
"subclasses",
"which",
"given",
"a",
"set",
"of",
"roles",
"returns",
"a",
"new",
"set",
"of",
"roles",
"with",
"all",
"added",
"and",
"removed",
"roles",
"from",
"this",
"modification",
"applied",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/identity/AuthIdentityModification.java#L81-L86 |
108,595 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/nio/BufferUtils.java | BufferUtils.getString | public static String getString(ByteBuffer buf, Charset encoding) {
return getString(buf, 0, buf.remaining(), encoding);
} | java | public static String getString(ByteBuffer buf, Charset encoding) {
return getString(buf, 0, buf.remaining(), encoding);
} | [
"public",
"static",
"String",
"getString",
"(",
"ByteBuffer",
"buf",
",",
"Charset",
"encoding",
")",
"{",
"return",
"getString",
"(",
"buf",
",",
"0",
",",
"buf",
".",
"remaining",
"(",
")",
",",
"encoding",
")",
";",
"}"
] | Converts all remaining bytes in the buffer a String using the specified encoding.
Does not move the buffer position. | [
"Converts",
"all",
"remaining",
"bytes",
"in",
"the",
"buffer",
"a",
"String",
"using",
"the",
"specified",
"encoding",
".",
"Does",
"not",
"move",
"the",
"buffer",
"position",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/nio/BufferUtils.java#L14-L16 |
108,596 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/nio/BufferUtils.java | BufferUtils.getString | public static String getString(ByteBuffer buf, int offset, int length, Charset encoding) {
buf = buf.duplicate();
buf.position(buf.position() + offset);
if (buf.hasArray()) {
return new String(buf.array(), buf.arrayOffset() + buf.position(), length, encoding);
} else {
... | java | public static String getString(ByteBuffer buf, int offset, int length, Charset encoding) {
buf = buf.duplicate();
buf.position(buf.position() + offset);
if (buf.hasArray()) {
return new String(buf.array(), buf.arrayOffset() + buf.position(), length, encoding);
} else {
... | [
"public",
"static",
"String",
"getString",
"(",
"ByteBuffer",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
",",
"Charset",
"encoding",
")",
"{",
"buf",
"=",
"buf",
".",
"duplicate",
"(",
")",
";",
"buf",
".",
"position",
"(",
"buf",
".",
"positio... | Converts the specified number of bytes in the buffer and converts them to a String using
the specified encoding. Does not move the buffer position. | [
"Converts",
"the",
"specified",
"number",
"of",
"bytes",
"in",
"the",
"buffer",
"and",
"converts",
"them",
"to",
"a",
"String",
"using",
"the",
"specified",
"encoding",
".",
"Does",
"not",
"move",
"the",
"buffer",
"position",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/nio/BufferUtils.java#L22-L32 |
108,597 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/throttling/AdHocThrottleManager.java | AdHocThrottleManager.addThrottle | public void addThrottle(AdHocThrottleEndpoint endpoint, AdHocThrottle throttle) {
checkNotNull(throttle, "throttle");
String key = endpoint.toString();
try {
// If the throttle is unlimited make sure it is not set, since the absence of a value indicates unlimited
if (thr... | java | public void addThrottle(AdHocThrottleEndpoint endpoint, AdHocThrottle throttle) {
checkNotNull(throttle, "throttle");
String key = endpoint.toString();
try {
// If the throttle is unlimited make sure it is not set, since the absence of a value indicates unlimited
if (thr... | [
"public",
"void",
"addThrottle",
"(",
"AdHocThrottleEndpoint",
"endpoint",
",",
"AdHocThrottle",
"throttle",
")",
"{",
"checkNotNull",
"(",
"throttle",
",",
"\"throttle\"",
")",
";",
"String",
"key",
"=",
"endpoint",
".",
"toString",
"(",
")",
";",
"try",
"{",... | Adds a throttle for an HTTP method and path. | [
"Adds",
"a",
"throttle",
"for",
"an",
"HTTP",
"method",
"and",
"path",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/throttling/AdHocThrottleManager.java#L34-L47 |
108,598 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/throttling/AdHocThrottleManager.java | AdHocThrottleManager.removeThrottle | public void removeThrottle(AdHocThrottleEndpoint endpoint) {
try {
_throttleMap.remove(endpoint.toString());
} catch (Exception e) {
_log.warn("Failed to remove throttle for {} {}", endpoint.getMethod(), endpoint.getPath(), e);
}
} | java | public void removeThrottle(AdHocThrottleEndpoint endpoint) {
try {
_throttleMap.remove(endpoint.toString());
} catch (Exception e) {
_log.warn("Failed to remove throttle for {} {}", endpoint.getMethod(), endpoint.getPath(), e);
}
} | [
"public",
"void",
"removeThrottle",
"(",
"AdHocThrottleEndpoint",
"endpoint",
")",
"{",
"try",
"{",
"_throttleMap",
".",
"remove",
"(",
"endpoint",
".",
"toString",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"_log",
".",
"warn",
"... | Removes the throttle for an HTTP method and path. This effectively allows umlimited concurrency. | [
"Removes",
"the",
"throttle",
"for",
"an",
"HTTP",
"method",
"and",
"path",
".",
"This",
"effectively",
"allows",
"umlimited",
"concurrency",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/throttling/AdHocThrottleManager.java#L52-L58 |
108,599 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/throttling/AdHocThrottleManager.java | AdHocThrottleManager.getThrottle | public AdHocThrottle getThrottle(AdHocThrottleEndpoint endpoint) {
String key = endpoint.toString();
AdHocThrottle throttle = _throttleMap.get(key);
if (throttle == null) {
// No throttle set, allow unlimited
throttle = AdHocThrottle.unlimitedInstance();
} else if... | java | public AdHocThrottle getThrottle(AdHocThrottleEndpoint endpoint) {
String key = endpoint.toString();
AdHocThrottle throttle = _throttleMap.get(key);
if (throttle == null) {
// No throttle set, allow unlimited
throttle = AdHocThrottle.unlimitedInstance();
} else if... | [
"public",
"AdHocThrottle",
"getThrottle",
"(",
"AdHocThrottleEndpoint",
"endpoint",
")",
"{",
"String",
"key",
"=",
"endpoint",
".",
"toString",
"(",
")",
";",
"AdHocThrottle",
"throttle",
"=",
"_throttleMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"th... | Returns the throttle in effect for the given HTTP method and path. This method is always guaranteed to return
a non-null throttle that is not expired. If no throttle has been configured or if the configured throttle has
expired then it will return an unlimited throttle with an effectively infinite expiration date. | [
"Returns",
"the",
"throttle",
"in",
"effect",
"for",
"the",
"given",
"HTTP",
"method",
"and",
"path",
".",
"This",
"method",
"is",
"always",
"guaranteed",
"to",
"return",
"a",
"non",
"-",
"null",
"throttle",
"that",
"is",
"not",
"expired",
".",
"If",
"no... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/throttling/AdHocThrottleManager.java#L65-L85 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.