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
partition
stringclasses
1 value
VoltDB/voltdb
src/frontend/org/voltdb/expressions/ExpressionUtil.java
ExpressionUtil.reduce
public static boolean reduce(AbstractExpression expr, Predicate<AbstractExpression> pred) { final boolean current = pred.test(expr); if (current) { return true; } else if (expr == null) { return pred.test(null); } else { return pred.test(expr.getLeft()...
java
public static boolean reduce(AbstractExpression expr, Predicate<AbstractExpression> pred) { final boolean current = pred.test(expr); if (current) { return true; } else if (expr == null) { return pred.test(null); } else { return pred.test(expr.getLeft()...
[ "public", "static", "boolean", "reduce", "(", "AbstractExpression", "expr", ",", "Predicate", "<", "AbstractExpression", ">", "pred", ")", "{", "final", "boolean", "current", "=", "pred", ".", "test", "(", "expr", ")", ";", "if", "(", "current", ")", "{", ...
Check if any node of given expression tree satisfies given predicate @param expr source expression tree @param pred predicate to check against any expression node to find if any node satisfies. Note that it should be able to handle null. @return true if there exists a node that satisfies the predicate
[ "Check", "if", "any", "node", "of", "given", "expression", "tree", "satisfies", "given", "predicate" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L311-L322
train
VoltDB/voltdb
src/frontend/org/voltdb/expressions/ExpressionUtil.java
ExpressionUtil.uncombineAny
public static Collection<AbstractExpression> uncombineAny(AbstractExpression expr) { ArrayDeque<AbstractExpression> out = new ArrayDeque<AbstractExpression>(); if (expr != null) { ArrayDeque<AbstractExpression> in = new ArrayDeque<AbstractExpression>(); // this chunk of code ...
java
public static Collection<AbstractExpression> uncombineAny(AbstractExpression expr) { ArrayDeque<AbstractExpression> out = new ArrayDeque<AbstractExpression>(); if (expr != null) { ArrayDeque<AbstractExpression> in = new ArrayDeque<AbstractExpression>(); // this chunk of code ...
[ "public", "static", "Collection", "<", "AbstractExpression", ">", "uncombineAny", "(", "AbstractExpression", "expr", ")", "{", "ArrayDeque", "<", "AbstractExpression", ">", "out", "=", "new", "ArrayDeque", "<", "AbstractExpression", ">", "(", ")", ";", "if", "("...
Convert one or more predicates, potentially in an arbitrarily nested conjunction tree into a flattened collection. Similar to uncombine but for arbitrary tree shapes and with no guarantee of the result collection type or of any ordering within the collection. In fact, it currently fills an ArrayDeque via a left=to-righ...
[ "Convert", "one", "or", "more", "predicates", "potentially", "in", "an", "arbitrarily", "nested", "conjunction", "tree", "into", "a", "flattened", "collection", ".", "Similar", "to", "uncombine", "but", "for", "arbitrary", "tree", "shapes", "and", "with", "no", ...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L442-L462
train
VoltDB/voltdb
src/frontend/org/voltdb/expressions/ExpressionUtil.java
ExpressionUtil.getTupleValueExpressions
public static List<TupleValueExpression> getTupleValueExpressions(AbstractExpression input) { ArrayList<TupleValueExpression> tves = new ArrayList<TupleValueExpression>(); // recursive stopping steps if (input == null) { return tves; } else if (inp...
java
public static List<TupleValueExpression> getTupleValueExpressions(AbstractExpression input) { ArrayList<TupleValueExpression> tves = new ArrayList<TupleValueExpression>(); // recursive stopping steps if (input == null) { return tves; } else if (inp...
[ "public", "static", "List", "<", "TupleValueExpression", ">", "getTupleValueExpressions", "(", "AbstractExpression", "input", ")", "{", "ArrayList", "<", "TupleValueExpression", ">", "tves", "=", "new", "ArrayList", "<", "TupleValueExpression", ">", "(", ")", ";", ...
Recursively walk an expression and return a list of all the tuple value expressions it contains.
[ "Recursively", "walk", "an", "expression", "and", "return", "a", "list", "of", "all", "the", "tuple", "value", "expressions", "it", "contains", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L533-L556
train
VoltDB/voltdb
src/frontend/org/voltdb/expressions/ExpressionUtil.java
ExpressionUtil.subqueryRequiresScalarValueExpressionFromContext
private static boolean subqueryRequiresScalarValueExpressionFromContext(AbstractExpression parentExpr) { if (parentExpr == null) { // No context: we are a top-level expression. E.g, an item on the // select list. In this case, assume the expression must be scalar. return tr...
java
private static boolean subqueryRequiresScalarValueExpressionFromContext(AbstractExpression parentExpr) { if (parentExpr == null) { // No context: we are a top-level expression. E.g, an item on the // select list. In this case, assume the expression must be scalar. return tr...
[ "private", "static", "boolean", "subqueryRequiresScalarValueExpressionFromContext", "(", "AbstractExpression", "parentExpr", ")", "{", "if", "(", "parentExpr", "==", "null", ")", "{", "// No context: we are a top-level expression. E.g, an item on the", "// select list. In this ca...
Return true if we must insert a ScalarValueExpression between a subquery and its parent expression. @param parentExpr the parent expression of a subquery @return true if the parent expression is not a comparison, EXISTS operator, or a scalar value expression
[ "Return", "true", "if", "we", "must", "insert", "a", "ScalarValueExpression", "between", "a", "subquery", "and", "its", "parent", "expression", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L801-L821
train
VoltDB/voltdb
src/frontend/org/voltdb/expressions/ExpressionUtil.java
ExpressionUtil.addScalarValueExpression
private static AbstractExpression addScalarValueExpression(SelectSubqueryExpression expr) { if (expr.getSubqueryScan().getOutputSchema().size() != 1) { throw new PlanningErrorException("Scalar subquery can have only one output column"); } expr.changeToScalarExprType(); Abst...
java
private static AbstractExpression addScalarValueExpression(SelectSubqueryExpression expr) { if (expr.getSubqueryScan().getOutputSchema().size() != 1) { throw new PlanningErrorException("Scalar subquery can have only one output column"); } expr.changeToScalarExprType(); Abst...
[ "private", "static", "AbstractExpression", "addScalarValueExpression", "(", "SelectSubqueryExpression", "expr", ")", "{", "if", "(", "expr", ".", "getSubqueryScan", "(", ")", ".", "getOutputSchema", "(", ")", ".", "size", "(", ")", "!=", "1", ")", "{", "throw"...
Add a ScalarValueExpression on top of the SubqueryExpression @param expr - subquery expression @return ScalarValueExpression
[ "Add", "a", "ScalarValueExpression", "on", "top", "of", "the", "SubqueryExpression" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L828-L840
train
VoltDB/voltdb
src/frontend/org/voltdb/PermissionValidator.java
PermissionValidator.shouldAccept
public ClientResponseImpl shouldAccept(String name, AuthSystem.AuthUser user, final StoredProcedureInvocation task, final Procedure catProc) { if (user.isAuthEnabled()) { InvocationPermissionPolicy deniedPolicy = null; I...
java
public ClientResponseImpl shouldAccept(String name, AuthSystem.AuthUser user, final StoredProcedureInvocation task, final Procedure catProc) { if (user.isAuthEnabled()) { InvocationPermissionPolicy deniedPolicy = null; I...
[ "public", "ClientResponseImpl", "shouldAccept", "(", "String", "name", ",", "AuthSystem", ".", "AuthUser", "user", ",", "final", "StoredProcedureInvocation", "task", ",", "final", "Procedure", "catProc", ")", "{", "if", "(", "user", ".", "isAuthEnabled", "(", ")...
For auth disabled user the first policy will return ALLOW breaking the loop.
[ "For", "auth", "disabled", "user", "the", "first", "policy", "will", "return", "ALLOW", "breaking", "the", "loop", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/PermissionValidator.java#L43-L71
train
VoltDB/voltdb
src/frontend/org/voltdb/sysprocs/UpdateLogging.java
UpdateLogging.run
@SuppressWarnings("deprecation") public VoltTable[] run(SystemProcedureExecutionContext ctx, String username, String remoteHost, String xmlConfig) { long oldLevels = 0; if (ctx.isLowestSiteId()) { // Lo...
java
@SuppressWarnings("deprecation") public VoltTable[] run(SystemProcedureExecutionContext ctx, String username, String remoteHost, String xmlConfig) { long oldLevels = 0; if (ctx.isLowestSiteId()) { // Lo...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "public", "VoltTable", "[", "]", "run", "(", "SystemProcedureExecutionContext", "ctx", ",", "String", "username", ",", "String", "remoteHost", ",", "String", "xmlConfig", ")", "{", "long", "oldLevels", "=", "...
Change the operational log configuration. @param ctx Internal parameter. Not user-accessible. @param xmlConfig New configuration XML document. @return Standard STATUS table.
[ "Change", "the", "operational", "log", "configuration", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/UpdateLogging.java#L69-L114
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusChoice.java
ZaurusChoice.add
public void add(String item, String value) { int maxChar = MaxLenInZChoice; if (item.length() < MaxLenInZChoice) { maxChar = item.length(); } super.add(item.substring(0, maxChar)); values.addElement(value); }
java
public void add(String item, String value) { int maxChar = MaxLenInZChoice; if (item.length() < MaxLenInZChoice) { maxChar = item.length(); } super.add(item.substring(0, maxChar)); values.addElement(value); }
[ "public", "void", "add", "(", "String", "item", ",", "String", "value", ")", "{", "int", "maxChar", "=", "MaxLenInZChoice", ";", "if", "(", "item", ".", "length", "(", ")", "<", "MaxLenInZChoice", ")", "{", "maxChar", "=", "item", ".", "length", "(", ...
restrict strings for the choice to MaxLenInZChoice characters
[ "restrict", "strings", "for", "the", "choice", "to", "MaxLenInZChoice", "characters" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusChoice.java#L68-L78
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusChoice.java
ZaurusChoice.findValue
private int findValue(String s) { for (int i = 0; i < values.size(); i++) { if (s.equals(values.elementAt(i))) { return i; } // end of if (s.equals(values.elementAt(i))) } // end of for (int i=0; i<values.size(); i++) return -1; }
java
private int findValue(String s) { for (int i = 0; i < values.size(); i++) { if (s.equals(values.elementAt(i))) { return i; } // end of if (s.equals(values.elementAt(i))) } // end of for (int i=0; i<values.size(); i++) return -1; }
[ "private", "int", "findValue", "(", "String", "s", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "s", ".", "equals", "(", "values", ".", "elementAt", "(", "i",...
find for a given value the index in values
[ "find", "for", "a", "given", "value", "the", "index", "in", "values" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusChoice.java#L121-L130
train
VoltDB/voltdb
src/frontend/org/voltdb/rejoin/StreamSnapshotSink.java
StreamSnapshotSink.getNextChunk
public static ByteBuffer getNextChunk(byte[] schemaBytes, ByteBuffer buf, CachedByteBufferAllocator resultBufferAllocator) { buf.position(buf.position() + 4);//skip partition id int length = schemaBytes.length + buf.remaining(); ByteBuffer outputBuffer ...
java
public static ByteBuffer getNextChunk(byte[] schemaBytes, ByteBuffer buf, CachedByteBufferAllocator resultBufferAllocator) { buf.position(buf.position() + 4);//skip partition id int length = schemaBytes.length + buf.remaining(); ByteBuffer outputBuffer ...
[ "public", "static", "ByteBuffer", "getNextChunk", "(", "byte", "[", "]", "schemaBytes", ",", "ByteBuffer", "buf", ",", "CachedByteBufferAllocator", "resultBufferAllocator", ")", "{", "buf", ".", "position", "(", "buf", ".", "position", "(", ")", "+", "4", ")",...
Assemble the chunk so that it can be used to construct the VoltTable that will be passed to EE. @param buf @return
[ "Assemble", "the", "chunk", "so", "that", "it", "can", "be", "used", "to", "construct", "the", "VoltTable", "that", "will", "be", "passed", "to", "EE", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/rejoin/StreamSnapshotSink.java#L201-L212
train
VoltDB/voltdb
src/frontend/org/voltdb/rejoin/StreamSnapshotSink.java
StreamSnapshotSink.processMessage
private RestoreWork processMessage(DecodedContainer msg, CachedByteBufferAllocator resultBufferAllocator) { if (msg == null) { return null; } RestoreWork restoreWork = null; try { if (msg.m_msgType == StreamSnapshotMessageTy...
java
private RestoreWork processMessage(DecodedContainer msg, CachedByteBufferAllocator resultBufferAllocator) { if (msg == null) { return null; } RestoreWork restoreWork = null; try { if (msg.m_msgType == StreamSnapshotMessageTy...
[ "private", "RestoreWork", "processMessage", "(", "DecodedContainer", "msg", ",", "CachedByteBufferAllocator", "resultBufferAllocator", ")", "{", "if", "(", "msg", "==", "null", ")", "{", "return", "null", ";", "}", "RestoreWork", "restoreWork", "=", "null", ";", ...
Process a message pulled off from the network thread, and discard the container once it's processed. @param msg A pair of <sourceHSId, blockContainer> @return The restore work, or null if there's no data block to return to the site.
[ "Process", "a", "message", "pulled", "off", "from", "the", "network", "thread", "and", "discard", "the", "container", "once", "it", "s", "processed", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/rejoin/StreamSnapshotSink.java#L251-L325
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.copyFile
public static void copyFile(String fromPath, String toPath) throws Exception { File inputFile = new File(fromPath); File outputFile = new File(toPath); com.google_voltpatches.common.io.Files.copy(inputFile, outputFile); }
java
public static void copyFile(String fromPath, String toPath) throws Exception { File inputFile = new File(fromPath); File outputFile = new File(toPath); com.google_voltpatches.common.io.Files.copy(inputFile, outputFile); }
[ "public", "static", "void", "copyFile", "(", "String", "fromPath", ",", "String", "toPath", ")", "throws", "Exception", "{", "File", "inputFile", "=", "new", "File", "(", "fromPath", ")", ";", "File", "outputFile", "=", "new", "File", "(", "toPath", ")", ...
Simple code to copy a file from one place to another... Java should have this built in... stupid java...
[ "Simple", "code", "to", "copy", "a", "file", "from", "one", "place", "to", "another", "...", "Java", "should", "have", "this", "built", "in", "...", "stupid", "java", "..." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L92-L96
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.parseRevisionString
public static String parseRevisionString(String fullBuildString) { String build = ""; // Test for SVN revision string - example: https://svn.voltdb.com/eng/trunk?revision=2352 String[] splitted = fullBuildString.split("=", 2); if (splitted.length == 2) { build = splitted[1]....
java
public static String parseRevisionString(String fullBuildString) { String build = ""; // Test for SVN revision string - example: https://svn.voltdb.com/eng/trunk?revision=2352 String[] splitted = fullBuildString.split("=", 2); if (splitted.length == 2) { build = splitted[1]....
[ "public", "static", "String", "parseRevisionString", "(", "String", "fullBuildString", ")", "{", "String", "build", "=", "\"\"", ";", "// Test for SVN revision string - example: https://svn.voltdb.com/eng/trunk?revision=2352", "String", "[", "]", "splitted", "=", "fullBuildSt...
Check that RevisionStrings are properly formatted. @param fullBuildString @return build revision # (SVN), build hash (git) or null
[ "Check", "that", "RevisionStrings", "are", "properly", "formatted", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L402-L427
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.parseVersionString
public static Object[] parseVersionString(String versionString) { if (versionString == null) { return null; } // check for whitespace if (versionString.matches("\\s")) { return null; } // split on the dots String[] split = versionString.s...
java
public static Object[] parseVersionString(String versionString) { if (versionString == null) { return null; } // check for whitespace if (versionString.matches("\\s")) { return null; } // split on the dots String[] split = versionString.s...
[ "public", "static", "Object", "[", "]", "parseVersionString", "(", "String", "versionString", ")", "{", "if", "(", "versionString", "==", "null", ")", "{", "return", "null", ";", "}", "// check for whitespace", "if", "(", "versionString", ".", "matches", "(", ...
Parse a version string in the form of x.y.z. It doesn't require that there are exactly three parts in the version. Each part must be separated by a dot. @param versionString @return an array of each part as integer.
[ "Parse", "a", "version", "string", "in", "the", "form", "of", "x", ".", "y", ".", "z", ".", "It", "doesn", "t", "require", "that", "there", "are", "exactly", "three", "parts", "in", "the", "version", ".", "Each", "part", "must", "be", "separated", "b...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L437-L471
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.compareVersions
public static int compareVersions(Object[] left, Object[] right) { if (left == null || right == null) { throw new IllegalArgumentException("Invalid versions"); } for (int i = 0; i < left.length; i++) { // right is shorter than left and share the same prefix => left must ...
java
public static int compareVersions(Object[] left, Object[] right) { if (left == null || right == null) { throw new IllegalArgumentException("Invalid versions"); } for (int i = 0; i < left.length; i++) { // right is shorter than left and share the same prefix => left must ...
[ "public", "static", "int", "compareVersions", "(", "Object", "[", "]", "left", ",", "Object", "[", "]", "right", ")", "{", "if", "(", "left", "==", "null", "||", "right", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid...
Compare two versions. Version should be represented as an array of integers. @param left @param right @return -1 if left is smaller than right, 0 if they are equal, 1 if left is greater than right.
[ "Compare", "two", "versions", ".", "Version", "should", "be", "represented", "as", "an", "array", "of", "integers", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L482-L534
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.isPro
public static boolean isPro() { if (m_isPro == null) { //Allow running pro kit as community. if (!Boolean.parseBoolean(System.getProperty("community", "false"))) { m_isPro = ProClass.load("org.voltdb.CommandLogImpl", "Command logging", ProClass.HANDLER_IGNORE) ...
java
public static boolean isPro() { if (m_isPro == null) { //Allow running pro kit as community. if (!Boolean.parseBoolean(System.getProperty("community", "false"))) { m_isPro = ProClass.load("org.voltdb.CommandLogImpl", "Command logging", ProClass.HANDLER_IGNORE) ...
[ "public", "static", "boolean", "isPro", "(", ")", "{", "if", "(", "m_isPro", "==", "null", ")", "{", "//Allow running pro kit as community.", "if", "(", "!", "Boolean", ".", "parseBoolean", "(", "System", ".", "getProperty", "(", "\"community\"", ",", "\"false...
check if we're running pro code
[ "check", "if", "we", "re", "running", "pro", "code" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L563-L574
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.cheesyBufferCheckSum
public static final long cheesyBufferCheckSum(ByteBuffer buffer) { final int mypos = buffer.position(); buffer.position(0); long checksum = 0; if (buffer.hasArray()) { final byte bytes[] = buffer.array(); final int end = buffer.arrayOffset() + mypos; f...
java
public static final long cheesyBufferCheckSum(ByteBuffer buffer) { final int mypos = buffer.position(); buffer.position(0); long checksum = 0; if (buffer.hasArray()) { final byte bytes[] = buffer.array(); final int end = buffer.arrayOffset() + mypos; f...
[ "public", "static", "final", "long", "cheesyBufferCheckSum", "(", "ByteBuffer", "buffer", ")", "{", "final", "int", "mypos", "=", "buffer", ".", "position", "(", ")", ";", "buffer", ".", "position", "(", "0", ")", ";", "long", "checksum", "=", "0", ";", ...
I heart commutativity @param buffer ByteBuffer assumed position is at end of data @return the cheesy checksum of this VoltTable
[ "I", "heart", "commutativity" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L617-L634
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.concatAll
public static <T> T[] concatAll(final T[] empty, Iterable<T[]> arrayList) { assert(empty.length == 0); if (arrayList.iterator().hasNext() == false) { return empty; } int len = 0; for (T[] subArray : arrayList) { len += subArray.length; } i...
java
public static <T> T[] concatAll(final T[] empty, Iterable<T[]> arrayList) { assert(empty.length == 0); if (arrayList.iterator().hasNext() == false) { return empty; } int len = 0; for (T[] subArray : arrayList) { len += subArray.length; } i...
[ "public", "static", "<", "T", ">", "T", "[", "]", "concatAll", "(", "final", "T", "[", "]", "empty", ",", "Iterable", "<", "T", "[", "]", ">", "arrayList", ")", "{", "assert", "(", "empty", ".", "length", "==", "0", ")", ";", "if", "(", "arrayL...
Concatenate an list of arrays of typed-objects @param empty An empty array of the right type used for cloning @param arrayList A list of arrays to concatenate. @return The concatenated mega-array.
[ "Concatenate", "an", "list", "of", "arrays", "of", "typed", "-", "objects" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L664-L681
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.getMBRss
public static long getMBRss(Client client) { assert(client != null); long rssMax = 0; try { ClientResponse r = client.callProcedure("@Statistics", "MEMORY", 0); VoltTable stats = r.getResults()[0]; stats.resetRowPosition(); while (stats.advanceRow(...
java
public static long getMBRss(Client client) { assert(client != null); long rssMax = 0; try { ClientResponse r = client.callProcedure("@Statistics", "MEMORY", 0); VoltTable stats = r.getResults()[0]; stats.resetRowPosition(); while (stats.advanceRow(...
[ "public", "static", "long", "getMBRss", "(", "Client", "client", ")", "{", "assert", "(", "client", "!=", "null", ")", ";", "long", "rssMax", "=", "0", ";", "try", "{", "ClientResponse", "r", "=", "client", ".", "callProcedure", "(", "\"@Statistics\"", "...
Get the resident set size, in mb, for the voltdb server on the other end of the client. If the client is connected to multiple servers, return the max individual rss across the cluster.
[ "Get", "the", "resident", "set", "size", "in", "mb", "for", "the", "voltdb", "server", "on", "the", "other", "end", "of", "the", "client", ".", "If", "the", "client", "is", "connected", "to", "multiple", "servers", "return", "the", "max", "individual", "...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L700-L720
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.zipToMap
public static <K, V> Multimap<K, V> zipToMap(List<K> keys, List<V> values) { if (keys.isEmpty() || values.isEmpty()) { return null; } Iterator<K> keyIter = keys.iterator(); Iterator<V> valueIter = values.iterator(); ArrayListMultimap<K, V> result = ArrayListMulti...
java
public static <K, V> Multimap<K, V> zipToMap(List<K> keys, List<V> values) { if (keys.isEmpty() || values.isEmpty()) { return null; } Iterator<K> keyIter = keys.iterator(); Iterator<V> valueIter = values.iterator(); ArrayListMultimap<K, V> result = ArrayListMulti...
[ "public", "static", "<", "K", ",", "V", ">", "Multimap", "<", "K", ",", "V", ">", "zipToMap", "(", "List", "<", "K", ">", "keys", ",", "List", "<", "V", ">", "values", ")", "{", "if", "(", "keys", ".", "isEmpty", "(", ")", "||", "values", "."...
Zip the two lists up into a multimap @return null if one of the lists is empty
[ "Zip", "the", "two", "lists", "up", "into", "a", "multimap" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L726-L748
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.zip
public static <K> List<K> zip(Collection<Deque<K>> stuff) { final List<K> result = Lists.newArrayList(); // merge the results Iterator<Deque<K>> iter = stuff.iterator(); while (iter.hasNext()) { final K next = iter.next().poll(); if (next != null) { ...
java
public static <K> List<K> zip(Collection<Deque<K>> stuff) { final List<K> result = Lists.newArrayList(); // merge the results Iterator<Deque<K>> iter = stuff.iterator(); while (iter.hasNext()) { final K next = iter.next().poll(); if (next != null) { ...
[ "public", "static", "<", "K", ">", "List", "<", "K", ">", "zip", "(", "Collection", "<", "Deque", "<", "K", ">", ">", "stuff", ")", "{", "final", "List", "<", "K", ">", "result", "=", "Lists", ".", "newArrayList", "(", ")", ";", "// merge the resul...
Aggregates the elements from each of the given deque. It takes one element from the head of each deque in each loop and put them into a single list. This method modifies the deques in-place. @param stuff @return
[ "Aggregates", "the", "elements", "from", "each", "of", "the", "given", "deque", ".", "It", "takes", "one", "element", "from", "the", "head", "of", "each", "deque", "in", "each", "loop", "and", "put", "them", "into", "a", "single", "list", ".", "This", ...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L757-L777
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.sortedArrayListMultimap
public static <K extends Comparable<?>, V> ListMultimap<K, V> sortedArrayListMultimap() { Map<K, Collection<V>> map = Maps.newTreeMap(); return Multimaps.newListMultimap(map, new Supplier<List<V>>() { @Override public List<V> get() { return Lists.n...
java
public static <K extends Comparable<?>, V> ListMultimap<K, V> sortedArrayListMultimap() { Map<K, Collection<V>> map = Maps.newTreeMap(); return Multimaps.newListMultimap(map, new Supplier<List<V>>() { @Override public List<V> get() { return Lists.n...
[ "public", "static", "<", "K", "extends", "Comparable", "<", "?", ">", ",", "V", ">", "ListMultimap", "<", "K", ",", "V", ">", "sortedArrayListMultimap", "(", ")", "{", "Map", "<", "K", ",", "Collection", "<", "V", ">", ">", "map", "=", "Maps", ".",...
Create an ArrayListMultimap that uses TreeMap as the container map, so order is preserved.
[ "Create", "an", "ArrayListMultimap", "that", "uses", "TreeMap", "as", "the", "container", "map", "so", "order", "is", "preserved", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L782-L792
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.roundTripForCL
public static StoredProcedureInvocation roundTripForCL(StoredProcedureInvocation invocation) throws IOException { if (invocation.getSerializedParams() != null) { return invocation; } ByteBuffer buf = ByteBuffer.allocate(invocation.getSerializedSize()); invocation.flattenT...
java
public static StoredProcedureInvocation roundTripForCL(StoredProcedureInvocation invocation) throws IOException { if (invocation.getSerializedParams() != null) { return invocation; } ByteBuffer buf = ByteBuffer.allocate(invocation.getSerializedSize()); invocation.flattenT...
[ "public", "static", "StoredProcedureInvocation", "roundTripForCL", "(", "StoredProcedureInvocation", "invocation", ")", "throws", "IOException", "{", "if", "(", "invocation", ".", "getSerializedParams", "(", ")", "!=", "null", ")", "{", "return", "invocation", ";", ...
Serialize and then deserialize an invocation so that it has serializedParams set for command logging if the invocation is sent to a local site. @return The round-tripped version of the invocation @throws IOException
[ "Serialize", "and", "then", "deserialize", "an", "invocation", "so", "that", "it", "has", "serializedParams", "set", "for", "command", "logging", "if", "the", "invocation", "is", "sent", "to", "a", "local", "site", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L800-L812
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.getBinaryPartitionKeys
public static Map<Integer, byte[]> getBinaryPartitionKeys(TheHashinator hashinator) { Map<Integer, byte[]> partitionMap = new HashMap<>(); VoltTable partitionKeys = null; if (hashinator == null) { partitionKeys = TheHashinator.getPartitionKeys(VoltType.VARBINARY); } ...
java
public static Map<Integer, byte[]> getBinaryPartitionKeys(TheHashinator hashinator) { Map<Integer, byte[]> partitionMap = new HashMap<>(); VoltTable partitionKeys = null; if (hashinator == null) { partitionKeys = TheHashinator.getPartitionKeys(VoltType.VARBINARY); } ...
[ "public", "static", "Map", "<", "Integer", ",", "byte", "[", "]", ">", "getBinaryPartitionKeys", "(", "TheHashinator", "hashinator", ")", "{", "Map", "<", "Integer", ",", "byte", "[", "]", ">", "partitionMap", "=", "new", "HashMap", "<>", "(", ")", ";", ...
Get VARBINARY partition keys for the specified topology. @return A map from partition IDs to partition keys, null if failed to get the keys.
[ "Get", "VARBINARY", "partition", "keys", "for", "the", "specified", "topology", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L1002-L1025
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.readPropertiesFromCredentials
public static Properties readPropertiesFromCredentials(String credentials) { Properties props = new Properties(); File propFD = new File(credentials); if (!propFD.exists() || !propFD.isFile() || !propFD.canRead()) { throw new IllegalArgumentException("Credentials file " + credentials...
java
public static Properties readPropertiesFromCredentials(String credentials) { Properties props = new Properties(); File propFD = new File(credentials); if (!propFD.exists() || !propFD.isFile() || !propFD.canRead()) { throw new IllegalArgumentException("Credentials file " + credentials...
[ "public", "static", "Properties", "readPropertiesFromCredentials", "(", "String", "credentials", ")", "{", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "File", "propFD", "=", "new", "File", "(", "credentials", ")", ";", "if", "(", "!", "pr...
Get username and password from credentials file. @return a Properties variable which contains username and password.
[ "Get", "username", "and", "password", "from", "credentials", "file", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L1031-L1046
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/MiscUtils.java
MiscUtils.writeDeferredSerialization
public static int writeDeferredSerialization(ByteBuffer mbuf, DeferredSerialization ds) throws IOException { int written = 0; try { final int objStartPosition = mbuf.position(); ds.serialize(mbuf); written = mbuf.position() - objStartPosition; } finally { ...
java
public static int writeDeferredSerialization(ByteBuffer mbuf, DeferredSerialization ds) throws IOException { int written = 0; try { final int objStartPosition = mbuf.position(); ds.serialize(mbuf); written = mbuf.position() - objStartPosition; } finally { ...
[ "public", "static", "int", "writeDeferredSerialization", "(", "ByteBuffer", "mbuf", ",", "DeferredSerialization", "ds", ")", "throws", "IOException", "{", "int", "written", "=", "0", ";", "try", "{", "final", "int", "objStartPosition", "=", "mbuf", ".", "positio...
Serialize the deferred serializer data into byte buffer @param mbuf ByteBuffer the buffer is written to @param ds DeferredSerialization data writes to the byte buffer @return size of data @throws IOException
[ "Serialize", "the", "deferred", "serializer", "data", "into", "byte", "buffer" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/MiscUtils.java#L1055-L1066
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/RowAVL.java
RowAVL.getNode
public NodeAVL getNode(int index) { NodeAVL n = nPrimaryNode; while (index-- > 0) { n = n.nNext; } return n; }
java
public NodeAVL getNode(int index) { NodeAVL n = nPrimaryNode; while (index-- > 0) { n = n.nNext; } return n; }
[ "public", "NodeAVL", "getNode", "(", "int", "index", ")", "{", "NodeAVL", "n", "=", "nPrimaryNode", ";", "while", "(", "index", "--", ">", "0", ")", "{", "n", "=", "n", ".", "nNext", ";", "}", "return", "n", ";", "}" ]
Returns the Node for a given Index, using the ordinal position of the Index within the Table Object.
[ "Returns", "the", "Node", "for", "a", "given", "Index", "using", "the", "ordinal", "position", "of", "the", "Index", "within", "the", "Table", "Object", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/RowAVL.java#L128-L137
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/RowAVL.java
RowAVL.getNextNode
NodeAVL getNextNode(NodeAVL n) { if (n == null) { n = nPrimaryNode; } else { n = n.nNext; } return n; }
java
NodeAVL getNextNode(NodeAVL n) { if (n == null) { n = nPrimaryNode; } else { n = n.nNext; } return n; }
[ "NodeAVL", "getNextNode", "(", "NodeAVL", "n", ")", "{", "if", "(", "n", "==", "null", ")", "{", "n", "=", "nPrimaryNode", ";", "}", "else", "{", "n", "=", "n", ".", "nNext", ";", "}", "return", "n", ";", "}" ]
Returns the Node for the next Index on this database row, given the Node for any Index.
[ "Returns", "the", "Node", "for", "the", "next", "Index", "on", "this", "database", "row", "given", "the", "Node", "for", "any", "Index", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/RowAVL.java#L143-L152
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.listACLEquals
private boolean listACLEquals(List<ACL> lista, List<ACL> listb) { if (lista.size() != listb.size()) { return false; } for (int i = 0; i < lista.size(); i++) { ACL a = lista.get(i); ACL b = listb.get(i); if (!a.equals(b)) { return fa...
java
private boolean listACLEquals(List<ACL> lista, List<ACL> listb) { if (lista.size() != listb.size()) { return false; } for (int i = 0; i < lista.size(); i++) { ACL a = lista.get(i); ACL b = listb.get(i); if (!a.equals(b)) { return fa...
[ "private", "boolean", "listACLEquals", "(", "List", "<", "ACL", ">", "lista", ",", "List", "<", "ACL", ">", "listb", ")", "{", "if", "(", "lista", ".", "size", "(", ")", "!=", "listb", ".", "size", "(", ")", ")", "{", "return", "false", ";", "}",...
compare two list of acls. if there elements are in the same order and the same size then return true else return false @param lista the list to be compared @param listb the list to be compared @return true if and only if the lists are of the same size and the elements are in the same order in lista and listb
[ "compare", "two", "list", "of", "acls", ".", "if", "there", "elements", "are", "in", "the", "same", "order", "and", "the", "same", "size", "then", "return", "true", "else", "return", "false" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L168-L180
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.convertAcls
public synchronized Long convertAcls(List<ACL> acls) { if (acls == null) return -1L; // get the value from the map Long ret = aclKeyMap.get(acls); // could not find the map if (ret != null) return ret; long val = incrementIndex(); longKeyMa...
java
public synchronized Long convertAcls(List<ACL> acls) { if (acls == null) return -1L; // get the value from the map Long ret = aclKeyMap.get(acls); // could not find the map if (ret != null) return ret; long val = incrementIndex(); longKeyMa...
[ "public", "synchronized", "Long", "convertAcls", "(", "List", "<", "ACL", ">", "acls", ")", "{", "if", "(", "acls", "==", "null", ")", "return", "-", "1L", ";", "// get the value from the map", "Long", "ret", "=", "aclKeyMap", ".", "get", "(", "acls", ")...
converts the list of acls to a list of longs. @param acls @return a list of longs that map to the acls
[ "converts", "the", "list", "of", "acls", "to", "a", "list", "of", "longs", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L188-L200
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.convertLong
public synchronized List<ACL> convertLong(Long longVal) { if (longVal == null) return null; if (longVal == -1L) return Ids.OPEN_ACL_UNSAFE; List<ACL> acls = longKeyMap.get(longVal); if (acls == null) { LOG.error("ERROR: ACL not available for long " + l...
java
public synchronized List<ACL> convertLong(Long longVal) { if (longVal == null) return null; if (longVal == -1L) return Ids.OPEN_ACL_UNSAFE; List<ACL> acls = longKeyMap.get(longVal); if (acls == null) { LOG.error("ERROR: ACL not available for long " + l...
[ "public", "synchronized", "List", "<", "ACL", ">", "convertLong", "(", "Long", "longVal", ")", "{", "if", "(", "longVal", "==", "null", ")", "return", "null", ";", "if", "(", "longVal", "==", "-", "1L", ")", "return", "Ids", ".", "OPEN_ACL_UNSAFE", ";"...
converts a list of longs to a list of acls. @param longs the list of longs @return a list of ACLs that map to longs
[ "converts", "a", "list", "of", "longs", "to", "a", "list", "of", "acls", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L209-L220
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.approximateDataSize
public long approximateDataSize() { long result = 0; for (Map.Entry<String, DataNode> entry : nodes.entrySet()) { DataNode value = entry.getValue(); synchronized (value) { result += entry.getKey().length(); result += (value.data == null ? 0 ...
java
public long approximateDataSize() { long result = 0; for (Map.Entry<String, DataNode> entry : nodes.entrySet()) { DataNode value = entry.getValue(); synchronized (value) { result += entry.getKey().length(); result += (value.data == null ? 0 ...
[ "public", "long", "approximateDataSize", "(", ")", "{", "long", "result", "=", "0", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "DataNode", ">", "entry", ":", "nodes", ".", "entrySet", "(", ")", ")", "{", "DataNode", "value", "=", "entr...
Get the size of the nodes based on path and data length. @return size of the data
[ "Get", "the", "size", "of", "the", "nodes", "based", "on", "path", "and", "data", "length", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L256-L267
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.isSpecialPath
boolean isSpecialPath(String path) { if (rootZookeeper.equals(path) || procZookeeper.equals(path) || quotaZookeeper.equals(path)) { return true; } return false; }
java
boolean isSpecialPath(String path) { if (rootZookeeper.equals(path) || procZookeeper.equals(path) || quotaZookeeper.equals(path)) { return true; } return false; }
[ "boolean", "isSpecialPath", "(", "String", "path", ")", "{", "if", "(", "rootZookeeper", ".", "equals", "(", "path", ")", "||", "procZookeeper", ".", "equals", "(", "path", ")", "||", "quotaZookeeper", ".", "equals", "(", "path", ")", ")", "{", "return",...
is the path one of the special paths owned by zookeeper. @param path the path to be checked @return true if a special path. false if not.
[ "is", "the", "path", "one", "of", "the", "special", "paths", "owned", "by", "zookeeper", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L309-L315
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.updateCount
public void updateCount(String lastPrefix, int diff) { String statNode = Quotas.statPath(lastPrefix); DataNode node = nodes.get(statNode); StatsTrack updatedStat = null; if (node == null) { // should not happen LOG.error("Missing count node for stat " + statNode);...
java
public void updateCount(String lastPrefix, int diff) { String statNode = Quotas.statPath(lastPrefix); DataNode node = nodes.get(statNode); StatsTrack updatedStat = null; if (node == null) { // should not happen LOG.error("Missing count node for stat " + statNode);...
[ "public", "void", "updateCount", "(", "String", "lastPrefix", ",", "int", "diff", ")", "{", "String", "statNode", "=", "Quotas", ".", "statPath", "(", "lastPrefix", ")", ";", "DataNode", "node", "=", "nodes", ".", "get", "(", "statNode", ")", ";", "Stats...
update the count of this stat datanode @param lastPrefix the path of the node that is quotaed. @param diff the diff to be added to the count
[ "update", "the", "count", "of", "this", "stat", "datanode" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L351-L383
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.deleteNode
public void deleteNode(String path, long zxid) throws KeeperException.NoNodeException { int lastSlash = path.lastIndexOf('/'); String parentName = path.substring(0, lastSlash); String childName = path.substring(lastSlash + 1); DataNode node = nodes.get(path); if (node...
java
public void deleteNode(String path, long zxid) throws KeeperException.NoNodeException { int lastSlash = path.lastIndexOf('/'); String parentName = path.substring(0, lastSlash); String childName = path.substring(lastSlash + 1); DataNode node = nodes.get(path); if (node...
[ "public", "void", "deleteNode", "(", "String", "path", ",", "long", "zxid", ")", "throws", "KeeperException", ".", "NoNodeException", "{", "int", "lastSlash", "=", "path", ".", "lastIndexOf", "(", "'", "'", ")", ";", "String", "parentName", "=", "path", "....
remove the path from the datatree @param path the path to of the node to be deleted @param zxid the current zxid @throws KeeperException.NoNodeException
[ "remove", "the", "path", "from", "the", "datatree" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L524-L584
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.getCounts
private void getCounts(String path, Counts counts) { DataNode node = getNode(path); if (node == null) { return; } String[] children = null; int len = 0; synchronized (node) { Set<String> childs = node.getChildren(); if (childs != null) ...
java
private void getCounts(String path, Counts counts) { DataNode node = getNode(path); if (node == null) { return; } String[] children = null; int len = 0; synchronized (node) { Set<String> childs = node.getChildren(); if (childs != null) ...
[ "private", "void", "getCounts", "(", "String", "path", ",", "Counts", "counts", ")", "{", "DataNode", "node", "=", "getNode", "(", "path", ")", ";", "if", "(", "node", "==", "null", ")", "{", "return", ";", "}", "String", "[", "]", "children", "=", ...
this method gets the count of nodes and the bytes under a subtree @param path the path to be used @param bytes the long bytes @param count the int count
[ "this", "method", "gets", "the", "count", "of", "nodes", "and", "the", "bytes", "under", "a", "subtree" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L853-L876
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.updateQuotaForPath
private void updateQuotaForPath(String path) { Counts c = new Counts(); getCounts(path, c); StatsTrack strack = new StatsTrack(); strack.setBytes(c.bytes); strack.setCount(c.count); String statPath = Quotas.quotaZookeeper + path + "/" + Quotas.statNode; DataNode n...
java
private void updateQuotaForPath(String path) { Counts c = new Counts(); getCounts(path, c); StatsTrack strack = new StatsTrack(); strack.setBytes(c.bytes); strack.setCount(c.count); String statPath = Quotas.quotaZookeeper + path + "/" + Quotas.statNode; DataNode n...
[ "private", "void", "updateQuotaForPath", "(", "String", "path", ")", "{", "Counts", "c", "=", "new", "Counts", "(", ")", ";", "getCounts", "(", "path", ",", "c", ")", ";", "StatsTrack", "strack", "=", "new", "StatsTrack", "(", ")", ";", "strack", ".", ...
update the quota for the given path @param path the path to be used
[ "update", "the", "quota", "for", "the", "given", "path" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L884-L900
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.traverseNode
private void traverseNode(String path) { DataNode node = getNode(path); String children[] = null; synchronized (node) { Set<String> childs = node.getChildren(); if (childs != null) { children = childs.toArray(new String[childs.size()]); } ...
java
private void traverseNode(String path) { DataNode node = getNode(path); String children[] = null; synchronized (node) { Set<String> childs = node.getChildren(); if (childs != null) { children = childs.toArray(new String[childs.size()]); } ...
[ "private", "void", "traverseNode", "(", "String", "path", ")", "{", "DataNode", "node", "=", "getNode", "(", "path", ")", ";", "String", "children", "[", "]", "=", "null", ";", "synchronized", "(", "node", ")", "{", "Set", "<", "String", ">", "childs",...
this method traverses the quota path and update the path trie and sets @param path
[ "this", "method", "traverses", "the", "quota", "path", "and", "update", "the", "path", "trie", "and", "sets" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L907-L937
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.setupQuota
private void setupQuota() { String quotaPath = Quotas.quotaZookeeper; DataNode node = getNode(quotaPath); if (node == null) { return; } traverseNode(quotaPath); }
java
private void setupQuota() { String quotaPath = Quotas.quotaZookeeper; DataNode node = getNode(quotaPath); if (node == null) { return; } traverseNode(quotaPath); }
[ "private", "void", "setupQuota", "(", ")", "{", "String", "quotaPath", "=", "Quotas", ".", "quotaZookeeper", ";", "DataNode", "node", "=", "getNode", "(", "quotaPath", ")", ";", "if", "(", "node", "==", "null", ")", "{", "return", ";", "}", "traverseNode...
this method sets up the path trie and sets up stats for quota nodes
[ "this", "method", "sets", "up", "the", "path", "trie", "and", "sets", "up", "stats", "for", "quota", "nodes" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L942-L949
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java
DataTree.dumpEphemerals
public void dumpEphemerals(PrintWriter pwriter) { Set<Long> keys = ephemerals.keySet(); pwriter.println("Sessions with Ephemerals (" + keys.size() + "):"); for (long k : keys) { pwriter.print("0x" + Long.toHexString(k)); pwriter.println(":"); H...
java
public void dumpEphemerals(PrintWriter pwriter) { Set<Long> keys = ephemerals.keySet(); pwriter.println("Sessions with Ephemerals (" + keys.size() + "):"); for (long k : keys) { pwriter.print("0x" + Long.toHexString(k)); pwriter.println(":"); H...
[ "public", "void", "dumpEphemerals", "(", "PrintWriter", "pwriter", ")", "{", "Set", "<", "Long", ">", "keys", "=", "ephemerals", ".", "keySet", "(", ")", ";", "pwriter", ".", "println", "(", "\"Sessions with Ephemerals (\"", "+", "keys", ".", "size", "(", ...
Write a text dump of all the ephemerals in the datatree. @param pwriter the output to write to
[ "Write", "a", "text", "dump", "of", "all", "the", "ephemerals", "in", "the", "datatree", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/DataTree.java#L1104-L1118
train
VoltDB/voltdb
src/frontend/org/voltcore/zk/ZKCountdownLatch.java
ZKCountdownLatch.getCount
public int getCount() throws InterruptedException, KeeperException { return ByteBuffer.wrap(m_zk.getData(m_path, false, null)).getInt(); }
java
public int getCount() throws InterruptedException, KeeperException { return ByteBuffer.wrap(m_zk.getData(m_path, false, null)).getInt(); }
[ "public", "int", "getCount", "(", ")", "throws", "InterruptedException", ",", "KeeperException", "{", "return", "ByteBuffer", ".", "wrap", "(", "m_zk", ".", "getData", "(", "m_path", ",", "false", ",", "null", ")", ")", ".", "getInt", "(", ")", ";", "}" ...
Returns the current count
[ "Returns", "the", "current", "count" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/zk/ZKCountdownLatch.java#L63-L65
train
VoltDB/voltdb
src/frontend/org/voltcore/zk/ZKCountdownLatch.java
ZKCountdownLatch.isCountedDown
public boolean isCountedDown() throws InterruptedException, KeeperException { if (countedDown) return true; int count = ByteBuffer.wrap(m_zk.getData(m_path, false, null)).getInt(); if (count > 0) return false; countedDown = true; return true; }
java
public boolean isCountedDown() throws InterruptedException, KeeperException { if (countedDown) return true; int count = ByteBuffer.wrap(m_zk.getData(m_path, false, null)).getInt(); if (count > 0) return false; countedDown = true; return true; }
[ "public", "boolean", "isCountedDown", "(", ")", "throws", "InterruptedException", ",", "KeeperException", "{", "if", "(", "countedDown", ")", "return", "true", ";", "int", "count", "=", "ByteBuffer", ".", "wrap", "(", "m_zk", ".", "getData", "(", "m_path", "...
Returns if already counted down to zero
[ "Returns", "if", "already", "counted", "down", "to", "zero" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/zk/ZKCountdownLatch.java#L68-L74
train
VoltDB/voltdb
src/frontend/org/voltdb/planner/parseinfo/StmtCommonTableScan.java
StmtCommonTableScan.copyTableSchemaFromShared
private void copyTableSchemaFromShared() { for (SchemaColumn scol : m_sharedScan.getOutputSchema()) { SchemaColumn copy = new SchemaColumn(scol.getTableName(), getTableAlias(), scol.getColumnName(), ...
java
private void copyTableSchemaFromShared() { for (SchemaColumn scol : m_sharedScan.getOutputSchema()) { SchemaColumn copy = new SchemaColumn(scol.getTableName(), getTableAlias(), scol.getColumnName(), ...
[ "private", "void", "copyTableSchemaFromShared", "(", ")", "{", "for", "(", "SchemaColumn", "scol", ":", "m_sharedScan", ".", "getOutputSchema", "(", ")", ")", "{", "SchemaColumn", "copy", "=", "new", "SchemaColumn", "(", "scol", ".", "getTableName", "(", ")", ...
Copy the table schema from the shared part to here. We have to repair the table aliases.
[ "Copy", "the", "table", "schema", "from", "the", "shared", "part", "to", "here", ".", "We", "have", "to", "repair", "the", "table", "aliases", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/StmtCommonTableScan.java#L216-L226
train
VoltDB/voltdb
src/frontend/org/voltdb/planner/parseinfo/StmtCommonTableScan.java
StmtCommonTableScan.harmonizeOutputSchema
public void harmonizeOutputSchema() { boolean changedCurrent; boolean changedBase; boolean changedRecursive = false; NodeSchema currentSchema = getOutputSchema(); NodeSchema baseSchema = getBestCostBasePlan().rootPlanGraph.getTrueOutputSchema(false); NodeSchema recursiveS...
java
public void harmonizeOutputSchema() { boolean changedCurrent; boolean changedBase; boolean changedRecursive = false; NodeSchema currentSchema = getOutputSchema(); NodeSchema baseSchema = getBestCostBasePlan().rootPlanGraph.getTrueOutputSchema(false); NodeSchema recursiveS...
[ "public", "void", "harmonizeOutputSchema", "(", ")", "{", "boolean", "changedCurrent", ";", "boolean", "changedBase", ";", "boolean", "changedRecursive", "=", "false", ";", "NodeSchema", "currentSchema", "=", "getOutputSchema", "(", ")", ";", "NodeSchema", "baseSche...
We have just planned the base query and perhaps the recursive query. We need to make sure that the output schema of the scan and the output schemas of the base and recursive plans are all compatible. <ol> <li>If they have different lengths, then it is an error, probably an internal error.</li> <li>If they have differ...
[ "We", "have", "just", "planned", "the", "base", "query", "and", "perhaps", "the", "recursive", "query", ".", "We", "need", "to", "make", "sure", "that", "the", "output", "schema", "of", "the", "scan", "and", "the", "output", "schemas", "of", "the", "base...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/StmtCommonTableScan.java#L244-L277
train
VoltDB/voltdb
third_party/java/src/com/google_voltpatches/common/util/concurrent/AbstractFuture.java
AbstractFuture.complete
private static void complete(AbstractFuture<?> future) { boolean maskExecutorExceptions = future.maskExecutorExceptions; Listener next = null; outer: while (true) { future.releaseWaiters(); // We call this before the listeners in order to avoid needing to manage a separate stack data // st...
java
private static void complete(AbstractFuture<?> future) { boolean maskExecutorExceptions = future.maskExecutorExceptions; Listener next = null; outer: while (true) { future.releaseWaiters(); // We call this before the listeners in order to avoid needing to manage a separate stack data // st...
[ "private", "static", "void", "complete", "(", "AbstractFuture", "<", "?", ">", "future", ")", "{", "boolean", "maskExecutorExceptions", "=", "future", ".", "maskExecutorExceptions", ";", "Listener", "next", "=", "null", ";", "outer", ":", "while", "(", "true",...
Unblocks all threads and runs all listeners.
[ "Unblocks", "all", "threads", "and", "runs", "all", "listeners", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/util/concurrent/AbstractFuture.java#L795-L833
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/common/PathTrie.java
PathTrie.addPath
public void addPath(String path) { if (path == null) { return; } String[] pathComponents = path.split("/"); TrieNode parent = rootNode; String part = null; if (pathComponents.length <= 1) { throw new IllegalArgumentException("Invalid path " + path)...
java
public void addPath(String path) { if (path == null) { return; } String[] pathComponents = path.split("/"); TrieNode parent = rootNode; String part = null; if (pathComponents.length <= 1) { throw new IllegalArgumentException("Invalid path " + path)...
[ "public", "void", "addPath", "(", "String", "path", ")", "{", "if", "(", "path", "==", "null", ")", "{", "return", ";", "}", "String", "[", "]", "pathComponents", "=", "path", ".", "split", "(", "\"/\"", ")", ";", "TrieNode", "parent", "=", "rootNode...
add a path to the path trie @param path
[ "add", "a", "path", "to", "the", "path", "trie" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/common/PathTrie.java#L197-L215
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/common/PathTrie.java
PathTrie.deletePath
public void deletePath(String path) { if (path == null) { return; } String[] pathComponents = path.split("/"); TrieNode parent = rootNode; String part = null; if (pathComponents.length <= 1) { throw new IllegalArgumentException("Invalid path " + pa...
java
public void deletePath(String path) { if (path == null) { return; } String[] pathComponents = path.split("/"); TrieNode parent = rootNode; String part = null; if (pathComponents.length <= 1) { throw new IllegalArgumentException("Invalid path " + pa...
[ "public", "void", "deletePath", "(", "String", "path", ")", "{", "if", "(", "path", "==", "null", ")", "{", "return", ";", "}", "String", "[", "]", "pathComponents", "=", "path", ".", "split", "(", "\"/\"", ")", ";", "TrieNode", "parent", "=", "rootN...
delete a path from the trie @param path the path to be deleted
[ "delete", "a", "path", "from", "the", "trie" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/common/PathTrie.java#L221-L242
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/common/PathTrie.java
PathTrie.findMaxPrefix
public String findMaxPrefix(String path) { if (path == null) { return null; } if ("/".equals(path)) { return path; } String[] pathComponents = path.split("/"); TrieNode parent = rootNode; List<String> components = new ArrayList<String>(); ...
java
public String findMaxPrefix(String path) { if (path == null) { return null; } if ("/".equals(path)) { return path; } String[] pathComponents = path.split("/"); TrieNode parent = rootNode; List<String> components = new ArrayList<String>(); ...
[ "public", "String", "findMaxPrefix", "(", "String", "path", ")", "{", "if", "(", "path", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "\"/\"", ".", "equals", "(", "path", ")", ")", "{", "return", "path", ";", "}", "String", "[", ...
return the largest prefix for the input path. @param path the input path @return the largest prefix for the input path.
[ "return", "the", "largest", "prefix", "for", "the", "input", "path", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/common/PathTrie.java#L249-L284
train
VoltDB/voltdb
src/frontend/org/voltdb/TableShorthand.java
TableShorthand.tableFromShorthand
public static VoltTable tableFromShorthand(String schema) { String name = "T"; VoltTable.ColumnInfo[] columns = null; // get a name Matcher nameMatcher = m_namePattern.matcher(schema); if (nameMatcher.find()) { name = nameMatcher.group().trim(); } /...
java
public static VoltTable tableFromShorthand(String schema) { String name = "T"; VoltTable.ColumnInfo[] columns = null; // get a name Matcher nameMatcher = m_namePattern.matcher(schema); if (nameMatcher.find()) { name = nameMatcher.group().trim(); } /...
[ "public", "static", "VoltTable", "tableFromShorthand", "(", "String", "schema", ")", "{", "String", "name", "=", "\"T\"", ";", "VoltTable", ".", "ColumnInfo", "[", "]", "columns", "=", "null", ";", "// get a name", "Matcher", "nameMatcher", "=", "m_namePattern",...
Parse the shorthand according to the syntax as described in the class comment.
[ "Parse", "the", "shorthand", "according", "to", "the", "syntax", "as", "described", "in", "the", "class", "comment", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TableShorthand.java#L152-L226
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/Sort.java
Sort.swap
private static void swap(Object[] w, int a, int b) { Object t = w[a]; w[a] = w[b]; w[b] = t; }
java
private static void swap(Object[] w, int a, int b) { Object t = w[a]; w[a] = w[b]; w[b] = t; }
[ "private", "static", "void", "swap", "(", "Object", "[", "]", "w", ",", "int", "a", ",", "int", "b", ")", "{", "Object", "t", "=", "w", "[", "a", "]", ";", "w", "[", "a", "]", "=", "w", "[", "b", "]", ";", "w", "[", "b", "]", "=", "t", ...
Swaps the a'th and b'th elements of the specified Row array.
[ "Swaps", "the", "a", "th", "and", "b", "th", "elements", "of", "the", "specified", "Row", "array", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/Sort.java#L149-L155
train
VoltDB/voltdb
src/frontend/org/voltdb/client/VoltBulkLoader/PerPartitionTable.java
PerPartitionTable.insertRowInTable
synchronized void insertRowInTable(final VoltBulkLoaderRow nextRow) throws InterruptedException { m_partitionRowQueue.put(nextRow); if (m_partitionRowQueue.size() == m_minBatchTriggerSize) { m_es.execute(new Runnable() { @Override public void run() { ...
java
synchronized void insertRowInTable(final VoltBulkLoaderRow nextRow) throws InterruptedException { m_partitionRowQueue.put(nextRow); if (m_partitionRowQueue.size() == m_minBatchTriggerSize) { m_es.execute(new Runnable() { @Override public void run() { ...
[ "synchronized", "void", "insertRowInTable", "(", "final", "VoltBulkLoaderRow", "nextRow", ")", "throws", "InterruptedException", "{", "m_partitionRowQueue", ".", "put", "(", "nextRow", ")", ";", "if", "(", "m_partitionRowQueue", ".", "size", "(", ")", "==", "m_min...
Synchronized so that when the a single batch is filled up, we only queue one task to drain the queue. The task will drain the queue until it doesn't contain a single batch.
[ "Synchronized", "so", "that", "when", "the", "a", "single", "batch", "is", "filled", "up", "we", "only", "queue", "one", "task", "to", "drain", "the", "queue", ".", "The", "task", "will", "drain", "the", "queue", "until", "it", "doesn", "t", "contain", ...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/client/VoltBulkLoader/PerPartitionTable.java#L170-L186
train
VoltDB/voltdb
src/frontend/org/voltdb/CLIConfig.java
CLIConfig.getFields
public static List<Field> getFields(Class<?> startClass) { List<Field> currentClassFields = new ArrayList<Field>(); currentClassFields.addAll(Arrays.asList(startClass.getDeclaredFields())); Class<?> parentClass = startClass.getSuperclass(); if (parentClass != null) { List<Fie...
java
public static List<Field> getFields(Class<?> startClass) { List<Field> currentClassFields = new ArrayList<Field>(); currentClassFields.addAll(Arrays.asList(startClass.getDeclaredFields())); Class<?> parentClass = startClass.getSuperclass(); if (parentClass != null) { List<Fie...
[ "public", "static", "List", "<", "Field", ">", "getFields", "(", "Class", "<", "?", ">", "startClass", ")", "{", "List", "<", "Field", ">", "currentClassFields", "=", "new", "ArrayList", "<", "Field", ">", "(", ")", ";", "currentClassFields", ".", "addAl...
get all the fields, including parents @param startClass the current class @return a list of fields
[ "get", "all", "the", "fields", "including", "parents" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/CLIConfig.java#L259-L268
train
VoltDB/voltdb
src/frontend/org/voltdb/importer/ImportManager.java
ImportManager.initialize
public static synchronized void initialize(int myHostId, CatalogContext catalogContext, HostMessenger messenger) throws BundleException, IOException { ImporterStatsCollector statsCollector = new ImporterStatsCollector(myHostId); ImportManager em = new ImportManager(myHostId, messenger, statsCollector); ...
java
public static synchronized void initialize(int myHostId, CatalogContext catalogContext, HostMessenger messenger) throws BundleException, IOException { ImporterStatsCollector statsCollector = new ImporterStatsCollector(myHostId); ImportManager em = new ImportManager(myHostId, messenger, statsCollector); ...
[ "public", "static", "synchronized", "void", "initialize", "(", "int", "myHostId", ",", "CatalogContext", "catalogContext", ",", "HostMessenger", "messenger", ")", "throws", "BundleException", ",", "IOException", "{", "ImporterStatsCollector", "statsCollector", "=", "new...
Create the singleton ImportManager and initialize. @param myHostId my host id in cluster @param catalogContext current catalog context @param messenger messenger to get to ZK @throws org.osgi.framework.BundleException @throws java.io.IOException
[ "Create", "the", "singleton", "ImportManager", "and", "initialize", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ImportManager.java#L112-L122
train
VoltDB/voltdb
src/frontend/org/voltdb/importer/ImportManager.java
ImportManager.create
private synchronized void create(CatalogContext catalogContext) { try { Map<String, ImportConfiguration> newProcessorConfig = loadNewConfigAndBundles(catalogContext); restartImporters(newProcessorConfig); } catch (final Exception e) { VoltDB.crashLocalVoltDB("Error cr...
java
private synchronized void create(CatalogContext catalogContext) { try { Map<String, ImportConfiguration> newProcessorConfig = loadNewConfigAndBundles(catalogContext); restartImporters(newProcessorConfig); } catch (final Exception e) { VoltDB.crashLocalVoltDB("Error cr...
[ "private", "synchronized", "void", "create", "(", "CatalogContext", "catalogContext", ")", "{", "try", "{", "Map", "<", "String", ",", "ImportConfiguration", ">", "newProcessorConfig", "=", "loadNewConfigAndBundles", "(", "catalogContext", ")", ";", "restartImporters"...
This creates a import connector from configuration provided. @param catalogContext
[ "This", "creates", "a", "import", "connector", "from", "configuration", "provided", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ImportManager.java#L128-L135
train
VoltDB/voltdb
src/frontend/org/voltdb/importer/ImportManager.java
ImportManager.loadNewConfigAndBundles
private Map<String, ImportConfiguration> loadNewConfigAndBundles(CatalogContext catalogContext) { Map<String, ImportConfiguration> newProcessorConfig; ImportType importElement = catalogContext.getDeployment().getImport(); if (importElement == null || importElement.getConfiguration().isEmpty()) ...
java
private Map<String, ImportConfiguration> loadNewConfigAndBundles(CatalogContext catalogContext) { Map<String, ImportConfiguration> newProcessorConfig; ImportType importElement = catalogContext.getDeployment().getImport(); if (importElement == null || importElement.getConfiguration().isEmpty()) ...
[ "private", "Map", "<", "String", ",", "ImportConfiguration", ">", "loadNewConfigAndBundles", "(", "CatalogContext", "catalogContext", ")", "{", "Map", "<", "String", ",", "ImportConfiguration", ">", "newProcessorConfig", ";", "ImportType", "importElement", "=", "catal...
Parses importer configs and loads the formatters and bundles needed into memory. This is used to generate a new configuration either to load or to compare with existing. @param catalogContext new catalog context @return new importer configuration
[ "Parses", "importer", "configs", "and", "loads", "the", "formatters", "and", "bundles", "needed", "into", "memory", ".", "This", "is", "used", "to", "generate", "a", "new", "configuration", "either", "to", "load", "or", "to", "compare", "with", "existing", "...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ImportManager.java#L161-L216
train
VoltDB/voltdb
src/frontend/org/voltdb/importer/ImportManager.java
ImportManager.loadImporterBundle
private boolean loadImporterBundle(Properties moduleProperties){ String importModuleName = moduleProperties.getProperty(ImportDataProcessor.IMPORT_MODULE); String attrs[] = importModuleName.split("\\|"); String bundleJar = attrs[1]; String moduleType = attrs[0]; try { ...
java
private boolean loadImporterBundle(Properties moduleProperties){ String importModuleName = moduleProperties.getProperty(ImportDataProcessor.IMPORT_MODULE); String attrs[] = importModuleName.split("\\|"); String bundleJar = attrs[1]; String moduleType = attrs[0]; try { ...
[ "private", "boolean", "loadImporterBundle", "(", "Properties", "moduleProperties", ")", "{", "String", "importModuleName", "=", "moduleProperties", ".", "getProperty", "(", "ImportDataProcessor", ".", "IMPORT_MODULE", ")", ";", "String", "attrs", "[", "]", "=", "imp...
Checks if the module for importer has been loaded in the memory. If bundle doesn't exists, it loades one and updates the mapping records of the bundles. @param moduleProperties @return true, if the bundle corresponding to the importer is in memory (uploaded or was already present)
[ "Checks", "if", "the", "module", "for", "importer", "has", "been", "loaded", "in", "the", "memory", ".", "If", "bundle", "doesn", "t", "exists", "it", "loades", "one", "and", "updates", "the", "mapping", "records", "of", "the", "bundles", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ImportManager.java#L225-L264
train
VoltDB/voltdb
src/frontend/org/voltdb/NonVoltDBBackend.java
NonVoltDBBackend.printCaughtException
protected static void printCaughtException(String exceptionMessage) { if (++countCaughtExceptions <= MAX_CAUGHT_EXCEPTION_MESSAGES) { System.out.println(exceptionMessage); } if (countCaughtExceptions == MAX_CAUGHT_EXCEPTION_MESSAGES) { System.out.println("In NonVoltDBBack...
java
protected static void printCaughtException(String exceptionMessage) { if (++countCaughtExceptions <= MAX_CAUGHT_EXCEPTION_MESSAGES) { System.out.println(exceptionMessage); } if (countCaughtExceptions == MAX_CAUGHT_EXCEPTION_MESSAGES) { System.out.println("In NonVoltDBBack...
[ "protected", "static", "void", "printCaughtException", "(", "String", "exceptionMessage", ")", "{", "if", "(", "++", "countCaughtExceptions", "<=", "MAX_CAUGHT_EXCEPTION_MESSAGES", ")", "{", "System", ".", "out", ".", "println", "(", "exceptionMessage", ")", ";", ...
Print a message about an Exception that was caught; but limit the number of such print messages, so that the console is not swamped by them.
[ "Print", "a", "message", "about", "an", "Exception", "that", "was", "caught", ";", "but", "limit", "the", "number", "of", "such", "print", "messages", "so", "that", "the", "console", "is", "not", "swamped", "by", "them", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/NonVoltDBBackend.java#L418-L426
train
VoltDB/voltdb
src/frontend/org/voltdb/NonVoltDBBackend.java
NonVoltDBBackend.getAllColumns
protected List<String> getAllColumns(String tableName) { List<String> columns = new ArrayList<String>(); try { // Lower-case table names are required for PostgreSQL; we might need to // alter this if we use another comparison database (besides HSQL) someday ResultSet ...
java
protected List<String> getAllColumns(String tableName) { List<String> columns = new ArrayList<String>(); try { // Lower-case table names are required for PostgreSQL; we might need to // alter this if we use another comparison database (besides HSQL) someday ResultSet ...
[ "protected", "List", "<", "String", ">", "getAllColumns", "(", "String", "tableName", ")", "{", "List", "<", "String", ">", "columns", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "try", "{", "// Lower-case table names are required for PostgreSQL;...
Returns all column names for the specified table, in the order defined in the DDL.
[ "Returns", "all", "column", "names", "for", "the", "specified", "table", "in", "the", "order", "defined", "in", "the", "DDL", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/NonVoltDBBackend.java#L430-L443
train
VoltDB/voltdb
src/frontend/org/voltdb/NonVoltDBBackend.java
NonVoltDBBackend.getPrimaryKeys
protected List<String> getPrimaryKeys(String tableName) { List<String> pkCols = new ArrayList<String>(); try { // Lower-case table names are required for PostgreSQL; we might need to // alter this if we use another comparison database (besides HSQL) someday ResultSet ...
java
protected List<String> getPrimaryKeys(String tableName) { List<String> pkCols = new ArrayList<String>(); try { // Lower-case table names are required for PostgreSQL; we might need to // alter this if we use another comparison database (besides HSQL) someday ResultSet ...
[ "protected", "List", "<", "String", ">", "getPrimaryKeys", "(", "String", "tableName", ")", "{", "List", "<", "String", ">", "pkCols", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "try", "{", "// Lower-case table names are required for PostgreSQL;...
Returns all primary key column names for the specified table, in the order defined in the DDL.
[ "Returns", "all", "primary", "key", "column", "names", "for", "the", "specified", "table", "in", "the", "order", "defined", "in", "the", "DDL", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/NonVoltDBBackend.java#L447-L460
train
VoltDB/voltdb
src/frontend/org/voltdb/NonVoltDBBackend.java
NonVoltDBBackend.getNonPrimaryKeyColumns
protected List<String> getNonPrimaryKeyColumns(String tableName) { List<String> columns = getAllColumns(tableName); columns.removeAll(getPrimaryKeys(tableName)); return columns; }
java
protected List<String> getNonPrimaryKeyColumns(String tableName) { List<String> columns = getAllColumns(tableName); columns.removeAll(getPrimaryKeys(tableName)); return columns; }
[ "protected", "List", "<", "String", ">", "getNonPrimaryKeyColumns", "(", "String", "tableName", ")", "{", "List", "<", "String", ">", "columns", "=", "getAllColumns", "(", "tableName", ")", ";", "columns", ".", "removeAll", "(", "getPrimaryKeys", "(", "tableNa...
Returns all non-primary-key column names for the specified table, in the order defined in the DDL.
[ "Returns", "all", "non", "-", "primary", "-", "key", "column", "names", "for", "the", "specified", "table", "in", "the", "order", "defined", "in", "the", "DDL", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/NonVoltDBBackend.java#L464-L468
train
VoltDB/voltdb
src/frontend/org/voltdb/NonVoltDBBackend.java
NonVoltDBBackend.transformQuery
protected String transformQuery(String query, QueryTransformer ... qts) { String result = query; for (QueryTransformer qt : qts) { result = transformQuery(result, qt); } return result; }
java
protected String transformQuery(String query, QueryTransformer ... qts) { String result = query; for (QueryTransformer qt : qts) { result = transformQuery(result, qt); } return result; }
[ "protected", "String", "transformQuery", "(", "String", "query", ",", "QueryTransformer", "...", "qts", ")", "{", "String", "result", "=", "query", ";", "for", "(", "QueryTransformer", "qt", ":", "qts", ")", "{", "result", "=", "transformQuery", "(", "result...
Calls the transformQuery method above multiple times, for each specified QueryTransformer.
[ "Calls", "the", "transformQuery", "method", "above", "multiple", "times", "for", "each", "specified", "QueryTransformer", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/NonVoltDBBackend.java#L899-L905
train
VoltDB/voltdb
src/frontend/org/voltdb/NonVoltDBBackend.java
NonVoltDBBackend.printTransformedSql
static protected void printTransformedSql(String originalSql, String modifiedSql) { if (transformedSqlFileWriter != null && !originalSql.equals(modifiedSql)) { try { transformedSqlFileWriter.write("original SQL: " + originalSql + "\n"); transformedSqlFileWriter.write(...
java
static protected void printTransformedSql(String originalSql, String modifiedSql) { if (transformedSqlFileWriter != null && !originalSql.equals(modifiedSql)) { try { transformedSqlFileWriter.write("original SQL: " + originalSql + "\n"); transformedSqlFileWriter.write(...
[ "static", "protected", "void", "printTransformedSql", "(", "String", "originalSql", ",", "String", "modifiedSql", ")", "{", "if", "(", "transformedSqlFileWriter", "!=", "null", "&&", "!", "originalSql", ".", "equals", "(", "modifiedSql", ")", ")", "{", "try", ...
Prints the original and modified SQL statements, to the "Transformed SQL" output file, assuming that that file is defined; and only if the original and modified SQL are not the same, i.e., only if some transformation has indeed taken place.
[ "Prints", "the", "original", "and", "modified", "SQL", "statements", "to", "the", "Transformed", "SQL", "output", "file", "assuming", "that", "that", "file", "is", "defined", ";", "and", "only", "if", "the", "original", "and", "modified", "SQL", "are", "not"...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/NonVoltDBBackend.java#L911-L922
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLPatternFactory.java
SQLPatternFactory.makeGroup
private static SQLPatternPart makeGroup(boolean capture, String captureLabel, SQLPatternPart part) { // Need an outer part if capturing something that's already a group (capturing or not) boolean alreadyGroup = (part.m_flags & (SQLPatternFactory.GROUP | SQLPatternFactory.CAPTURE)) != 0; SQLP...
java
private static SQLPatternPart makeGroup(boolean capture, String captureLabel, SQLPatternPart part) { // Need an outer part if capturing something that's already a group (capturing or not) boolean alreadyGroup = (part.m_flags & (SQLPatternFactory.GROUP | SQLPatternFactory.CAPTURE)) != 0; SQLP...
[ "private", "static", "SQLPatternPart", "makeGroup", "(", "boolean", "capture", ",", "String", "captureLabel", ",", "SQLPatternPart", "part", ")", "{", "// Need an outer part if capturing something that's already a group (capturing or not)", "boolean", "alreadyGroup", "=", "(", ...
Make a capturing or non-capturing group
[ "Make", "a", "capturing", "or", "non", "-", "capturing", "group" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLPatternFactory.java#L298-L311
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java
HSQLInterface.loadHsqldb
public static HSQLInterface loadHsqldb(ParameterStateManager psMgr) { // Specifically set the timezone to UTC to avoid the default usage local timezone in HSQL. // This ensures that all VoltDB data paths use the same timezone for representing time. TimeZone.setDefault(TimeZone.getTimeZone("GMT+0...
java
public static HSQLInterface loadHsqldb(ParameterStateManager psMgr) { // Specifically set the timezone to UTC to avoid the default usage local timezone in HSQL. // This ensures that all VoltDB data paths use the same timezone for representing time. TimeZone.setDefault(TimeZone.getTimeZone("GMT+0...
[ "public", "static", "HSQLInterface", "loadHsqldb", "(", "ParameterStateManager", "psMgr", ")", "{", "// Specifically set the timezone to UTC to avoid the default usage local timezone in HSQL.", "// This ensures that all VoltDB data paths use the same timezone for representing time.", "TimeZone...
Load up an HSQLDB in-memory instance. @return A newly initialized in-memory HSQLDB instance accessible through the returned instance of HSQLInterface
[ "Load", "up", "an", "HSQLDB", "in", "-", "memory", "instance", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java#L146-L168
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java
HSQLInterface.runDDLCommandAndDiff
public VoltXMLDiff runDDLCommandAndDiff(HSQLDDLInfo stmtInfo, String ddl) throws HSQLParseException { // name of the table we're going to have to diff (if any) String expectedTableAffected = null; // If ...
java
public VoltXMLDiff runDDLCommandAndDiff(HSQLDDLInfo stmtInfo, String ddl) throws HSQLParseException { // name of the table we're going to have to diff (if any) String expectedTableAffected = null; // If ...
[ "public", "VoltXMLDiff", "runDDLCommandAndDiff", "(", "HSQLDDLInfo", "stmtInfo", ",", "String", "ddl", ")", "throws", "HSQLParseException", "{", "// name of the table we're going to have to diff (if any)", "String", "expectedTableAffected", "=", "null", ";", "// If we fail to p...
Modify the current schema with a SQL DDL command and get the diff which represents the changes. Note that you have to be consistent WRT case for the expected names. @param expectedTableAffected The name of the table affected by this DDL or null if unknown @param expectedIndexAffected The name of the index affected by...
[ "Modify", "the", "current", "schema", "with", "a", "SQL", "DDL", "command", "and", "get", "the", "diff", "which", "represents", "the", "changes", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java#L185-L282
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java
HSQLInterface.runDDLCommand
public void runDDLCommand(String ddl) throws HSQLParseException { sessionProxy.clearLocalTables(); Result result = sessionProxy.executeDirectStatement(ddl); if (result.hasError()) { throw new HSQLParseException(result.getMainString()); } }
java
public void runDDLCommand(String ddl) throws HSQLParseException { sessionProxy.clearLocalTables(); Result result = sessionProxy.executeDirectStatement(ddl); if (result.hasError()) { throw new HSQLParseException(result.getMainString()); } }
[ "public", "void", "runDDLCommand", "(", "String", "ddl", ")", "throws", "HSQLParseException", "{", "sessionProxy", ".", "clearLocalTables", "(", ")", ";", "Result", "result", "=", "sessionProxy", ".", "executeDirectStatement", "(", "ddl", ")", ";", "if", "(", ...
Modify the current schema with a SQL DDL command. @param ddl The SQL DDL statement to be run. @throws HSQLParseException Throws exception if SQL parse error is encountered.
[ "Modify", "the", "current", "schema", "with", "a", "SQL", "DDL", "command", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java#L291-L297
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java
HSQLInterface.fixupInStatementExpressions
private void fixupInStatementExpressions(VoltXMLElement expr) throws HSQLParseException { if (doesExpressionReallyMeanIn(expr)) { inFixup(expr); // can't return because in with subquery can be nested } // recursive hunt for (VoltXMLElement child : expr.children) ...
java
private void fixupInStatementExpressions(VoltXMLElement expr) throws HSQLParseException { if (doesExpressionReallyMeanIn(expr)) { inFixup(expr); // can't return because in with subquery can be nested } // recursive hunt for (VoltXMLElement child : expr.children) ...
[ "private", "void", "fixupInStatementExpressions", "(", "VoltXMLElement", "expr", ")", "throws", "HSQLParseException", "{", "if", "(", "doesExpressionReallyMeanIn", "(", "expr", ")", ")", "{", "inFixup", "(", "expr", ")", ";", "// can't return because in with subquery ca...
Recursively find all in-lists, subquery, row comparisons found in the XML and munge them into the simpler thing we want to pass to the AbstractParsedStmt. @throws HSQLParseException
[ "Recursively", "find", "all", "in", "-", "lists", "subquery", "row", "comparisons", "found", "in", "the", "XML", "and", "munge", "them", "into", "the", "simpler", "thing", "we", "want", "to", "pass", "to", "the", "AbstractParsedStmt", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java#L418-L428
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java
HSQLInterface.inFixup
private void inFixup(VoltXMLElement inElement) { // make this an in expression inElement.name = "operation"; inElement.attributes.put("optype", "in"); VoltXMLElement rowElem = null; VoltXMLElement tableElem = null; VoltXMLElement subqueryElem = null; VoltXMLEleme...
java
private void inFixup(VoltXMLElement inElement) { // make this an in expression inElement.name = "operation"; inElement.attributes.put("optype", "in"); VoltXMLElement rowElem = null; VoltXMLElement tableElem = null; VoltXMLElement subqueryElem = null; VoltXMLEleme...
[ "private", "void", "inFixup", "(", "VoltXMLElement", "inElement", ")", "{", "// make this an in expression", "inElement", ".", "name", "=", "\"operation\"", ";", "inElement", ".", "attributes", ".", "put", "(", "\"optype\"", ",", "\"in\"", ")", ";", "VoltXMLElemen...
Take an equality-test expression that represents in-list and munge it into the simpler thing we want to output to the AbstractParsedStmt for its AbstractExpression classes.
[ "Take", "an", "equality", "-", "test", "expression", "that", "represents", "in", "-", "list", "and", "munge", "it", "into", "the", "simpler", "thing", "we", "want", "to", "output", "to", "the", "AbstractParsedStmt", "for", "its", "AbstractExpression", "classes...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java#L478-L527
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java
HSQLInterface.printTables
@SuppressWarnings("unused") private void printTables() { try { String schemaName = sessionProxy.getSchemaName(null); System.out.println("*** Tables For Schema: " + schemaName + " ***"); } catch (HsqlException caught) { caught.printStackTrace(); } ...
java
@SuppressWarnings("unused") private void printTables() { try { String schemaName = sessionProxy.getSchemaName(null); System.out.println("*** Tables For Schema: " + schemaName + " ***"); } catch (HsqlException caught) { caught.printStackTrace(); } ...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "private", "void", "printTables", "(", ")", "{", "try", "{", "String", "schemaName", "=", "sessionProxy", ".", "getSchemaName", "(", "null", ")", ";", "System", ".", "out", ".", "println", "(", "\"*** Tables F...
Debug-only method that prints out the names of all tables in the current schema.
[ "Debug", "-", "only", "method", "that", "prints", "out", "the", "names", "of", "all", "tables", "in", "the", "current", "schema", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java#L533-L549
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java
HSQLInterface.getXMLForTable
public VoltXMLElement getXMLForTable(String tableName) throws HSQLParseException { VoltXMLElement xml = emptySchema.duplicate(); // search all the tables XXX probably could do this non-linearly, // but i don't know about case-insensitivity yet HashMappedList hsqlTables = getHSQLTables(...
java
public VoltXMLElement getXMLForTable(String tableName) throws HSQLParseException { VoltXMLElement xml = emptySchema.duplicate(); // search all the tables XXX probably could do this non-linearly, // but i don't know about case-insensitivity yet HashMappedList hsqlTables = getHSQLTables(...
[ "public", "VoltXMLElement", "getXMLForTable", "(", "String", "tableName", ")", "throws", "HSQLParseException", "{", "VoltXMLElement", "xml", "=", "emptySchema", ".", "duplicate", "(", ")", ";", "// search all the tables XXX probably could do this non-linearly,", "// but i do...
Get a serialized XML representation of a particular table.
[ "Get", "a", "serialized", "XML", "representation", "of", "a", "particular", "table", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java#L611-L630
train
VoltDB/voltdb
src/frontend/org/voltdb/importclient/kafka10/KafkaConsumerRunner.java
KafkaConsumerRunner.calculateTrackers
private void calculateTrackers(Collection<TopicPartition> partitions) { Map<TopicPartition, CommitTracker> trackers = new HashMap<>(); trackers.putAll(m_trackerMap.get()); Map<TopicPartition, AtomicLong> lastCommittedOffSets = new HashMap<>(); lastCommittedOffSets.putAll(m_lastCommitte...
java
private void calculateTrackers(Collection<TopicPartition> partitions) { Map<TopicPartition, CommitTracker> trackers = new HashMap<>(); trackers.putAll(m_trackerMap.get()); Map<TopicPartition, AtomicLong> lastCommittedOffSets = new HashMap<>(); lastCommittedOffSets.putAll(m_lastCommitte...
[ "private", "void", "calculateTrackers", "(", "Collection", "<", "TopicPartition", ">", "partitions", ")", "{", "Map", "<", "TopicPartition", ",", "CommitTracker", ">", "trackers", "=", "new", "HashMap", "<>", "(", ")", ";", "trackers", ".", "putAll", "(", "m...
add trackers for new topic-partition in this importer
[ "add", "trackers", "for", "new", "topic", "-", "partition", "in", "this", "importer" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importclient/kafka10/KafkaConsumerRunner.java#L134-L177
train
VoltDB/voltdb
src/frontend/org/voltdb/importclient/kafka10/KafkaConsumerRunner.java
KafkaConsumerRunner.seek
private void seek(List<TopicPartition> seekList) { for (TopicPartition tp : seekList) { AtomicLong lastCommittedOffset = m_lastCommittedOffSets.get().get(tp); if (lastCommittedOffset != null && lastCommittedOffset.get() > -1L) { AtomicLong lastSeeked = m_lastSeekedOffSets...
java
private void seek(List<TopicPartition> seekList) { for (TopicPartition tp : seekList) { AtomicLong lastCommittedOffset = m_lastCommittedOffSets.get().get(tp); if (lastCommittedOffset != null && lastCommittedOffset.get() > -1L) { AtomicLong lastSeeked = m_lastSeekedOffSets...
[ "private", "void", "seek", "(", "List", "<", "TopicPartition", ">", "seekList", ")", "{", "for", "(", "TopicPartition", "tp", ":", "seekList", ")", "{", "AtomicLong", "lastCommittedOffset", "=", "m_lastCommittedOffSets", ".", "get", "(", ")", ".", "get", "("...
Move offsets to correct positions for next poll
[ "Move", "offsets", "to", "correct", "positions", "for", "next", "poll" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importclient/kafka10/KafkaConsumerRunner.java#L355-L373
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java
StringUtil.toZeroPaddedString
public static String toZeroPaddedString(long value, int precision, int maxSize) { StringBuffer sb = new StringBuffer(); if (value < 0) { value = -value; } String s = Long.toString(value); if (s.length() > precision) { s = s.substring(precis...
java
public static String toZeroPaddedString(long value, int precision, int maxSize) { StringBuffer sb = new StringBuffer(); if (value < 0) { value = -value; } String s = Long.toString(value); if (s.length() > precision) { s = s.substring(precis...
[ "public", "static", "String", "toZeroPaddedString", "(", "long", "value", ",", "int", "precision", ",", "int", "maxSize", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "if", "(", "value", "<", "0", ")", "{", "value", "=", "...
If necessary, adds zeros to the beginning of a value so that the total length matches the given precision, otherwise trims the right digits. Then if maxSize is smaller than precision, trims the right digits to maxSize. Negative values are treated as positive
[ "If", "necessary", "adds", "zeros", "to", "the", "beginning", "of", "a", "value", "so", "that", "the", "total", "length", "matches", "the", "given", "precision", "otherwise", "trims", "the", "right", "digits", ".", "Then", "if", "maxSize", "is", "smaller", ...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java#L53-L79
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java
StringUtil.toLowerSubset
public static String toLowerSubset(String source, char substitute) { int len = source.length(); StringBuffer sb = new StringBuffer(len); char ch; for (int i = 0; i < len; i++) { ch = source.charAt(i); if (!Character.isLetterOrDigit(ch)) { ...
java
public static String toLowerSubset(String source, char substitute) { int len = source.length(); StringBuffer sb = new StringBuffer(len); char ch; for (int i = 0; i < len; i++) { ch = source.charAt(i); if (!Character.isLetterOrDigit(ch)) { ...
[ "public", "static", "String", "toLowerSubset", "(", "String", "source", ",", "char", "substitute", ")", "{", "int", "len", "=", "source", ".", "length", "(", ")", ";", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "len", ")", ";", "char", "ch", ...
Returns a string with non alphanumeric chars converted to the substitute character. A digit first character is also converted. By sqlbob@users @param source string to convert @param substitute character to use @return converted string
[ "Returns", "a", "string", "with", "non", "alphanumeric", "chars", "converted", "to", "the", "substitute", "character", ".", "A", "digit", "first", "character", "is", "also", "converted", ".", "By", "sqlbob" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java#L115-L134
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java
StringUtil.arrayToString
public static String arrayToString(Object array) { int len = Array.getLength(array); int last = len - 1; StringBuffer sb = new StringBuffer(2 * (len + 1)); sb.append('{'); for (int i = 0; i < len; i++) { sb.append(Array.get(array, i)); ...
java
public static String arrayToString(Object array) { int len = Array.getLength(array); int last = len - 1; StringBuffer sb = new StringBuffer(2 * (len + 1)); sb.append('{'); for (int i = 0; i < len; i++) { sb.append(Array.get(array, i)); ...
[ "public", "static", "String", "arrayToString", "(", "Object", "array", ")", "{", "int", "len", "=", "Array", ".", "getLength", "(", "array", ")", ";", "int", "last", "=", "len", "-", "1", ";", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "2",...
Builds a bracketed CSV list from the array @param array an array of Objects @return string
[ "Builds", "a", "bracketed", "CSV", "list", "from", "the", "array" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java#L141-L160
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java
StringUtil.appendPair
public static void appendPair(StringBuffer b, String s1, String s2, String separator, String terminator) { b.append(s1); b.append(separator); b.append(s2); b.append(terminator); }
java
public static void appendPair(StringBuffer b, String s1, String s2, String separator, String terminator) { b.append(s1); b.append(separator); b.append(s2); b.append(terminator); }
[ "public", "static", "void", "appendPair", "(", "StringBuffer", "b", ",", "String", "s1", ",", "String", "s2", ",", "String", "separator", ",", "String", "terminator", ")", "{", "b", ".", "append", "(", "s1", ")", ";", "b", ".", "append", "(", "separato...
Appends a pair of string to the string buffer, using the separator between and terminator at the end @param b the buffer @param s1 first string @param s2 second string @param separator separator string @param terminator terminator string
[ "Appends", "a", "pair", "of", "string", "to", "the", "string", "buffer", "using", "the", "separator", "between", "and", "terminator", "at", "the", "end" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java#L279-L286
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java
StringUtil.rightTrimSize
public static int rightTrimSize(String s) { int i = s.length(); while (i > 0) { i--; if (s.charAt(i) != ' ') { return i + 1; } } return 0; }
java
public static int rightTrimSize(String s) { int i = s.length(); while (i > 0) { i--; if (s.charAt(i) != ' ') { return i + 1; } } return 0; }
[ "public", "static", "int", "rightTrimSize", "(", "String", "s", ")", "{", "int", "i", "=", "s", ".", "length", "(", ")", ";", "while", "(", "i", ">", "0", ")", "{", "i", "--", ";", "if", "(", "s", ".", "charAt", "(", "i", ")", "!=", "'", "'...
Returns the size of substring that does not contain any trailing spaces @param s the string @return trimmed size
[ "Returns", "the", "size", "of", "substring", "that", "does", "not", "contain", "any", "trailing", "spaces" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java#L312-L325
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java
StringUtil.skipSpaces
public static int skipSpaces(String s, int start) { int limit = s.length(); int i = start; for (; i < limit; i++) { if (s.charAt(i) != ' ') { break; } } return i; }
java
public static int skipSpaces(String s, int start) { int limit = s.length(); int i = start; for (; i < limit; i++) { if (s.charAt(i) != ' ') { break; } } return i; }
[ "public", "static", "int", "skipSpaces", "(", "String", "s", ",", "int", "start", ")", "{", "int", "limit", "=", "s", ".", "length", "(", ")", ";", "int", "i", "=", "start", ";", "for", "(", ";", "i", "<", "limit", ";", "i", "++", ")", "{", "...
Skips any spaces at or after start and returns the index of first non-space character; @param s the string @param start index to start @return index of first non-space
[ "Skips", "any", "spaces", "at", "or", "after", "start", "and", "returns", "the", "index", "of", "first", "non", "-", "space", "character", ";" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java#L334-L346
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java
StringUtil.split
public static String[] split(String s, String separator) { HsqlArrayList list = new HsqlArrayList(); int currindex = 0; for (boolean more = true; more; ) { int nextindex = s.indexOf(separator, currindex); if (nextindex == -1) { nextindex ...
java
public static String[] split(String s, String separator) { HsqlArrayList list = new HsqlArrayList(); int currindex = 0; for (boolean more = true; more; ) { int nextindex = s.indexOf(separator, currindex); if (nextindex == -1) { nextindex ...
[ "public", "static", "String", "[", "]", "split", "(", "String", "s", ",", "String", "separator", ")", "{", "HsqlArrayList", "list", "=", "new", "HsqlArrayList", "(", ")", ";", "int", "currindex", "=", "0", ";", "for", "(", "boolean", "more", "=", "true...
Splits the string into an array, using the separator. If separator is not found in the string, the whole string is returned in the array. @param s the string @param separator the separator @return array of strings
[ "Splits", "the", "string", "into", "an", "array", "using", "the", "separator", ".", "If", "separator", "is", "not", "found", "in", "the", "string", "the", "whole", "string", "is", "returned", "in", "the", "array", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/StringUtil.java#L356-L375
train
VoltDB/voltdb
src/frontend/org/voltdb/ExportStatsBase.java
ExportStatsBase.populateColumnSchema
@Override protected void populateColumnSchema(ArrayList<ColumnInfo> columns) { super.populateColumnSchema(columns); columns.add(new ColumnInfo(VoltSystemProcedure.CNAME_SITE_ID, VoltSystemProcedure.CTYPE_ID)); columns.add(new ColumnInfo(Columns.PARTITION_ID, VoltType.BIGINT)); column...
java
@Override protected void populateColumnSchema(ArrayList<ColumnInfo> columns) { super.populateColumnSchema(columns); columns.add(new ColumnInfo(VoltSystemProcedure.CNAME_SITE_ID, VoltSystemProcedure.CTYPE_ID)); columns.add(new ColumnInfo(Columns.PARTITION_ID, VoltType.BIGINT)); column...
[ "@", "Override", "protected", "void", "populateColumnSchema", "(", "ArrayList", "<", "ColumnInfo", ">", "columns", ")", "{", "super", ".", "populateColumnSchema", "(", "columns", ")", ";", "columns", ".", "add", "(", "new", "ColumnInfo", "(", "VoltSystemProcedur...
Check cluster.py and checkstats.py if order of the columns is changed,
[ "Check", "cluster", ".", "py", "and", "checkstats", ".", "py", "if", "order", "of", "the", "columns", "is", "changed" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ExportStatsBase.java#L90-L106
train
VoltDB/voltdb
src/frontend/org/voltdb/iv2/BufferedReadLog.java
BufferedReadLog.offerInternal
private void offerInternal(Mailbox mailbox, Item item, long handle) { m_bufferedReads.add(item); releaseBufferedReads(mailbox, handle); }
java
private void offerInternal(Mailbox mailbox, Item item, long handle) { m_bufferedReads.add(item); releaseBufferedReads(mailbox, handle); }
[ "private", "void", "offerInternal", "(", "Mailbox", "mailbox", ",", "Item", "item", ",", "long", "handle", ")", "{", "m_bufferedReads", ".", "add", "(", "item", ")", ";", "releaseBufferedReads", "(", "mailbox", ",", "handle", ")", ";", "}" ]
SPI offers a new message.
[ "SPI", "offers", "a", "new", "message", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/BufferedReadLog.java#L98-L101
train
VoltDB/voltdb
src/frontend/org/voltdb/export/StreamBlockQueue.java
StreamBlockQueue.sizeInBytes
public long sizeInBytes() throws IOException { long memoryBlockUsage = 0; for (StreamBlock b : m_memoryDeque) { //Use only total size, but throw in the USO //to make book keeping consistent when flushed to disk //Also dont count persisted blocks. memoryBlo...
java
public long sizeInBytes() throws IOException { long memoryBlockUsage = 0; for (StreamBlock b : m_memoryDeque) { //Use only total size, but throw in the USO //to make book keeping consistent when flushed to disk //Also dont count persisted blocks. memoryBlo...
[ "public", "long", "sizeInBytes", "(", ")", "throws", "IOException", "{", "long", "memoryBlockUsage", "=", "0", ";", "for", "(", "StreamBlock", "b", ":", "m_memoryDeque", ")", "{", "//Use only total size, but throw in the USO", "//to make book keeping consistent when flush...
Only used in tests, should be removed.
[ "Only", "used", "in", "tests", "should", "be", "removed", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/export/StreamBlockQueue.java#L308-L318
train
VoltDB/voltdb
src/frontend/org/voltdb/export/StreamBlockQueue.java
StreamBlockQueue.truncateToSequenceNumber
public void truncateToSequenceNumber(final long truncationSeqNo) throws IOException { assert(m_memoryDeque.isEmpty()); m_persistentDeque.parseAndTruncate(new BinaryDequeTruncator() { @Override public TruncatorResponse parse(BBContainer bbc) { ByteBuffer b = bbc.b...
java
public void truncateToSequenceNumber(final long truncationSeqNo) throws IOException { assert(m_memoryDeque.isEmpty()); m_persistentDeque.parseAndTruncate(new BinaryDequeTruncator() { @Override public TruncatorResponse parse(BBContainer bbc) { ByteBuffer b = bbc.b...
[ "public", "void", "truncateToSequenceNumber", "(", "final", "long", "truncationSeqNo", ")", "throws", "IOException", "{", "assert", "(", "m_memoryDeque", ".", "isEmpty", "(", ")", ")", ";", "m_persistentDeque", ".", "parseAndTruncate", "(", "new", "BinaryDequeTrunca...
See PDB segment layout at beginning of this file.
[ "See", "PDB", "segment", "layout", "at", "beginning", "of", "this", "file", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/export/StreamBlockQueue.java#L337-L400
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/store/BitMap.java
BitMap.set
public int set(int pos) { while (pos >= capacity) { doubleCapacity(); } if (pos >= limitPos) { limitPos = pos + 1; } int windex = pos >> 5; int mask = 0x80000000 >>> (pos & 0x1F); int word = map[windex]; int result = (word & ...
java
public int set(int pos) { while (pos >= capacity) { doubleCapacity(); } if (pos >= limitPos) { limitPos = pos + 1; } int windex = pos >> 5; int mask = 0x80000000 >>> (pos & 0x1F); int word = map[windex]; int result = (word & ...
[ "public", "int", "set", "(", "int", "pos", ")", "{", "while", "(", "pos", ">=", "capacity", ")", "{", "doubleCapacity", "(", ")", ";", "}", "if", "(", "pos", ">=", "limitPos", ")", "{", "limitPos", "=", "pos", "+", "1", ";", "}", "int", "windex",...
Sets pos and returns old value
[ "Sets", "pos", "and", "returns", "old", "value" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/store/BitMap.java#L83-L102
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/store/BitMap.java
BitMap.and
public static void and(byte[] map, int pos, byte source, int count) { int shift = pos & 0x07; int mask = (source & 0xff) >>> shift; int innermask = 0xff >> shift; int index = pos / 8; if (count < 8) { innermask = innermask >>> (8 - count); i...
java
public static void and(byte[] map, int pos, byte source, int count) { int shift = pos & 0x07; int mask = (source & 0xff) >>> shift; int innermask = 0xff >> shift; int index = pos / 8; if (count < 8) { innermask = innermask >>> (8 - count); i...
[ "public", "static", "void", "and", "(", "byte", "[", "]", "map", ",", "int", "pos", ",", "byte", "source", ",", "int", "count", ")", "{", "int", "shift", "=", "pos", "&", "0x07", ";", "int", "mask", "=", "(", "source", "&", "0xff", ")", ">>>", ...
AND count bits from source with map contents starting at pos
[ "AND", "count", "bits", "from", "source", "with", "map", "contents", "starting", "at", "pos" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/store/BitMap.java#L307-L347
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/store/BitMap.java
BitMap.or
public static void or(byte[] map, int pos, byte source, int count) { int shift = pos & 0x07; int mask = (source & 0xff) >>> shift; int index = pos / 8; if (index >= map.length) { return; } byte b = (byte) (map[index] | mask); map[index] = b; ...
java
public static void or(byte[] map, int pos, byte source, int count) { int shift = pos & 0x07; int mask = (source & 0xff) >>> shift; int index = pos / 8; if (index >= map.length) { return; } byte b = (byte) (map[index] | mask); map[index] = b; ...
[ "public", "static", "void", "or", "(", "byte", "[", "]", "map", ",", "int", "pos", ",", "byte", "source", ",", "int", "count", ")", "{", "int", "shift", "=", "pos", "&", "0x07", ";", "int", "mask", "=", "(", "source", "&", "0xff", ")", ">>>", "...
OR count bits from source with map contents starting at pos
[ "OR", "count", "bits", "from", "source", "with", "map", "contents", "starting", "at", "pos" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/store/BitMap.java#L352-L377
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java
DoubleIntIndex.addUnsorted
public synchronized boolean addUnsorted(int key, int value) { if (count == capacity) { if (fixedSize) { return false; } else { doubleCapacity(); } } if (sorted && count != 0) { if (sortOnValues) { i...
java
public synchronized boolean addUnsorted(int key, int value) { if (count == capacity) { if (fixedSize) { return false; } else { doubleCapacity(); } } if (sorted && count != 0) { if (sortOnValues) { i...
[ "public", "synchronized", "boolean", "addUnsorted", "(", "int", "key", ",", "int", "value", ")", "{", "if", "(", "count", "==", "capacity", ")", "{", "if", "(", "fixedSize", ")", "{", "return", "false", ";", "}", "else", "{", "doubleCapacity", "(", ")"...
Adds a pair into the table. @param key the key @param value the value @return true or false depending on success
[ "Adds", "a", "pair", "into", "the", "table", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java#L145-L174
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java
DoubleIntIndex.addUnique
public synchronized boolean addUnique(int key, int value) { if (count == capacity) { if (fixedSize) { return false; } else { doubleCapacity(); } } if (!sorted) { fastQuickSort(); } targetSearchValu...
java
public synchronized boolean addUnique(int key, int value) { if (count == capacity) { if (fixedSize) { return false; } else { doubleCapacity(); } } if (!sorted) { fastQuickSort(); } targetSearchValu...
[ "public", "synchronized", "boolean", "addUnique", "(", "int", "key", ",", "int", "value", ")", "{", "if", "(", "count", "==", "capacity", ")", "{", "if", "(", "fixedSize", ")", "{", "return", "false", ";", "}", "else", "{", "doubleCapacity", "(", ")", ...
Adds a pair, ensuring no duplicate key xor value already exists in the current search target column. @param key the key @param value the value @return true or false depending on success
[ "Adds", "a", "pair", "ensuring", "no", "duplicate", "key", "xor", "value", "already", "exists", "in", "the", "current", "search", "target", "column", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java#L215-L250
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java
DoubleIntIndex.binaryFirstSearch
private int binaryFirstSearch() { int low = 0; int high = count; int mid = 0; int compare = 0; int found = count; while (low < high) { mid = (low + high) / 2; compare = compare(mid); if (compare < 0) { ...
java
private int binaryFirstSearch() { int low = 0; int high = count; int mid = 0; int compare = 0; int found = count; while (low < high) { mid = (low + high) / 2; compare = compare(mid); if (compare < 0) { ...
[ "private", "int", "binaryFirstSearch", "(", ")", "{", "int", "low", "=", "0", ";", "int", "high", "=", "count", ";", "int", "mid", "=", "0", ";", "int", "compare", "=", "0", ";", "int", "found", "=", "count", ";", "while", "(", "low", "<", "high"...
Returns the index of the lowest element == the given search target, or -1 @return index or -1 if not found
[ "Returns", "the", "index", "of", "the", "lowest", "element", "==", "the", "given", "search", "target", "or", "-", "1" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java#L398-L422
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java
DoubleIntIndex.binaryGreaterSearch
private int binaryGreaterSearch() { int low = 0; int high = count; int mid = 0; int compare = 0; while (low < high) { mid = (low + high) / 2; compare = compare(mid); if (compare < 0) { high = mid; }...
java
private int binaryGreaterSearch() { int low = 0; int high = count; int mid = 0; int compare = 0; while (low < high) { mid = (low + high) / 2; compare = compare(mid); if (compare < 0) { high = mid; }...
[ "private", "int", "binaryGreaterSearch", "(", ")", "{", "int", "low", "=", "0", ";", "int", "high", "=", "count", ";", "int", "mid", "=", "0", ";", "int", "compare", "=", "0", ";", "while", "(", "low", "<", "high", ")", "{", "mid", "=", "(", "l...
Returns the index of the lowest element > the given search target @return the index
[ "Returns", "the", "index", "of", "the", "lowest", "element", ">", "the", "given", "search", "target" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java#L428-L448
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java
DoubleIntIndex.binarySlotSearch
private int binarySlotSearch() { int low = 0; int high = count; int mid = 0; int compare = 0; while (low < high) { mid = (low + high) / 2; compare = compare(mid); if (compare <= 0) { high = mid; } e...
java
private int binarySlotSearch() { int low = 0; int high = count; int mid = 0; int compare = 0; while (low < high) { mid = (low + high) / 2; compare = compare(mid); if (compare <= 0) { high = mid; } e...
[ "private", "int", "binarySlotSearch", "(", ")", "{", "int", "low", "=", "0", ";", "int", "high", "=", "count", ";", "int", "mid", "=", "0", ";", "int", "compare", "=", "0", ";", "while", "(", "low", "<", "high", ")", "{", "mid", "=", "(", "low"...
Returns the index of the lowest element >= the given search target, or count @return the index
[ "Returns", "the", "index", "of", "the", "lowest", "element", ">", "=", "the", "given", "search", "target", "or", "count" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java#L455-L474
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java
DoubleIntIndex.binaryEmptySlotSearch
private int binaryEmptySlotSearch() { int low = 0; int high = count; int mid = 0; int compare = 0; while (low < high) { mid = (low + high) / 2; compare = compare(mid); if (compare < 0) { high = mid; ...
java
private int binaryEmptySlotSearch() { int low = 0; int high = count; int mid = 0; int compare = 0; while (low < high) { mid = (low + high) / 2; compare = compare(mid); if (compare < 0) { high = mid; ...
[ "private", "int", "binaryEmptySlotSearch", "(", ")", "{", "int", "low", "=", "0", ";", "int", "high", "=", "count", ";", "int", "mid", "=", "0", ";", "int", "compare", "=", "0", ";", "while", "(", "low", "<", "high", ")", "{", "mid", "=", "(", ...
Returns the index of the lowest element > the given search target or count or -1 if target is found @return the index
[ "Returns", "the", "index", "of", "the", "lowest", "element", ">", "the", "given", "search", "target", "or", "count", "or", "-", "1", "if", "target", "is", "found" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java#L481-L502
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java
DoubleIntIndex.compare
private int compare(int i) { if (sortOnValues) { if (targetSearchValue > values[i]) { return 1; } else if (targetSearchValue < values[i]) { return -1; } } else { if (targetSearchValue > keys[i]) { return 1; ...
java
private int compare(int i) { if (sortOnValues) { if (targetSearchValue > values[i]) { return 1; } else if (targetSearchValue < values[i]) { return -1; } } else { if (targetSearchValue > keys[i]) { return 1; ...
[ "private", "int", "compare", "(", "int", "i", ")", "{", "if", "(", "sortOnValues", ")", "{", "if", "(", "targetSearchValue", ">", "values", "[", "i", "]", ")", "{", "return", "1", ";", "}", "else", "if", "(", "targetSearchValue", "<", "values", "[", ...
Check if targeted column value in the row indexed i is less than the search target object. @param i the index @return -1, 0 or +1
[ "Check", "if", "targeted", "column", "value", "in", "the", "row", "indexed", "i", "is", "less", "than", "the", "search", "target", "object", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java#L634-L651
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java
DoubleIntIndex.lessThan
private boolean lessThan(int i, int j) { if (sortOnValues) { if (values[i] < values[j]) { return true; } } else { if (keys[i] < keys[j]) { return true; } } return false; }
java
private boolean lessThan(int i, int j) { if (sortOnValues) { if (values[i] < values[j]) { return true; } } else { if (keys[i] < keys[j]) { return true; } } return false; }
[ "private", "boolean", "lessThan", "(", "int", "i", ",", "int", "j", ")", "{", "if", "(", "sortOnValues", ")", "{", "if", "(", "values", "[", "i", "]", "<", "values", "[", "j", "]", ")", "{", "return", "true", ";", "}", "}", "else", "{", "if", ...
Check if row indexed i is less than row indexed j @param i the first index @param j the second index @return true or false
[ "Check", "if", "row", "indexed", "i", "is", "less", "than", "row", "indexed", "j" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/DoubleIntIndex.java#L671-L684
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/util/FontDialogSwing.java
FontDialogSwing.setFontSize
public static void setFontSize(String inFontSize) { // weconsultants@users 20050215 - Changed for Compatbilty fix for JDK 1.3 // Convert Strng to float for deriveFont() call Float stageFloat = new Float(inFontSize); float fontSize = stageFloat.floatValue(); Font fonttTree = ...
java
public static void setFontSize(String inFontSize) { // weconsultants@users 20050215 - Changed for Compatbilty fix for JDK 1.3 // Convert Strng to float for deriveFont() call Float stageFloat = new Float(inFontSize); float fontSize = stageFloat.floatValue(); Font fonttTree = ...
[ "public", "static", "void", "setFontSize", "(", "String", "inFontSize", ")", "{", "// weconsultants@users 20050215 - Changed for Compatbilty fix for JDK 1.3", "// Convert Strng to float for deriveFont() call", "Float", "stageFloat", "=", "new", "Float", "(", "inFontSize", ")", ...
Displays a color chooser and Sets the selected color.
[ "Displays", "a", "color", "chooser", "and", "Sets", "the", "selected", "color", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/FontDialogSwing.java#L260-L278
train
VoltDB/voltdb
third_party/java/src/org/spearce_voltpatches/jgit/transport/OpenSshConfig.java
OpenSshConfig.lookup
public Host lookup(final String hostName) { final Map<String, Host> cache = this.refresh(); Host h = cache.get(hostName); if(h == null) { h = new Host(); } if(h.patternsApplied) { return h; } for(final Map.Entry<String, Host> e : cache.ent...
java
public Host lookup(final String hostName) { final Map<String, Host> cache = this.refresh(); Host h = cache.get(hostName); if(h == null) { h = new Host(); } if(h.patternsApplied) { return h; } for(final Map.Entry<String, Host> e : cache.ent...
[ "public", "Host", "lookup", "(", "final", "String", "hostName", ")", "{", "final", "Map", "<", "String", ",", "Host", ">", "cache", "=", "this", ".", "refresh", "(", ")", ";", "Host", "h", "=", "cache", ".", "get", "(", "hostName", ")", ";", "if", ...
Locate the configuration for a specific host request. @param hostName the name the user has supplied to the SSH tool. This may be a real host name, or it may just be a "Host" block in the configuration file. @return r configuration for the requested name. Never null.
[ "Locate", "the", "configuration", "for", "a", "specific", "host", "request", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/spearce_voltpatches/jgit/transport/OpenSshConfig.java#L103-L128
train
VoltDB/voltdb
src/frontend/org/voltcore/utils/CoreUtils.java
CoreUtils.getCachedSingleThreadExecutor
public static ListeningExecutorService getCachedSingleThreadExecutor(String name, long keepAlive) { return MoreExecutors.listeningDecorator(new ThreadPoolExecutor( 0, 1, keepAlive, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runn...
java
public static ListeningExecutorService getCachedSingleThreadExecutor(String name, long keepAlive) { return MoreExecutors.listeningDecorator(new ThreadPoolExecutor( 0, 1, keepAlive, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runn...
[ "public", "static", "ListeningExecutorService", "getCachedSingleThreadExecutor", "(", "String", "name", ",", "long", "keepAlive", ")", "{", "return", "MoreExecutors", ".", "listeningDecorator", "(", "new", "ThreadPoolExecutor", "(", "0", ",", "1", ",", "keepAlive", ...
Get a single thread executor that caches its thread meaning that the thread will terminate after keepAlive milliseconds. A new thread will be created the next time a task arrives and that will be kept around for keepAlive milliseconds. On creation no thread is allocated, the first task creates a thread. Uses LinkedTra...
[ "Get", "a", "single", "thread", "executor", "that", "caches", "its", "thread", "meaning", "that", "the", "thread", "will", "terminate", "after", "keepAlive", "milliseconds", ".", "A", "new", "thread", "will", "be", "created", "the", "next", "time", "a", "tas...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/CoreUtils.java#L429-L437
train
VoltDB/voltdb
src/frontend/org/voltcore/utils/CoreUtils.java
CoreUtils.getBoundedSingleThreadExecutor
public static ListeningExecutorService getBoundedSingleThreadExecutor(String name, int capacity) { LinkedBlockingQueue<Runnable> lbq = new LinkedBlockingQueue<Runnable>(capacity); ThreadPoolExecutor tpe = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, lbq, CoreUtils.getThreadFac...
java
public static ListeningExecutorService getBoundedSingleThreadExecutor(String name, int capacity) { LinkedBlockingQueue<Runnable> lbq = new LinkedBlockingQueue<Runnable>(capacity); ThreadPoolExecutor tpe = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, lbq, CoreUtils.getThreadFac...
[ "public", "static", "ListeningExecutorService", "getBoundedSingleThreadExecutor", "(", "String", "name", ",", "int", "capacity", ")", "{", "LinkedBlockingQueue", "<", "Runnable", ">", "lbq", "=", "new", "LinkedBlockingQueue", "<", "Runnable", ">", "(", "capacity", "...
Create a bounded single threaded executor that rejects requests if more than capacity requests are outstanding.
[ "Create", "a", "bounded", "single", "threaded", "executor", "that", "rejects", "requests", "if", "more", "than", "capacity", "requests", "are", "outstanding", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/CoreUtils.java#L485-L490
train
VoltDB/voltdb
src/frontend/org/voltcore/utils/CoreUtils.java
CoreUtils.getBoundedThreadPoolExecutor
public static ThreadPoolExecutor getBoundedThreadPoolExecutor(int maxPoolSize, long keepAliveTime, TimeUnit unit, ThreadFactory tFactory) { return new ThreadPoolExecutor(0, maxPoolSize, keepAliveTime, unit, new SynchronousQueue<Runnable>(), tFactory); }
java
public static ThreadPoolExecutor getBoundedThreadPoolExecutor(int maxPoolSize, long keepAliveTime, TimeUnit unit, ThreadFactory tFactory) { return new ThreadPoolExecutor(0, maxPoolSize, keepAliveTime, unit, new SynchronousQueue<Runnable>(), tFactory); }
[ "public", "static", "ThreadPoolExecutor", "getBoundedThreadPoolExecutor", "(", "int", "maxPoolSize", ",", "long", "keepAliveTime", ",", "TimeUnit", "unit", ",", "ThreadFactory", "tFactory", ")", "{", "return", "new", "ThreadPoolExecutor", "(", "0", ",", "maxPoolSize",...
Create a bounded thread pool executor. The work queue is synchronous and can cause RejectedExecutionException if there is no available thread to take a new task. @param maxPoolSize: the maximum number of threads to allow in the pool. @param keepAliveTime: when the number of threads is greater than the core, this is the...
[ "Create", "a", "bounded", "thread", "pool", "executor", ".", "The", "work", "queue", "is", "synchronous", "and", "can", "cause", "RejectedExecutionException", "if", "there", "is", "no", "available", "thread", "to", "take", "a", "new", "task", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/CoreUtils.java#L588-L591
train
VoltDB/voltdb
src/frontend/org/voltcore/utils/CoreUtils.java
CoreUtils.getQueueingExecutorService
public static ExecutorService getQueueingExecutorService(final Queue<Runnable> taskQueue) { return new ExecutorService() { @Override public void execute(Runnable command) { taskQueue.offer(command); } @Override public void shutdown() {...
java
public static ExecutorService getQueueingExecutorService(final Queue<Runnable> taskQueue) { return new ExecutorService() { @Override public void execute(Runnable command) { taskQueue.offer(command); } @Override public void shutdown() {...
[ "public", "static", "ExecutorService", "getQueueingExecutorService", "(", "final", "Queue", "<", "Runnable", ">", "taskQueue", ")", "{", "return", "new", "ExecutorService", "(", ")", "{", "@", "Override", "public", "void", "execute", "(", "Runnable", "command", ...
Create an ExceutorService that places tasks in an existing task queue for execution. Used to create a bridge for using ListenableFutures in classes already built around a queue. @param taskQueue : place to enqueue Runnables submitted to the service
[ "Create", "an", "ExceutorService", "that", "places", "tasks", "in", "an", "existing", "task", "queue", "for", "execution", ".", "Used", "to", "create", "a", "bridge", "for", "using", "ListenableFutures", "in", "classes", "already", "built", "around", "a", "que...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/CoreUtils.java#L598-L682
train