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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
161,000 | voldemort/voldemort | src/java/voldemort/utils/JmxUtils.java | JmxUtils.createObjectName | public static ObjectName createObjectName(String domain, String type) {
try {
return new ObjectName(domain + ":type=" + type);
} catch(MalformedObjectNameException e) {
throw new VoldemortException(e);
}
} | java | public static ObjectName createObjectName(String domain, String type) {
try {
return new ObjectName(domain + ":type=" + type);
} catch(MalformedObjectNameException e) {
throw new VoldemortException(e);
}
} | [
"public",
"static",
"ObjectName",
"createObjectName",
"(",
"String",
"domain",
",",
"String",
"type",
")",
"{",
"try",
"{",
"return",
"new",
"ObjectName",
"(",
"domain",
"+",
"\":type=\"",
"+",
"type",
")",
";",
"}",
"catch",
"(",
"MalformedObjectNameException... | Create a JMX ObjectName
@param domain The domain of the object
@param type The type of the object
@return An ObjectName representing the name | [
"Create",
"a",
"JMX",
"ObjectName"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L238-L244 |
161,001 | voldemort/voldemort | src/java/voldemort/utils/JmxUtils.java | JmxUtils.getClassName | public static String getClassName(Class<?> c) {
String name = c.getName();
return name.substring(name.lastIndexOf('.') + 1, name.length());
} | java | public static String getClassName(Class<?> c) {
String name = c.getName();
return name.substring(name.lastIndexOf('.') + 1, name.length());
} | [
"public",
"static",
"String",
"getClassName",
"(",
"Class",
"<",
"?",
">",
"c",
")",
"{",
"String",
"name",
"=",
"c",
".",
"getName",
"(",
")",
";",
"return",
"name",
".",
"substring",
"(",
"name",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
"+",
"1",
... | Get the class name without the package
@param c The class name with package
@return the class name without the package | [
"Get",
"the",
"class",
"name",
"without",
"the",
"package"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L273-L276 |
161,002 | voldemort/voldemort | src/java/voldemort/utils/JmxUtils.java | JmxUtils.registerMbean | public static void registerMbean(Object mbean, ObjectName name) {
registerMbean(ManagementFactory.getPlatformMBeanServer(),
JmxUtils.createModelMBean(mbean),
name);
} | java | public static void registerMbean(Object mbean, ObjectName name) {
registerMbean(ManagementFactory.getPlatformMBeanServer(),
JmxUtils.createModelMBean(mbean),
name);
} | [
"public",
"static",
"void",
"registerMbean",
"(",
"Object",
"mbean",
",",
"ObjectName",
"name",
")",
"{",
"registerMbean",
"(",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
",",
"JmxUtils",
".",
"createModelMBean",
"(",
"mbean",
")",
",",
"name"... | Register the given mbean with the platform mbean server
@param mbean The mbean to register
@param name The name to register under | [
"Register",
"the",
"given",
"mbean",
"with",
"the",
"platform",
"mbean",
"server"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L284-L288 |
161,003 | voldemort/voldemort | src/java/voldemort/utils/JmxUtils.java | JmxUtils.registerMbean | public static ObjectName registerMbean(String typeName, Object obj) {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
ObjectName name = JmxUtils.createObjectName(JmxUtils.getPackageName(obj.getClass()),
typeName);
registerMbean... | java | public static ObjectName registerMbean(String typeName, Object obj) {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
ObjectName name = JmxUtils.createObjectName(JmxUtils.getPackageName(obj.getClass()),
typeName);
registerMbean... | [
"public",
"static",
"ObjectName",
"registerMbean",
"(",
"String",
"typeName",
",",
"Object",
"obj",
")",
"{",
"MBeanServer",
"server",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",
"ObjectName",
"name",
"=",
"JmxUtils",
".",
"createObject... | Register the given object under the package name of the object's class
with the given type name.
this method using the platform mbean server as returned by
ManagementFactory.getPlatformMBeanServer()
@param typeName The name of the type to register
@param obj The object to register as an mbean | [
"Register",
"the",
"given",
"object",
"under",
"the",
"package",
"name",
"of",
"the",
"object",
"s",
"class",
"with",
"the",
"given",
"type",
"name",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L300-L306 |
161,004 | voldemort/voldemort | src/java/voldemort/utils/JmxUtils.java | JmxUtils.registerMbean | public static void registerMbean(MBeanServer server, ModelMBean mbean, ObjectName name) {
try {
synchronized(LOCK) {
if(server.isRegistered(name))
JmxUtils.unregisterMbean(server, name);
server.registerMBean(mbean, name);
}
} ca... | java | public static void registerMbean(MBeanServer server, ModelMBean mbean, ObjectName name) {
try {
synchronized(LOCK) {
if(server.isRegistered(name))
JmxUtils.unregisterMbean(server, name);
server.registerMBean(mbean, name);
}
} ca... | [
"public",
"static",
"void",
"registerMbean",
"(",
"MBeanServer",
"server",
",",
"ModelMBean",
"mbean",
",",
"ObjectName",
"name",
")",
"{",
"try",
"{",
"synchronized",
"(",
"LOCK",
")",
"{",
"if",
"(",
"server",
".",
"isRegistered",
"(",
"name",
")",
")",
... | Register the given mbean with the server
@param server The server to register with
@param mbean The mbean to register
@param name The name to register under | [
"Register",
"the",
"given",
"mbean",
"with",
"the",
"server"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L315-L325 |
161,005 | voldemort/voldemort | src/java/voldemort/utils/JmxUtils.java | JmxUtils.unregisterMbean | public static void unregisterMbean(MBeanServer server, ObjectName name) {
try {
server.unregisterMBean(name);
} catch(Exception e) {
logger.error("Error unregistering mbean", e);
}
} | java | public static void unregisterMbean(MBeanServer server, ObjectName name) {
try {
server.unregisterMBean(name);
} catch(Exception e) {
logger.error("Error unregistering mbean", e);
}
} | [
"public",
"static",
"void",
"unregisterMbean",
"(",
"MBeanServer",
"server",
",",
"ObjectName",
"name",
")",
"{",
"try",
"{",
"server",
".",
"unregisterMBean",
"(",
"name",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"logger",
".",
"error",
... | Unregister the mbean with the given name
@param server The server to unregister from
@param name The name of the mbean to unregister | [
"Unregister",
"the",
"mbean",
"with",
"the",
"given",
"name"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L333-L339 |
161,006 | voldemort/voldemort | src/java/voldemort/utils/JmxUtils.java | JmxUtils.unregisterMbean | public static void unregisterMbean(ObjectName name) {
try {
ManagementFactory.getPlatformMBeanServer().unregisterMBean(name);
} catch(Exception e) {
logger.error("Error unregistering mbean", e);
}
} | java | public static void unregisterMbean(ObjectName name) {
try {
ManagementFactory.getPlatformMBeanServer().unregisterMBean(name);
} catch(Exception e) {
logger.error("Error unregistering mbean", e);
}
} | [
"public",
"static",
"void",
"unregisterMbean",
"(",
"ObjectName",
"name",
")",
"{",
"try",
"{",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
".",
"unregisterMBean",
"(",
"name",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"logge... | Unregister the mbean with the given name from the platform mbean server
@param name The name of the mbean to unregister | [
"Unregister",
"the",
"mbean",
"with",
"the",
"given",
"name",
"from",
"the",
"platform",
"mbean",
"server"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/JmxUtils.java#L346-L352 |
161,007 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyUtils.java | ReadOnlyUtils.isFormatCorrect | public static boolean isFormatCorrect(String fileName, ReadOnlyStorageFormat format) {
switch(format) {
case READONLY_V0:
case READONLY_V1:
if(fileName.matches("^[\\d]+_[\\d]+\\.(data|index)")) {
return true;
} else {
... | java | public static boolean isFormatCorrect(String fileName, ReadOnlyStorageFormat format) {
switch(format) {
case READONLY_V0:
case READONLY_V1:
if(fileName.matches("^[\\d]+_[\\d]+\\.(data|index)")) {
return true;
} else {
... | [
"public",
"static",
"boolean",
"isFormatCorrect",
"(",
"String",
"fileName",
",",
"ReadOnlyStorageFormat",
"format",
")",
"{",
"switch",
"(",
"format",
")",
"{",
"case",
"READONLY_V0",
":",
"case",
"READONLY_V1",
":",
"if",
"(",
"fileName",
".",
"matches",
"("... | Given a file name and read-only storage format, tells whether the file
name format is correct
@param fileName The name of the file
@param format The RO format
@return true if file format is correct, else false | [
"Given",
"a",
"file",
"name",
"and",
"read",
"-",
"only",
"storage",
"format",
"tells",
"whether",
"the",
"file",
"name",
"format",
"is",
"correct"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyUtils.java#L53-L73 |
161,008 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyUtils.java | ReadOnlyUtils.getChunkId | public static int getChunkId(String fileName) {
Pattern pattern = Pattern.compile("_[\\d]+\\.");
Matcher matcher = pattern.matcher(fileName);
if(matcher.find()) {
return new Integer(fileName.substring(matcher.start() + 1, matcher.end() - 1));
} else {
throw new V... | java | public static int getChunkId(String fileName) {
Pattern pattern = Pattern.compile("_[\\d]+\\.");
Matcher matcher = pattern.matcher(fileName);
if(matcher.find()) {
return new Integer(fileName.substring(matcher.start() + 1, matcher.end() - 1));
} else {
throw new V... | [
"public",
"static",
"int",
"getChunkId",
"(",
"String",
"fileName",
")",
"{",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"\"_[\\\\d]+\\\\.\"",
")",
";",
"Matcher",
"matcher",
"=",
"pattern",
".",
"matcher",
"(",
"fileName",
")",
";",
"if",
... | Returns the chunk id for the file name
@param fileName The file name
@return Chunk id | [
"Returns",
"the",
"chunk",
"id",
"for",
"the",
"file",
"name"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyUtils.java#L103-L112 |
161,009 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyUtils.java | ReadOnlyUtils.getCurrentVersion | public static File getCurrentVersion(File storeDirectory) {
File latestDir = getLatestDir(storeDirectory);
if(latestDir != null)
return latestDir;
File[] versionDirs = getVersionDirs(storeDirectory);
if(versionDirs == null || versionDirs.length == 0) {
return nul... | java | public static File getCurrentVersion(File storeDirectory) {
File latestDir = getLatestDir(storeDirectory);
if(latestDir != null)
return latestDir;
File[] versionDirs = getVersionDirs(storeDirectory);
if(versionDirs == null || versionDirs.length == 0) {
return nul... | [
"public",
"static",
"File",
"getCurrentVersion",
"(",
"File",
"storeDirectory",
")",
"{",
"File",
"latestDir",
"=",
"getLatestDir",
"(",
"storeDirectory",
")",
";",
"if",
"(",
"latestDir",
"!=",
"null",
")",
"return",
"latestDir",
";",
"File",
"[",
"]",
"ver... | Retrieve the dir pointed to by 'latest' symbolic-link or the current
version dir
@return Current version directory, else null | [
"Retrieve",
"the",
"dir",
"pointed",
"to",
"by",
"latest",
"symbolic",
"-",
"link",
"or",
"the",
"current",
"version",
"dir"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyUtils.java#L120-L131 |
161,010 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyUtils.java | ReadOnlyUtils.checkVersionDirName | public static boolean checkVersionDirName(File versionDir) {
return (versionDir.isDirectory() && versionDir.getName().contains("version-") && !versionDir.getName()
.endsWith(".bak"));
} | java | public static boolean checkVersionDirName(File versionDir) {
return (versionDir.isDirectory() && versionDir.getName().contains("version-") && !versionDir.getName()
.endsWith(".bak"));
} | [
"public",
"static",
"boolean",
"checkVersionDirName",
"(",
"File",
"versionDir",
")",
"{",
"return",
"(",
"versionDir",
".",
"isDirectory",
"(",
")",
"&&",
"versionDir",
".",
"getName",
"(",
")",
".",
"contains",
"(",
"\"version-\"",
")",
"&&",
"!",
"version... | Checks if the name of the file follows the version-n format
@param versionDir The directory
@return Returns true if the name is correct, else false | [
"Checks",
"if",
"the",
"name",
"of",
"the",
"file",
"follows",
"the",
"version",
"-",
"n",
"format"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyUtils.java#L162-L165 |
161,011 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyUtils.java | ReadOnlyUtils.getVersionId | private static long getVersionId(String versionDir) {
try {
return Long.parseLong(versionDir.replace("version-", ""));
} catch(NumberFormatException e) {
logger.trace("Cannot parse version directory to obtain id " + versionDir);
return -1;
}
} | java | private static long getVersionId(String versionDir) {
try {
return Long.parseLong(versionDir.replace("version-", ""));
} catch(NumberFormatException e) {
logger.trace("Cannot parse version directory to obtain id " + versionDir);
return -1;
}
} | [
"private",
"static",
"long",
"getVersionId",
"(",
"String",
"versionDir",
")",
"{",
"try",
"{",
"return",
"Long",
".",
"parseLong",
"(",
"versionDir",
".",
"replace",
"(",
"\"version-\"",
",",
"\"\"",
")",
")",
";",
"}",
"catch",
"(",
"NumberFormatException"... | Extracts the version id from a string
@param versionDir The string
@return Returns the version id of the directory, else -1 | [
"Extracts",
"the",
"version",
"id",
"from",
"a",
"string"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyUtils.java#L183-L190 |
161,012 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyUtils.java | ReadOnlyUtils.getVersionDirs | public static File[] getVersionDirs(File rootDir, final long minId, final long maxId) {
return rootDir.listFiles(new FileFilter() {
public boolean accept(File pathName) {
if(checkVersionDirName(pathName)) {
long versionId = getVersionId(pathName);
... | java | public static File[] getVersionDirs(File rootDir, final long minId, final long maxId) {
return rootDir.listFiles(new FileFilter() {
public boolean accept(File pathName) {
if(checkVersionDirName(pathName)) {
long versionId = getVersionId(pathName);
... | [
"public",
"static",
"File",
"[",
"]",
"getVersionDirs",
"(",
"File",
"rootDir",
",",
"final",
"long",
"minId",
",",
"final",
"long",
"maxId",
")",
"{",
"return",
"rootDir",
".",
"listFiles",
"(",
"new",
"FileFilter",
"(",
")",
"{",
"public",
"boolean",
"... | Returns all the version directories present in the root directory
specified
@param rootDir The parent directory
@param maxId The
@return An array of version directories | [
"Returns",
"all",
"the",
"version",
"directories",
"present",
"in",
"the",
"root",
"directory",
"specified"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyUtils.java#L211-L224 |
161,013 | voldemort/voldemort | src/java/voldemort/server/VoldemortServer.java | VoldemortServer.stopInner | @Override
protected void stopInner() throws VoldemortException {
List<VoldemortException> exceptions = new ArrayList<VoldemortException>();
logger.info("Stopping services:" + getIdentityNode().getId());
/* Stop in reverse order */
exceptions.addAll(stopOnlineServices());
for... | java | @Override
protected void stopInner() throws VoldemortException {
List<VoldemortException> exceptions = new ArrayList<VoldemortException>();
logger.info("Stopping services:" + getIdentityNode().getId());
/* Stop in reverse order */
exceptions.addAll(stopOnlineServices());
for... | [
"@",
"Override",
"protected",
"void",
"stopInner",
"(",
")",
"throws",
"VoldemortException",
"{",
"List",
"<",
"VoldemortException",
">",
"exceptions",
"=",
"new",
"ArrayList",
"<",
"VoldemortException",
">",
"(",
")",
";",
"logger",
".",
"info",
"(",
"\"Stopp... | Attempt to shutdown the server. As much shutdown as possible will be
completed, even if intermediate errors are encountered.
@throws VoldemortException | [
"Attempt",
"to",
"shutdown",
"the",
"server",
".",
"As",
"much",
"shutdown",
"as",
"possible",
"will",
"be",
"completed",
"even",
"if",
"intermediate",
"errors",
"are",
"encountered",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/VoldemortServer.java#L502-L523 |
161,014 | voldemort/voldemort | src/java/voldemort/store/readonly/chunk/ChunkedFileSet.java | ChunkedFileSet.getReplicaTypeForPartition | private int getReplicaTypeForPartition(int partitionId) {
List<Integer> routingPartitionList = routingStrategy.getReplicatingPartitionList(partitionId);
// Determine if we should host this partition, and if so, whether we are a primary,
// secondary or n-ary replica for it
int correctRe... | java | private int getReplicaTypeForPartition(int partitionId) {
List<Integer> routingPartitionList = routingStrategy.getReplicatingPartitionList(partitionId);
// Determine if we should host this partition, and if so, whether we are a primary,
// secondary or n-ary replica for it
int correctRe... | [
"private",
"int",
"getReplicaTypeForPartition",
"(",
"int",
"partitionId",
")",
"{",
"List",
"<",
"Integer",
">",
"routingPartitionList",
"=",
"routingStrategy",
".",
"getReplicatingPartitionList",
"(",
"partitionId",
")",
";",
"// Determine if we should host this partition... | Given a partition ID, determine which replica of this partition is hosted by the
current node, if any.
Note: This is an implementation detail of the READONLY_V2 naming scheme, and should
not be used outside of that scope.
@param partitionId for which we want to know the replica type
@return the requested partition's ... | [
"Given",
"a",
"partition",
"ID",
"determine",
"which",
"replica",
"of",
"this",
"partition",
"is",
"hosted",
"by",
"the",
"current",
"node",
"if",
"any",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/chunk/ChunkedFileSet.java#L261-L278 |
161,015 | voldemort/voldemort | src/java/voldemort/store/readonly/chunk/ChunkedFileSet.java | ChunkedFileSet.renameReadOnlyV2Files | private void renameReadOnlyV2Files(int masterPartitionId, int correctReplicaType) {
for (int replica = 0; replica < routingStrategy.getNumReplicas(); replica++) {
if (replica != correctReplicaType) {
int chunkId = 0;
while (true) {
String fileName ... | java | private void renameReadOnlyV2Files(int masterPartitionId, int correctReplicaType) {
for (int replica = 0; replica < routingStrategy.getNumReplicas(); replica++) {
if (replica != correctReplicaType) {
int chunkId = 0;
while (true) {
String fileName ... | [
"private",
"void",
"renameReadOnlyV2Files",
"(",
"int",
"masterPartitionId",
",",
"int",
"correctReplicaType",
")",
"{",
"for",
"(",
"int",
"replica",
"=",
"0",
";",
"replica",
"<",
"routingStrategy",
".",
"getNumReplicas",
"(",
")",
";",
"replica",
"++",
")",... | This function looks for files with the "wrong" replica type in their name, and
if it finds any, renames them.
Those files may have ended up on this server either because:
- 1. We restored them from another server, where they were named according to
another replica type. Or,
- 2. The {@link voldemort.store.readonly.mr.... | [
"This",
"function",
"looks",
"for",
"files",
"with",
"the",
"wrong",
"replica",
"type",
"in",
"their",
"name",
"and",
"if",
"it",
"finds",
"any",
"renames",
"them",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/chunk/ChunkedFileSet.java#L299-L340 |
161,016 | voldemort/voldemort | src/java/voldemort/store/readonly/chunk/ChunkedFileSet.java | ChunkedFileSet.keyToStorageFormat | public byte[] keyToStorageFormat(byte[] key) {
switch(getReadOnlyStorageFormat()) {
case READONLY_V0:
case READONLY_V1:
return ByteUtils.md5(key);
case READONLY_V2:
return ByteUtils.copy(ByteUtils.md5(key), 0, 2 * ByteUtils.SIZE_OF_INT);
... | java | public byte[] keyToStorageFormat(byte[] key) {
switch(getReadOnlyStorageFormat()) {
case READONLY_V0:
case READONLY_V1:
return ByteUtils.md5(key);
case READONLY_V2:
return ByteUtils.copy(ByteUtils.md5(key), 0, 2 * ByteUtils.SIZE_OF_INT);
... | [
"public",
"byte",
"[",
"]",
"keyToStorageFormat",
"(",
"byte",
"[",
"]",
"key",
")",
"{",
"switch",
"(",
"getReadOnlyStorageFormat",
"(",
")",
")",
"{",
"case",
"READONLY_V0",
":",
"case",
"READONLY_V1",
":",
"return",
"ByteUtils",
".",
"md5",
"(",
"key",
... | Converts the key to the format in which it is stored for searching
@param key Byte array of the key
@return The format stored in the index file | [
"Converts",
"the",
"key",
"to",
"the",
"format",
"in",
"which",
"it",
"is",
"stored",
"for",
"searching"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/chunk/ChunkedFileSet.java#L529-L540 |
161,017 | voldemort/voldemort | src/java/voldemort/store/readonly/chunk/ChunkedFileSet.java | ChunkedFileSet.getChunkForKey | public int getChunkForKey(byte[] key) throws IllegalStateException {
if(numChunks == 0) {
throw new IllegalStateException("The ChunkedFileSet is closed.");
}
switch(storageFormat) {
case READONLY_V0: {
return ReadOnlyUtils.chunk(ByteUtils.md5(key), numChu... | java | public int getChunkForKey(byte[] key) throws IllegalStateException {
if(numChunks == 0) {
throw new IllegalStateException("The ChunkedFileSet is closed.");
}
switch(storageFormat) {
case READONLY_V0: {
return ReadOnlyUtils.chunk(ByteUtils.md5(key), numChu... | [
"public",
"int",
"getChunkForKey",
"(",
"byte",
"[",
"]",
"key",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"numChunks",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The ChunkedFileSet is closed.\"",
")",
";",
"}",
"switch",... | Given a particular key, first converts its to the storage format and then
determines which chunk it belongs to
@param key Byte array of keys
@return Chunk id
@throws IllegalStateException if unable to find the chunk id for the given key | [
"Given",
"a",
"particular",
"key",
"first",
"converts",
"its",
"to",
"the",
"storage",
"format",
"and",
"then",
"determines",
"which",
"chunk",
"it",
"belongs",
"to"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/chunk/ChunkedFileSet.java#L568-L626 |
161,018 | voldemort/voldemort | src/java/voldemort/tools/ReadOnlyReplicationHelperCLI.java | ReadOnlyReplicationHelperCLI.parseAndCompare | private static List<String> parseAndCompare(List<String> fileNames, int masterPartitionId) {
List<String> sourceFileNames = new ArrayList<String>();
for(String fileName: fileNames) {
String[] partitionIdReplicaChunk = fileName.split(SPLIT_LITERAL);
if(Integer.parseInt(partitionId... | java | private static List<String> parseAndCompare(List<String> fileNames, int masterPartitionId) {
List<String> sourceFileNames = new ArrayList<String>();
for(String fileName: fileNames) {
String[] partitionIdReplicaChunk = fileName.split(SPLIT_LITERAL);
if(Integer.parseInt(partitionId... | [
"private",
"static",
"List",
"<",
"String",
">",
"parseAndCompare",
"(",
"List",
"<",
"String",
">",
"fileNames",
",",
"int",
"masterPartitionId",
")",
"{",
"List",
"<",
"String",
">",
"sourceFileNames",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")... | This method take a list of fileName of the type partitionId_Replica_Chunk
and returns file names that match the regular expression
masterPartitionId_ | [
"This",
"method",
"take",
"a",
"list",
"of",
"fileName",
"of",
"the",
"type",
"partitionId_Replica_Chunk",
"and",
"returns",
"file",
"names",
"that",
"match",
"the",
"regular",
"expression",
"masterPartitionId_"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/ReadOnlyReplicationHelperCLI.java#L151-L160 |
161,019 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java | ReadOnlyStorageEngine.getChunkIdToNumChunks | @JmxGetter(name = "getChunkIdToNumChunks", description = "Returns a string representation of the map of chunk id to number of chunks")
public String getChunkIdToNumChunks() {
StringBuilder builder = new StringBuilder();
for(Entry<Object, Integer> entry: fileSet.getChunkIdToNumChunks().entrySet()) {
... | java | @JmxGetter(name = "getChunkIdToNumChunks", description = "Returns a string representation of the map of chunk id to number of chunks")
public String getChunkIdToNumChunks() {
StringBuilder builder = new StringBuilder();
for(Entry<Object, Integer> entry: fileSet.getChunkIdToNumChunks().entrySet()) {
... | [
"@",
"JmxGetter",
"(",
"name",
"=",
"\"getChunkIdToNumChunks\"",
",",
"description",
"=",
"\"Returns a string representation of the map of chunk id to number of chunks\"",
")",
"public",
"String",
"getChunkIdToNumChunks",
"(",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",... | Returns a string representation of map of chunk id to number of chunks
@return String of map of chunk id to number of chunks | [
"Returns",
"a",
"string",
"representation",
"of",
"map",
"of",
"chunk",
"id",
"to",
"number",
"of",
"chunks"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java#L171-L178 |
161,020 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java | ReadOnlyStorageEngine.open | public void open(File versionDir) {
/* acquire modification lock */
fileModificationLock.writeLock().lock();
try {
/* check that the store is currently closed */
if(isOpen)
throw new IllegalStateException("Attempt to open already open store.");
... | java | public void open(File versionDir) {
/* acquire modification lock */
fileModificationLock.writeLock().lock();
try {
/* check that the store is currently closed */
if(isOpen)
throw new IllegalStateException("Attempt to open already open store.");
... | [
"public",
"void",
"open",
"(",
"File",
"versionDir",
")",
"{",
"/* acquire modification lock */",
"fileModificationLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"/* check that the store is currently closed */",
"if",
"(",
"isOpen",
")",
... | Open the store with the version directory specified. If null is specified
we open the directory with the maximum version
@param versionDir Version Directory to open. If null, we open the max
versioned / latest directory | [
"Open",
"the",
"store",
"with",
"the",
"version",
"directory",
"specified",
".",
"If",
"null",
"is",
"specified",
"we",
"open",
"the",
"directory",
"with",
"the",
"maximum",
"version"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java#L187-L222 |
161,021 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java | ReadOnlyStorageEngine.getLastSwapped | @JmxGetter(name = "lastSwapped", description = "Time in milliseconds since the store was swapped")
public long getLastSwapped() {
long timeSinceLastSwap = System.currentTimeMillis() - lastSwapped;
return timeSinceLastSwap > 0 ? timeSinceLastSwap : 0;
} | java | @JmxGetter(name = "lastSwapped", description = "Time in milliseconds since the store was swapped")
public long getLastSwapped() {
long timeSinceLastSwap = System.currentTimeMillis() - lastSwapped;
return timeSinceLastSwap > 0 ? timeSinceLastSwap : 0;
} | [
"@",
"JmxGetter",
"(",
"name",
"=",
"\"lastSwapped\"",
",",
"description",
"=",
"\"Time in milliseconds since the store was swapped\"",
")",
"public",
"long",
"getLastSwapped",
"(",
")",
"{",
"long",
"timeSinceLastSwap",
"=",
"System",
".",
"currentTimeMillis",
"(",
"... | Time since last time the store was swapped
@return Time in milliseconds since the store was swapped | [
"Time",
"since",
"last",
"time",
"the",
"store",
"was",
"swapped"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java#L277-L281 |
161,022 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java | ReadOnlyStorageEngine.close | @Override
public void close() throws VoldemortException {
logger.debug("Close called for read-only store.");
this.fileModificationLock.writeLock().lock();
try {
if(isOpen) {
this.isOpen = false;
fileSet.close();
} else {
... | java | @Override
public void close() throws VoldemortException {
logger.debug("Close called for read-only store.");
this.fileModificationLock.writeLock().lock();
try {
if(isOpen) {
this.isOpen = false;
fileSet.close();
} else {
... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"VoldemortException",
"{",
"logger",
".",
"debug",
"(",
"\"Close called for read-only store.\"",
")",
";",
"this",
".",
"fileModificationLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
"... | Close the store. | [
"Close",
"the",
"store",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java#L286-L301 |
161,023 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java | ReadOnlyStorageEngine.swapFiles | @JmxOperation(description = "swapFiles changes this store to use the new data directory")
public void swapFiles(String newStoreDirectory) {
logger.info("Swapping files for store '" + getName() + "' to " + newStoreDirectory);
File newVersionDir = new File(newStoreDirectory);
if(!newVersionDi... | java | @JmxOperation(description = "swapFiles changes this store to use the new data directory")
public void swapFiles(String newStoreDirectory) {
logger.info("Swapping files for store '" + getName() + "' to " + newStoreDirectory);
File newVersionDir = new File(newStoreDirectory);
if(!newVersionDi... | [
"@",
"JmxOperation",
"(",
"description",
"=",
"\"swapFiles changes this store to use the new data directory\"",
")",
"public",
"void",
"swapFiles",
"(",
"String",
"newStoreDirectory",
")",
"{",
"logger",
".",
"info",
"(",
"\"Swapping files for store '\"",
"+",
"getName",
... | Swap the current version folder for a new one
@param newStoreDirectory The path to the new version directory | [
"Swap",
"the",
"current",
"version",
"folder",
"for",
"a",
"new",
"one"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java#L308-L374 |
161,024 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java | ReadOnlyStorageEngine.deleteBackups | private void deleteBackups() {
File[] storeDirList = ReadOnlyUtils.getVersionDirs(storeDir, 0L, getCurrentVersionId());
if(storeDirList != null && storeDirList.length > (numBackups + 1)) {
// delete ALL old directories asynchronously
File[] extraBackups = ReadOnlyUtils.findKthVer... | java | private void deleteBackups() {
File[] storeDirList = ReadOnlyUtils.getVersionDirs(storeDir, 0L, getCurrentVersionId());
if(storeDirList != null && storeDirList.length > (numBackups + 1)) {
// delete ALL old directories asynchronously
File[] extraBackups = ReadOnlyUtils.findKthVer... | [
"private",
"void",
"deleteBackups",
"(",
")",
"{",
"File",
"[",
"]",
"storeDirList",
"=",
"ReadOnlyUtils",
".",
"getVersionDirs",
"(",
"storeDir",
",",
"0L",
",",
"getCurrentVersionId",
"(",
")",
")",
";",
"if",
"(",
"storeDirList",
"!=",
"null",
"&&",
"st... | Delete all backups asynchronously | [
"Delete",
"all",
"backups",
"asynchronously"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java#L379-L393 |
161,025 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java | ReadOnlyStorageEngine.deleteAsync | private void deleteAsync(final File file) {
new Thread(new Runnable() {
@Override
public void run() {
try {
try {
logger.info("Waiting for " + deleteBackupMs
+ " milliseconds before deleting ... | java | private void deleteAsync(final File file) {
new Thread(new Runnable() {
@Override
public void run() {
try {
try {
logger.info("Waiting for " + deleteBackupMs
+ " milliseconds before deleting ... | [
"private",
"void",
"deleteAsync",
"(",
"final",
"File",
"file",
")",
"{",
"new",
"Thread",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"try",
"{",
"logger",
".",
"info",
"(",
"\"Waiting ... | Delete the given file in a separate thread
@param file The file to delete | [
"Delete",
"the",
"given",
"file",
"in",
"a",
"separate",
"thread"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java#L400-L423 |
161,026 | voldemort/voldemort | src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java | ReadOnlyStorageEngine.rollback | public void rollback(File rollbackToDir) {
logger.info("Rolling back store '" + getName() + "'");
fileModificationLock.writeLock().lock();
try {
if(rollbackToDir == null)
throw new VoldemortException("Version directory specified to rollback is null");
if(... | java | public void rollback(File rollbackToDir) {
logger.info("Rolling back store '" + getName() + "'");
fileModificationLock.writeLock().lock();
try {
if(rollbackToDir == null)
throw new VoldemortException("Version directory specified to rollback is null");
if(... | [
"public",
"void",
"rollback",
"(",
"File",
"rollbackToDir",
")",
"{",
"logger",
".",
"info",
"(",
"\"Rolling back store '\"",
"+",
"getName",
"(",
")",
"+",
"\"'\"",
")",
";",
"fileModificationLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
... | Rollback to the specified push version
@param rollbackToDir The version directory to rollback to | [
"Rollback",
"to",
"the",
"specified",
"push",
"version"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyStorageEngine.java#L441-L480 |
161,027 | voldemort/voldemort | src/java/voldemort/rest/RestRequestValidator.java | RestRequestValidator.hasTimeOutHeader | protected boolean hasTimeOutHeader() {
boolean result = false;
String timeoutValStr = this.request.getHeader(RestMessageHeaders.X_VOLD_REQUEST_TIMEOUT_MS);
if(timeoutValStr != null) {
try {
this.parsedTimeoutInMs = Long.parseLong(timeoutValStr);
if(th... | java | protected boolean hasTimeOutHeader() {
boolean result = false;
String timeoutValStr = this.request.getHeader(RestMessageHeaders.X_VOLD_REQUEST_TIMEOUT_MS);
if(timeoutValStr != null) {
try {
this.parsedTimeoutInMs = Long.parseLong(timeoutValStr);
if(th... | [
"protected",
"boolean",
"hasTimeOutHeader",
"(",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"String",
"timeoutValStr",
"=",
"this",
".",
"request",
".",
"getHeader",
"(",
"RestMessageHeaders",
".",
"X_VOLD_REQUEST_TIMEOUT_MS",
")",
";",
"if",
"(",
"timeou... | Retrieve and validate the timeout value from the REST request.
"X_VOLD_REQUEST_TIMEOUT_MS" is the timeout header.
@return true if present, false if missing | [
"Retrieve",
"and",
"validate",
"the",
"timeout",
"value",
"from",
"the",
"REST",
"request",
".",
"X_VOLD_REQUEST_TIMEOUT_MS",
"is",
"the",
"timeout",
"header",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestRequestValidator.java#L67-L98 |
161,028 | voldemort/voldemort | src/java/voldemort/rest/RestRequestValidator.java | RestRequestValidator.parseRoutingCodeHeader | protected void parseRoutingCodeHeader() {
String rtCode = this.request.getHeader(RestMessageHeaders.X_VOLD_ROUTING_TYPE_CODE);
if(rtCode != null) {
try {
int routingTypeCode = Integer.parseInt(rtCode);
this.parsedRoutingType = RequestRoutingType.getRequestRou... | java | protected void parseRoutingCodeHeader() {
String rtCode = this.request.getHeader(RestMessageHeaders.X_VOLD_ROUTING_TYPE_CODE);
if(rtCode != null) {
try {
int routingTypeCode = Integer.parseInt(rtCode);
this.parsedRoutingType = RequestRoutingType.getRequestRou... | [
"protected",
"void",
"parseRoutingCodeHeader",
"(",
")",
"{",
"String",
"rtCode",
"=",
"this",
".",
"request",
".",
"getHeader",
"(",
"RestMessageHeaders",
".",
"X_VOLD_ROUTING_TYPE_CODE",
")",
";",
"if",
"(",
"rtCode",
"!=",
"null",
")",
"{",
"try",
"{",
"i... | Retrieve the routing type value from the REST request.
"X_VOLD_ROUTING_TYPE_CODE" is the routing type header.
By default, the routing code is set to NORMAL
TODO REST-Server 1. Change the header name to a better name. 2. Assumes
that integer is passed in the header | [
"Retrieve",
"the",
"routing",
"type",
"value",
"from",
"the",
"REST",
"request",
".",
"X_VOLD_ROUTING_TYPE_CODE",
"is",
"the",
"routing",
"type",
"header",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestRequestValidator.java#L110-L133 |
161,029 | voldemort/voldemort | src/java/voldemort/rest/RestRequestValidator.java | RestRequestValidator.hasTimeStampHeader | protected boolean hasTimeStampHeader() {
String originTime = request.getHeader(RestMessageHeaders.X_VOLD_REQUEST_ORIGIN_TIME_MS);
boolean result = false;
if(originTime != null) {
try {
// TODO: remove the originTime field from request header,
// becaus... | java | protected boolean hasTimeStampHeader() {
String originTime = request.getHeader(RestMessageHeaders.X_VOLD_REQUEST_ORIGIN_TIME_MS);
boolean result = false;
if(originTime != null) {
try {
// TODO: remove the originTime field from request header,
// becaus... | [
"protected",
"boolean",
"hasTimeStampHeader",
"(",
")",
"{",
"String",
"originTime",
"=",
"request",
".",
"getHeader",
"(",
"RestMessageHeaders",
".",
"X_VOLD_REQUEST_ORIGIN_TIME_MS",
")",
";",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"originTime",
"!=",... | Retrieve and validate the timestamp value from the REST request.
"X_VOLD_REQUEST_ORIGIN_TIME_MS" is timestamp header
TODO REST-Server 1. Change Time stamp header to a better name.
@return true if present, false if missing | [
"Retrieve",
"and",
"validate",
"the",
"timestamp",
"value",
"from",
"the",
"REST",
"request",
".",
"X_VOLD_REQUEST_ORIGIN_TIME_MS",
"is",
"timestamp",
"header"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestRequestValidator.java#L143-L183 |
161,030 | voldemort/voldemort | src/java/voldemort/rest/RestRequestValidator.java | RestRequestValidator.hasVectorClock | protected boolean hasVectorClock(boolean isVectorClockOptional) {
boolean result = false;
String vectorClockHeader = this.request.getHeader(RestMessageHeaders.X_VOLD_VECTOR_CLOCK);
if(vectorClockHeader != null) {
ObjectMapper mapper = new ObjectMapper();
try {
... | java | protected boolean hasVectorClock(boolean isVectorClockOptional) {
boolean result = false;
String vectorClockHeader = this.request.getHeader(RestMessageHeaders.X_VOLD_VECTOR_CLOCK);
if(vectorClockHeader != null) {
ObjectMapper mapper = new ObjectMapper();
try {
... | [
"protected",
"boolean",
"hasVectorClock",
"(",
"boolean",
"isVectorClockOptional",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"String",
"vectorClockHeader",
"=",
"this",
".",
"request",
".",
"getHeader",
"(",
"RestMessageHeaders",
".",
"X_VOLD_VECTOR_CLOCK",
... | Retrieve and validate vector clock value from the REST request.
"X_VOLD_VECTOR_CLOCK" is the vector clock header.
@return true if present, false if missing | [
"Retrieve",
"and",
"validate",
"vector",
"clock",
"value",
"from",
"the",
"REST",
"request",
".",
"X_VOLD_VECTOR_CLOCK",
"is",
"the",
"vector",
"clock",
"header",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestRequestValidator.java#L191-L219 |
161,031 | voldemort/voldemort | src/java/voldemort/rest/RestRequestValidator.java | RestRequestValidator.hasKey | protected boolean hasKey() {
boolean result = false;
String requestURI = this.request.getUri();
parseKeys(requestURI);
if(this.parsedKeys != null) {
result = true;
} else {
logger.error("Error when validating request. No key specified.");
Rest... | java | protected boolean hasKey() {
boolean result = false;
String requestURI = this.request.getUri();
parseKeys(requestURI);
if(this.parsedKeys != null) {
result = true;
} else {
logger.error("Error when validating request. No key specified.");
Rest... | [
"protected",
"boolean",
"hasKey",
"(",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"String",
"requestURI",
"=",
"this",
".",
"request",
".",
"getUri",
"(",
")",
";",
"parseKeys",
"(",
"requestURI",
")",
";",
"if",
"(",
"this",
".",
"parsedKeys",
... | Retrieve and validate the key from the REST request.
@return true if present, false if missing | [
"Retrieve",
"and",
"validate",
"the",
"key",
"from",
"the",
"REST",
"request",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestRequestValidator.java#L226-L240 |
161,032 | voldemort/voldemort | src/java/voldemort/rest/RestRequestValidator.java | RestRequestValidator.isStoreValid | protected boolean isStoreValid() {
boolean result = false;
String requestURI = this.request.getUri();
this.storeName = parseStoreName(requestURI);
if(storeName != null) {
result = true;
} else {
logger.error("Error when validating request. Missing store na... | java | protected boolean isStoreValid() {
boolean result = false;
String requestURI = this.request.getUri();
this.storeName = parseStoreName(requestURI);
if(storeName != null) {
result = true;
} else {
logger.error("Error when validating request. Missing store na... | [
"protected",
"boolean",
"isStoreValid",
"(",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"String",
"requestURI",
"=",
"this",
".",
"request",
".",
"getUri",
"(",
")",
";",
"this",
".",
"storeName",
"=",
"parseStoreName",
"(",
"requestURI",
")",
";",
... | Retrieve and validate store name from the REST request.
@return true if valid, false otherwise | [
"Retrieve",
"and",
"validate",
"store",
"name",
"from",
"the",
"REST",
"request",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestRequestValidator.java#L275-L288 |
161,033 | voldemort/voldemort | src/java/voldemort/rest/RestRequestValidator.java | RestRequestValidator.debugLog | protected void debugLog(String operationType, Long receivedTimeInMs) {
long durationInMs = receivedTimeInMs - (this.parsedRequestOriginTimeInMs);
int numVectorClockEntries = (this.parsedVectorClock == null ? 0
: this.parsedVectorClock.ge... | java | protected void debugLog(String operationType, Long receivedTimeInMs) {
long durationInMs = receivedTimeInMs - (this.parsedRequestOriginTimeInMs);
int numVectorClockEntries = (this.parsedVectorClock == null ? 0
: this.parsedVectorClock.ge... | [
"protected",
"void",
"debugLog",
"(",
"String",
"operationType",
",",
"Long",
"receivedTimeInMs",
")",
"{",
"long",
"durationInMs",
"=",
"receivedTimeInMs",
"-",
"(",
"this",
".",
"parsedRequestOriginTimeInMs",
")",
";",
"int",
"numVectorClockEntries",
"=",
"(",
"... | Prints a debug log message that details the time taken for the Http
request to be parsed by the coordinator
@param operationType
@param receivedTimeInMs | [
"Prints",
"a",
"debug",
"log",
"message",
"that",
"details",
"the",
"time",
"taken",
"for",
"the",
"Http",
"request",
"to",
"be",
"parsed",
"by",
"the",
"coordinator"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestRequestValidator.java#L321-L334 |
161,034 | voldemort/voldemort | contrib/hadoop-store-builder/src/java/voldemort/store/readonly/fetcher/HdfsFetcher.java | HdfsFetcher.fetch | @Deprecated
@Override
public File fetch(String source, String dest, long diskQuotaSizeInKB) throws Exception {
return fetchFromSource(source, dest, null, null, -1, diskQuotaSizeInKB, null);
} | java | @Deprecated
@Override
public File fetch(String source, String dest, long diskQuotaSizeInKB) throws Exception {
return fetchFromSource(source, dest, null, null, -1, diskQuotaSizeInKB, null);
} | [
"@",
"Deprecated",
"@",
"Override",
"public",
"File",
"fetch",
"(",
"String",
"source",
",",
"String",
"dest",
",",
"long",
"diskQuotaSizeInKB",
")",
"throws",
"Exception",
"{",
"return",
"fetchFromSource",
"(",
"source",
",",
"dest",
",",
"null",
",",
"null... | Used for unit tests only.
FIXME: Refactor test code with dependency injection or scope restrictions so this function is not public.
@deprecated Do not use for production code, use {@link #fetch(String, String, voldemort.server.protocol.admin.AsyncOperationStatus, String, long, voldemort.store.metadata.MetadataStore, ... | [
"Used",
"for",
"unit",
"tests",
"only",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/fetcher/HdfsFetcher.java#L178-L182 |
161,035 | voldemort/voldemort | contrib/hadoop-store-builder/src/java/voldemort/store/readonly/fetcher/HdfsFetcher.java | HdfsFetcher.main | public static void main(String[] args) throws Exception {
if(args.length < 1)
Utils.croak("USAGE: java " + HdfsFetcher.class.getName()
+ " url [keytab-location kerberos-username hadoop-config-path [destDir]]");
String url = args[0];
VoldemortConfig config = n... | java | public static void main(String[] args) throws Exception {
if(args.length < 1)
Utils.croak("USAGE: java " + HdfsFetcher.class.getName()
+ " url [keytab-location kerberos-username hadoop-config-path [destDir]]");
String url = args[0];
VoldemortConfig config = n... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"if",
"(",
"args",
".",
"length",
"<",
"1",
")",
"Utils",
".",
"croak",
"(",
"\"USAGE: java \"",
"+",
"HdfsFetcher",
".",
"class",
".",
"getName",
"("... | Main method for testing fetching | [
"Main",
"method",
"for",
"testing",
"fetching"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/fetcher/HdfsFetcher.java#L487-L532 |
161,036 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceTaskInfo.java | RebalanceTaskInfo.getPartitionStoreMoves | public synchronized int getPartitionStoreMoves() {
int count = 0;
for (List<Integer> entry : storeToPartitionIds.values())
count += entry.size();
return count;
} | java | public synchronized int getPartitionStoreMoves() {
int count = 0;
for (List<Integer> entry : storeToPartitionIds.values())
count += entry.size();
return count;
} | [
"public",
"synchronized",
"int",
"getPartitionStoreMoves",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"List",
"<",
"Integer",
">",
"entry",
":",
"storeToPartitionIds",
".",
"values",
"(",
")",
")",
"count",
"+=",
"entry",
".",
"size",
"(",... | Total count of partition-stores moved in this task.
@return number of partition stores moved in this task. | [
"Total",
"count",
"of",
"partition",
"-",
"stores",
"moved",
"in",
"this",
"task",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceTaskInfo.java#L156-L161 |
161,037 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceTaskInfo.java | RebalanceTaskInfo.getPartitionStoreCount | public synchronized int getPartitionStoreCount() {
int count = 0;
for (String store : storeToPartitionIds.keySet()) {
count += storeToPartitionIds.get(store).size();
}
return count;
} | java | public synchronized int getPartitionStoreCount() {
int count = 0;
for (String store : storeToPartitionIds.keySet()) {
count += storeToPartitionIds.get(store).size();
}
return count;
} | [
"public",
"synchronized",
"int",
"getPartitionStoreCount",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"String",
"store",
":",
"storeToPartitionIds",
".",
"keySet",
"(",
")",
")",
"{",
"count",
"+=",
"storeToPartitionIds",
".",
"get",
"(",
"s... | Returns the total count of partitions across all stores.
@return returns the total count of partitions across all stores. | [
"Returns",
"the",
"total",
"count",
"of",
"partitions",
"across",
"all",
"stores",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceTaskInfo.java#L196-L202 |
161,038 | voldemort/voldemort | src/java/voldemort/client/rebalance/RebalanceTaskInfo.java | RebalanceTaskInfo.taskListToString | public static String taskListToString(List<RebalanceTaskInfo> infos) {
StringBuffer sb = new StringBuffer();
for (RebalanceTaskInfo info : infos) {
sb.append("\t").append(info.getDonorId()).append(" -> ").append(info.getStealerId()).append(" : [");
for (String storeName : info.ge... | java | public static String taskListToString(List<RebalanceTaskInfo> infos) {
StringBuffer sb = new StringBuffer();
for (RebalanceTaskInfo info : infos) {
sb.append("\t").append(info.getDonorId()).append(" -> ").append(info.getStealerId()).append(" : [");
for (String storeName : info.ge... | [
"public",
"static",
"String",
"taskListToString",
"(",
"List",
"<",
"RebalanceTaskInfo",
">",
"infos",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"RebalanceTaskInfo",
"info",
":",
"infos",
")",
"{",
"sb",
".",
"a... | Pretty prints a task list of rebalancing tasks.
@param infos list of rebalancing tasks (RebalancePartitionsInfo)
@return pretty-printed string | [
"Pretty",
"prints",
"a",
"task",
"list",
"of",
"rebalancing",
"tasks",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/RebalanceTaskInfo.java#L231-L241 |
161,039 | voldemort/voldemort | contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/AvroStoreBuilderMapper.java | AvroStoreBuilderMapper.map | @Override
public void map(GenericData.Record record,
AvroCollector<Pair<ByteBuffer, ByteBuffer>> collector,
Reporter reporter) throws IOException {
byte[] keyBytes = null;
byte[] valBytes = null;
Object keyRecord = null;
Object valRecord = nul... | java | @Override
public void map(GenericData.Record record,
AvroCollector<Pair<ByteBuffer, ByteBuffer>> collector,
Reporter reporter) throws IOException {
byte[] keyBytes = null;
byte[] valBytes = null;
Object keyRecord = null;
Object valRecord = nul... | [
"@",
"Override",
"public",
"void",
"map",
"(",
"GenericData",
".",
"Record",
"record",
",",
"AvroCollector",
"<",
"Pair",
"<",
"ByteBuffer",
",",
"ByteBuffer",
">",
">",
"collector",
",",
"Reporter",
"reporter",
")",
"throws",
"IOException",
"{",
"byte",
"["... | Create the voldemort key and value from the input Avro record by
extracting the key and value and map it out for each of the responsible
voldemort nodes
The output value is the node_id & partition_id of the responsible node
followed by serialized value | [
"Create",
"the",
"voldemort",
"key",
"and",
"value",
"from",
"the",
"input",
"Avro",
"record",
"by",
"extracting",
"the",
"key",
"and",
"value",
"and",
"map",
"it",
"out",
"for",
"each",
"of",
"the",
"responsible",
"voldemort",
"nodes"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/AvroStoreBuilderMapper.java#L113-L142 |
161,040 | voldemort/voldemort | src/java/voldemort/store/readonly/io/jna/mman.java | mman.mmap | public static Pointer mmap(long len, int prot, int flags, int fildes, long off)
throws IOException {
// we don't really have a need to change the recommended pointer.
Pointer addr = new Pointer(0);
Pointer result = Delegate.mmap(addr,
new Nati... | java | public static Pointer mmap(long len, int prot, int flags, int fildes, long off)
throws IOException {
// we don't really have a need to change the recommended pointer.
Pointer addr = new Pointer(0);
Pointer result = Delegate.mmap(addr,
new Nati... | [
"public",
"static",
"Pointer",
"mmap",
"(",
"long",
"len",
",",
"int",
"prot",
",",
"int",
"flags",
",",
"int",
"fildes",
",",
"long",
"off",
")",
"throws",
"IOException",
"{",
"// we don't really have a need to change the recommended pointer.",
"Pointer",
"addr",
... | Map the given region of the given file descriptor into memory.
Returns a Pointer to the newly mapped memory throws an
IOException on error. | [
"Map",
"the",
"given",
"region",
"of",
"the",
"given",
"file",
"descriptor",
"into",
"memory",
".",
"Returns",
"a",
"Pointer",
"to",
"the",
"newly",
"mapped",
"memory",
"throws",
"an",
"IOException",
"on",
"error",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/io/jna/mman.java#L36-L57 |
161,041 | voldemort/voldemort | src/java/voldemort/store/readonly/io/jna/mman.java | mman.mlock | public static void mlock(Pointer addr, long len) {
int res = Delegate.mlock(addr, new NativeLong(len));
if(res != 0) {
if(logger.isDebugEnabled()) {
logger.debug("Mlock failed probably because of insufficient privileges, errno:"
+ errno.strerror(... | java | public static void mlock(Pointer addr, long len) {
int res = Delegate.mlock(addr, new NativeLong(len));
if(res != 0) {
if(logger.isDebugEnabled()) {
logger.debug("Mlock failed probably because of insufficient privileges, errno:"
+ errno.strerror(... | [
"public",
"static",
"void",
"mlock",
"(",
"Pointer",
"addr",
",",
"long",
"len",
")",
"{",
"int",
"res",
"=",
"Delegate",
".",
"mlock",
"(",
"addr",
",",
"new",
"NativeLong",
"(",
"len",
")",
")",
";",
"if",
"(",
"res",
"!=",
"0",
")",
"{",
"if",... | Lock the given region. Does not report failures. | [
"Lock",
"the",
"given",
"region",
".",
"Does",
"not",
"report",
"failures",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/io/jna/mman.java#L80-L94 |
161,042 | voldemort/voldemort | src/java/voldemort/store/readonly/io/jna/mman.java | mman.munlock | public static void munlock(Pointer addr, long len) {
if(Delegate.munlock(addr, new NativeLong(len)) != 0) {
if(logger.isDebugEnabled())
logger.debug("munlocking failed with errno:" + errno.strerror());
} else {
if(logger.isDebugEnabled())
logger.d... | java | public static void munlock(Pointer addr, long len) {
if(Delegate.munlock(addr, new NativeLong(len)) != 0) {
if(logger.isDebugEnabled())
logger.debug("munlocking failed with errno:" + errno.strerror());
} else {
if(logger.isDebugEnabled())
logger.d... | [
"public",
"static",
"void",
"munlock",
"(",
"Pointer",
"addr",
",",
"long",
"len",
")",
"{",
"if",
"(",
"Delegate",
".",
"munlock",
"(",
"addr",
",",
"new",
"NativeLong",
"(",
"len",
")",
")",
"!=",
"0",
")",
"{",
"if",
"(",
"logger",
".",
"isDebug... | Unlock the given region. Does not report failures. | [
"Unlock",
"the",
"given",
"region",
".",
"Does",
"not",
"report",
"failures",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/io/jna/mman.java#L99-L108 |
161,043 | voldemort/voldemort | src/java/voldemort/serialization/json/JsonTypeDefinition.java | JsonTypeDefinition.projectionType | public JsonTypeDefinition projectionType(String... properties) {
if(this.getType() instanceof Map<?, ?>) {
Map<?, ?> type = (Map<?, ?>) getType();
Arrays.sort(properties);
Map<String, Object> newType = new LinkedHashMap<String, Object>();
for(String prop: properti... | java | public JsonTypeDefinition projectionType(String... properties) {
if(this.getType() instanceof Map<?, ?>) {
Map<?, ?> type = (Map<?, ?>) getType();
Arrays.sort(properties);
Map<String, Object> newType = new LinkedHashMap<String, Object>();
for(String prop: properti... | [
"public",
"JsonTypeDefinition",
"projectionType",
"(",
"String",
"...",
"properties",
")",
"{",
"if",
"(",
"this",
".",
"getType",
"(",
")",
"instanceof",
"Map",
"<",
"?",
",",
"?",
">",
")",
"{",
"Map",
"<",
"?",
",",
"?",
">",
"type",
"=",
"(",
"... | Get the type created by selecting only a subset of properties from this
type. The type must be a map for this to work
@param properties The properties to select
@return The new type definition | [
"Get",
"the",
"type",
"created",
"by",
"selecting",
"only",
"a",
"subset",
"of",
"properties",
"from",
"this",
"type",
".",
"The",
"type",
"must",
"be",
"a",
"map",
"for",
"this",
"to",
"work"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/serialization/json/JsonTypeDefinition.java#L96-L107 |
161,044 | voldemort/voldemort | src/java/voldemort/server/protocol/admin/BufferedUpdatePartitionEntriesStreamRequestHandler.java | BufferedUpdatePartitionEntriesStreamRequestHandler.writeBufferedValsToStorage | private void writeBufferedValsToStorage() {
List<Versioned<byte[]>> obsoleteVals = storageEngine.multiVersionPut(currBufferedKey,
currBufferedVals);
// log Obsolete versions in debug mode
if(logger.isDebugEnabled() && o... | java | private void writeBufferedValsToStorage() {
List<Versioned<byte[]>> obsoleteVals = storageEngine.multiVersionPut(currBufferedKey,
currBufferedVals);
// log Obsolete versions in debug mode
if(logger.isDebugEnabled() && o... | [
"private",
"void",
"writeBufferedValsToStorage",
"(",
")",
"{",
"List",
"<",
"Versioned",
"<",
"byte",
"[",
"]",
">",
">",
"obsoleteVals",
"=",
"storageEngine",
".",
"multiVersionPut",
"(",
"currBufferedKey",
",",
"currBufferedVals",
")",
";",
"// log Obsolete ver... | Persists the current set of versions buffered for the current key into
storage, using the multiVersionPut api
NOTE: Now, it could be that the stream broke off and has more pending
versions. For now, we simply commit what we have to disk. A better design
would rely on in-stream markers to do the flushing to storage. | [
"Persists",
"the",
"current",
"set",
"of",
"versions",
"buffered",
"for",
"the",
"current",
"key",
"into",
"storage",
"using",
"the",
"multiVersionPut",
"api"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/BufferedUpdatePartitionEntriesStreamRequestHandler.java#L66-L75 |
161,045 | voldemort/voldemort | src/java/voldemort/server/rebalance/Rebalancer.java | Rebalancer.acquireRebalancingPermit | public synchronized boolean acquireRebalancingPermit(int nodeId) {
boolean added = rebalancePermits.add(nodeId);
logger.info("Acquiring rebalancing permit for node id " + nodeId + ", returned: " + added);
return added;
} | java | public synchronized boolean acquireRebalancingPermit(int nodeId) {
boolean added = rebalancePermits.add(nodeId);
logger.info("Acquiring rebalancing permit for node id " + nodeId + ", returned: " + added);
return added;
} | [
"public",
"synchronized",
"boolean",
"acquireRebalancingPermit",
"(",
"int",
"nodeId",
")",
"{",
"boolean",
"added",
"=",
"rebalancePermits",
".",
"add",
"(",
"nodeId",
")",
";",
"logger",
".",
"info",
"(",
"\"Acquiring rebalancing permit for node id \"",
"+",
"node... | Acquire a permit for a particular node id so as to allow rebalancing
@param nodeId The id of the node for which we are acquiring a permit
@return Returns true if permit acquired, false if the permit is already
held by someone | [
"Acquire",
"a",
"permit",
"for",
"a",
"particular",
"node",
"id",
"so",
"as",
"to",
"allow",
"rebalancing"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/rebalance/Rebalancer.java#L91-L96 |
161,046 | voldemort/voldemort | src/java/voldemort/server/rebalance/Rebalancer.java | Rebalancer.releaseRebalancingPermit | public synchronized void releaseRebalancingPermit(int nodeId) {
boolean removed = rebalancePermits.remove(nodeId);
logger.info("Releasing rebalancing permit for node id " + nodeId + ", returned: " + removed);
if(!removed)
throw new VoldemortException(new IllegalStateException("Invali... | java | public synchronized void releaseRebalancingPermit(int nodeId) {
boolean removed = rebalancePermits.remove(nodeId);
logger.info("Releasing rebalancing permit for node id " + nodeId + ", returned: " + removed);
if(!removed)
throw new VoldemortException(new IllegalStateException("Invali... | [
"public",
"synchronized",
"void",
"releaseRebalancingPermit",
"(",
"int",
"nodeId",
")",
"{",
"boolean",
"removed",
"=",
"rebalancePermits",
".",
"remove",
"(",
"nodeId",
")",
";",
"logger",
".",
"info",
"(",
"\"Releasing rebalancing permit for node id \"",
"+",
"no... | Release the rebalancing permit for a particular node id
@param nodeId The node id whose permit we want to release | [
"Release",
"the",
"rebalancing",
"permit",
"for",
"a",
"particular",
"node",
"id"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/rebalance/Rebalancer.java#L103-L109 |
161,047 | voldemort/voldemort | src/java/voldemort/server/rebalance/Rebalancer.java | Rebalancer.swapROStores | private void swapROStores(List<String> swappedStoreNames, boolean useSwappedStoreNames) {
try {
for(StoreDefinition storeDef: metadataStore.getStoreDefList()) {
// Only pick up the RO stores
if(storeDef.getType().compareTo(ReadOnlyStorageConfiguration.TYPE_NAME) == ... | java | private void swapROStores(List<String> swappedStoreNames, boolean useSwappedStoreNames) {
try {
for(StoreDefinition storeDef: metadataStore.getStoreDefList()) {
// Only pick up the RO stores
if(storeDef.getType().compareTo(ReadOnlyStorageConfiguration.TYPE_NAME) == ... | [
"private",
"void",
"swapROStores",
"(",
"List",
"<",
"String",
">",
"swappedStoreNames",
",",
"boolean",
"useSwappedStoreNames",
")",
"{",
"try",
"{",
"for",
"(",
"StoreDefinition",
"storeDef",
":",
"metadataStore",
".",
"getStoreDefList",
"(",
")",
")",
"{",
... | Goes through all the RO Stores in the plan and swaps it
@param swappedStoreNames Names of stores already swapped
@param useSwappedStoreNames Swap only the previously swapped stores (
Happens during error ) | [
"Goes",
"through",
"all",
"the",
"RO",
"Stores",
"in",
"the",
"plan",
"and",
"swaps",
"it"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/rebalance/Rebalancer.java#L336-L370 |
161,048 | voldemort/voldemort | src/java/voldemort/server/rebalance/Rebalancer.java | Rebalancer.changeClusterAndStores | private void changeClusterAndStores(String clusterKey,
final Cluster cluster,
String storesKey,
final List<StoreDefinition> storeDefs) {
metadataStore.writeLock.lock();
try {
... | java | private void changeClusterAndStores(String clusterKey,
final Cluster cluster,
String storesKey,
final List<StoreDefinition> storeDefs) {
metadataStore.writeLock.lock();
try {
... | [
"private",
"void",
"changeClusterAndStores",
"(",
"String",
"clusterKey",
",",
"final",
"Cluster",
"cluster",
",",
"String",
"storesKey",
",",
"final",
"List",
"<",
"StoreDefinition",
">",
"storeDefs",
")",
"{",
"metadataStore",
".",
"writeLock",
".",
"lock",
"(... | Updates the cluster and store metadata atomically
This is required during rebalance and expansion into a new zone since we
have to update the store def along with the cluster def.
@param cluster The cluster metadata information
@param storeDefs The stores metadata information | [
"Updates",
"the",
"cluster",
"and",
"store",
"metadata",
"atomically"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/rebalance/Rebalancer.java#L381-L406 |
161,049 | voldemort/voldemort | src/java/voldemort/server/rebalance/Rebalancer.java | Rebalancer.rebalanceNode | public int rebalanceNode(final RebalanceTaskInfo stealInfo) {
final RebalanceTaskInfo info = metadataStore.getRebalancerState()
.find(stealInfo.getDonorId());
// Do we have the plan in the state?
if(info == null) {
throw new Volde... | java | public int rebalanceNode(final RebalanceTaskInfo stealInfo) {
final RebalanceTaskInfo info = metadataStore.getRebalancerState()
.find(stealInfo.getDonorId());
// Do we have the plan in the state?
if(info == null) {
throw new Volde... | [
"public",
"int",
"rebalanceNode",
"(",
"final",
"RebalanceTaskInfo",
"stealInfo",
")",
"{",
"final",
"RebalanceTaskInfo",
"info",
"=",
"metadataStore",
".",
"getRebalancerState",
"(",
")",
".",
"find",
"(",
"stealInfo",
".",
"getDonorId",
"(",
")",
")",
";",
"... | This function is responsible for starting the actual async rebalance
operation. This is run if this node is the stealer node
<br>
We also assume that the check that this server is in rebalancing state
has been done at a higher level
@param stealInfo Partition info to steal
@return Returns a id identifying the async ... | [
"This",
"function",
"is",
"responsible",
"for",
"starting",
"the",
"actual",
"async",
"rebalance",
"operation",
".",
"This",
"is",
"run",
"if",
"this",
"node",
"is",
"the",
"stealer",
"node"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/rebalance/Rebalancer.java#L420-L453 |
161,050 | voldemort/voldemort | src/java/voldemort/server/niosocket/AsyncRequestHandler.java | AsyncRequestHandler.prepForWrite | protected void prepForWrite(SelectionKey selectionKey) {
if(logger.isTraceEnabled())
traceInputBufferState("About to clear read buffer");
if(requestHandlerFactory.shareReadWriteBuffer() == false) {
inputStream.clear();
}
if(logger.isTraceEnabled())
t... | java | protected void prepForWrite(SelectionKey selectionKey) {
if(logger.isTraceEnabled())
traceInputBufferState("About to clear read buffer");
if(requestHandlerFactory.shareReadWriteBuffer() == false) {
inputStream.clear();
}
if(logger.isTraceEnabled())
t... | [
"protected",
"void",
"prepForWrite",
"(",
"SelectionKey",
"selectionKey",
")",
"{",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"traceInputBufferState",
"(",
"\"About to clear read buffer\"",
")",
";",
"if",
"(",
"requestHandlerFactory",
".",
"shareRe... | Flips the output buffer, and lets the Selector know we're ready to write.
@param selectionKey | [
"Flips",
"the",
"output",
"buffer",
"and",
"lets",
"the",
"Selector",
"know",
"we",
"re",
"ready",
"to",
"write",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/niosocket/AsyncRequestHandler.java#L92-L105 |
161,051 | voldemort/voldemort | src/java/voldemort/server/niosocket/AsyncRequestHandler.java | AsyncRequestHandler.initRequestHandler | private boolean initRequestHandler(SelectionKey selectionKey) {
ByteBuffer inputBuffer = inputStream.getBuffer();
int remaining = inputBuffer.remaining();
// Don't have enough bytes to determine the protocol yet...
if(remaining < 3)
return true;
byte[] protoBytes = ... | java | private boolean initRequestHandler(SelectionKey selectionKey) {
ByteBuffer inputBuffer = inputStream.getBuffer();
int remaining = inputBuffer.remaining();
// Don't have enough bytes to determine the protocol yet...
if(remaining < 3)
return true;
byte[] protoBytes = ... | [
"private",
"boolean",
"initRequestHandler",
"(",
"SelectionKey",
"selectionKey",
")",
"{",
"ByteBuffer",
"inputBuffer",
"=",
"inputStream",
".",
"getBuffer",
"(",
")",
";",
"int",
"remaining",
"=",
"inputBuffer",
".",
"remaining",
"(",
")",
";",
"// Don't have eno... | Returns true if the request should continue.
@return | [
"Returns",
"true",
"if",
"the",
"request",
"should",
"continue",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/niosocket/AsyncRequestHandler.java#L401-L440 |
161,052 | voldemort/voldemort | src/java/voldemort/client/rebalance/QuotaResetter.java | QuotaResetter.rememberAndDisableQuota | public void rememberAndDisableQuota() {
for(Integer nodeId: nodeIds) {
boolean quotaEnforcement = Boolean.parseBoolean(adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
MetadataStore.QUOTA_E... | java | public void rememberAndDisableQuota() {
for(Integer nodeId: nodeIds) {
boolean quotaEnforcement = Boolean.parseBoolean(adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
MetadataStore.QUOTA_E... | [
"public",
"void",
"rememberAndDisableQuota",
"(",
")",
"{",
"for",
"(",
"Integer",
"nodeId",
":",
"nodeIds",
")",
"{",
"boolean",
"quotaEnforcement",
"=",
"Boolean",
".",
"parseBoolean",
"(",
"adminClient",
".",
"metadataMgmtOps",
".",
"getRemoteMetadata",
"(",
... | Before cluster management operations, i.e. remember and disable quota
enforcement settings | [
"Before",
"cluster",
"management",
"operations",
"i",
".",
"e",
".",
"remember",
"and",
"disable",
"quota",
"enforcement",
"settings"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/QuotaResetter.java#L37-L47 |
161,053 | voldemort/voldemort | src/java/voldemort/client/rebalance/QuotaResetter.java | QuotaResetter.resetQuotaAndRecoverEnforcement | public void resetQuotaAndRecoverEnforcement() {
for(Integer nodeId: nodeIds) {
boolean quotaEnforcement = mapNodeToQuotaEnforcingEnabled.get(nodeId);
adminClient.metadataMgmtOps.updateRemoteMetadata(Arrays.asList(nodeId),
Metad... | java | public void resetQuotaAndRecoverEnforcement() {
for(Integer nodeId: nodeIds) {
boolean quotaEnforcement = mapNodeToQuotaEnforcingEnabled.get(nodeId);
adminClient.metadataMgmtOps.updateRemoteMetadata(Arrays.asList(nodeId),
Metad... | [
"public",
"void",
"resetQuotaAndRecoverEnforcement",
"(",
")",
"{",
"for",
"(",
"Integer",
"nodeId",
":",
"nodeIds",
")",
"{",
"boolean",
"quotaEnforcement",
"=",
"mapNodeToQuotaEnforcingEnabled",
".",
"get",
"(",
"nodeId",
")",
";",
"adminClient",
".",
"metadataM... | After cluster management operations, i.e. reset quota and recover quota
enforcement settings | [
"After",
"cluster",
"management",
"operations",
"i",
".",
"e",
".",
"reset",
"quota",
"and",
"recover",
"quota",
"enforcement",
"settings"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/rebalance/QuotaResetter.java#L53-L63 |
161,054 | voldemort/voldemort | src/java/voldemort/versioning/VectorClock.java | VectorClock.incrementVersion | public void incrementVersion(int node, long time) {
if(node < 0 || node > Short.MAX_VALUE)
throw new IllegalArgumentException(node
+ " is outside the acceptable range of node ids.");
this.timestamp = time;
Long version = versionMap.get... | java | public void incrementVersion(int node, long time) {
if(node < 0 || node > Short.MAX_VALUE)
throw new IllegalArgumentException(node
+ " is outside the acceptable range of node ids.");
this.timestamp = time;
Long version = versionMap.get... | [
"public",
"void",
"incrementVersion",
"(",
"int",
"node",
",",
"long",
"time",
")",
"{",
"if",
"(",
"node",
"<",
"0",
"||",
"node",
">",
"Short",
".",
"MAX_VALUE",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"node",
"+",
"\" is outside the acceptab... | Increment the version info associated with the given node
@param node The node | [
"Increment",
"the",
"version",
"info",
"associated",
"with",
"the",
"given",
"node"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/versioning/VectorClock.java#L205-L224 |
161,055 | voldemort/voldemort | src/java/voldemort/versioning/VectorClock.java | VectorClock.incremented | public VectorClock incremented(int nodeId, long time) {
VectorClock copyClock = this.clone();
copyClock.incrementVersion(nodeId, time);
return copyClock;
} | java | public VectorClock incremented(int nodeId, long time) {
VectorClock copyClock = this.clone();
copyClock.incrementVersion(nodeId, time);
return copyClock;
} | [
"public",
"VectorClock",
"incremented",
"(",
"int",
"nodeId",
",",
"long",
"time",
")",
"{",
"VectorClock",
"copyClock",
"=",
"this",
".",
"clone",
"(",
")",
";",
"copyClock",
".",
"incrementVersion",
"(",
"nodeId",
",",
"time",
")",
";",
"return",
"copyCl... | Get new vector clock based on this clock but incremented on index nodeId
@param nodeId The id of the node to increment
@return A vector clock equal on each element execept that indexed by
nodeId | [
"Get",
"new",
"vector",
"clock",
"based",
"on",
"this",
"clock",
"but",
"incremented",
"on",
"index",
"nodeId"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/versioning/VectorClock.java#L233-L237 |
161,056 | voldemort/voldemort | src/java/voldemort/tools/PartitionBalance.java | PartitionBalance.getNodeIdToPrimaryCount | private Map<Integer, Integer> getNodeIdToPrimaryCount(Cluster cluster) {
Map<Integer, Integer> nodeIdToPrimaryCount = Maps.newHashMap();
for(Node node: cluster.getNodes()) {
nodeIdToPrimaryCount.put(node.getId(), node.getPartitionIds().size());
}
return nodeIdToPrimaryCount;... | java | private Map<Integer, Integer> getNodeIdToPrimaryCount(Cluster cluster) {
Map<Integer, Integer> nodeIdToPrimaryCount = Maps.newHashMap();
for(Node node: cluster.getNodes()) {
nodeIdToPrimaryCount.put(node.getId(), node.getPartitionIds().size());
}
return nodeIdToPrimaryCount;... | [
"private",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"getNodeIdToPrimaryCount",
"(",
"Cluster",
"cluster",
")",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"nodeIdToPrimaryCount",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"for",
"(",
"Node",
"n... | Go through all nodes and determine how many partition Ids each node
hosts.
@param cluster
@return map of nodeId to number of primary partitions hosted on node. | [
"Go",
"through",
"all",
"nodes",
"and",
"determine",
"how",
"many",
"partition",
"Ids",
"each",
"node",
"hosts",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/PartitionBalance.java#L180-L187 |
161,057 | voldemort/voldemort | src/java/voldemort/tools/PartitionBalance.java | PartitionBalance.getNodeIdToZonePrimaryCount | private Map<Integer, Integer> getNodeIdToZonePrimaryCount(Cluster cluster,
StoreRoutingPlan storeRoutingPlan) {
Map<Integer, Integer> nodeIdToZonePrimaryCount = Maps.newHashMap();
for(Integer nodeId: cluster.getNodeIds()) {
nodeId... | java | private Map<Integer, Integer> getNodeIdToZonePrimaryCount(Cluster cluster,
StoreRoutingPlan storeRoutingPlan) {
Map<Integer, Integer> nodeIdToZonePrimaryCount = Maps.newHashMap();
for(Integer nodeId: cluster.getNodeIds()) {
nodeId... | [
"private",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"getNodeIdToZonePrimaryCount",
"(",
"Cluster",
"cluster",
",",
"StoreRoutingPlan",
"storeRoutingPlan",
")",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"nodeIdToZonePrimaryCount",
"=",
"Maps",
".",
"newHa... | Go through all partition IDs and determine which node is "first" in the
replicating node list for every zone. This determines the number of
"zone primaries" each node hosts.
@return map of nodeId to number of zone-primaries hosted on node. | [
"Go",
"through",
"all",
"partition",
"IDs",
"and",
"determine",
"which",
"node",
"is",
"first",
"in",
"the",
"replicating",
"node",
"list",
"for",
"every",
"zone",
".",
"This",
"determines",
"the",
"number",
"of",
"zone",
"primaries",
"each",
"node",
"hosts"... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/PartitionBalance.java#L196-L205 |
161,058 | voldemort/voldemort | src/java/voldemort/tools/PartitionBalance.java | PartitionBalance.getNodeIdToNaryCount | private Map<Integer, Integer> getNodeIdToNaryCount(Cluster cluster,
StoreRoutingPlan storeRoutingPlan) {
Map<Integer, Integer> nodeIdToNaryCount = Maps.newHashMap();
for(int nodeId: cluster.getNodeIds()) {
nodeIdToNaryCount.put(nodeId, ... | java | private Map<Integer, Integer> getNodeIdToNaryCount(Cluster cluster,
StoreRoutingPlan storeRoutingPlan) {
Map<Integer, Integer> nodeIdToNaryCount = Maps.newHashMap();
for(int nodeId: cluster.getNodeIds()) {
nodeIdToNaryCount.put(nodeId, ... | [
"private",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"getNodeIdToNaryCount",
"(",
"Cluster",
"cluster",
",",
"StoreRoutingPlan",
"storeRoutingPlan",
")",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"nodeIdToNaryCount",
"=",
"Maps",
".",
"newHashMap",
"(",... | Go through all node IDs and determine which node
@param cluster
@param storeRoutingPlan
@return | [
"Go",
"through",
"all",
"node",
"IDs",
"and",
"determine",
"which",
"node"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/PartitionBalance.java#L214-L223 |
161,059 | voldemort/voldemort | src/java/voldemort/tools/PartitionBalance.java | PartitionBalance.dumpZoneNAryDetails | private String dumpZoneNAryDetails(StoreRoutingPlan storeRoutingPlan) {
StringBuilder sb = new StringBuilder();
sb.append("\tDetailed Dump (Zone N-Aries):").append(Utils.NEWLINE);
for(Node node: storeRoutingPlan.getCluster().getNodes()) {
int zoneId = node.getZoneId();
i... | java | private String dumpZoneNAryDetails(StoreRoutingPlan storeRoutingPlan) {
StringBuilder sb = new StringBuilder();
sb.append("\tDetailed Dump (Zone N-Aries):").append(Utils.NEWLINE);
for(Node node: storeRoutingPlan.getCluster().getNodes()) {
int zoneId = node.getZoneId();
i... | [
"private",
"String",
"dumpZoneNAryDetails",
"(",
"StoreRoutingPlan",
"storeRoutingPlan",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"\\tDetailed Dump (Zone N-Aries):\"",
")",
".",
"append",
"(",
"Utils",
... | Dumps the partition IDs per node in terms of zone n-ary type.
@param cluster
@param storeRoutingPlan
@return pretty printed string of detailed zone n-ary type. | [
"Dumps",
"the",
"partition",
"IDs",
"per",
"node",
"in",
"terms",
"of",
"zone",
"n",
"-",
"ary",
"type",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/PartitionBalance.java#L232-L260 |
161,060 | voldemort/voldemort | src/java/voldemort/tools/PartitionBalance.java | PartitionBalance.summarizeBalance | private Pair<Double, String>
summarizeBalance(final Map<Integer, Integer> nodeIdToPartitionCount, String title) {
StringBuilder builder = new StringBuilder();
builder.append("\n" + title + "\n");
Map<Integer, ZoneBalanceStats> zoneToBalanceStats = new HashMap<Integer, ZoneBalanceSta... | java | private Pair<Double, String>
summarizeBalance(final Map<Integer, Integer> nodeIdToPartitionCount, String title) {
StringBuilder builder = new StringBuilder();
builder.append("\n" + title + "\n");
Map<Integer, ZoneBalanceStats> zoneToBalanceStats = new HashMap<Integer, ZoneBalanceSta... | [
"private",
"Pair",
"<",
"Double",
",",
"String",
">",
"summarizeBalance",
"(",
"final",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"nodeIdToPartitionCount",
",",
"String",
"title",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
... | Summarizes balance for the given nodeId to PartitionCount.
@param nodeIdToPartitionCount
@param title for use in pretty string
@return Pair: getFirst() is utility value to be minimized, getSecond() is
pretty summary string of balance | [
"Summarizes",
"balance",
"for",
"the",
"given",
"nodeId",
"to",
"PartitionCount",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/PartitionBalance.java#L398-L430 |
161,061 | voldemort/voldemort | src/java/voldemort/server/rebalance/async/StealerBasedRebalanceAsyncOperation.java | StealerBasedRebalanceAsyncOperation.rebalanceStore | private void rebalanceStore(String storeName,
final AdminClient adminClient,
RebalanceTaskInfo stealInfo,
boolean isReadOnlyStore) {
// Move partitions
if (stealInfo.getPartitionIds(storeName) != null && stea... | java | private void rebalanceStore(String storeName,
final AdminClient adminClient,
RebalanceTaskInfo stealInfo,
boolean isReadOnlyStore) {
// Move partitions
if (stealInfo.getPartitionIds(storeName) != null && stea... | [
"private",
"void",
"rebalanceStore",
"(",
"String",
"storeName",
",",
"final",
"AdminClient",
"adminClient",
",",
"RebalanceTaskInfo",
"stealInfo",
",",
"boolean",
"isReadOnlyStore",
")",
"{",
"// Move partitions",
"if",
"(",
"stealInfo",
".",
"getPartitionIds",
"(",
... | Blocking function which completes the migration of one store
@param storeName The name of the store
@param adminClient Admin client used to initiate the copying of data
@param stealInfo The steal information
@param isReadOnlyStore Boolean indicating that this is a read-only store | [
"Blocking",
"function",
"which",
"completes",
"the",
"migration",
"of",
"one",
"store"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/rebalance/async/StealerBasedRebalanceAsyncOperation.java#L174-L209 |
161,062 | voldemort/voldemort | src/java/voldemort/store/stats/ClientSocketStats.java | ClientSocketStats.recordSyncOpTimeNs | public void recordSyncOpTimeNs(SocketDestination dest, long opTimeNs) {
if(dest != null) {
getOrCreateNodeStats(dest).recordSyncOpTimeNs(null, opTimeNs);
recordSyncOpTimeNs(null, opTimeNs);
} else {
this.syncOpTimeRequestCounter.addRequest(opTimeNs);
}
} | java | public void recordSyncOpTimeNs(SocketDestination dest, long opTimeNs) {
if(dest != null) {
getOrCreateNodeStats(dest).recordSyncOpTimeNs(null, opTimeNs);
recordSyncOpTimeNs(null, opTimeNs);
} else {
this.syncOpTimeRequestCounter.addRequest(opTimeNs);
}
} | [
"public",
"void",
"recordSyncOpTimeNs",
"(",
"SocketDestination",
"dest",
",",
"long",
"opTimeNs",
")",
"{",
"if",
"(",
"dest",
"!=",
"null",
")",
"{",
"getOrCreateNodeStats",
"(",
"dest",
")",
".",
"recordSyncOpTimeNs",
"(",
"null",
",",
"opTimeNs",
")",
";... | Record operation for sync ops time
@param dest Destination of the socket to connect to. Will actually record
if null. Otherwise will call this on self and corresponding child
with this param null.
@param opTimeUs The number of us for the op to finish | [
"Record",
"operation",
"for",
"sync",
"ops",
"time"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L213-L220 |
161,063 | voldemort/voldemort | src/java/voldemort/store/stats/ClientSocketStats.java | ClientSocketStats.recordAsyncOpTimeNs | public void recordAsyncOpTimeNs(SocketDestination dest, long opTimeNs) {
if(dest != null) {
getOrCreateNodeStats(dest).recordAsyncOpTimeNs(null, opTimeNs);
recordAsyncOpTimeNs(null, opTimeNs);
} else {
this.asynOpTimeRequestCounter.addRequest(opTimeNs);
}
... | java | public void recordAsyncOpTimeNs(SocketDestination dest, long opTimeNs) {
if(dest != null) {
getOrCreateNodeStats(dest).recordAsyncOpTimeNs(null, opTimeNs);
recordAsyncOpTimeNs(null, opTimeNs);
} else {
this.asynOpTimeRequestCounter.addRequest(opTimeNs);
}
... | [
"public",
"void",
"recordAsyncOpTimeNs",
"(",
"SocketDestination",
"dest",
",",
"long",
"opTimeNs",
")",
"{",
"if",
"(",
"dest",
"!=",
"null",
")",
"{",
"getOrCreateNodeStats",
"(",
"dest",
")",
".",
"recordAsyncOpTimeNs",
"(",
"null",
",",
"opTimeNs",
")",
... | Record operation for async ops time
@param dest Destination of the socket to connect to. Will actually record
if null. Otherwise will call this on self and corresponding child
with this param null.
@param opTimeUs The number of us for the op to finish | [
"Record",
"operation",
"for",
"async",
"ops",
"time"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L230-L237 |
161,064 | voldemort/voldemort | src/java/voldemort/store/stats/ClientSocketStats.java | ClientSocketStats.recordConnectionEstablishmentTimeUs | public void recordConnectionEstablishmentTimeUs(SocketDestination dest, long connEstTimeUs) {
if(dest != null) {
getOrCreateNodeStats(dest).recordConnectionEstablishmentTimeUs(null, connEstTimeUs);
recordConnectionEstablishmentTimeUs(null, connEstTimeUs);
} else {
thi... | java | public void recordConnectionEstablishmentTimeUs(SocketDestination dest, long connEstTimeUs) {
if(dest != null) {
getOrCreateNodeStats(dest).recordConnectionEstablishmentTimeUs(null, connEstTimeUs);
recordConnectionEstablishmentTimeUs(null, connEstTimeUs);
} else {
thi... | [
"public",
"void",
"recordConnectionEstablishmentTimeUs",
"(",
"SocketDestination",
"dest",
",",
"long",
"connEstTimeUs",
")",
"{",
"if",
"(",
"dest",
"!=",
"null",
")",
"{",
"getOrCreateNodeStats",
"(",
"dest",
")",
".",
"recordConnectionEstablishmentTimeUs",
"(",
"... | Record the connection establishment time
@param dest Destination of the socket to connect to. Will actually record
if null. Otherwise will call this on self and corresponding child
with this param null.
@param connEstTimeUs The number of us to wait before establishing a
connection | [
"Record",
"the",
"connection",
"establishment",
"time"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L248-L255 |
161,065 | voldemort/voldemort | src/java/voldemort/store/stats/ClientSocketStats.java | ClientSocketStats.recordCheckoutTimeUs | public void recordCheckoutTimeUs(SocketDestination dest, long checkoutTimeUs) {
if(dest != null) {
getOrCreateNodeStats(dest).recordCheckoutTimeUs(null, checkoutTimeUs);
recordCheckoutTimeUs(null, checkoutTimeUs);
} else {
this.checkoutTimeRequestCounter.addRequest(ch... | java | public void recordCheckoutTimeUs(SocketDestination dest, long checkoutTimeUs) {
if(dest != null) {
getOrCreateNodeStats(dest).recordCheckoutTimeUs(null, checkoutTimeUs);
recordCheckoutTimeUs(null, checkoutTimeUs);
} else {
this.checkoutTimeRequestCounter.addRequest(ch... | [
"public",
"void",
"recordCheckoutTimeUs",
"(",
"SocketDestination",
"dest",
",",
"long",
"checkoutTimeUs",
")",
"{",
"if",
"(",
"dest",
"!=",
"null",
")",
"{",
"getOrCreateNodeStats",
"(",
"dest",
")",
".",
"recordCheckoutTimeUs",
"(",
"null",
",",
"checkoutTime... | Record the checkout wait time in us
@param dest Destination of the socket to checkout. Will actually record
if null. Otherwise will call this on self and corresponding child
with this param null.
@param checkoutTimeUs The number of us to wait before getting a socket | [
"Record",
"the",
"checkout",
"wait",
"time",
"in",
"us"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L265-L272 |
161,066 | voldemort/voldemort | src/java/voldemort/store/stats/ClientSocketStats.java | ClientSocketStats.recordCheckoutQueueLength | public void recordCheckoutQueueLength(SocketDestination dest, int queueLength) {
if(dest != null) {
getOrCreateNodeStats(dest).recordCheckoutQueueLength(null, queueLength);
recordCheckoutQueueLength(null, queueLength);
} else {
this.checkoutQueueLengthHistogram.insert... | java | public void recordCheckoutQueueLength(SocketDestination dest, int queueLength) {
if(dest != null) {
getOrCreateNodeStats(dest).recordCheckoutQueueLength(null, queueLength);
recordCheckoutQueueLength(null, queueLength);
} else {
this.checkoutQueueLengthHistogram.insert... | [
"public",
"void",
"recordCheckoutQueueLength",
"(",
"SocketDestination",
"dest",
",",
"int",
"queueLength",
")",
"{",
"if",
"(",
"dest",
"!=",
"null",
")",
"{",
"getOrCreateNodeStats",
"(",
"dest",
")",
".",
"recordCheckoutQueueLength",
"(",
"null",
",",
"queueL... | Record the checkout queue length
@param dest Destination of the socket to checkout. Will actually record
if null. Otherwise will call this on self and corresponding child
with this param null.
@param queueLength The number of entries in the "synchronous" checkout
queue. | [
"Record",
"the",
"checkout",
"queue",
"length"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L283-L291 |
161,067 | voldemort/voldemort | src/java/voldemort/store/stats/ClientSocketStats.java | ClientSocketStats.recordResourceRequestTimeUs | public void recordResourceRequestTimeUs(SocketDestination dest, long resourceRequestTimeUs) {
if(dest != null) {
getOrCreateNodeStats(dest).recordResourceRequestTimeUs(null, resourceRequestTimeUs);
recordResourceRequestTimeUs(null, resourceRequestTimeUs);
} else {
thi... | java | public void recordResourceRequestTimeUs(SocketDestination dest, long resourceRequestTimeUs) {
if(dest != null) {
getOrCreateNodeStats(dest).recordResourceRequestTimeUs(null, resourceRequestTimeUs);
recordResourceRequestTimeUs(null, resourceRequestTimeUs);
} else {
thi... | [
"public",
"void",
"recordResourceRequestTimeUs",
"(",
"SocketDestination",
"dest",
",",
"long",
"resourceRequestTimeUs",
")",
"{",
"if",
"(",
"dest",
"!=",
"null",
")",
"{",
"getOrCreateNodeStats",
"(",
"dest",
")",
".",
"recordResourceRequestTimeUs",
"(",
"null",
... | Record the resource request wait time in us
@param dest Destination of the socket for which the resource was
requested. Will actually record if null. Otherwise will call this
on self and corresponding child with this param null.
@param resourceRequestTimeUs The number of us to wait before getting a
socket | [
"Record",
"the",
"resource",
"request",
"wait",
"time",
"in",
"us"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L302-L310 |
161,068 | voldemort/voldemort | src/java/voldemort/store/stats/ClientSocketStats.java | ClientSocketStats.recordResourceRequestQueueLength | public void recordResourceRequestQueueLength(SocketDestination dest, int queueLength) {
if(dest != null) {
getOrCreateNodeStats(dest).recordResourceRequestQueueLength(null, queueLength);
recordResourceRequestQueueLength(null, queueLength);
} else {
this.resourceReques... | java | public void recordResourceRequestQueueLength(SocketDestination dest, int queueLength) {
if(dest != null) {
getOrCreateNodeStats(dest).recordResourceRequestQueueLength(null, queueLength);
recordResourceRequestQueueLength(null, queueLength);
} else {
this.resourceReques... | [
"public",
"void",
"recordResourceRequestQueueLength",
"(",
"SocketDestination",
"dest",
",",
"int",
"queueLength",
")",
"{",
"if",
"(",
"dest",
"!=",
"null",
")",
"{",
"getOrCreateNodeStats",
"(",
"dest",
")",
".",
"recordResourceRequestQueueLength",
"(",
"null",
... | Record the resource request queue length
@param dest Destination of the socket for which resource request is
enqueued. Will actually record if null. Otherwise will call this
on self and corresponding child with this param null.
@param queueLength The number of entries in the "asynchronous" resource
request queue. | [
"Record",
"the",
"resource",
"request",
"queue",
"length"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L321-L329 |
161,069 | voldemort/voldemort | src/java/voldemort/store/stats/ClientSocketStats.java | ClientSocketStats.close | public void close() {
Iterator<SocketDestination> it = getStatsMap().keySet().iterator();
while(it.hasNext()) {
try {
SocketDestination destination = it.next();
JmxUtils.unregisterMbean(JmxUtils.createObjectName(JmxUtils.getPackageName(ClientRequestExecutor.cl... | java | public void close() {
Iterator<SocketDestination> it = getStatsMap().keySet().iterator();
while(it.hasNext()) {
try {
SocketDestination destination = it.next();
JmxUtils.unregisterMbean(JmxUtils.createObjectName(JmxUtils.getPackageName(ClientRequestExecutor.cl... | [
"public",
"void",
"close",
"(",
")",
"{",
"Iterator",
"<",
"SocketDestination",
">",
"it",
"=",
"getStatsMap",
"(",
")",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"try",
"{",
... | Unregister all MBeans | [
"Unregister",
"all",
"MBeans"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L504-L517 |
161,070 | voldemort/voldemort | src/java/voldemort/store/socket/SocketStore.java | SocketStore.request | private <T> T request(ClientRequest<T> delegate, String operationName) {
long startTimeMs = -1;
long startTimeNs = -1;
if(logger.isDebugEnabled()) {
startTimeMs = System.currentTimeMillis();
}
ClientRequestExecutor clientRequestExecutor = pool.checkout(destination);
... | java | private <T> T request(ClientRequest<T> delegate, String operationName) {
long startTimeMs = -1;
long startTimeNs = -1;
if(logger.isDebugEnabled()) {
startTimeMs = System.currentTimeMillis();
}
ClientRequestExecutor clientRequestExecutor = pool.checkout(destination);
... | [
"private",
"<",
"T",
">",
"T",
"request",
"(",
"ClientRequest",
"<",
"T",
">",
"delegate",
",",
"String",
"operationName",
")",
"{",
"long",
"startTimeMs",
"=",
"-",
"1",
";",
"long",
"startTimeNs",
"=",
"-",
"1",
";",
"if",
"(",
"logger",
".",
"isDe... | This method handles submitting and then waiting for the request from the
server. It uses the ClientRequest API to actually write the request and
then read back the response. This implementation will block for a
response from the server.
@param <T> Return type
@param clientRequest ClientRequest implementation used to ... | [
"This",
"method",
"handles",
"submitting",
"and",
"then",
"waiting",
"for",
"the",
"request",
"from",
"the",
"server",
".",
"It",
"uses",
"the",
"ClientRequest",
"API",
"to",
"actually",
"write",
"the",
"request",
"and",
"then",
"read",
"back",
"the",
"respo... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/socket/SocketStore.java#L271-L349 |
161,071 | voldemort/voldemort | src/java/voldemort/store/socket/SocketStore.java | SocketStore.requestAsync | private <T> void requestAsync(ClientRequest<T> delegate,
NonblockingStoreCallback callback,
long timeoutMs,
String operationName) {
pool.submitAsync(this.destination, delegate, callback, timeoutMs, operationNam... | java | private <T> void requestAsync(ClientRequest<T> delegate,
NonblockingStoreCallback callback,
long timeoutMs,
String operationName) {
pool.submitAsync(this.destination, delegate, callback, timeoutMs, operationNam... | [
"private",
"<",
"T",
">",
"void",
"requestAsync",
"(",
"ClientRequest",
"<",
"T",
">",
"delegate",
",",
"NonblockingStoreCallback",
"callback",
",",
"long",
"timeoutMs",
",",
"String",
"operationName",
")",
"{",
"pool",
".",
"submitAsync",
"(",
"this",
".",
... | This method handles submitting and then waiting for the request from the
server. It uses the ClientRequest API to actually write the request and
then read back the response. This implementation will not block for a
response from the server.
@param <T> Return type
@param clientRequest ClientRequest implementation used... | [
"This",
"method",
"handles",
"submitting",
"and",
"then",
"waiting",
"for",
"the",
"request",
"from",
"the",
"server",
".",
"It",
"uses",
"the",
"ClientRequest",
"API",
"to",
"actually",
"write",
"the",
"request",
"and",
"then",
"read",
"back",
"the",
"respo... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/socket/SocketStore.java#L366-L371 |
161,072 | voldemort/voldemort | src/java/voldemort/store/stats/StreamingStats.java | StreamingStats.getAvgFetchKeysNetworkTimeMs | @JmxGetter(name = "avgFetchKeysNetworkTimeMs", description = "average time spent on network, for fetch keys")
public double getAvgFetchKeysNetworkTimeMs() {
return networkTimeCounterMap.get(Operation.FETCH_KEYS).getAvgEventValue() / Time.NS_PER_MS;
} | java | @JmxGetter(name = "avgFetchKeysNetworkTimeMs", description = "average time spent on network, for fetch keys")
public double getAvgFetchKeysNetworkTimeMs() {
return networkTimeCounterMap.get(Operation.FETCH_KEYS).getAvgEventValue() / Time.NS_PER_MS;
} | [
"@",
"JmxGetter",
"(",
"name",
"=",
"\"avgFetchKeysNetworkTimeMs\"",
",",
"description",
"=",
"\"average time spent on network, for fetch keys\"",
")",
"public",
"double",
"getAvgFetchKeysNetworkTimeMs",
"(",
")",
"{",
"return",
"networkTimeCounterMap",
".",
"get",
"(",
"... | Mbeans for FETCH_KEYS | [
"Mbeans",
"for",
"FETCH_KEYS"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StreamingStats.java#L118-L121 |
161,073 | voldemort/voldemort | src/java/voldemort/store/stats/StreamingStats.java | StreamingStats.getAvgFetchEntriesNetworkTimeMs | @JmxGetter(name = "avgFetchEntriesNetworkTimeMs", description = "average time spent on network, for streaming operations")
public double getAvgFetchEntriesNetworkTimeMs() {
return networkTimeCounterMap.get(Operation.FETCH_ENTRIES).getAvgEventValue()
/ Time.NS_PER_MS;
} | java | @JmxGetter(name = "avgFetchEntriesNetworkTimeMs", description = "average time spent on network, for streaming operations")
public double getAvgFetchEntriesNetworkTimeMs() {
return networkTimeCounterMap.get(Operation.FETCH_ENTRIES).getAvgEventValue()
/ Time.NS_PER_MS;
} | [
"@",
"JmxGetter",
"(",
"name",
"=",
"\"avgFetchEntriesNetworkTimeMs\"",
",",
"description",
"=",
"\"average time spent on network, for streaming operations\"",
")",
"public",
"double",
"getAvgFetchEntriesNetworkTimeMs",
"(",
")",
"{",
"return",
"networkTimeCounterMap",
".",
"... | Mbeans for FETCH_ENTRIES | [
"Mbeans",
"for",
"FETCH_ENTRIES"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StreamingStats.java#L139-L143 |
161,074 | voldemort/voldemort | src/java/voldemort/store/stats/StreamingStats.java | StreamingStats.getAvgUpdateEntriesNetworkTimeMs | @JmxGetter(name = "avgUpdateEntriesNetworkTimeMs", description = "average time spent on network, for streaming operations")
public double getAvgUpdateEntriesNetworkTimeMs() {
return networkTimeCounterMap.get(Operation.UPDATE_ENTRIES).getAvgEventValue()
/ Time.NS_PER_MS;
} | java | @JmxGetter(name = "avgUpdateEntriesNetworkTimeMs", description = "average time spent on network, for streaming operations")
public double getAvgUpdateEntriesNetworkTimeMs() {
return networkTimeCounterMap.get(Operation.UPDATE_ENTRIES).getAvgEventValue()
/ Time.NS_PER_MS;
} | [
"@",
"JmxGetter",
"(",
"name",
"=",
"\"avgUpdateEntriesNetworkTimeMs\"",
",",
"description",
"=",
"\"average time spent on network, for streaming operations\"",
")",
"public",
"double",
"getAvgUpdateEntriesNetworkTimeMs",
"(",
")",
"{",
"return",
"networkTimeCounterMap",
".",
... | Mbeans for UPDATE_ENTRIES | [
"Mbeans",
"for",
"UPDATE_ENTRIES"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StreamingStats.java#L168-L172 |
161,075 | voldemort/voldemort | src/java/voldemort/store/stats/StreamingStats.java | StreamingStats.getAvgSlopUpdateNetworkTimeMs | @JmxGetter(name = "avgSlopUpdateNetworkTimeMs", description = "average time spent on network, for streaming operations")
public double getAvgSlopUpdateNetworkTimeMs() {
return networkTimeCounterMap.get(Operation.SLOP_UPDATE).getAvgEventValue() / Time.NS_PER_MS;
} | java | @JmxGetter(name = "avgSlopUpdateNetworkTimeMs", description = "average time spent on network, for streaming operations")
public double getAvgSlopUpdateNetworkTimeMs() {
return networkTimeCounterMap.get(Operation.SLOP_UPDATE).getAvgEventValue() / Time.NS_PER_MS;
} | [
"@",
"JmxGetter",
"(",
"name",
"=",
"\"avgSlopUpdateNetworkTimeMs\"",
",",
"description",
"=",
"\"average time spent on network, for streaming operations\"",
")",
"public",
"double",
"getAvgSlopUpdateNetworkTimeMs",
"(",
")",
"{",
"return",
"networkTimeCounterMap",
".",
"get"... | Mbeans for SLOP_UPDATE | [
"Mbeans",
"for",
"SLOP_UPDATE"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StreamingStats.java#L186-L189 |
161,076 | voldemort/voldemort | src/java/voldemort/serialization/SerializationUtils.java | SerializationUtils.getJavaClassFromSchemaInfo | public static String getJavaClassFromSchemaInfo(String schemaInfo) {
final String ONLY_JAVA_CLIENTS_SUPPORTED = "Only Java clients are supported currently, so the format of the schema-info should be: <schema-info>java=foo.Bar</schema-info> where foo.Bar is the fully qualified name of the message.";
if(... | java | public static String getJavaClassFromSchemaInfo(String schemaInfo) {
final String ONLY_JAVA_CLIENTS_SUPPORTED = "Only Java clients are supported currently, so the format of the schema-info should be: <schema-info>java=foo.Bar</schema-info> where foo.Bar is the fully qualified name of the message.";
if(... | [
"public",
"static",
"String",
"getJavaClassFromSchemaInfo",
"(",
"String",
"schemaInfo",
")",
"{",
"final",
"String",
"ONLY_JAVA_CLIENTS_SUPPORTED",
"=",
"\"Only Java clients are supported currently, so the format of the schema-info should be: <schema-info>java=foo.Bar</schema-info> where ... | Extracts the java class name from the schema info
@param schemaInfo the schema info, a string like: java=java.lang.String
@return the name of the class extracted from the schema info | [
"Extracts",
"the",
"java",
"class",
"name",
"from",
"the",
"schema",
"info"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/serialization/SerializationUtils.java#L35-L50 |
161,077 | voldemort/voldemort | src/java/voldemort/utils/StoreDefinitionUtils.java | StoreDefinitionUtils.filterStores | public static List<StoreDefinition> filterStores(List<StoreDefinition> storeDefs,
final boolean isReadOnly) {
List<StoreDefinition> filteredStores = Lists.newArrayList();
for(StoreDefinition storeDef: storeDefs) {
if(storeDef.getType().equ... | java | public static List<StoreDefinition> filterStores(List<StoreDefinition> storeDefs,
final boolean isReadOnly) {
List<StoreDefinition> filteredStores = Lists.newArrayList();
for(StoreDefinition storeDef: storeDefs) {
if(storeDef.getType().equ... | [
"public",
"static",
"List",
"<",
"StoreDefinition",
">",
"filterStores",
"(",
"List",
"<",
"StoreDefinition",
">",
"storeDefs",
",",
"final",
"boolean",
"isReadOnly",
")",
"{",
"List",
"<",
"StoreDefinition",
">",
"filteredStores",
"=",
"Lists",
".",
"newArrayLi... | Given a list of store definitions, filters the list depending on the
boolean
@param storeDefs Complete list of store definitions
@param isReadOnly Boolean indicating whether filter on read-only or not?
@return List of filtered store definition | [
"Given",
"a",
"list",
"of",
"store",
"definitions",
"filters",
"the",
"list",
"depending",
"on",
"the",
"boolean"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L57-L66 |
161,078 | voldemort/voldemort | src/java/voldemort/utils/StoreDefinitionUtils.java | StoreDefinitionUtils.getStoreNames | public static List<String> getStoreNames(List<StoreDefinition> storeDefList) {
List<String> storeList = new ArrayList<String>();
for(StoreDefinition def: storeDefList) {
storeList.add(def.getName());
}
return storeList;
} | java | public static List<String> getStoreNames(List<StoreDefinition> storeDefList) {
List<String> storeList = new ArrayList<String>();
for(StoreDefinition def: storeDefList) {
storeList.add(def.getName());
}
return storeList;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getStoreNames",
"(",
"List",
"<",
"StoreDefinition",
">",
"storeDefList",
")",
"{",
"List",
"<",
"String",
">",
"storeList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"StoreDe... | Given a list of store definitions return a list of store names
@param storeDefList The list of store definitions
@return Returns a list of store names | [
"Given",
"a",
"list",
"of",
"store",
"definitions",
"return",
"a",
"list",
"of",
"store",
"names"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L74-L80 |
161,079 | voldemort/voldemort | src/java/voldemort/utils/StoreDefinitionUtils.java | StoreDefinitionUtils.getStoreNamesSet | public static Set<String> getStoreNamesSet(List<StoreDefinition> storeDefList) {
HashSet<String> storeSet = new HashSet<String>();
for(StoreDefinition def: storeDefList) {
storeSet.add(def.getName());
}
return storeSet;
} | java | public static Set<String> getStoreNamesSet(List<StoreDefinition> storeDefList) {
HashSet<String> storeSet = new HashSet<String>();
for(StoreDefinition def: storeDefList) {
storeSet.add(def.getName());
}
return storeSet;
} | [
"public",
"static",
"Set",
"<",
"String",
">",
"getStoreNamesSet",
"(",
"List",
"<",
"StoreDefinition",
">",
"storeDefList",
")",
"{",
"HashSet",
"<",
"String",
">",
"storeSet",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"Store... | Given a list of store definitions return a set of store names
@param storeDefList The list of store definitions
@return Returns a set of store names | [
"Given",
"a",
"list",
"of",
"store",
"definitions",
"return",
"a",
"set",
"of",
"store",
"names"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L88-L94 |
161,080 | voldemort/voldemort | src/java/voldemort/utils/StoreDefinitionUtils.java | StoreDefinitionUtils.getUniqueStoreDefinitionsWithCounts | public static HashMap<StoreDefinition, Integer> getUniqueStoreDefinitionsWithCounts(List<StoreDefinition> storeDefs) {
HashMap<StoreDefinition, Integer> uniqueStoreDefs = Maps.newHashMap();
for(StoreDefinition storeDef: storeDefs) {
if(uniqueStoreDefs.isEmpty()) {
uniqueStor... | java | public static HashMap<StoreDefinition, Integer> getUniqueStoreDefinitionsWithCounts(List<StoreDefinition> storeDefs) {
HashMap<StoreDefinition, Integer> uniqueStoreDefs = Maps.newHashMap();
for(StoreDefinition storeDef: storeDefs) {
if(uniqueStoreDefs.isEmpty()) {
uniqueStor... | [
"public",
"static",
"HashMap",
"<",
"StoreDefinition",
",",
"Integer",
">",
"getUniqueStoreDefinitionsWithCounts",
"(",
"List",
"<",
"StoreDefinition",
">",
"storeDefs",
")",
"{",
"HashMap",
"<",
"StoreDefinition",
",",
"Integer",
">",
"uniqueStoreDefs",
"=",
"Maps"... | Given a list of store definitions, find out and return a map of similar
store definitions + count of them
@param storeDefs All store definitions
@return Map of a unique store definition + counts | [
"Given",
"a",
"list",
"of",
"store",
"definitions",
"find",
"out",
"and",
"return",
"a",
"map",
"of",
"similar",
"store",
"definitions",
"+",
"count",
"of",
"them"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L127-L178 |
161,081 | voldemort/voldemort | src/java/voldemort/utils/StoreDefinitionUtils.java | StoreDefinitionUtils.isAvroSchema | public static boolean isAvroSchema(String serializerName) {
if(serializerName.equals(AVRO_GENERIC_VERSIONED_TYPE_NAME)
|| serializerName.equals(AVRO_GENERIC_TYPE_NAME)
|| serializerName.equals(AVRO_REFLECTIVE_TYPE_NAME)
|| serializerName.equals(AVRO_SPECIFIC_TYPE_NAME)) {
... | java | public static boolean isAvroSchema(String serializerName) {
if(serializerName.equals(AVRO_GENERIC_VERSIONED_TYPE_NAME)
|| serializerName.equals(AVRO_GENERIC_TYPE_NAME)
|| serializerName.equals(AVRO_REFLECTIVE_TYPE_NAME)
|| serializerName.equals(AVRO_SPECIFIC_TYPE_NAME)) {
... | [
"public",
"static",
"boolean",
"isAvroSchema",
"(",
"String",
"serializerName",
")",
"{",
"if",
"(",
"serializerName",
".",
"equals",
"(",
"AVRO_GENERIC_VERSIONED_TYPE_NAME",
")",
"||",
"serializerName",
".",
"equals",
"(",
"AVRO_GENERIC_TYPE_NAME",
")",
"||",
"seri... | Determine whether or not a given serializedr is "AVRO" based
@param serializerName
@return | [
"Determine",
"whether",
"or",
"not",
"a",
"given",
"serializedr",
"is",
"AVRO",
"based"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L186-L195 |
161,082 | voldemort/voldemort | src/java/voldemort/utils/StoreDefinitionUtils.java | StoreDefinitionUtils.validateIfAvroSchema | private static void validateIfAvroSchema(SerializerDefinition serializerDef) {
if(serializerDef.getName().equals(AVRO_GENERIC_VERSIONED_TYPE_NAME)
|| serializerDef.getName().equals(AVRO_GENERIC_TYPE_NAME)) {
SchemaEvolutionValidator.validateAllAvroSchemas(serializerDef);
// ch... | java | private static void validateIfAvroSchema(SerializerDefinition serializerDef) {
if(serializerDef.getName().equals(AVRO_GENERIC_VERSIONED_TYPE_NAME)
|| serializerDef.getName().equals(AVRO_GENERIC_TYPE_NAME)) {
SchemaEvolutionValidator.validateAllAvroSchemas(serializerDef);
// ch... | [
"private",
"static",
"void",
"validateIfAvroSchema",
"(",
"SerializerDefinition",
"serializerDef",
")",
"{",
"if",
"(",
"serializerDef",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"AVRO_GENERIC_VERSIONED_TYPE_NAME",
")",
"||",
"serializerDef",
".",
"getName",
"("... | If provided with an AVRO schema, validates it and checks if there are
backwards compatible.
TODO should probably place some similar checks for other serializer types
as well?
@param serializerDef | [
"If",
"provided",
"with",
"an",
"AVRO",
"schema",
"validates",
"it",
"and",
"checks",
"if",
"there",
"are",
"backwards",
"compatible",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L206-L215 |
161,083 | voldemort/voldemort | src/java/voldemort/store/stats/Histogram.java | Histogram.insert | public synchronized void insert(long data) {
resetIfNeeded();
long index = 0;
if(data >= this.upperBound) {
index = nBuckets - 1;
} else if(data < 0) {
logger.error(data + " can't be bucketed because it is negative!");
return;
} else {
... | java | public synchronized void insert(long data) {
resetIfNeeded();
long index = 0;
if(data >= this.upperBound) {
index = nBuckets - 1;
} else if(data < 0) {
logger.error(data + " can't be bucketed because it is negative!");
return;
} else {
... | [
"public",
"synchronized",
"void",
"insert",
"(",
"long",
"data",
")",
"{",
"resetIfNeeded",
"(",
")",
";",
"long",
"index",
"=",
"0",
";",
"if",
"(",
"data",
">=",
"this",
".",
"upperBound",
")",
"{",
"index",
"=",
"nBuckets",
"-",
"1",
";",
"}",
"... | Insert a value into the right bucket of the histogram. If the value is
larger than any bound, insert into the last bucket. If the value is less
than zero, then ignore it.
@param data The value to insert into the histogram | [
"Insert",
"a",
"value",
"into",
"the",
"right",
"bucket",
"of",
"the",
"histogram",
".",
"If",
"the",
"value",
"is",
"larger",
"than",
"any",
"bound",
"insert",
"into",
"the",
"last",
"bucket",
".",
"If",
"the",
"value",
"is",
"less",
"than",
"zero",
"... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/Histogram.java#L101-L121 |
161,084 | voldemort/voldemort | src/java/voldemort/store/rebalancing/RebootstrappingStore.java | RebootstrappingStore.checkAndAddNodeStore | private void checkAndAddNodeStore() {
for(Node node: metadata.getCluster().getNodes()) {
if(!routedStore.getInnerStores().containsKey(node.getId())) {
if(!storeRepository.hasNodeStore(getName(), node.getId())) {
storeRepository.addNodeStore(node.getId(), createNod... | java | private void checkAndAddNodeStore() {
for(Node node: metadata.getCluster().getNodes()) {
if(!routedStore.getInnerStores().containsKey(node.getId())) {
if(!storeRepository.hasNodeStore(getName(), node.getId())) {
storeRepository.addNodeStore(node.getId(), createNod... | [
"private",
"void",
"checkAndAddNodeStore",
"(",
")",
"{",
"for",
"(",
"Node",
"node",
":",
"metadata",
".",
"getCluster",
"(",
")",
".",
"getNodes",
"(",
")",
")",
"{",
"if",
"(",
"!",
"routedStore",
".",
"getInnerStores",
"(",
")",
".",
"containsKey",
... | Check that all nodes in the new cluster have a corresponding entry in
storeRepository and innerStores. add a NodeStore if not present, is
needed as with rebalancing we can add new nodes on the fly. | [
"Check",
"that",
"all",
"nodes",
"in",
"the",
"new",
"cluster",
"have",
"a",
"corresponding",
"entry",
"in",
"storeRepository",
"and",
"innerStores",
".",
"add",
"a",
"NodeStore",
"if",
"not",
"present",
"is",
"needed",
"as",
"with",
"rebalancing",
"we",
"ca... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/rebalancing/RebootstrappingStore.java#L93-L104 |
161,085 | voldemort/voldemort | src/java/voldemort/utils/pool/ResourcePoolConfig.java | ResourcePoolConfig.setTimeout | public ResourcePoolConfig setTimeout(long timeout, TimeUnit unit) {
if(timeout < 0)
throw new IllegalArgumentException("The timeout must be a non-negative number.");
this.timeoutNs = TimeUnit.NANOSECONDS.convert(timeout, unit);
return this;
} | java | public ResourcePoolConfig setTimeout(long timeout, TimeUnit unit) {
if(timeout < 0)
throw new IllegalArgumentException("The timeout must be a non-negative number.");
this.timeoutNs = TimeUnit.NANOSECONDS.convert(timeout, unit);
return this;
} | [
"public",
"ResourcePoolConfig",
"setTimeout",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"timeout",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The timeout must be a non-negative number.\"",
")",
";",
"this",
".",
... | The timeout which we block for when a resource is not available
@param timeout The timeout
@param unit The units of the timeout | [
"The",
"timeout",
"which",
"we",
"block",
"for",
"when",
"a",
"resource",
"is",
"not",
"available"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/ResourcePoolConfig.java#L59-L64 |
161,086 | voldemort/voldemort | contrib/krati/src/java/voldemort/store/krati/KratiStorageEngine.java | KratiStorageEngine.assembleValues | private byte[] assembleValues(List<Versioned<byte[]>> values) throws IOException {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
DataOutputStream dataStream = new DataOutputStream(stream);
for(Versioned<byte[]> value: values) {
byte[] object = value.getValue();
... | java | private byte[] assembleValues(List<Versioned<byte[]>> values) throws IOException {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
DataOutputStream dataStream = new DataOutputStream(stream);
for(Versioned<byte[]> value: values) {
byte[] object = value.getValue();
... | [
"private",
"byte",
"[",
"]",
"assembleValues",
"(",
"List",
"<",
"Versioned",
"<",
"byte",
"[",
"]",
">",
">",
"values",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"stream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"DataOutputStream... | Store the versioned values
@param values list of versioned bytes
@return the list of versioned values rolled into an array of bytes | [
"Store",
"the",
"versioned",
"values"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/krati/src/java/voldemort/store/krati/KratiStorageEngine.java#L266-L282 |
161,087 | voldemort/voldemort | contrib/krati/src/java/voldemort/store/krati/KratiStorageEngine.java | KratiStorageEngine.disassembleValues | private List<Versioned<byte[]>> disassembleValues(byte[] values) throws IOException {
if(values == null)
return new ArrayList<Versioned<byte[]>>(0);
List<Versioned<byte[]>> returnList = new ArrayList<Versioned<byte[]>>();
ByteArrayInputStream stream = new ByteArrayInputStream(value... | java | private List<Versioned<byte[]>> disassembleValues(byte[] values) throws IOException {
if(values == null)
return new ArrayList<Versioned<byte[]>>(0);
List<Versioned<byte[]>> returnList = new ArrayList<Versioned<byte[]>>();
ByteArrayInputStream stream = new ByteArrayInputStream(value... | [
"private",
"List",
"<",
"Versioned",
"<",
"byte",
"[",
"]",
">",
">",
"disassembleValues",
"(",
"byte",
"[",
"]",
"values",
")",
"throws",
"IOException",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"return",
"new",
"ArrayList",
"<",
"Versioned",
"<",
... | Splits up value into multiple versioned values
@param value
@return
@throws IOException | [
"Splits",
"up",
"value",
"into",
"multiple",
"versioned",
"values"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/krati/src/java/voldemort/store/krati/KratiStorageEngine.java#L291-L312 |
161,088 | voldemort/voldemort | src/java/voldemort/server/protocol/admin/PartitionScanFetchStreamRequestHandler.java | PartitionScanFetchStreamRequestHandler.statusInfoMessage | protected void statusInfoMessage(final String tag) {
if(logger.isInfoEnabled()) {
logger.info(tag + " : [partition: " + currentPartition + ", partitionFetched: "
+ currentPartitionFetched
+ "] for store " + storageEngine.getName());
}
} | java | protected void statusInfoMessage(final String tag) {
if(logger.isInfoEnabled()) {
logger.info(tag + " : [partition: " + currentPartition + ", partitionFetched: "
+ currentPartitionFetched
+ "] for store " + storageEngine.getName());
}
} | [
"protected",
"void",
"statusInfoMessage",
"(",
"final",
"String",
"tag",
")",
"{",
"if",
"(",
"logger",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"logger",
".",
"info",
"(",
"tag",
"+",
"\" : [partition: \"",
"+",
"currentPartition",
"+",
"\", partitionFetched... | Simple info message for status
@param tag Message to print out at start of info message | [
"Simple",
"info",
"message",
"for",
"status"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/PartitionScanFetchStreamRequestHandler.java#L75-L81 |
161,089 | voldemort/voldemort | src/java/voldemort/server/scheduler/slop/StreamingSlopPusherJob.java | StreamingSlopPusherJob.slopSize | private int slopSize(Versioned<Slop> slopVersioned) {
int nBytes = 0;
Slop slop = slopVersioned.getValue();
nBytes += slop.getKey().length();
nBytes += ((VectorClock) slopVersioned.getVersion()).sizeInBytes();
switch(slop.getOperation()) {
case PUT: {
... | java | private int slopSize(Versioned<Slop> slopVersioned) {
int nBytes = 0;
Slop slop = slopVersioned.getValue();
nBytes += slop.getKey().length();
nBytes += ((VectorClock) slopVersioned.getVersion()).sizeInBytes();
switch(slop.getOperation()) {
case PUT: {
... | [
"private",
"int",
"slopSize",
"(",
"Versioned",
"<",
"Slop",
">",
"slopVersioned",
")",
"{",
"int",
"nBytes",
"=",
"0",
";",
"Slop",
"slop",
"=",
"slopVersioned",
".",
"getValue",
"(",
")",
";",
"nBytes",
"+=",
"slop",
".",
"getKey",
"(",
")",
".",
"... | Returns the approximate size of slop to help in throttling
@param slopVersioned The versioned slop whose size we want
@return Size in bytes | [
"Returns",
"the",
"approximate",
"size",
"of",
"slop",
"to",
"help",
"in",
"throttling"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/scheduler/slop/StreamingSlopPusherJob.java#L328-L345 |
161,090 | voldemort/voldemort | contrib/restclient/src/java/voldemort/restclient/RESTClientFactory.java | RESTClientFactory.getStoreClient | @Override
public <K, V> StoreClient<K, V> getStoreClient(final String storeName,
final InconsistencyResolver<Versioned<V>> resolver) {
// wrap it in LazyStoreClient here so any direct calls to this method
// returns a lazy client
return new ... | java | @Override
public <K, V> StoreClient<K, V> getStoreClient(final String storeName,
final InconsistencyResolver<Versioned<V>> resolver) {
// wrap it in LazyStoreClient here so any direct calls to this method
// returns a lazy client
return new ... | [
"@",
"Override",
"public",
"<",
"K",
",",
"V",
">",
"StoreClient",
"<",
"K",
",",
"V",
">",
"getStoreClient",
"(",
"final",
"String",
"storeName",
",",
"final",
"InconsistencyResolver",
"<",
"Versioned",
"<",
"V",
">",
">",
"resolver",
")",
"{",
"// wrap... | Creates a REST client used to perform Voldemort operations against the
Coordinator
@param storeName Name of the store to perform the operations on
@param resolver Custom resolver as specified by the application
@return | [
"Creates",
"a",
"REST",
"client",
"used",
"to",
"perform",
"Voldemort",
"operations",
"against",
"the",
"Coordinator"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/restclient/src/java/voldemort/restclient/RESTClientFactory.java#L105-L118 |
161,091 | voldemort/voldemort | src/java/voldemort/routing/ConsistentRoutingStrategy.java | ConsistentRoutingStrategy.abs | private static int abs(int a) {
if(a >= 0)
return a;
else if(a != Integer.MIN_VALUE)
return -a;
return Integer.MAX_VALUE;
} | java | private static int abs(int a) {
if(a >= 0)
return a;
else if(a != Integer.MIN_VALUE)
return -a;
return Integer.MAX_VALUE;
} | [
"private",
"static",
"int",
"abs",
"(",
"int",
"a",
")",
"{",
"if",
"(",
"a",
">=",
"0",
")",
"return",
"a",
";",
"else",
"if",
"(",
"a",
"!=",
"Integer",
".",
"MIN_VALUE",
")",
"return",
"-",
"a",
";",
"return",
"Integer",
".",
"MAX_VALUE",
";",... | A modified version of abs that always returns a non-negative value.
Math.abs returns Integer.MIN_VALUE if a == Integer.MIN_VALUE and this
method returns Integer.MAX_VALUE in that case. | [
"A",
"modified",
"version",
"of",
"abs",
"that",
"always",
"returns",
"a",
"non",
"-",
"negative",
"value",
".",
"Math",
".",
"abs",
"returns",
"Integer",
".",
"MIN_VALUE",
"if",
"a",
"==",
"Integer",
".",
"MIN_VALUE",
"and",
"this",
"method",
"returns",
... | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/ConsistentRoutingStrategy.java#L106-L112 |
161,092 | voldemort/voldemort | src/java/voldemort/routing/ConsistentRoutingStrategy.java | ConsistentRoutingStrategy.getMasterPartition | @Override
public Integer getMasterPartition(byte[] key) {
return abs(hash.hash(key)) % (Math.max(1, this.partitionToNode.length));
} | java | @Override
public Integer getMasterPartition(byte[] key) {
return abs(hash.hash(key)) % (Math.max(1, this.partitionToNode.length));
} | [
"@",
"Override",
"public",
"Integer",
"getMasterPartition",
"(",
"byte",
"[",
"]",
"key",
")",
"{",
"return",
"abs",
"(",
"hash",
".",
"hash",
"(",
"key",
")",
")",
"%",
"(",
"Math",
".",
"max",
"(",
"1",
",",
"this",
".",
"partitionToNode",
".",
"... | Obtain the master partition for a given key
@param key
@return master partition id | [
"Obtain",
"the",
"master",
"partition",
"for",
"a",
"given",
"key"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/ConsistentRoutingStrategy.java#L170-L173 |
161,093 | voldemort/voldemort | src/java/voldemort/server/scheduler/slop/SlopPusherJob.java | SlopPusherJob.isSlopDead | protected boolean isSlopDead(Cluster cluster, Set<String> storeNames, Slop slop) {
// destination node , no longer exists
if(!cluster.getNodeIds().contains(slop.getNodeId())) {
return true;
}
// destination store, no longer exists
if(!storeNames.contains(slop.getStor... | java | protected boolean isSlopDead(Cluster cluster, Set<String> storeNames, Slop slop) {
// destination node , no longer exists
if(!cluster.getNodeIds().contains(slop.getNodeId())) {
return true;
}
// destination store, no longer exists
if(!storeNames.contains(slop.getStor... | [
"protected",
"boolean",
"isSlopDead",
"(",
"Cluster",
"cluster",
",",
"Set",
"<",
"String",
">",
"storeNames",
",",
"Slop",
"slop",
")",
"{",
"// destination node , no longer exists",
"if",
"(",
"!",
"cluster",
".",
"getNodeIds",
"(",
")",
".",
"contains",
"("... | A slop is dead if the destination node or the store does not exist
anymore on the cluster.
@param slop
@return | [
"A",
"slop",
"is",
"dead",
"if",
"the",
"destination",
"node",
"or",
"the",
"store",
"does",
"not",
"exist",
"anymore",
"on",
"the",
"cluster",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/scheduler/slop/SlopPusherJob.java#L52-L65 |
161,094 | voldemort/voldemort | src/java/voldemort/server/scheduler/slop/SlopPusherJob.java | SlopPusherJob.handleDeadSlop | protected void handleDeadSlop(SlopStorageEngine slopStorageEngine,
Pair<ByteArray, Versioned<Slop>> keyAndVal) {
Versioned<Slop> versioned = keyAndVal.getSecond();
// If configured to delete the dead slop
if(voldemortConfig.getAutoPurgeDeadSlops()) {
... | java | protected void handleDeadSlop(SlopStorageEngine slopStorageEngine,
Pair<ByteArray, Versioned<Slop>> keyAndVal) {
Versioned<Slop> versioned = keyAndVal.getSecond();
// If configured to delete the dead slop
if(voldemortConfig.getAutoPurgeDeadSlops()) {
... | [
"protected",
"void",
"handleDeadSlop",
"(",
"SlopStorageEngine",
"slopStorageEngine",
",",
"Pair",
"<",
"ByteArray",
",",
"Versioned",
"<",
"Slop",
">",
">",
"keyAndVal",
")",
"{",
"Versioned",
"<",
"Slop",
">",
"versioned",
"=",
"keyAndVal",
".",
"getSecond",
... | Handle slop for nodes that are no longer part of the cluster. It may not
always be the case. For example, shrinking a zone or deleting a store. | [
"Handle",
"slop",
"for",
"nodes",
"that",
"are",
"no",
"longer",
"part",
"of",
"the",
"cluster",
".",
"It",
"may",
"not",
"always",
"be",
"the",
"case",
".",
"For",
"example",
"shrinking",
"a",
"zone",
"or",
"deleting",
"a",
"store",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/scheduler/slop/SlopPusherJob.java#L71-L87 |
161,095 | voldemort/voldemort | src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorFactory.java | ClientRequestExecutorFactory.destroy | @Override
public void destroy(SocketDestination dest, ClientRequestExecutor clientRequestExecutor)
throws Exception {
clientRequestExecutor.close();
int numDestroyed = destroyed.incrementAndGet();
if(stats != null) {
stats.incrementCount(dest, ClientSocketStats.Tracke... | java | @Override
public void destroy(SocketDestination dest, ClientRequestExecutor clientRequestExecutor)
throws Exception {
clientRequestExecutor.close();
int numDestroyed = destroyed.incrementAndGet();
if(stats != null) {
stats.incrementCount(dest, ClientSocketStats.Tracke... | [
"@",
"Override",
"public",
"void",
"destroy",
"(",
"SocketDestination",
"dest",
",",
"ClientRequestExecutor",
"clientRequestExecutor",
")",
"throws",
"Exception",
"{",
"clientRequestExecutor",
".",
"close",
"(",
")",
";",
"int",
"numDestroyed",
"=",
"destroyed",
"."... | Close the ClientRequestExecutor. | [
"Close",
"the",
"ClientRequestExecutor",
"."
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorFactory.java#L120-L132 |
161,096 | voldemort/voldemort | src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java | ClientConfigUtil.readSingleClientConfigAvro | @SuppressWarnings("unchecked")
public static Properties readSingleClientConfigAvro(String configAvro) {
Properties props = new Properties();
try {
JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIG_AVRO_SCHEMA, configAvro);
GenericDatumReader<Object> datumReader = new Generi... | java | @SuppressWarnings("unchecked")
public static Properties readSingleClientConfigAvro(String configAvro) {
Properties props = new Properties();
try {
JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIG_AVRO_SCHEMA, configAvro);
GenericDatumReader<Object> datumReader = new Generi... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Properties",
"readSingleClientConfigAvro",
"(",
"String",
"configAvro",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"{",
"JsonDecoder",
"decoder",
"=",
... | Parses a string that contains single fat client config string in avro
format
@param configAvro Input string of avro format, that contains config for
multiple stores
@return Properties of single fat client config | [
"Parses",
"a",
"string",
"that",
"contains",
"single",
"fat",
"client",
"config",
"string",
"in",
"avro",
"format"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L34-L48 |
161,097 | voldemort/voldemort | src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java | ClientConfigUtil.readMultipleClientConfigAvro | @SuppressWarnings("unchecked")
public static Map<String, Properties> readMultipleClientConfigAvro(String configAvro) {
Map<String, Properties> mapStoreToProps = Maps.newHashMap();
try {
JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIGS_AVRO_SCHEMA, configAvro);
GenericDatu... | java | @SuppressWarnings("unchecked")
public static Map<String, Properties> readMultipleClientConfigAvro(String configAvro) {
Map<String, Properties> mapStoreToProps = Maps.newHashMap();
try {
JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIGS_AVRO_SCHEMA, configAvro);
GenericDatu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Map",
"<",
"String",
",",
"Properties",
">",
"readMultipleClientConfigAvro",
"(",
"String",
"configAvro",
")",
"{",
"Map",
"<",
"String",
",",
"Properties",
">",
"mapStoreToProps",
"=",
"Ma... | Parses a string that contains multiple fat client configs in avro format
@param configAvro Input string of avro format, that contains config for
multiple stores
@return Map of store names to store config properties | [
"Parses",
"a",
"string",
"that",
"contains",
"multiple",
"fat",
"client",
"configs",
"in",
"avro",
"format"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L57-L85 |
161,098 | voldemort/voldemort | src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java | ClientConfigUtil.writeSingleClientConfigAvro | public static String writeSingleClientConfigAvro(Properties props) {
// TODO: Use a dedicated json lib. We shouldn't be manually manipulating json...
String avroConfig = "";
Boolean firstProp = true;
for(String key: props.stringPropertyNames()) {
if(firstProp) {
... | java | public static String writeSingleClientConfigAvro(Properties props) {
// TODO: Use a dedicated json lib. We shouldn't be manually manipulating json...
String avroConfig = "";
Boolean firstProp = true;
for(String key: props.stringPropertyNames()) {
if(firstProp) {
... | [
"public",
"static",
"String",
"writeSingleClientConfigAvro",
"(",
"Properties",
"props",
")",
"{",
"// TODO: Use a dedicated json lib. We shouldn't be manually manipulating json...",
"String",
"avroConfig",
"=",
"\"\"",
";",
"Boolean",
"firstProp",
"=",
"true",
";",
"for",
... | Assembles an avro format string of single store config from store
properties
@param props Store properties
@return String in avro format that contains single store configs | [
"Assembles",
"an",
"avro",
"format",
"string",
"of",
"single",
"store",
"config",
"from",
"store",
"properties"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L94-L111 |
161,099 | voldemort/voldemort | src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java | ClientConfigUtil.writeMultipleClientConfigAvro | public static String writeMultipleClientConfigAvro(Map<String, Properties> mapStoreToProps) {
// TODO: Use a dedicated json lib. We shouldn't be manually manipulating json...
String avroConfig = "";
Boolean firstStore = true;
for(String storeName: mapStoreToProps.keySet()) {
... | java | public static String writeMultipleClientConfigAvro(Map<String, Properties> mapStoreToProps) {
// TODO: Use a dedicated json lib. We shouldn't be manually manipulating json...
String avroConfig = "";
Boolean firstStore = true;
for(String storeName: mapStoreToProps.keySet()) {
... | [
"public",
"static",
"String",
"writeMultipleClientConfigAvro",
"(",
"Map",
"<",
"String",
",",
"Properties",
">",
"mapStoreToProps",
")",
"{",
"// TODO: Use a dedicated json lib. We shouldn't be manually manipulating json...",
"String",
"avroConfig",
"=",
"\"\"",
";",
"Boolea... | Assembles an avro format string that contains multiple fat client configs
from map of store to properties
@param mapStoreToProps A map of store names to their properties
@return Avro string that contains multiple store configs | [
"Assembles",
"an",
"avro",
"format",
"string",
"that",
"contains",
"multiple",
"fat",
"client",
"configs",
"from",
"map",
"of",
"store",
"to",
"properties"
] | a7dbdea58032021361680faacf2782cf981c5332 | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L120-L136 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.