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
third_party/java/src/com/google_voltpatches/common/util/concurrent/WrappingExecutorService.java
WrappingExecutorService.wrapTasks
private final <T> ImmutableList<Callable<T>> wrapTasks(Collection<? extends Callable<T>> tasks) { ImmutableList.Builder<Callable<T>> builder = ImmutableList.builder(); for (Callable<T> task : tasks) { builder.add(wrapTask(task)); } return builder.build(); }
java
private final <T> ImmutableList<Callable<T>> wrapTasks(Collection<? extends Callable<T>> tasks) { ImmutableList.Builder<Callable<T>> builder = ImmutableList.builder(); for (Callable<T> task : tasks) { builder.add(wrapTask(task)); } return builder.build(); }
[ "private", "final", "<", "T", ">", "ImmutableList", "<", "Callable", "<", "T", ">", ">", "wrapTasks", "(", "Collection", "<", "?", "extends", "Callable", "<", "T", ">", ">", "tasks", ")", "{", "ImmutableList", ".", "Builder", "<", "Callable", "<", "T",...
Wraps a collection of tasks. @throws NullPointerException if any element of {@code tasks} is null
[ "Wraps", "a", "collection", "of", "tasks", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/util/concurrent/WrappingExecutorService.java#L82-L88
train
VoltDB/voltdb
src/frontend/org/voltdb/LoadedProcedureSet.java
LoadedProcedureSet.loadProcedures
public void loadProcedures(CatalogContext catalogContext, boolean isInitOrReplay) { m_defaultProcManager = catalogContext.m_defaultProcs; // default proc caches clear on catalog update m_defaultProcCache.clear(); m_plannerTool = catalogContext.m_ptool; // reload all system p...
java
public void loadProcedures(CatalogContext catalogContext, boolean isInitOrReplay) { m_defaultProcManager = catalogContext.m_defaultProcs; // default proc caches clear on catalog update m_defaultProcCache.clear(); m_plannerTool = catalogContext.m_ptool; // reload all system p...
[ "public", "void", "loadProcedures", "(", "CatalogContext", "catalogContext", ",", "boolean", "isInitOrReplay", ")", "{", "m_defaultProcManager", "=", "catalogContext", ".", "m_defaultProcs", ";", "// default proc caches clear on catalog update", "m_defaultProcCache", ".", "cl...
Load procedures.
[ "Load", "procedures", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/LoadedProcedureSet.java#L94-L118
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.makeInnerProcedureModifierClausePattern
private static SQLPatternPart makeInnerProcedureModifierClausePattern(boolean captureTokens) { return SPF.oneOf( SPF.clause( SPF.token("allow"), SPF.group(captureTokens, SPF.commaList(SPF.userName())) ), SPF....
java
private static SQLPatternPart makeInnerProcedureModifierClausePattern(boolean captureTokens) { return SPF.oneOf( SPF.clause( SPF.token("allow"), SPF.group(captureTokens, SPF.commaList(SPF.userName())) ), SPF....
[ "private", "static", "SQLPatternPart", "makeInnerProcedureModifierClausePattern", "(", "boolean", "captureTokens", ")", "{", "return", "SPF", ".", "oneOf", "(", "SPF", ".", "clause", "(", "SPF", ".", "token", "(", "\"allow\"", ")", ",", "SPF", ".", "group", "(...
Build a pattern segment to accept a single optional ALLOW or PARTITION clause to modify CREATE PROCEDURE statements. @param captureTokens Capture individual tokens if true @return Inner pattern to be wrapped by the caller as appropriate Capture groups (when captureTokens is true): (1) ALLOW clause: ent...
[ "Build", "a", "pattern", "segment", "to", "accept", "a", "single", "optional", "ALLOW", "or", "PARTITION", "clause", "to", "modify", "CREATE", "PROCEDURE", "statements", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L908-L944
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.unparsedProcedureModifierClauses
static SQLPatternPart unparsedProcedureModifierClauses() { // Force the leading space to go inside the repeat block. return SPF.capture(SPF.repeat(makeInnerProcedureModifierClausePattern(false))).withFlags(SQLPatternFactory.ADD_LEADING_SPACE_TO_CHILD); }
java
static SQLPatternPart unparsedProcedureModifierClauses() { // Force the leading space to go inside the repeat block. return SPF.capture(SPF.repeat(makeInnerProcedureModifierClausePattern(false))).withFlags(SQLPatternFactory.ADD_LEADING_SPACE_TO_CHILD); }
[ "static", "SQLPatternPart", "unparsedProcedureModifierClauses", "(", ")", "{", "// Force the leading space to go inside the repeat block.", "return", "SPF", ".", "capture", "(", "SPF", ".", "repeat", "(", "makeInnerProcedureModifierClausePattern", "(", "false", ")", ")", ")...
Build a pattern segment to recognize all the ALLOW or PARTITION modifier clauses of a CREATE PROCEDURE statement. @return Pattern to be used by the caller inside a CREATE PROCEDURE pattern. Capture groups: (1) All ALLOW/PARTITION modifier clauses as one string
[ "Build", "a", "pattern", "segment", "to", "recognize", "all", "the", "ALLOW", "or", "PARTITION", "modifier", "clauses", "of", "a", "CREATE", "PROCEDURE", "statement", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L973-L977
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.makeInnerStreamModifierClausePattern
private static SQLPatternPart makeInnerStreamModifierClausePattern(boolean captureTokens) { return SPF.oneOf( SPF.clause( SPF.token("export"),SPF.token("to"),SPF.token("target"), SPF.group(captureTokens, SPF.databaseObjectName()) ...
java
private static SQLPatternPart makeInnerStreamModifierClausePattern(boolean captureTokens) { return SPF.oneOf( SPF.clause( SPF.token("export"),SPF.token("to"),SPF.token("target"), SPF.group(captureTokens, SPF.databaseObjectName()) ...
[ "private", "static", "SQLPatternPart", "makeInnerStreamModifierClausePattern", "(", "boolean", "captureTokens", ")", "{", "return", "SPF", ".", "oneOf", "(", "SPF", ".", "clause", "(", "SPF", ".", "token", "(", "\"export\"", ")", ",", "SPF", ".", "token", "(",...
Build a pattern segment to accept a single optional EXPORT or PARTITION clause to modify CREATE STREAM statements. @param captureTokens Capture individual tokens if true @return Inner pattern to be wrapped by the caller as appropriate Capture groups (when captureTokens is true): (1) EXPORT clause: targ...
[ "Build", "a", "pattern", "segment", "to", "accept", "a", "single", "optional", "EXPORT", "or", "PARTITION", "clause", "to", "modify", "CREATE", "STREAM", "statements", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L990-L1003
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.unparsedStreamModifierClauses
private static SQLPatternPart unparsedStreamModifierClauses() { // Force the leading space to go inside the repeat block. return SPF.capture(SPF.repeat(makeInnerStreamModifierClausePattern(false))).withFlags(SQLPatternFactory.ADD_LEADING_SPACE_TO_CHILD); }
java
private static SQLPatternPart unparsedStreamModifierClauses() { // Force the leading space to go inside the repeat block. return SPF.capture(SPF.repeat(makeInnerStreamModifierClausePattern(false))).withFlags(SQLPatternFactory.ADD_LEADING_SPACE_TO_CHILD); }
[ "private", "static", "SQLPatternPart", "unparsedStreamModifierClauses", "(", ")", "{", "// Force the leading space to go inside the repeat block.", "return", "SPF", ".", "capture", "(", "SPF", ".", "repeat", "(", "makeInnerStreamModifierClausePattern", "(", "false", ")", ")...
Build a pattern segment to recognize all the EXPORT or PARTITION modifier clauses of a CREATE STREAM statement. @return Pattern to be used by the caller inside a CREATE STREAM pattern. Capture groups: (1) All EXPORT/PARTITION modifier clauses as one string
[ "Build", "a", "pattern", "segment", "to", "recognize", "all", "the", "EXPORT", "or", "PARTITION", "modifier", "clauses", "of", "a", "CREATE", "STREAM", "statement", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1028-L1031
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.parseExecParameters
private static List<String> parseExecParameters(String paramText) { final String SafeParamStringValuePattern = "#(SQL_PARSER_SAFE_PARAMSTRING)"; // Find all quoted strings. // Mask out strings that contain whitespace or commas // that must not be confused with parameter separators. ...
java
private static List<String> parseExecParameters(String paramText) { final String SafeParamStringValuePattern = "#(SQL_PARSER_SAFE_PARAMSTRING)"; // Find all quoted strings. // Mask out strings that contain whitespace or commas // that must not be confused with parameter separators. ...
[ "private", "static", "List", "<", "String", ">", "parseExecParameters", "(", "String", "paramText", ")", "{", "final", "String", "SafeParamStringValuePattern", "=", "\"#(SQL_PARSER_SAFE_PARAMSTRING)\"", ";", "// Find all quoted strings.", "// Mask out strings that contain white...
to the extent that comments are supported they have already been stripped out.
[ "to", "the", "extent", "that", "comments", "are", "supported", "they", "have", "already", "been", "stripped", "out", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1132-L1188
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.parseRecallStatement
public static ParseRecallResults parseRecallStatement(String statement, int lineMax) { Matcher matcher = RecallToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); String lineNumberText = matcher.group(2); String erro...
java
public static ParseRecallResults parseRecallStatement(String statement, int lineMax) { Matcher matcher = RecallToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); String lineNumberText = matcher.group(2); String erro...
[ "public", "static", "ParseRecallResults", "parseRecallStatement", "(", "String", "statement", ",", "int", "lineMax", ")", "{", "Matcher", "matcher", "=", "RecallToken", ".", "matcher", "(", "statement", ")", ";", "if", "(", "matcher", ".", "matches", "(", ")",...
Parse RECALL statement for sqlcmd. @param statement statement to parse @param lineMax maximum line # + 1 @return results object or NULL if statement wasn't recognized
[ "Parse", "RECALL", "statement", "for", "sqlcmd", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1244-L1282
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.parseFileStatement
public static List<FileInfo> parseFileStatement(FileInfo parentContext, String statement) { Matcher fileMatcher = FileToken.matcher(statement); if (! fileMatcher.lookingAt()) { // This input does not start with FILE, // so it's not a file command, it's something else. ...
java
public static List<FileInfo> parseFileStatement(FileInfo parentContext, String statement) { Matcher fileMatcher = FileToken.matcher(statement); if (! fileMatcher.lookingAt()) { // This input does not start with FILE, // so it's not a file command, it's something else. ...
[ "public", "static", "List", "<", "FileInfo", ">", "parseFileStatement", "(", "FileInfo", "parentContext", ",", "String", "statement", ")", "{", "Matcher", "fileMatcher", "=", "FileToken", ".", "matcher", "(", "statement", ")", ";", "if", "(", "!", "fileMatcher...
Parse FILE statement for sqlcmd. @param fileInfo optional parent file context for better diagnostics. @param statement statement to parse @return File object or NULL if statement wasn't recognized
[ "Parse", "FILE", "statement", "for", "sqlcmd", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1411-L1489
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.parseShowStatementSubcommand
public static String parseShowStatementSubcommand(String statement) { Matcher matcher = ShowToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { String...
java
public static String parseShowStatementSubcommand(String statement) { Matcher matcher = ShowToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { String...
[ "public", "static", "String", "parseShowStatementSubcommand", "(", "String", "statement", ")", "{", "Matcher", "matcher", "=", "ShowToken", ".", "matcher", "(", "statement", ")", ";", "if", "(", "matcher", ".", "matches", "(", ")", ")", "{", "String", "comma...
Parse a SHOW or LIST statement for sqlcmd. @param statement statement to parse @return String containing captured argument(s) possibly invalid, or null if a show/list statement wasn't recognized
[ "Parse", "a", "SHOW", "or", "LIST", "statement", "for", "sqlcmd", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1507-L1528
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.parseHelpStatement
public static String parseHelpStatement(String statement) { Matcher matcher = HelpToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { String trailings...
java
public static String parseHelpStatement(String statement) { Matcher matcher = HelpToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { String trailings...
[ "public", "static", "String", "parseHelpStatement", "(", "String", "statement", ")", "{", "Matcher", "matcher", "=", "HelpToken", ".", "matcher", "(", "statement", ")", ";", "if", "(", "matcher", ".", "matches", "(", ")", ")", "{", "String", "commandWordTerm...
Parse HELP statement for sqlcmd. The sub-command will be "" if the user just typed HELP. @param statement statement to parse @return Sub-command or NULL if statement wasn't recognized
[ "Parse", "HELP", "statement", "for", "sqlcmd", ".", "The", "sub", "-", "command", "will", "be", "if", "the", "user", "just", "typed", "HELP", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1536-L1558
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.getDigitsFromHexLiteral
public static String getDigitsFromHexLiteral(String paramString) { Matcher matcher = SingleQuotedHexLiteral.matcher(paramString); if (matcher.matches()) { return matcher.group(1); } return null; }
java
public static String getDigitsFromHexLiteral(String paramString) { Matcher matcher = SingleQuotedHexLiteral.matcher(paramString); if (matcher.matches()) { return matcher.group(1); } return null; }
[ "public", "static", "String", "getDigitsFromHexLiteral", "(", "String", "paramString", ")", "{", "Matcher", "matcher", "=", "SingleQuotedHexLiteral", ".", "matcher", "(", "paramString", ")", ";", "if", "(", "matcher", ".", "matches", "(", ")", ")", "{", "retur...
Given a parameter string, if it's of the form x'0123456789ABCDEF', return a string containing just the digits. Otherwise, return null.
[ "Given", "a", "parameter", "string", "if", "it", "s", "of", "the", "form", "x", "0123456789ABCDEF", "return", "a", "string", "containing", "just", "the", "digits", ".", "Otherwise", "return", "null", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1612-L1618
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.hexDigitsToLong
public static long hexDigitsToLong(String hexDigits) throws SQLParser.Exception { // BigInteger.longValue() will truncate to the lowest 64 bits, // so we need to explicitly check if there's too many digits. if (hexDigits.length() > 16) { throw new SQLParser.Exception("Too many hexad...
java
public static long hexDigitsToLong(String hexDigits) throws SQLParser.Exception { // BigInteger.longValue() will truncate to the lowest 64 bits, // so we need to explicitly check if there's too many digits. if (hexDigits.length() > 16) { throw new SQLParser.Exception("Too many hexad...
[ "public", "static", "long", "hexDigitsToLong", "(", "String", "hexDigits", ")", "throws", "SQLParser", ".", "Exception", "{", "// BigInteger.longValue() will truncate to the lowest 64 bits,", "// so we need to explicitly check if there's too many digits.", "if", "(", "hexDigits", ...
Given a string of hex digits, produce a long value, assuming a 2's complement representation.
[ "Given", "a", "string", "of", "hex", "digits", "produce", "a", "long", "value", "assuming", "a", "2", "s", "complement", "representation", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1624-L1647
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.parseExecuteCall
public static ExecuteCallResults parseExecuteCall( String statement, Map<String,Map<Integer, List<String>>> procedures) throws SQLParser.Exception { assert(procedures != null); return parseExecuteCallInternal(statement, procedures); }
java
public static ExecuteCallResults parseExecuteCall( String statement, Map<String,Map<Integer, List<String>>> procedures) throws SQLParser.Exception { assert(procedures != null); return parseExecuteCallInternal(statement, procedures); }
[ "public", "static", "ExecuteCallResults", "parseExecuteCall", "(", "String", "statement", ",", "Map", "<", "String", ",", "Map", "<", "Integer", ",", "List", "<", "String", ">", ">", ">", "procedures", ")", "throws", "SQLParser", ".", "Exception", "{", "asse...
Parse EXECUTE procedure call. @param statement statement to parse @param procedures maps procedures to parameter signature maps @return results object or NULL if statement wasn't recognized @throws SQLParser.Exception
[ "Parse", "EXECUTE", "procedure", "call", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1792-L1798
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.parseExecuteCallInternal
private static ExecuteCallResults parseExecuteCallInternal( String statement, Map<String,Map<Integer, List<String>>> procedures ) throws SQLParser.Exception { Matcher matcher = ExecuteCallPreamble.matcher(statement); if ( ! matcher.lookingAt()) { return null; ...
java
private static ExecuteCallResults parseExecuteCallInternal( String statement, Map<String,Map<Integer, List<String>>> procedures ) throws SQLParser.Exception { Matcher matcher = ExecuteCallPreamble.matcher(statement); if ( ! matcher.lookingAt()) { return null; ...
[ "private", "static", "ExecuteCallResults", "parseExecuteCallInternal", "(", "String", "statement", ",", "Map", "<", "String", ",", "Map", "<", "Integer", ",", "List", "<", "String", ">", ">", ">", "procedures", ")", "throws", "SQLParser", ".", "Exception", "{"...
Private implementation of parse EXECUTE procedure call. Also supports short-circuiting procedure lookup for testing. @param statement statement to parse @param procedures maps procedures to parameter signature maps @return results object or NULL if statement wasn't recognized @throws SQLParser.Exception
[ "Private", "implementation", "of", "parse", "EXECUTE", "procedure", "call", ".", "Also", "supports", "short", "-", "circuiting", "procedure", "lookup", "for", "testing", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L1822-L1869
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.appearsToBeValidDDLBatch
public static boolean appearsToBeValidDDLBatch(String batch) { BufferedReader reader = new BufferedReader(new StringReader(batch)); String line; try { while ((line = reader.readLine()) != null) { if (isWholeLineComment(line)) { continue; ...
java
public static boolean appearsToBeValidDDLBatch(String batch) { BufferedReader reader = new BufferedReader(new StringReader(batch)); String line; try { while ((line = reader.readLine()) != null) { if (isWholeLineComment(line)) { continue; ...
[ "public", "static", "boolean", "appearsToBeValidDDLBatch", "(", "String", "batch", ")", "{", "BufferedReader", "reader", "=", "new", "BufferedReader", "(", "new", "StringReader", "(", "batch", ")", ")", ";", "String", "line", ";", "try", "{", "while", "(", "...
Make sure that the batch starts with an appropriate DDL verb. We do not look further than the first token of the first non-comment and non-whitespace line. Empty batches are considered to be trivially valid. @param batch A SQL string containing multiple statements separated by semicolons @return true if the first k...
[ "Make", "sure", "that", "the", "batch", "starts", "with", "an", "appropriate", "DDL", "verb", ".", "We", "do", "not", "look", "further", "than", "the", "first", "token", "of", "the", "first", "non", "-", "comment", "and", "non", "-", "whitespace", "line"...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L2012-L2036
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.parseEchoStatement
public static String parseEchoStatement(String statement) { Matcher matcher = EchoToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { return matcher.g...
java
public static String parseEchoStatement(String statement) { Matcher matcher = EchoToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { return matcher.g...
[ "public", "static", "String", "parseEchoStatement", "(", "String", "statement", ")", "{", "Matcher", "matcher", "=", "EchoToken", ".", "matcher", "(", "statement", ")", ";", "if", "(", "matcher", ".", "matches", "(", ")", ")", "{", "String", "commandWordTerm...
Parse ECHO statement for sqlcmd. The result will be "" if the user just typed ECHO. @param statement statement to parse @return Argument text or NULL if statement wasn't recognized
[ "Parse", "ECHO", "statement", "for", "sqlcmd", ".", "The", "result", "will", "be", "if", "the", "user", "just", "typed", "ECHO", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L2044-L2055
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.parseEchoErrorStatement
public static String parseEchoErrorStatement(String statement) { Matcher matcher = EchoErrorToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { return mat...
java
public static String parseEchoErrorStatement(String statement) { Matcher matcher = EchoErrorToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { return mat...
[ "public", "static", "String", "parseEchoErrorStatement", "(", "String", "statement", ")", "{", "Matcher", "matcher", "=", "EchoErrorToken", ".", "matcher", "(", "statement", ")", ";", "if", "(", "matcher", ".", "matches", "(", ")", ")", "{", "String", "comma...
Parse ECHOERROR statement for sqlcmd. The result will be "" if the user just typed ECHOERROR. @param statement statement to parse @return Argument text or NULL if statement wasn't recognized
[ "Parse", "ECHOERROR", "statement", "for", "sqlcmd", ".", "The", "result", "will", "be", "if", "the", "user", "just", "typed", "ECHOERROR", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L2063-L2073
train
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLParser.java
SQLParser.parseDescribeStatement
public static String parseDescribeStatement(String statement) { Matcher matcher = DescribeToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { String trail...
java
public static String parseDescribeStatement(String statement) { Matcher matcher = DescribeToken.matcher(statement); if (matcher.matches()) { String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches()) { String trail...
[ "public", "static", "String", "parseDescribeStatement", "(", "String", "statement", ")", "{", "Matcher", "matcher", "=", "DescribeToken", ".", "matcher", "(", "statement", ")", ";", "if", "(", "matcher", ".", "matches", "(", ")", ")", "{", "String", "command...
Parse DESCRIBE statement for sqlcmd. The result will be "" if the user just typed DESCRIBE or DESC. @param statement statement to parse @return String containing possible table name
[ "Parse", "DESCRIBE", "statement", "for", "sqlcmd", ".", "The", "result", "will", "be", "if", "the", "user", "just", "typed", "DESCRIBE", "or", "DESC", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLParser.java#L2081-L2101
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/QueryExpression.java
QueryExpression.resolveColumnRefernecesInUnionOrderBy
void resolveColumnRefernecesInUnionOrderBy() { int orderCount = sortAndSlice.getOrderLength(); if (orderCount == 0) { return; } String[] unionColumnNames = getColumnNames(); for (int i = 0; i < orderCount; i++) { Expression sort = (Expression) sortAndS...
java
void resolveColumnRefernecesInUnionOrderBy() { int orderCount = sortAndSlice.getOrderLength(); if (orderCount == 0) { return; } String[] unionColumnNames = getColumnNames(); for (int i = 0; i < orderCount; i++) { Expression sort = (Expression) sortAndS...
[ "void", "resolveColumnRefernecesInUnionOrderBy", "(", ")", "{", "int", "orderCount", "=", "sortAndSlice", ".", "getOrderLength", "(", ")", ";", "if", "(", "orderCount", "==", "0", ")", "{", "return", ";", "}", "String", "[", "]", "unionColumnNames", "=", "ge...
Only simple column reference or column position allowed
[ "Only", "simple", "column", "reference", "or", "column", "position", "allowed" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/QueryExpression.java#L331-L370
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/QueryExpression.java
QueryExpression.setTableColumnNames
public void setTableColumnNames(HashMappedList list) { if (resultTable != null) { ((TableDerived) resultTable).columnList = list; return; } leftQueryExpression.setTableColumnNames(list); }
java
public void setTableColumnNames(HashMappedList list) { if (resultTable != null) { ((TableDerived) resultTable).columnList = list; return; } leftQueryExpression.setTableColumnNames(list); }
[ "public", "void", "setTableColumnNames", "(", "HashMappedList", "list", ")", "{", "if", "(", "resultTable", "!=", "null", ")", "{", "(", "(", "TableDerived", ")", "resultTable", ")", ".", "columnList", "=", "list", ";", "return", ";", "}", "leftQueryExpressi...
Used in views after full type resolution
[ "Used", "in", "views", "after", "full", "type", "resolution" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/QueryExpression.java#L670-L679
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/QueryExpression.java
QueryExpression.setAsTopLevel
public void setAsTopLevel() { if (compileContext.getSequences().length > 0) { throw Error.error(ErrorCode.X_42598); } isTopLevel = true; setReturningResultSet(); }
java
public void setAsTopLevel() { if (compileContext.getSequences().length > 0) { throw Error.error(ErrorCode.X_42598); } isTopLevel = true; setReturningResultSet(); }
[ "public", "void", "setAsTopLevel", "(", ")", "{", "if", "(", "compileContext", ".", "getSequences", "(", ")", ".", "length", ">", "0", ")", "{", "throw", "Error", ".", "error", "(", "ErrorCode", ".", "X_42598", ")", ";", "}", "isTopLevel", "=", "true",...
Not for views. Only used on root node.
[ "Not", "for", "views", ".", "Only", "used", "on", "root", "node", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/QueryExpression.java#L733-L742
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/QueryExpression.java
QueryExpression.setReturningResultSet
void setReturningResultSet() { if (unionCorresponding) { persistenceScope = TableBase.SCOPE_SESSION; columnMode = TableBase.COLUMNS_UNREFERENCED; return; } leftQueryExpression.setReturningResultSet(); }
java
void setReturningResultSet() { if (unionCorresponding) { persistenceScope = TableBase.SCOPE_SESSION; columnMode = TableBase.COLUMNS_UNREFERENCED; return; } leftQueryExpression.setReturningResultSet(); }
[ "void", "setReturningResultSet", "(", ")", "{", "if", "(", "unionCorresponding", ")", "{", "persistenceScope", "=", "TableBase", ".", "SCOPE_SESSION", ";", "columnMode", "=", "TableBase", ".", "COLUMNS_UNREFERENCED", ";", "return", ";", "}", "leftQueryExpression", ...
Sets the scope to SESSION for the QueryExpression object that creates the table
[ "Sets", "the", "scope", "to", "SESSION", "for", "the", "QueryExpression", "object", "that", "creates", "the", "table" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/QueryExpression.java#L748-L758
train
VoltDB/voltdb
examples/geospatial/client/geospatial/AdBrokerBenchmark.java
AdBrokerBenchmark.schedulePeriodicStats
public void schedulePeriodicStats() { Runnable statsPrinter = new Runnable() { @Override public void run() { printStatistics(); } }; m_scheduler.scheduleWithFixedDelay(statsPrinter, m_config.displayinterval, m_config.displayinterval, ...
java
public void schedulePeriodicStats() { Runnable statsPrinter = new Runnable() { @Override public void run() { printStatistics(); } }; m_scheduler.scheduleWithFixedDelay(statsPrinter, m_config.displayinterval, m_config.displayinterval, ...
[ "public", "void", "schedulePeriodicStats", "(", ")", "{", "Runnable", "statsPrinter", "=", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "printStatistics", "(", ")", ";", "}", "}", ";", "m_scheduler", ".", "sc...
Add a task to the scheduler to print statistics to the console at regular intervals.
[ "Add", "a", "task", "to", "the", "scheduler", "to", "print", "statistics", "to", "the", "console", "at", "regular", "intervals", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/geospatial/client/geospatial/AdBrokerBenchmark.java#L248-L257
train
VoltDB/voltdb
examples/geospatial/client/geospatial/AdBrokerBenchmark.java
AdBrokerBenchmark.printResults
public synchronized void printResults() throws Exception { ClientStats stats = m_fullStatsContext.fetch().getStats(); System.out.print(HORIZONTAL_RULE); System.out.println(" Client Workload Statistics"); System.out.println(HORIZONTAL_RULE); System.out.printf("Average throughput...
java
public synchronized void printResults() throws Exception { ClientStats stats = m_fullStatsContext.fetch().getStats(); System.out.print(HORIZONTAL_RULE); System.out.println(" Client Workload Statistics"); System.out.println(HORIZONTAL_RULE); System.out.printf("Average throughput...
[ "public", "synchronized", "void", "printResults", "(", ")", "throws", "Exception", "{", "ClientStats", "stats", "=", "m_fullStatsContext", ".", "fetch", "(", ")", ".", "getStats", "(", ")", ";", "System", ".", "out", ".", "print", "(", "HORIZONTAL_RULE", ")"...
Prints some summary statistics about performance. @throws Exception if anything unexpected happens.
[ "Prints", "some", "summary", "statistics", "about", "performance", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/geospatial/client/geospatial/AdBrokerBenchmark.java#L315-L348
train
VoltDB/voltdb
examples/geospatial/client/geospatial/AdBrokerBenchmark.java
AdBrokerBenchmark.shutdown
private void shutdown() { // Stop the stats printer, the bid generator and the nibble deleter. m_scheduler.shutdown(); try { m_scheduler.awaitTermination(60, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } try { ...
java
private void shutdown() { // Stop the stats printer, the bid generator and the nibble deleter. m_scheduler.shutdown(); try { m_scheduler.awaitTermination(60, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } try { ...
[ "private", "void", "shutdown", "(", ")", "{", "// Stop the stats printer, the bid generator and the nibble deleter.", "m_scheduler", ".", "shutdown", "(", ")", ";", "try", "{", "m_scheduler", ".", "awaitTermination", "(", "60", ",", "TimeUnit", ".", "SECONDS", ")", ...
Perform various tasks to end the demo cleanly.
[ "Perform", "various", "tasks", "to", "end", "the", "demo", "cleanly", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/geospatial/client/geospatial/AdBrokerBenchmark.java#L353-L373
train
VoltDB/voltdb
examples/geospatial/client/geospatial/AdBrokerBenchmark.java
AdBrokerBenchmark.requestAd
private void requestAd() { long deviceId = Math.abs(m_rand.nextLong()) % AdBrokerBenchmark.NUM_DEVICES; GeographyPointValue point = getRandomPoint(); try { m_client.callProcedure(new NullCallback(), "GetHighestBidForLocation", deviceId, point); } catch (IOException e) { ...
java
private void requestAd() { long deviceId = Math.abs(m_rand.nextLong()) % AdBrokerBenchmark.NUM_DEVICES; GeographyPointValue point = getRandomPoint(); try { m_client.callProcedure(new NullCallback(), "GetHighestBidForLocation", deviceId, point); } catch (IOException e) { ...
[ "private", "void", "requestAd", "(", ")", "{", "long", "deviceId", "=", "Math", ".", "abs", "(", "m_rand", ".", "nextLong", "(", ")", ")", "%", "AdBrokerBenchmark", ".", "NUM_DEVICES", ";", "GeographyPointValue", "point", "=", "getRandomPoint", "(", ")", "...
Invoke the stored procedure GetHighestBidForLocation, which, given a random point, returns the id of the bid that has the highest dollar amount.
[ "Invoke", "the", "stored", "procedure", "GetHighestBidForLocation", "which", "given", "a", "random", "point", "returns", "the", "id", "of", "the", "bid", "that", "has", "the", "highest", "dollar", "amount", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/geospatial/client/geospatial/AdBrokerBenchmark.java#L395-L404
train
VoltDB/voltdb
src/frontend/org/voltdb/planner/parseinfo/StmtSubqueryScan.java
StmtSubqueryScan.promoteSinglePartitionInfo
public void promoteSinglePartitionInfo( HashMap<AbstractExpression, Set<AbstractExpression>> valueEquivalence, Set< Set<AbstractExpression> > eqSets) { assert(getScanPartitioning() != null); if (getScanPartitioning().getCountOfPartitionedTables() == 0 || getScanPa...
java
public void promoteSinglePartitionInfo( HashMap<AbstractExpression, Set<AbstractExpression>> valueEquivalence, Set< Set<AbstractExpression> > eqSets) { assert(getScanPartitioning() != null); if (getScanPartitioning().getCountOfPartitionedTables() == 0 || getScanPa...
[ "public", "void", "promoteSinglePartitionInfo", "(", "HashMap", "<", "AbstractExpression", ",", "Set", "<", "AbstractExpression", ">", ">", "valueEquivalence", ",", "Set", "<", "Set", "<", "AbstractExpression", ">", ">", "eqSets", ")", "{", "assert", "(", "getSc...
upgrade single partitioning expression to parent level add the info to equality sets and input value equivalence @param valueEquivalence @param eqSets
[ "upgrade", "single", "partitioning", "expression", "to", "parent", "level", "add", "the", "info", "to", "equality", "sets", "and", "input", "value", "equivalence" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/StmtSubqueryScan.java#L95-L132
train
VoltDB/voltdb
src/frontend/org/voltdb/planner/parseinfo/StmtSubqueryScan.java
StmtSubqueryScan.updateEqualSets
private void updateEqualSets(Set<AbstractExpression> values, HashMap<AbstractExpression, Set<AbstractExpression>> valueEquivalence, Set< Set<AbstractExpression> > eqSets, AbstractExpression tveKey, AbstractExpression spExpr) { boolean hasLegacyValues = false; if (eqSe...
java
private void updateEqualSets(Set<AbstractExpression> values, HashMap<AbstractExpression, Set<AbstractExpression>> valueEquivalence, Set< Set<AbstractExpression> > eqSets, AbstractExpression tveKey, AbstractExpression spExpr) { boolean hasLegacyValues = false; if (eqSe...
[ "private", "void", "updateEqualSets", "(", "Set", "<", "AbstractExpression", ">", "values", ",", "HashMap", "<", "AbstractExpression", ",", "Set", "<", "AbstractExpression", ">", ">", "valueEquivalence", ",", "Set", "<", "Set", "<", "AbstractExpression", ">", ">...
Because HashSet stored a legacy hashcode for the non-final object.
[ "Because", "HashSet", "stored", "a", "legacy", "hashcode", "for", "the", "non", "-", "final", "object", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/StmtSubqueryScan.java#L137-L153
train
VoltDB/voltdb
src/frontend/org/voltdb/planner/parseinfo/StmtSubqueryScan.java
StmtSubqueryScan.getIsReplicated
@Override public boolean getIsReplicated() { for (StmtTableScan tableScan : m_subqueryStmt.allScans()) { if ( ! tableScan.getIsReplicated()) { return false; } } return true; }
java
@Override public boolean getIsReplicated() { for (StmtTableScan tableScan : m_subqueryStmt.allScans()) { if ( ! tableScan.getIsReplicated()) { return false; } } return true; }
[ "@", "Override", "public", "boolean", "getIsReplicated", "(", ")", "{", "for", "(", "StmtTableScan", "tableScan", ":", "m_subqueryStmt", ".", "allScans", "(", ")", ")", "{", "if", "(", "!", "tableScan", ".", "getIsReplicated", "(", ")", ")", "{", "return",...
The subquery is replicated if all tables from the FROM clause defining this subquery are replicated @return True if the subquery is replicated
[ "The", "subquery", "is", "replicated", "if", "all", "tables", "from", "the", "FROM", "clause", "defining", "this", "subquery", "are", "replicated" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/StmtSubqueryScan.java#L218-L226
train
VoltDB/voltdb
src/frontend/org/voltdb/planner/parseinfo/StmtSubqueryScan.java
StmtSubqueryScan.getOutputExpression
public TupleValueExpression getOutputExpression(int index) { SchemaColumn schemaCol = getSchemaColumn(index); TupleValueExpression tve = new TupleValueExpression(getTableAlias(), getTableAlias(), schemaCol.getColumnAlias(), schemaCol.getColumnAlias(), index); return tve; }
java
public TupleValueExpression getOutputExpression(int index) { SchemaColumn schemaCol = getSchemaColumn(index); TupleValueExpression tve = new TupleValueExpression(getTableAlias(), getTableAlias(), schemaCol.getColumnAlias(), schemaCol.getColumnAlias(), index); return tve; }
[ "public", "TupleValueExpression", "getOutputExpression", "(", "int", "index", ")", "{", "SchemaColumn", "schemaCol", "=", "getSchemaColumn", "(", "index", ")", ";", "TupleValueExpression", "tve", "=", "new", "TupleValueExpression", "(", "getTableAlias", "(", ")", ",...
Produce a tuple value expression for a column produced by this subquery
[ "Produce", "a", "tuple", "value", "expression", "for", "a", "column", "produced", "by", "this", "subquery" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/StmtSubqueryScan.java#L363-L368
train
VoltDB/voltdb
src/frontend/org/voltdb/expressions/ComparisonExpression.java
ComparisonExpression.rangeFilterFromPrefixLike
static private ComparisonExpression rangeFilterFromPrefixLike(AbstractExpression leftExpr, ExpressionType rangeComparator, String comparand) { ConstantValueExpression cve = new ConstantValueExpression(); cve.setValueType(VoltType.STRING); cve.setValue(comparand); cve.setValueSize(compara...
java
static private ComparisonExpression rangeFilterFromPrefixLike(AbstractExpression leftExpr, ExpressionType rangeComparator, String comparand) { ConstantValueExpression cve = new ConstantValueExpression(); cve.setValueType(VoltType.STRING); cve.setValue(comparand); cve.setValueSize(compara...
[ "static", "private", "ComparisonExpression", "rangeFilterFromPrefixLike", "(", "AbstractExpression", "leftExpr", ",", "ExpressionType", "rangeComparator", ",", "String", "comparand", ")", "{", "ConstantValueExpression", "cve", "=", "new", "ConstantValueExpression", "(", ")"...
Construct the upper or lower bound expression that is implied by a prefix LIKE operator, given its required elements. @param leftExpr - the LIKE operator's (and the result's) lhs expression @param rangeComparator - a GTE or LT operator to indicate lower or upper bound, respectively, @param comparand - a string operand ...
[ "Construct", "the", "upper", "or", "lower", "bound", "expression", "that", "is", "implied", "by", "a", "prefix", "LIKE", "operator", "given", "its", "required", "elements", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ComparisonExpression.java#L144-L151
train
VoltDB/voltdb
src/frontend/org/voltdb/plannodes/NodeSchema.java
NodeSchema.resetTableName
public NodeSchema resetTableName(String tbName, String tbAlias) { m_columns.forEach(sc -> sc.reset(tbName, tbAlias, sc.getColumnName(), sc.getColumnAlias())); m_columnsMapHelper.forEach((k, v) -> k.reset(tbName, tbAlias, k.getColumnName(), k.getColumnAlias())); return this...
java
public NodeSchema resetTableName(String tbName, String tbAlias) { m_columns.forEach(sc -> sc.reset(tbName, tbAlias, sc.getColumnName(), sc.getColumnAlias())); m_columnsMapHelper.forEach((k, v) -> k.reset(tbName, tbAlias, k.getColumnName(), k.getColumnAlias())); return this...
[ "public", "NodeSchema", "resetTableName", "(", "String", "tbName", ",", "String", "tbAlias", ")", "{", "m_columns", ".", "forEach", "(", "sc", "->", "sc", ".", "reset", "(", "tbName", ",", "tbAlias", ",", "sc", ".", "getColumnName", "(", ")", ",", "sc", ...
Substitute table name only for all schema columns and map entries
[ "Substitute", "table", "name", "only", "for", "all", "schema", "columns", "and", "map", "entries" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/NodeSchema.java#L74-L80
train
VoltDB/voltdb
src/frontend/org/voltdb/plannodes/NodeSchema.java
NodeSchema.addColumn
public void addColumn(SchemaColumn column) { int size = m_columns.size(); m_columnsMapHelper.put(column, size); m_columns.add(column); }
java
public void addColumn(SchemaColumn column) { int size = m_columns.size(); m_columnsMapHelper.put(column, size); m_columns.add(column); }
[ "public", "void", "addColumn", "(", "SchemaColumn", "column", ")", "{", "int", "size", "=", "m_columns", ".", "size", "(", ")", ";", "m_columnsMapHelper", ".", "put", "(", "column", ",", "size", ")", ";", "m_columns", ".", "add", "(", "column", ")", ";...
Add a column to this schema. Unless actively modified, updated, or sorted, the column order is implicitly the order in which columns are added using this call. Note that it's possible to add the same column to a schema more than once. In this case we replace the old entry for the column in the map (so it will stay th...
[ "Add", "a", "column", "to", "this", "schema", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/NodeSchema.java#L118-L122
train
VoltDB/voltdb
src/frontend/org/voltdb/plannodes/NodeSchema.java
NodeSchema.find
public SchemaColumn find(String tableName, String tableAlias, String columnName, String columnAlias) { SchemaColumn col = new SchemaColumn(tableName, tableAlias, columnName, columnAlias); int index = findIndexOfColumn(col); if (index != -1) { return m_colu...
java
public SchemaColumn find(String tableName, String tableAlias, String columnName, String columnAlias) { SchemaColumn col = new SchemaColumn(tableName, tableAlias, columnName, columnAlias); int index = findIndexOfColumn(col); if (index != -1) { return m_colu...
[ "public", "SchemaColumn", "find", "(", "String", "tableName", ",", "String", "tableAlias", ",", "String", "columnName", ",", "String", "columnAlias", ")", "{", "SchemaColumn", "col", "=", "new", "SchemaColumn", "(", "tableName", ",", "tableAlias", ",", "columnNa...
Retrieve the SchemaColumn that matches the provided arguments. @param tableName The table name of the desired column. @param tableAlias The table alias of the desired column. @param columnName The column name of the desired column. @param columnAlias The column alias of the desired column. @return The matching SchemaCo...
[ "Retrieve", "the", "SchemaColumn", "that", "matches", "the", "provided", "arguments", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/NodeSchema.java#L173-L182
train
VoltDB/voltdb
src/frontend/org/voltdb/plannodes/NodeSchema.java
NodeSchema.sortByTveIndex
void sortByTveIndex(int fromIndex, int toIndex) { Collections.sort(m_columns.subList(fromIndex, toIndex), TVE_IDX_COMPARE); }
java
void sortByTveIndex(int fromIndex, int toIndex) { Collections.sort(m_columns.subList(fromIndex, toIndex), TVE_IDX_COMPARE); }
[ "void", "sortByTveIndex", "(", "int", "fromIndex", ",", "int", "toIndex", ")", "{", "Collections", ".", "sort", "(", "m_columns", ".", "subList", "(", "fromIndex", ",", "toIndex", ")", ",", "TVE_IDX_COMPARE", ")", ";", "}" ]
Sort a sub-range of the schema columns by TVE index. All elements must be TupleValueExpressions. Modification is made in-place. @param fromIndex lower bound of range to be sorted, inclusive @param toIndex upper bound of range to be sorted, exclusive
[ "Sort", "a", "sub", "-", "range", "of", "the", "schema", "columns", "by", "TVE", "index", ".", "All", "elements", "must", "be", "TupleValueExpressions", ".", "Modification", "is", "made", "in", "-", "place", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/NodeSchema.java#L266-L268
train
VoltDB/voltdb
src/frontend/org/voltdb/plannodes/NodeSchema.java
NodeSchema.equalsOnlyNames
public boolean equalsOnlyNames(NodeSchema otherSchema) { if (otherSchema == null) { return false; } if (otherSchema.size() != size()) { return false; } for (int colIndex = 0; colIndex < size(); colIndex++ ) { SchemaColumn col1 = otherSchema.g...
java
public boolean equalsOnlyNames(NodeSchema otherSchema) { if (otherSchema == null) { return false; } if (otherSchema.size() != size()) { return false; } for (int colIndex = 0; colIndex < size(); colIndex++ ) { SchemaColumn col1 = otherSchema.g...
[ "public", "boolean", "equalsOnlyNames", "(", "NodeSchema", "otherSchema", ")", "{", "if", "(", "otherSchema", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "otherSchema", ".", "size", "(", ")", "!=", "size", "(", ")", ")", "{", "retur...
names are the same. Don't worry about the differentiator field.
[ "names", "are", "the", "same", ".", "Don", "t", "worry", "about", "the", "differentiator", "field", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/NodeSchema.java#L329-L347
train
VoltDB/voltdb
src/frontend/org/voltdb/plannodes/NodeSchema.java
NodeSchema.copyAndReplaceWithTVE
NodeSchema copyAndReplaceWithTVE() { NodeSchema copy = new NodeSchema(); int colIndex = 0; for (SchemaColumn column : m_columns) { copy.addColumn(column.copyAndReplaceWithTVE(colIndex)); ++colIndex; } return copy; }
java
NodeSchema copyAndReplaceWithTVE() { NodeSchema copy = new NodeSchema(); int colIndex = 0; for (SchemaColumn column : m_columns) { copy.addColumn(column.copyAndReplaceWithTVE(colIndex)); ++colIndex; } return copy; }
[ "NodeSchema", "copyAndReplaceWithTVE", "(", ")", "{", "NodeSchema", "copy", "=", "new", "NodeSchema", "(", ")", ";", "int", "colIndex", "=", "0", ";", "for", "(", "SchemaColumn", "column", ":", "m_columns", ")", "{", "copy", ".", "addColumn", "(", "column"...
Returns a copy of this NodeSchema but with all non-TVE expressions replaced with an appropriate TVE. This is used primarily when generating a node's output schema based on its childrens' schema; we want to carry the columns across but leave any non-TVE expressions behind.
[ "Returns", "a", "copy", "of", "this", "NodeSchema", "but", "with", "all", "non", "-", "TVE", "expressions", "replaced", "with", "an", "appropriate", "TVE", ".", "This", "is", "used", "primarily", "when", "generating", "a", "node", "s", "output", "schema", ...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/NodeSchema.java#L364-L372
train
VoltDB/voltdb
src/frontend/org/voltdb/plannodes/NodeSchema.java
NodeSchema.harmonize
public boolean harmonize(NodeSchema otherSchema, String schemaKindName) { if (size() != otherSchema.size()) { throw new PlanningErrorException( "The " + schemaKindName + "schema and the statement output schemas have different lengths."); } bool...
java
public boolean harmonize(NodeSchema otherSchema, String schemaKindName) { if (size() != otherSchema.size()) { throw new PlanningErrorException( "The " + schemaKindName + "schema and the statement output schemas have different lengths."); } bool...
[ "public", "boolean", "harmonize", "(", "NodeSchema", "otherSchema", ",", "String", "schemaKindName", ")", "{", "if", "(", "size", "(", ")", "!=", "otherSchema", ".", "size", "(", ")", ")", "{", "throw", "new", "PlanningErrorException", "(", "\"The \"", "+", ...
Modifies this schema such that its columns can accommodate both values of its own types and that of otherSchema. Does not modify otherSchema. @param otherSchema The schema whose values we would like to accommodate in this schema @param schemaKindName The kind of schema we are harmonizing, for error reporting @retu...
[ "Modifies", "this", "schema", "such", "that", "its", "columns", "can", "accommodate", "both", "values", "of", "its", "own", "types", "and", "that", "of", "otherSchema", ".", "Does", "not", "modify", "otherSchema", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/NodeSchema.java#L436-L511
train
VoltDB/voltdb
third_party/java/src/org/HdrHistogram_voltpatches/HistogramIterationValue.java
HistogramIterationValue.set
void set(final long valueIteratedTo, final long valueIteratedFrom, final long countAtValueIteratedTo, final long countInThisIterationStep, final long totalCountToThisValue, final long totalValueToThisValue, final double percentile, final double percentileLevelIteratedTo, double integerToDouble...
java
void set(final long valueIteratedTo, final long valueIteratedFrom, final long countAtValueIteratedTo, final long countInThisIterationStep, final long totalCountToThisValue, final long totalValueToThisValue, final double percentile, final double percentileLevelIteratedTo, double integerToDouble...
[ "void", "set", "(", "final", "long", "valueIteratedTo", ",", "final", "long", "valueIteratedFrom", ",", "final", "long", "countAtValueIteratedTo", ",", "final", "long", "countInThisIterationStep", ",", "final", "long", "totalCountToThisValue", ",", "final", "long", ...
Set is all-or-nothing to avoid the potential for accidental omission of some values...
[ "Set", "is", "all", "-", "or", "-", "nothing", "to", "avoid", "the", "potential", "for", "accidental", "omission", "of", "some", "values", "..." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/HistogramIterationValue.java#L48-L60
train
VoltDB/voltdb
src/frontend/org/voltdb/expressions/ParameterValueExpression.java
ParameterValueExpression.bindingToIndexedExpression
@Override public List<AbstractExpression> bindingToIndexedExpression(AbstractExpression expr) { if (m_originalValue == null || ! m_originalValue.equals(expr)) { return null; } // This parameter's value was matched, so return this as one bound parameter. List<AbstractExpre...
java
@Override public List<AbstractExpression> bindingToIndexedExpression(AbstractExpression expr) { if (m_originalValue == null || ! m_originalValue.equals(expr)) { return null; } // This parameter's value was matched, so return this as one bound parameter. List<AbstractExpre...
[ "@", "Override", "public", "List", "<", "AbstractExpression", ">", "bindingToIndexedExpression", "(", "AbstractExpression", "expr", ")", "{", "if", "(", "m_originalValue", "==", "null", "||", "!", "m_originalValue", ".", "equals", "(", "expr", ")", ")", "{", "...
query in which that constant differs.
[ "query", "in", "which", "that", "constant", "differs", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ParameterValueExpression.java#L227-L236
train
VoltDB/voltdb
src/frontend/org/voltdb/StoredProcedureInvocation.java
StoredProcedureInvocation.getParameterAtIndex
Object getParameterAtIndex(int partitionIndex) { try { if (serializedParams != null) { return ParameterSet.getParameterAtIndex(partitionIndex, serializedParams.duplicate()); } else { return params.get().getParam(partitionIndex); } } ...
java
Object getParameterAtIndex(int partitionIndex) { try { if (serializedParams != null) { return ParameterSet.getParameterAtIndex(partitionIndex, serializedParams.duplicate()); } else { return params.get().getParam(partitionIndex); } } ...
[ "Object", "getParameterAtIndex", "(", "int", "partitionIndex", ")", "{", "try", "{", "if", "(", "serializedParams", "!=", "null", ")", "{", "return", "ParameterSet", ".", "getParameterAtIndex", "(", "partitionIndex", ",", "serializedParams", ".", "duplicate", "(",...
Read into an serialized parameter buffer to extract a single parameter
[ "Read", "into", "an", "serialized", "parameter", "buffer", "to", "extract", "a", "single", "parameter" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/StoredProcedureInvocation.java#L189-L200
train
VoltDB/voltdb
src/frontend/org/voltdb/StoredProcedureInvocation.java
StoredProcedureInvocation.flattenToBufferForOriginalVersion
public void flattenToBufferForOriginalVersion(ByteBuffer buf) throws IOException { assert((params != null) || (serializedParams != null)); // for self-check assertion int startPosition = buf.position(); buf.put(ProcedureInvocationType.ORIGINAL.getValue()); SerializationHel...
java
public void flattenToBufferForOriginalVersion(ByteBuffer buf) throws IOException { assert((params != null) || (serializedParams != null)); // for self-check assertion int startPosition = buf.position(); buf.put(ProcedureInvocationType.ORIGINAL.getValue()); SerializationHel...
[ "public", "void", "flattenToBufferForOriginalVersion", "(", "ByteBuffer", "buf", ")", "throws", "IOException", "{", "assert", "(", "(", "params", "!=", "null", ")", "||", "(", "serializedParams", "!=", "null", ")", ")", ";", "// for self-check assertion", "int", ...
Serializes this SPI in the original serialization version. This is currently used by DR.
[ "Serializes", "this", "SPI", "in", "the", "original", "serialization", "version", ".", "This", "is", "currently", "used", "by", "DR", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/StoredProcedureInvocation.java#L349-L366
train
VoltDB/voltdb
src/frontend/org/voltdb/importclient/kafka/util/DurableTracker.java
DurableTracker.submit
@Override public synchronized void submit(long offset) { if (submittedOffset == -1L && offset >= 0) { committedOffsets[idx(offset)] = safeOffset = submittedOffset = offset; } if (firstOffset == -1L) { firstOffset = offset; } if ((offset - safeOffset) >...
java
@Override public synchronized void submit(long offset) { if (submittedOffset == -1L && offset >= 0) { committedOffsets[idx(offset)] = safeOffset = submittedOffset = offset; } if (firstOffset == -1L) { firstOffset = offset; } if ((offset - safeOffset) >...
[ "@", "Override", "public", "synchronized", "void", "submit", "(", "long", "offset", ")", "{", "if", "(", "submittedOffset", "==", "-", "1L", "&&", "offset", ">=", "0", ")", "{", "committedOffsets", "[", "idx", "(", "offset", ")", "]", "=", "safeOffset", ...
submit an offset while consuming a message and record the maximal submitted offset
[ "submit", "an", "offset", "while", "consuming", "a", "message", "and", "record", "the", "maximal", "submitted", "offset" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importclient/kafka/util/DurableTracker.java#L73-L93
train
VoltDB/voltdb
src/frontend/org/voltdb/importclient/kafka/util/DurableTracker.java
DurableTracker.commit
@Override public synchronized long commit(long offset) { if (offset <= submittedOffset && offset > safeOffset) { int ggap = (int)Math.min(committedOffsets.length, offset-safeOffset); if (ggap == committedOffsets.length) { LOGGER.rateLimitedLog(LOG_SUPPRESSION_INTERVAL...
java
@Override public synchronized long commit(long offset) { if (offset <= submittedOffset && offset > safeOffset) { int ggap = (int)Math.min(committedOffsets.length, offset-safeOffset); if (ggap == committedOffsets.length) { LOGGER.rateLimitedLog(LOG_SUPPRESSION_INTERVAL...
[ "@", "Override", "public", "synchronized", "long", "commit", "(", "long", "offset", ")", "{", "if", "(", "offset", "<=", "submittedOffset", "&&", "offset", ">", "safeOffset", ")", "{", "int", "ggap", "=", "(", "int", ")", "Math", ".", "min", "(", "comm...
VoltDB. It will be recorded in committedOffsets and calculate the offset-safeOffset, which is safe to commit to Kafka
[ "VoltDB", ".", "It", "will", "be", "recorded", "in", "committedOffsets", "and", "calculate", "the", "offset", "-", "safeOffset", "which", "is", "safe", "to", "commit", "to", "Kafka" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importclient/kafka/util/DurableTracker.java#L110-L136
train
VoltDB/voltdb
src/frontend/org/voltcore/utils/RateLimitedLogger.java
RateLimitedLogger.log
public void log(long now, Level level, Throwable cause, String stemformat, Object...args) { if (now - m_lastLogTime > m_maxLogIntervalMillis) { synchronized (this) { if (now - m_lastLogTime > m_maxLogIntervalMillis) { String message = formatMessage(cause, stemform...
java
public void log(long now, Level level, Throwable cause, String stemformat, Object...args) { if (now - m_lastLogTime > m_maxLogIntervalMillis) { synchronized (this) { if (now - m_lastLogTime > m_maxLogIntervalMillis) { String message = formatMessage(cause, stemform...
[ "public", "void", "log", "(", "long", "now", ",", "Level", "level", ",", "Throwable", "cause", ",", "String", "stemformat", ",", "Object", "...", "args", ")", "{", "if", "(", "now", "-", "m_lastLogTime", ">", "m_maxLogIntervalMillis", ")", "{", "synchroniz...
This variant delays the formatting of the string message until it is actually logged @param now @param level a {@link Level debug level} @param cause evidentiary exception @param stemformat a {@link String#format(String, Object...) string format} @param args format arguments
[ "This", "variant", "delays", "the", "formatting", "of", "the", "string", "message", "until", "it", "is", "actually", "logged" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/RateLimitedLogger.java#L91-L114
train
VoltDB/voltdb
src/frontend/org/voltdb/iv2/ElasticJoinProducer.java
ElasticJoinProducer.sendFirstFragResponse
private void sendFirstFragResponse() { if (ELASTICLOG.isDebugEnabled()) { ELASTICLOG.debug("P" + m_partitionId + " sending first fragment response to coordinator " + CoreUtils.hsIdToString(m_coordinatorHsId)); } RejoinMessage msg = new RejoinMessage(m_mailbox....
java
private void sendFirstFragResponse() { if (ELASTICLOG.isDebugEnabled()) { ELASTICLOG.debug("P" + m_partitionId + " sending first fragment response to coordinator " + CoreUtils.hsIdToString(m_coordinatorHsId)); } RejoinMessage msg = new RejoinMessage(m_mailbox....
[ "private", "void", "sendFirstFragResponse", "(", ")", "{", "if", "(", "ELASTICLOG", ".", "isDebugEnabled", "(", ")", ")", "{", "ELASTICLOG", ".", "debug", "(", "\"P\"", "+", "m_partitionId", "+", "\" sending first fragment response to coordinator \"", "+", "CoreUtil...
Notify the coordinator that this site has received the first fragment message
[ "Notify", "the", "coordinator", "that", "this", "site", "has", "received", "the", "first", "fragment", "message" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/ElasticJoinProducer.java#L147-L157
train
VoltDB/voltdb
src/frontend/org/voltdb/iv2/ElasticJoinProducer.java
ElasticJoinProducer.runForBlockingDataTransfer
private void runForBlockingDataTransfer(SiteProcedureConnection siteConnection) { boolean sourcesReady = false; RestoreWork restoreWork = m_dataSink.poll(m_snapshotBufferAllocator); if (restoreWork != null) { restoreBlock(restoreWork, siteConnection); sourcesReady = t...
java
private void runForBlockingDataTransfer(SiteProcedureConnection siteConnection) { boolean sourcesReady = false; RestoreWork restoreWork = m_dataSink.poll(m_snapshotBufferAllocator); if (restoreWork != null) { restoreBlock(restoreWork, siteConnection); sourcesReady = t...
[ "private", "void", "runForBlockingDataTransfer", "(", "SiteProcedureConnection", "siteConnection", ")", "{", "boolean", "sourcesReady", "=", "false", ";", "RestoreWork", "restoreWork", "=", "m_dataSink", ".", "poll", "(", "m_snapshotBufferAllocator", ")", ";", "if", "...
Blocking transfer all partitioned table data and notify the coordinator. @param siteConnection
[ "Blocking", "transfer", "all", "partitioned", "table", "data", "and", "notify", "the", "coordinator", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/ElasticJoinProducer.java#L163-L212
train
VoltDB/voltdb
src/frontend/org/voltdb/modular/ModuleManager.java
ModuleManager.getService
public <T> T getService(URI bundleURI, Class<T> svcClazz) { return m_bundles.getService(bundleURI, svcClazz); }
java
public <T> T getService(URI bundleURI, Class<T> svcClazz) { return m_bundles.getService(bundleURI, svcClazz); }
[ "public", "<", "T", ">", "T", "getService", "(", "URI", "bundleURI", ",", "Class", "<", "T", ">", "svcClazz", ")", "{", "return", "m_bundles", ".", "getService", "(", "bundleURI", ",", "svcClazz", ")", ";", "}" ]
Gets the service from the given bundle jar uri. Loads and starts the bundle if it isn't yet loaded @param bundleURI bundle jar URI @param svcClazz the service class exposed by the bundle jar @return a reference to an instance of the service class
[ "Gets", "the", "service", "from", "the", "given", "bundle", "jar", "uri", ".", "Loads", "and", "starts", "the", "bundle", "if", "it", "isn", "t", "yet", "loaded" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/modular/ModuleManager.java#L187-L189
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/RowAVLDisk.java
RowAVLDisk.setPos
public void setPos(int pos) { position = pos; NodeAVL n = nPrimaryNode; while (n != null) { ((NodeAVLDisk) n).iData = position; n = n.nNext; } }
java
public void setPos(int pos) { position = pos; NodeAVL n = nPrimaryNode; while (n != null) { ((NodeAVLDisk) n).iData = position; n = n.nNext; } }
[ "public", "void", "setPos", "(", "int", "pos", ")", "{", "position", "=", "pos", ";", "NodeAVL", "n", "=", "nPrimaryNode", ";", "while", "(", "n", "!=", "null", ")", "{", "(", "(", "NodeAVLDisk", ")", "n", ")", ".", "iData", "=", "position", ";", ...
Sets the file position for the row @param pos position in data file
[ "Sets", "the", "file", "position", "for", "the", "row" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/RowAVLDisk.java#L208-L218
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/RowAVLDisk.java
RowAVLDisk.setNewNodes
void setNewNodes() { int indexcount = tTable.getIndexCount(); nPrimaryNode = new NodeAVLDisk(this, 0); NodeAVL n = nPrimaryNode; for (int i = 1; i < indexcount; i++) { n.nNext = new NodeAVLDisk(this, i); n = n.nNext; } }
java
void setNewNodes() { int indexcount = tTable.getIndexCount(); nPrimaryNode = new NodeAVLDisk(this, 0); NodeAVL n = nPrimaryNode; for (int i = 1; i < indexcount; i++) { n.nNext = new NodeAVLDisk(this, i); n = n.nNext; } }
[ "void", "setNewNodes", "(", ")", "{", "int", "indexcount", "=", "tTable", ".", "getIndexCount", "(", ")", ";", "nPrimaryNode", "=", "new", "NodeAVLDisk", "(", "this", ",", "0", ")", ";", "NodeAVL", "n", "=", "nPrimaryNode", ";", "for", "(", "int", "i",...
used in CachedDataRow
[ "used", "in", "CachedDataRow" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/RowAVLDisk.java#L316-L328
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/RowAVLDisk.java
RowAVLDisk.write
public void write(RowOutputInterface out) { try { writeNodes(out); if (hasDataChanged) { out.writeData(rowData, tTable.colTypes); out.writeEnd(); hasDataChanged = false; } } catch (IOException e) {} }
java
public void write(RowOutputInterface out) { try { writeNodes(out); if (hasDataChanged) { out.writeData(rowData, tTable.colTypes); out.writeEnd(); hasDataChanged = false; } } catch (IOException e) {} }
[ "public", "void", "write", "(", "RowOutputInterface", "out", ")", "{", "try", "{", "writeNodes", "(", "out", ")", ";", "if", "(", "hasDataChanged", ")", "{", "out", ".", "writeData", "(", "rowData", ",", "tTable", ".", "colTypes", ")", ";", "out", ".",...
Used exclusively by Cache to save the row to disk. New implementation in 1.7.2 writes out only the Node data if the table row data has not changed. This situation accounts for the majority of invocations as for each row deleted or inserted, the Nodes for several other rows will change.
[ "Used", "exclusively", "by", "Cache", "to", "save", "the", "row", "to", "disk", ".", "New", "implementation", "in", "1", ".", "7", ".", "2", "writes", "out", "only", "the", "Node", "data", "if", "the", "table", "row", "data", "has", "not", "changed", ...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/RowAVLDisk.java#L345-L357
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/RowAVLDisk.java
RowAVLDisk.writeNodes
private void writeNodes(RowOutputInterface out) throws IOException { out.writeSize(storageSize); NodeAVL n = nPrimaryNode; while (n != null) { n.write(out); n = n.nNext; } hasNodesChanged = false; }
java
private void writeNodes(RowOutputInterface out) throws IOException { out.writeSize(storageSize); NodeAVL n = nPrimaryNode; while (n != null) { n.write(out); n = n.nNext; } hasNodesChanged = false; }
[ "private", "void", "writeNodes", "(", "RowOutputInterface", "out", ")", "throws", "IOException", "{", "out", ".", "writeSize", "(", "storageSize", ")", ";", "NodeAVL", "n", "=", "nPrimaryNode", ";", "while", "(", "n", "!=", "null", ")", "{", "n", ".", "w...
Writes the Nodes, immediately after the row size. @param out @throws IOException
[ "Writes", "the", "Nodes", "immediately", "after", "the", "row", "size", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/RowAVLDisk.java#L387-L400
train
VoltDB/voltdb
src/frontend/org/voltdb/exceptions/SerializableException.java
SerializableException.serializeToBuffer
public void serializeToBuffer(ByteBuffer b) { assert(getSerializedSize() <= b.remaining()); b.putInt(getSerializedSize() - 4); b.put((byte)getExceptionType().ordinal()); if (m_message != null) { final byte messageBytes[] = m_message.getBytes(); b.putInt(messageByt...
java
public void serializeToBuffer(ByteBuffer b) { assert(getSerializedSize() <= b.remaining()); b.putInt(getSerializedSize() - 4); b.put((byte)getExceptionType().ordinal()); if (m_message != null) { final byte messageBytes[] = m_message.getBytes(); b.putInt(messageByt...
[ "public", "void", "serializeToBuffer", "(", "ByteBuffer", "b", ")", "{", "assert", "(", "getSerializedSize", "(", ")", "<=", "b", ".", "remaining", "(", ")", ")", ";", "b", ".", "putInt", "(", "getSerializedSize", "(", ")", "-", "4", ")", ";", "b", "...
Serialize this exception to the supplied byte buffer @param b ByteBuffer to serialize this exception to
[ "Serialize", "this", "exception", "to", "the", "supplied", "byte", "buffer" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/exceptions/SerializableException.java#L189-L201
train
VoltDB/voltdb
src/frontend/org/voltdb/StatsSource.java
StatsSource.populateColumnSchema
protected void populateColumnSchema(ArrayList<ColumnInfo> columns) { columns.add(new ColumnInfo("TIMESTAMP", VoltType.BIGINT)); columns.add(new ColumnInfo(VoltSystemProcedure.CNAME_HOST_ID, VoltSystemProcedure.CTYPE_ID)); columns.add(new ColumnInfo("HOSTNAME", ...
java
protected void populateColumnSchema(ArrayList<ColumnInfo> columns) { columns.add(new ColumnInfo("TIMESTAMP", VoltType.BIGINT)); columns.add(new ColumnInfo(VoltSystemProcedure.CNAME_HOST_ID, VoltSystemProcedure.CTYPE_ID)); columns.add(new ColumnInfo("HOSTNAME", ...
[ "protected", "void", "populateColumnSchema", "(", "ArrayList", "<", "ColumnInfo", ">", "columns", ")", "{", "columns", ".", "add", "(", "new", "ColumnInfo", "(", "\"TIMESTAMP\"", ",", "VoltType", ".", "BIGINT", ")", ")", ";", "columns", ".", "add", "(", "n...
Called from the constructor to generate the column schema at run time. Derived classes need to override this method in order to specify the columns they will be adding. The first line must always be a call the superclasses version of populateColumnSchema in order to ensure the columns are add to the list in the right o...
[ "Called", "from", "the", "constructor", "to", "generate", "the", "column", "schema", "at", "run", "time", ".", "Derived", "classes", "need", "to", "override", "this", "method", "in", "order", "to", "specify", "the", "columns", "they", "will", "be", "adding",...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/StatsSource.java#L93-L98
train
VoltDB/voltdb
src/frontend/org/voltdb/StatsSource.java
StatsSource.getStatsRows
public Object[][] getStatsRows(boolean interval, final Long now) { this.now = now; /* * Synchronizing on this allows derived classes to maintain thread safety */ synchronized (this) { Iterator<Object> i = getStatsRowKeyIterator(interval); ArrayList<Objec...
java
public Object[][] getStatsRows(boolean interval, final Long now) { this.now = now; /* * Synchronizing on this allows derived classes to maintain thread safety */ synchronized (this) { Iterator<Object> i = getStatsRowKeyIterator(interval); ArrayList<Objec...
[ "public", "Object", "[", "]", "[", "]", "getStatsRows", "(", "boolean", "interval", ",", "final", "Long", "now", ")", "{", "this", ".", "now", "=", "now", ";", "/*\n * Synchronizing on this allows derived classes to maintain thread safety\n */", "synchro...
Get the latest stat values as an array of arrays of objects suitable for insertion into an VoltTable @param interval Whether to get stats since the beginning or since the last time stats were retrieved @return Array of Arrays of objects containing the latest values
[ "Get", "the", "latest", "stat", "values", "as", "an", "array", "of", "arrays", "of", "objects", "suitable", "for", "insertion", "into", "an", "VoltTable" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/StatsSource.java#L115-L131
train
VoltDB/voltdb
src/frontend/org/voltdb/StatsSource.java
StatsSource.updateStatsRow
protected void updateStatsRow(Object rowKey, Object rowValues[]) { rowValues[0] = now; rowValues[1] = m_hostId; rowValues[2] = m_hostname; }
java
protected void updateStatsRow(Object rowKey, Object rowValues[]) { rowValues[0] = now; rowValues[1] = m_hostId; rowValues[2] = m_hostname; }
[ "protected", "void", "updateStatsRow", "(", "Object", "rowKey", ",", "Object", "rowValues", "[", "]", ")", "{", "rowValues", "[", "0", "]", "=", "now", ";", "rowValues", "[", "1", "]", "=", "m_hostId", ";", "rowValues", "[", "2", "]", "=", "m_hostname"...
Update the parameter array with the latest values. This is similar to populateColumnSchema in that it must be overriden by derived classes and the derived class implementation must call the super classes implementation. @param rowKey Key identifying the specific row to be populated @param rowValues Output parameter. Ar...
[ "Update", "the", "parameter", "array", "with", "the", "latest", "values", ".", "This", "is", "similar", "to", "populateColumnSchema", "in", "that", "it", "must", "be", "overriden", "by", "derived", "classes", "and", "the", "derived", "class", "implementation", ...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/StatsSource.java#L183-L187
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java
FileSnap.deserialize
@Override public long deserialize(DataTree dt, Map<Long, Long> sessions) throws IOException { // we run through 100 snapshots (not all of them) // if we cannot get it running within 100 snapshots // we should give up List<File> snapList = findNValidSnapshots(100); ...
java
@Override public long deserialize(DataTree dt, Map<Long, Long> sessions) throws IOException { // we run through 100 snapshots (not all of them) // if we cannot get it running within 100 snapshots // we should give up List<File> snapList = findNValidSnapshots(100); ...
[ "@", "Override", "public", "long", "deserialize", "(", "DataTree", "dt", ",", "Map", "<", "Long", ",", "Long", ">", "sessions", ")", "throws", "IOException", "{", "// we run through 100 snapshots (not all of them)", "// if we cannot get it running within 100 snapshots", "...
deserialize a data tree from the most recent snapshot @return the zxid of the snapshot
[ "deserialize", "a", "data", "tree", "from", "the", "most", "recent", "snapshot" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java#L70-L113
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java
FileSnap.deserialize
public void deserialize(DataTree dt, Map<Long, Long> sessions, InputArchive ia) throws IOException { FileHeader header = new FileHeader(); header.deserialize(ia, "fileheader"); if (header.getMagic() != SNAP_MAGIC) { throw new IOException("mismatching magic headers " ...
java
public void deserialize(DataTree dt, Map<Long, Long> sessions, InputArchive ia) throws IOException { FileHeader header = new FileHeader(); header.deserialize(ia, "fileheader"); if (header.getMagic() != SNAP_MAGIC) { throw new IOException("mismatching magic headers " ...
[ "public", "void", "deserialize", "(", "DataTree", "dt", ",", "Map", "<", "Long", ",", "Long", ">", "sessions", ",", "InputArchive", "ia", ")", "throws", "IOException", "{", "FileHeader", "header", "=", "new", "FileHeader", "(", ")", ";", "header", ".", "...
deserialize the datatree from an inputarchive @param dt the datatree to be serialized into @param sessions the sessions to be filled up @param ia the input archive to restore from @throws IOException
[ "deserialize", "the", "datatree", "from", "an", "inputarchive" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java#L122-L132
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java
FileSnap.findMostRecentSnapshot
@Override public File findMostRecentSnapshot() throws IOException { List<File> files = findNValidSnapshots(1); if (files.size() == 0) { return null; } return files.get(0); }
java
@Override public File findMostRecentSnapshot() throws IOException { List<File> files = findNValidSnapshots(1); if (files.size() == 0) { return null; } return files.get(0); }
[ "@", "Override", "public", "File", "findMostRecentSnapshot", "(", ")", "throws", "IOException", "{", "List", "<", "File", ">", "files", "=", "findNValidSnapshots", "(", "1", ")", ";", "if", "(", "files", ".", "size", "(", ")", "==", "0", ")", "{", "ret...
find the most recent snapshot in the database. @return the file containing the most recent snapshot
[ "find", "the", "most", "recent", "snapshot", "in", "the", "database", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java#L138-L145
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java
FileSnap.findNRecentSnapshots
public List<File> findNRecentSnapshots(int n) throws IOException { List<File> files = Util.sortDataDir(snapDir.listFiles(), "snapshot", false); int i = 0; List<File> list = new ArrayList<File>(); for (File f: files) { if (i==n) break; i++; ...
java
public List<File> findNRecentSnapshots(int n) throws IOException { List<File> files = Util.sortDataDir(snapDir.listFiles(), "snapshot", false); int i = 0; List<File> list = new ArrayList<File>(); for (File f: files) { if (i==n) break; i++; ...
[ "public", "List", "<", "File", ">", "findNRecentSnapshots", "(", "int", "n", ")", "throws", "IOException", "{", "List", "<", "File", ">", "files", "=", "Util", ".", "sortDataDir", "(", "snapDir", ".", "listFiles", "(", ")", ",", "\"snapshot\"", ",", "fal...
find the last n snapshots. this does not have any checks if the snapshot might be valid or not @param the number of most recent snapshots @return the last n snapshots @throws IOException
[ "find", "the", "last", "n", "snapshots", ".", "this", "does", "not", "have", "any", "checks", "if", "the", "snapshot", "might", "be", "valid", "or", "not" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java#L189-L200
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java
FileSnap.serialize
protected void serialize(DataTree dt,Map<Long, Long> sessions, OutputArchive oa, FileHeader header) throws IOException { // this is really a programmatic error and not something that can // happen at runtime if(header==null) throw new IllegalStateException( ...
java
protected void serialize(DataTree dt,Map<Long, Long> sessions, OutputArchive oa, FileHeader header) throws IOException { // this is really a programmatic error and not something that can // happen at runtime if(header==null) throw new IllegalStateException( ...
[ "protected", "void", "serialize", "(", "DataTree", "dt", ",", "Map", "<", "Long", ",", "Long", ">", "sessions", ",", "OutputArchive", "oa", ",", "FileHeader", "header", ")", "throws", "IOException", "{", "// this is really a programmatic error and not something that c...
serialize the datatree and sessions @param dt the datatree to be serialized @param sessions the sessions to be serialized @param oa the output archive to serialize into @param header the header of this snapshot @throws IOException
[ "serialize", "the", "datatree", "and", "sessions" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java#L210-L219
train
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java
FileSnap.serialize
@Override public synchronized void serialize(DataTree dt, Map<Long, Long> sessions, File snapShot) throws IOException { if (!close) { OutputStream sessOS = new BufferedOutputStream(new FileOutputStream(snapShot)); CheckedOutputStream crcOut = new CheckedOutputStream(sessO...
java
@Override public synchronized void serialize(DataTree dt, Map<Long, Long> sessions, File snapShot) throws IOException { if (!close) { OutputStream sessOS = new BufferedOutputStream(new FileOutputStream(snapShot)); CheckedOutputStream crcOut = new CheckedOutputStream(sessO...
[ "@", "Override", "public", "synchronized", "void", "serialize", "(", "DataTree", "dt", ",", "Map", "<", "Long", ",", "Long", ">", "sessions", ",", "File", "snapShot", ")", "throws", "IOException", "{", "if", "(", "!", "close", ")", "{", "OutputStream", "...
serialize the datatree and session into the file snapshot @param dt the datatree to be serialized @param sessions the sessions to be serialized @param snapShot the file to store snapshot into
[ "serialize", "the", "datatree", "and", "session", "into", "the", "file", "snapshot" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileSnap.java#L227-L244
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/SystemStatsCollector.java
SystemStatsCollector.sampleSystemNow
public static Datum sampleSystemNow(final boolean medium, final boolean large) { Datum d = generateCurrentSample(); if (d == null) return null; historyS.addLast(d); if (historyS.size() > historySize) historyS.removeFirst(); if (medium) { historyM.addLast(d...
java
public static Datum sampleSystemNow(final boolean medium, final boolean large) { Datum d = generateCurrentSample(); if (d == null) return null; historyS.addLast(d); if (historyS.size() > historySize) historyS.removeFirst(); if (medium) { historyM.addLast(d...
[ "public", "static", "Datum", "sampleSystemNow", "(", "final", "boolean", "medium", ",", "final", "boolean", "large", ")", "{", "Datum", "d", "=", "generateCurrentSample", "(", ")", ";", "if", "(", "d", "==", "null", ")", "return", "null", ";", "historyS", ...
Synchronously collect memory stats. @param medium Add result to medium set? @param large Add result to large set? @return The generated Datum instance.
[ "Synchronously", "collect", "memory", "stats", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SystemStatsCollector.java#L237-L253
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/SystemStatsCollector.java
SystemStatsCollector.asyncSampleSystemNow
public static synchronized void asyncSampleSystemNow(final boolean medium, final boolean large) { // slow mode starts an async thread if (mode == GetRSSMode.PS) { if (thread != null) { if (thread.isAlive()) return; else thread = null; } ...
java
public static synchronized void asyncSampleSystemNow(final boolean medium, final boolean large) { // slow mode starts an async thread if (mode == GetRSSMode.PS) { if (thread != null) { if (thread.isAlive()) return; else thread = null; } ...
[ "public", "static", "synchronized", "void", "asyncSampleSystemNow", "(", "final", "boolean", "medium", ",", "final", "boolean", "large", ")", "{", "// slow mode starts an async thread", "if", "(", "mode", "==", "GetRSSMode", ".", "PS", ")", "{", "if", "(", "thre...
Fire off a thread to asynchronously collect stats. @param medium Add result to medium set? @param large Add result to large set?
[ "Fire", "off", "a", "thread", "to", "asynchronously", "collect", "stats", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SystemStatsCollector.java#L260-L278
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/SystemStatsCollector.java
SystemStatsCollector.initialize
private static synchronized void initialize() { PlatformProperties pp = PlatformProperties.getPlatformProperties(); String processName = java.lang.management.ManagementFactory.getRuntimeMXBean().getName(); String pidString = processName.substring(0, processName.indexOf('@')); pid = Inte...
java
private static synchronized void initialize() { PlatformProperties pp = PlatformProperties.getPlatformProperties(); String processName = java.lang.management.ManagementFactory.getRuntimeMXBean().getName(); String pidString = processName.substring(0, processName.indexOf('@')); pid = Inte...
[ "private", "static", "synchronized", "void", "initialize", "(", ")", "{", "PlatformProperties", "pp", "=", "PlatformProperties", ".", "getPlatformProperties", "(", ")", ";", "String", "processName", "=", "java", ".", "lang", ".", "management", ".", "ManagementFact...
Get the process id, the total memory size and determine the best way to get the RSS on an ongoing basis.
[ "Get", "the", "process", "id", "the", "total", "memory", "size", "and", "determine", "the", "best", "way", "to", "get", "the", "RSS", "on", "an", "ongoing", "basis", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SystemStatsCollector.java#L294-L335
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/SystemStatsCollector.java
SystemStatsCollector.getRSSFromProcFS
private static long getRSSFromProcFS() { try { File statFile = new File(String.format("/proc/%d/stat", pid)); FileInputStream fis = new FileInputStream(statFile); try { BufferedReader r = new BufferedReader(new InputStreamReader(fis)); String s...
java
private static long getRSSFromProcFS() { try { File statFile = new File(String.format("/proc/%d/stat", pid)); FileInputStream fis = new FileInputStream(statFile); try { BufferedReader r = new BufferedReader(new InputStreamReader(fis)); String s...
[ "private", "static", "long", "getRSSFromProcFS", "(", ")", "{", "try", "{", "File", "statFile", "=", "new", "File", "(", "String", ".", "format", "(", "\"/proc/%d/stat\"", ",", "pid", ")", ")", ";", "FileInputStream", "fis", "=", "new", "FileInputStream", ...
Get the RSS using the procfs. If procfs is not around, this will return -1;
[ "Get", "the", "RSS", "using", "the", "procfs", ".", "If", "procfs", "is", "not", "around", "this", "will", "return", "-", "1", ";" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SystemStatsCollector.java#L341-L357
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/SystemStatsCollector.java
SystemStatsCollector.generateCurrentSample
private static synchronized Datum generateCurrentSample() { // Code used to fake system statistics by tests if (testStatsProducer!=null) { return testStatsProducer.getCurrentStatsData(); } // get this info once if (!initialized) initialize(); long rss = -1; ...
java
private static synchronized Datum generateCurrentSample() { // Code used to fake system statistics by tests if (testStatsProducer!=null) { return testStatsProducer.getCurrentStatsData(); } // get this info once if (!initialized) initialize(); long rss = -1; ...
[ "private", "static", "synchronized", "Datum", "generateCurrentSample", "(", ")", "{", "// Code used to fake system statistics by tests", "if", "(", "testStatsProducer", "!=", "null", ")", "{", "return", "testStatsProducer", ".", "getCurrentStatsData", "(", ")", ";", "}"...
Poll the operating system and generate a Datum @return A newly created Datum instance.
[ "Poll", "the", "operating", "system", "and", "generate", "a", "Datum" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SystemStatsCollector.java#L368-L393
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/SystemStatsCollector.java
SystemStatsCollector.getGoogleChartURL
public static synchronized String getGoogleChartURL(int minutes, int width, int height, String timeLabel) { ArrayDeque<Datum> history = historyS; if (minutes > 2) history = historyM; if (minutes > 30) history = historyL; HTMLChartHelper chart = new HTMLChartHelper(); chart.widt...
java
public static synchronized String getGoogleChartURL(int minutes, int width, int height, String timeLabel) { ArrayDeque<Datum> history = historyS; if (minutes > 2) history = historyM; if (minutes > 30) history = historyL; HTMLChartHelper chart = new HTMLChartHelper(); chart.widt...
[ "public", "static", "synchronized", "String", "getGoogleChartURL", "(", "int", "minutes", ",", "int", "width", ",", "int", "height", ",", "String", "timeLabel", ")", "{", "ArrayDeque", "<", "Datum", ">", "history", "=", "historyS", ";", "if", "(", "minutes",...
Get a URL that uses the Google Charts API to show a chart of memory usage history. @param minutes The number of minutes the chart should cover. Tested values are 2, 30 and 1440. @param width The width of the chart image in pixels. @param height The height of the chart image in pixels. @param timeLabel The text to put ...
[ "Get", "a", "URL", "that", "uses", "the", "Google", "Charts", "API", "to", "show", "a", "chart", "of", "memory", "usage", "history", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SystemStatsCollector.java#L404-L463
train
VoltDB/voltdb
src/frontend/org/voltdb/utils/SystemStatsCollector.java
SystemStatsCollector.main
public static void main(String[] args) { int repeat = 1000; long start, duration, correct; double per; String processName = java.lang.management.ManagementFactory.getRuntimeMXBean().getName(); String pidString = processName.substring(0, processName.indexOf('@')); pid = I...
java
public static void main(String[] args) { int repeat = 1000; long start, duration, correct; double per; String processName = java.lang.management.ManagementFactory.getRuntimeMXBean().getName(); String pidString = processName.substring(0, processName.indexOf('@')); pid = I...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "int", "repeat", "=", "1000", ";", "long", "start", ",", "duration", ",", "correct", ";", "double", "per", ";", "String", "processName", "=", "java", ".", "lang", ".", "ma...
Manual performance testing code for getting stats.
[ "Manual", "performance", "testing", "code", "for", "getting", "stats", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SystemStatsCollector.java#L472-L519
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java
TransactionManager.rollbackPartial
void rollbackPartial(Session session, int start, long timestamp) { Object[] list = session.rowActionList.getArray(); int limit = session.rowActionList.size(); if (start == limit) { return; } for (int i = start; i < limit; i++) { RowAction action =...
java
void rollbackPartial(Session session, int start, long timestamp) { Object[] list = session.rowActionList.getArray(); int limit = session.rowActionList.size(); if (start == limit) { return; } for (int i = start; i < limit; i++) { RowAction action =...
[ "void", "rollbackPartial", "(", "Session", "session", ",", "int", "start", ",", "long", "timestamp", ")", "{", "Object", "[", "]", "list", "=", "session", ".", "rowActionList", ".", "getArray", "(", ")", ";", "int", "limit", "=", "session", ".", "rowActi...
rollback the row actions from start index in list and the given timestamp
[ "rollback", "the", "row", "actions", "from", "start", "index", "in", "list", "and", "the", "given", "timestamp" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L436-L462
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java
TransactionManager.canRead
public boolean canRead(Session session, Row row) { synchronized (row) { RowAction action = row.rowAction; if (action == null) { return true; } return action.canRead(session); } }
java
public boolean canRead(Session session, Row row) { synchronized (row) { RowAction action = row.rowAction; if (action == null) { return true; } return action.canRead(session); } }
[ "public", "boolean", "canRead", "(", "Session", "session", ",", "Row", "row", ")", "{", "synchronized", "(", "row", ")", "{", "RowAction", "action", "=", "row", ".", "rowAction", ";", "if", "(", "action", "==", "null", ")", "{", "return", "true", ";", ...
functional unit - accessibility of rows
[ "functional", "unit", "-", "accessibility", "of", "rows" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L517-L528
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java
TransactionManager.setTransactionInfo
public void setTransactionInfo(CachedObject object) { Row row = (Row) object; if (row.rowAction != null) { return; } RowAction rowact = (RowAction) rowActionMap.get(row.position); row.rowAction = rowact; }
java
public void setTransactionInfo(CachedObject object) { Row row = (Row) object; if (row.rowAction != null) { return; } RowAction rowact = (RowAction) rowActionMap.get(row.position); row.rowAction = rowact; }
[ "public", "void", "setTransactionInfo", "(", "CachedObject", "object", ")", "{", "Row", "row", "=", "(", "Row", ")", "object", ";", "if", "(", "row", ".", "rowAction", "!=", "null", ")", "{", "return", ";", "}", "RowAction", "rowact", "=", "(", "RowAct...
add transaction info to a row just loaded from the cache. called only for CACHED tables
[ "add", "transaction", "info", "to", "a", "row", "just", "loaded", "from", "the", "cache", ".", "called", "only", "for", "CACHED", "tables" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L609-L620
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java
TransactionManager.mergeRolledBackTransaction
void mergeRolledBackTransaction(Object[] list, int start, int limit) { for (int i = start; i < limit; i++) { RowAction rowact = (RowAction) list[i]; if (rowact == null || rowact.type == RowActionBase.ACTION_NONE || rowact.type == RowActionBase.ACTION_DELETE_FINAL) {...
java
void mergeRolledBackTransaction(Object[] list, int start, int limit) { for (int i = start; i < limit; i++) { RowAction rowact = (RowAction) list[i]; if (rowact == null || rowact.type == RowActionBase.ACTION_NONE || rowact.type == RowActionBase.ACTION_DELETE_FINAL) {...
[ "void", "mergeRolledBackTransaction", "(", "Object", "[", "]", "list", ",", "int", "start", ",", "int", "limit", ")", "{", "for", "(", "int", "i", "=", "start", ";", "i", "<", "limit", ";", "i", "++", ")", "{", "RowAction", "rowact", "=", "(", "Row...
merge a given list of transaction rollback action with given timestamp
[ "merge", "a", "given", "list", "of", "transaction", "rollback", "action", "with", "given", "timestamp" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L625-L657
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java
TransactionManager.addToCommittedQueue
void addToCommittedQueue(Session session, Object[] list) { synchronized (committedTransactionTimestamps) { // add the txList according to commit timestamp committedTransactions.addLast(list); // get session commit timestamp committedTransactionTimestamps.addLas...
java
void addToCommittedQueue(Session session, Object[] list) { synchronized (committedTransactionTimestamps) { // add the txList according to commit timestamp committedTransactions.addLast(list); // get session commit timestamp committedTransactionTimestamps.addLas...
[ "void", "addToCommittedQueue", "(", "Session", "session", ",", "Object", "[", "]", "list", ")", "{", "synchronized", "(", "committedTransactionTimestamps", ")", "{", "// add the txList according to commit timestamp", "committedTransactions", ".", "addLast", "(", "list", ...
add a list of actions to the end of queue
[ "add", "a", "list", "of", "actions", "to", "the", "end", "of", "queue" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L662-L677
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java
TransactionManager.mergeExpiredTransactions
void mergeExpiredTransactions(Session session) { long timestamp = getFirstLiveTransactionTimestamp(); while (true) { long commitTimestamp = 0; Object[] actions = null; synchronized (committedTransactionTimestamps) { if (committedTransact...
java
void mergeExpiredTransactions(Session session) { long timestamp = getFirstLiveTransactionTimestamp(); while (true) { long commitTimestamp = 0; Object[] actions = null; synchronized (committedTransactionTimestamps) { if (committedTransact...
[ "void", "mergeExpiredTransactions", "(", "Session", "session", ")", "{", "long", "timestamp", "=", "getFirstLiveTransactionTimestamp", "(", ")", ";", "while", "(", "true", ")", "{", "long", "commitTimestamp", "=", "0", ";", "Object", "[", "]", "actions", "=", ...
expire all committed transactions that are no longer in scope
[ "expire", "all", "committed", "transactions", "that", "are", "no", "longer", "in", "scope" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L682-L710
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java
TransactionManager.endTransaction
void endTransaction(Session session) { try { writeLock.lock(); long timestamp = session.transactionTimestamp; synchronized (liveTransactionTimestamps) { session.isTransaction = false; int index = liveTransactionTimestamps.indexOf(timestamp)...
java
void endTransaction(Session session) { try { writeLock.lock(); long timestamp = session.transactionTimestamp; synchronized (liveTransactionTimestamps) { session.isTransaction = false; int index = liveTransactionTimestamps.indexOf(timestamp)...
[ "void", "endTransaction", "(", "Session", "session", ")", "{", "try", "{", "writeLock", ".", "lock", "(", ")", ";", "long", "timestamp", "=", "session", ".", "transactionTimestamp", ";", "synchronized", "(", "liveTransactionTimestamps", ")", "{", "session", "....
remove session from queue when a transaction ends and expire any committed transactions that are no longer required. remove transactions ended before the first timestamp in liveTransactionsSession queue
[ "remove", "session", "from", "queue", "when", "a", "transaction", "ends", "and", "expire", "any", "committed", "transactions", "that", "are", "no", "longer", "required", ".", "remove", "transactions", "ended", "before", "the", "first", "timestamp", "in", "liveTr...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L1060-L1079
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java
TransactionManager.getRowActionList
RowAction[] getRowActionList() { try { writeLock.lock(); Session[] sessions = database.sessionManager.getAllSessions(); int[] tIndex = new int[sessions.length]; RowAction[] rowActions; int rowActionCount = 0; { ...
java
RowAction[] getRowActionList() { try { writeLock.lock(); Session[] sessions = database.sessionManager.getAllSessions(); int[] tIndex = new int[sessions.length]; RowAction[] rowActions; int rowActionCount = 0; { ...
[ "RowAction", "[", "]", "getRowActionList", "(", ")", "{", "try", "{", "writeLock", ".", "lock", "(", ")", ";", "Session", "[", "]", "sessions", "=", "database", ".", "sessionManager", ".", "getAllSessions", "(", ")", ";", "int", "[", "]", "tIndex", "="...
Return an array of all row actions sorted by System Change No.
[ "Return", "an", "array", "of", "all", "row", "actions", "sorted", "by", "System", "Change", "No", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L1097-L1170
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java
TransactionManager.getTransactionIDList
public DoubleIntIndex getTransactionIDList() { writeLock.lock(); try { DoubleIntIndex lookup = new DoubleIntIndex(10, false); lookup.setKeysSearchTarget(); Iterator it = this.rowActionMap.keySet().iterator(); for (; it.hasNext(); ) { l...
java
public DoubleIntIndex getTransactionIDList() { writeLock.lock(); try { DoubleIntIndex lookup = new DoubleIntIndex(10, false); lookup.setKeysSearchTarget(); Iterator it = this.rowActionMap.keySet().iterator(); for (; it.hasNext(); ) { l...
[ "public", "DoubleIntIndex", "getTransactionIDList", "(", ")", "{", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "DoubleIntIndex", "lookup", "=", "new", "DoubleIntIndex", "(", "10", ",", "false", ")", ";", "lookup", ".", "setKeysSearchTarget", "(", ")...
Return a lookup of all row ids for cached tables in transactions. For auto-defrag, as currently there will be no RowAction entries at the time of defrag.
[ "Return", "a", "lookup", "of", "all", "row", "ids", "for", "cached", "tables", "in", "transactions", ".", "For", "auto", "-", "defrag", "as", "currently", "there", "will", "be", "no", "RowAction", "entries", "at", "the", "time", "of", "defrag", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L1177-L1196
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java
TransactionManager.convertTransactionIDs
public void convertTransactionIDs(DoubleIntIndex lookup) { writeLock.lock(); try { RowAction[] list = new RowAction[rowActionMap.size()]; Iterator it = this.rowActionMap.values().iterator(); for (int i = 0; it.hasNext(); i++) { list[i] = (RowAc...
java
public void convertTransactionIDs(DoubleIntIndex lookup) { writeLock.lock(); try { RowAction[] list = new RowAction[rowActionMap.size()]; Iterator it = this.rowActionMap.values().iterator(); for (int i = 0; it.hasNext(); i++) { list[i] = (RowAc...
[ "public", "void", "convertTransactionIDs", "(", "DoubleIntIndex", "lookup", ")", "{", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "RowAction", "[", "]", "list", "=", "new", "RowAction", "[", "rowActionMap", ".", "size", "(", ")", "]", ";", "Iter...
Convert row ID's for cached table rows in transactions
[ "Convert", "row", "ID", "s", "for", "cached", "table", "rows", "in", "transactions" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L1201-L1224
train
VoltDB/voltdb
src/frontend/org/voltdb/messaging/VoltDbMessageFactory.java
VoltDbMessageFactory.instantiate_local
@Override protected VoltMessage instantiate_local(byte messageType) { // instantiate a new message instance according to the id VoltMessage message = null; switch (messageType) { case INITIATE_TASK_ID: message = new InitiateTaskMessage(); break; c...
java
@Override protected VoltMessage instantiate_local(byte messageType) { // instantiate a new message instance according to the id VoltMessage message = null; switch (messageType) { case INITIATE_TASK_ID: message = new InitiateTaskMessage(); break; c...
[ "@", "Override", "protected", "VoltMessage", "instantiate_local", "(", "byte", "messageType", ")", "{", "// instantiate a new message instance according to the id", "VoltMessage", "message", "=", "null", ";", "switch", "(", "messageType", ")", "{", "case", "INITIATE_TASK_...
Overridden by subclasses to create message types unknown by voltcore @param messageType @return
[ "Overridden", "by", "subclasses", "to", "create", "message", "types", "unknown", "by", "voltcore" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/VoltDbMessageFactory.java#L63-L164
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/Database.java
Database.clearStructures
void clearStructures() { if (schemaManager != null) { schemaManager.clearStructures(); } granteeManager = null; userManager = null; nameManager = null; schemaManager = null; sessionManager = null; dbInfo = null; }
java
void clearStructures() { if (schemaManager != null) { schemaManager.clearStructures(); } granteeManager = null; userManager = null; nameManager = null; schemaManager = null; sessionManager = null; dbInfo = null; }
[ "void", "clearStructures", "(", ")", "{", "if", "(", "schemaManager", "!=", "null", ")", "{", "schemaManager", ".", "clearStructures", "(", ")", ";", "}", "granteeManager", "=", "null", ";", "userManager", "=", "null", ";", "nameManager", "=", "null", ";",...
Clears the data structuress, making them elligible for garbage collection.
[ "Clears", "the", "data", "structuress", "making", "them", "elligible", "for", "garbage", "collection", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Database.java#L394-L406
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/Database.java
Database.getScript
public Result getScript(boolean indexRoots) { Result r = Result.newSingleColumnResult("COMMAND", Type.SQL_VARCHAR); String[] list = getSettingsSQL(); addRows(r, list); list = getGranteeManager().getSQL(); addRows(r, list); // schemas and schema objects such as tabl...
java
public Result getScript(boolean indexRoots) { Result r = Result.newSingleColumnResult("COMMAND", Type.SQL_VARCHAR); String[] list = getSettingsSQL(); addRows(r, list); list = getGranteeManager().getSQL(); addRows(r, list); // schemas and schema objects such as tabl...
[ "public", "Result", "getScript", "(", "boolean", "indexRoots", ")", "{", "Result", "r", "=", "Result", ".", "newSingleColumnResult", "(", "\"COMMAND\"", ",", "Type", ".", "SQL_VARCHAR", ")", ";", "String", "[", "]", "list", "=", "getSettingsSQL", "(", ")", ...
Returns the schema and authorisation statements for the database.
[ "Returns", "the", "schema", "and", "authorisation", "statements", "for", "the", "database", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Database.java#L767-L805
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java
ParserDQL.readWindowSpecification
private Expression readWindowSpecification(int tokenT, Expression aggExpr) { SortAndSlice sortAndSlice = null; readThis(Tokens.OPENBRACKET); List<Expression> partitionByList = new ArrayList<>(); if (token.tokenType == Tokens.PARTITION) { read(); readThis(Tokens....
java
private Expression readWindowSpecification(int tokenT, Expression aggExpr) { SortAndSlice sortAndSlice = null; readThis(Tokens.OPENBRACKET); List<Expression> partitionByList = new ArrayList<>(); if (token.tokenType == Tokens.PARTITION) { read(); readThis(Tokens....
[ "private", "Expression", "readWindowSpecification", "(", "int", "tokenT", ",", "Expression", "aggExpr", ")", "{", "SortAndSlice", "sortAndSlice", "=", "null", ";", "readThis", "(", "Tokens", ".", "OPENBRACKET", ")", ";", "List", "<", "Expression", ">", "partitio...
This is a minimal parsing of the Window Specification. We only use partition by and order by lists. There is a lot of complexity in the full SQL specification which we don't parse at all. @param tokenT @param aggExpr @return
[ "This", "is", "a", "minimal", "parsing", "of", "the", "Window", "Specification", ".", "We", "only", "use", "partition", "by", "and", "order", "by", "lists", ".", "There", "is", "a", "lot", "of", "complexity", "in", "the", "full", "SQL", "specification", ...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L1734-L1786
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java
ParserDQL.XStartsWithPredicateRightPart
private ExpressionLogical XStartsWithPredicateRightPart(Expression left) { readThis(Tokens.WITH); if (token.tokenType == Tokens.QUESTION) { // handle user parameter case Expression right = XreadRowValuePredicand(); if (left.isParam() && right.isParam()) { // again make sure...
java
private ExpressionLogical XStartsWithPredicateRightPart(Expression left) { readThis(Tokens.WITH); if (token.tokenType == Tokens.QUESTION) { // handle user parameter case Expression right = XreadRowValuePredicand(); if (left.isParam() && right.isParam()) { // again make sure...
[ "private", "ExpressionLogical", "XStartsWithPredicateRightPart", "(", "Expression", "left", ")", "{", "readThis", "(", "Tokens", ".", "WITH", ")", ";", "if", "(", "token", ".", "tokenType", "==", "Tokens", ".", "QUESTION", ")", "{", "// handle user parameter case"...
Scan the right-side string value, return a STARTS WITH Expression for generating XML @param a ExpressionColumn
[ "Scan", "the", "right", "-", "side", "string", "value", "return", "a", "STARTS", "WITH", "Expression", "for", "generating", "XML" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L3384-L3405
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java
ParserDQL.XreadRowValueConstructor
Expression XreadRowValueConstructor() { Expression e; e = XreadExplicitRowValueConstructorOrNull(); if (e != null) { return e; } e = XreadRowOrCommonValueExpression(); if (e != null) { return e; } return XreadBooleanValueExpre...
java
Expression XreadRowValueConstructor() { Expression e; e = XreadExplicitRowValueConstructorOrNull(); if (e != null) { return e; } e = XreadRowOrCommonValueExpression(); if (e != null) { return e; } return XreadBooleanValueExpre...
[ "Expression", "XreadRowValueConstructor", "(", ")", "{", "Expression", "e", ";", "e", "=", "XreadExplicitRowValueConstructorOrNull", "(", ")", ";", "if", "(", "e", "!=", "null", ")", "{", "return", "e", ";", "}", "e", "=", "XreadRowOrCommonValueExpression", "(...
ISSUE - XreadCommonValueExpression and XreadBooleanValueExpression should merge
[ "ISSUE", "-", "XreadCommonValueExpression", "and", "XreadBooleanValueExpression", "should", "merge" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L3505-L3522
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java
ParserDQL.XreadExplicitRowValueConstructorOrNull
Expression XreadExplicitRowValueConstructorOrNull() { Expression e; switch (token.tokenType) { case Tokens.OPENBRACKET : { read(); int position = getPosition(); int brackets = readOpenBrackets(); switch (token.tokenType) { ...
java
Expression XreadExplicitRowValueConstructorOrNull() { Expression e; switch (token.tokenType) { case Tokens.OPENBRACKET : { read(); int position = getPosition(); int brackets = readOpenBrackets(); switch (token.tokenType) { ...
[ "Expression", "XreadExplicitRowValueConstructorOrNull", "(", ")", "{", "Expression", "e", ";", "switch", "(", "token", ".", "tokenType", ")", "{", "case", "Tokens", ".", "OPENBRACKET", ":", "{", "read", "(", ")", ";", "int", "position", "=", "getPosition", "...
must be called in conjusnction with <parenthesized ..
[ "must", "be", "called", "in", "conjusnction", "with", "<parenthesized", ".." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L3526-L3575
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java
ParserDQL.readCaseWhen
private Expression readCaseWhen(final Expression l) { readThis(Tokens.WHEN); Expression condition = null; if (l == null) { condition = XreadBooleanValueExpression(); } else { while (true) { Expression newCondition = XreadPredicateRightPart(l); ...
java
private Expression readCaseWhen(final Expression l) { readThis(Tokens.WHEN); Expression condition = null; if (l == null) { condition = XreadBooleanValueExpression(); } else { while (true) { Expression newCondition = XreadPredicateRightPart(l); ...
[ "private", "Expression", "readCaseWhen", "(", "final", "Expression", "l", ")", "{", "readThis", "(", "Tokens", ".", "WHEN", ")", ";", "Expression", "condition", "=", "null", ";", "if", "(", "l", "==", "null", ")", "{", "condition", "=", "XreadBooleanValueE...
Reads part of a CASE .. WHEN expression
[ "Reads", "part", "of", "a", "CASE", "..", "WHEN", "expression" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L4011-L4070
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java
ParserDQL.readCaseWhenExpression
private Expression readCaseWhenExpression() { Expression l = null; read(); readThis(Tokens.OPENBRACKET); l = XreadBooleanValueExpression(); readThis(Tokens.COMMA); Expression thenelse = XreadRowValueExpression(); readThis(Tokens.COMMA); thenelse = n...
java
private Expression readCaseWhenExpression() { Expression l = null; read(); readThis(Tokens.OPENBRACKET); l = XreadBooleanValueExpression(); readThis(Tokens.COMMA); Expression thenelse = XreadRowValueExpression(); readThis(Tokens.COMMA); thenelse = n...
[ "private", "Expression", "readCaseWhenExpression", "(", ")", "{", "Expression", "l", "=", "null", ";", "read", "(", ")", ";", "readThis", "(", "Tokens", ".", "OPENBRACKET", ")", ";", "l", "=", "XreadBooleanValueExpression", "(", ")", ";", "readThis", "(", ...
reads a CASEWHEN expression
[ "reads", "a", "CASEWHEN", "expression" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L4075-L4097
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java
ParserDQL.readCastExpression
private Expression readCastExpression() { boolean isConvert = token.tokenType == Tokens.CONVERT; read(); readThis(Tokens.OPENBRACKET); Expression l = this.XreadValueExpressionOrNull(); if (isConvert) { readThis(Tokens.COMMA); } else { readThis(...
java
private Expression readCastExpression() { boolean isConvert = token.tokenType == Tokens.CONVERT; read(); readThis(Tokens.OPENBRACKET); Expression l = this.XreadValueExpressionOrNull(); if (isConvert) { readThis(Tokens.COMMA); } else { readThis(...
[ "private", "Expression", "readCastExpression", "(", ")", "{", "boolean", "isConvert", "=", "token", ".", "tokenType", "==", "Tokens", ".", "CONVERT", ";", "read", "(", ")", ";", "readThis", "(", "Tokens", ".", "OPENBRACKET", ")", ";", "Expression", "l", "=...
Reads a CAST or CONVERT expression
[ "Reads", "a", "CAST", "or", "CONVERT", "expression" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L4102-L4128
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java
ParserDQL.readNullIfExpression
private Expression readNullIfExpression() { // turn into a CASEWHEN read(); readThis(Tokens.OPENBRACKET); Expression c = XreadValueExpression(); readThis(Tokens.COMMA); Expression thenelse = new ExpressionOp(OpTypes.ALTERNATIVE, ...
java
private Expression readNullIfExpression() { // turn into a CASEWHEN read(); readThis(Tokens.OPENBRACKET); Expression c = XreadValueExpression(); readThis(Tokens.COMMA); Expression thenelse = new ExpressionOp(OpTypes.ALTERNATIVE, ...
[ "private", "Expression", "readNullIfExpression", "(", ")", "{", "// turn into a CASEWHEN", "read", "(", ")", ";", "readThis", "(", "Tokens", ".", "OPENBRACKET", ")", ";", "Expression", "c", "=", "XreadValueExpression", "(", ")", ";", "readThis", "(", "Tokens", ...
Reads a NULLIF expression
[ "Reads", "a", "NULLIF", "expression" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L4278-L4299
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java
ParserDQL.readCoalesceExpression
private Expression readCoalesceExpression() { Expression c = null; // turn into a CASEWHEN read(); readThis(Tokens.OPENBRACKET); Expression leaf = null; while (true) { Expression current = XreadValueExpression(); if (leaf != null && token.toke...
java
private Expression readCoalesceExpression() { Expression c = null; // turn into a CASEWHEN read(); readThis(Tokens.OPENBRACKET); Expression leaf = null; while (true) { Expression current = XreadValueExpression(); if (leaf != null && token.toke...
[ "private", "Expression", "readCoalesceExpression", "(", ")", "{", "Expression", "c", "=", "null", ";", "// turn into a CASEWHEN", "read", "(", ")", ";", "readThis", "(", "Tokens", ".", "OPENBRACKET", ")", ";", "Expression", "leaf", "=", "null", ";", "while", ...
Reads a COALESE or IFNULL expression
[ "Reads", "a", "COALESE", "or", "IFNULL", "expression" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L4304-L4343
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java
ParserDQL.compileCursorSpecification
StatementDMQL compileCursorSpecification() { QueryExpression queryExpression = XreadQueryExpression(); queryExpression.setAsTopLevel(); queryExpression.resolve(session); if (token.tokenType == Tokens.FOR) { read(); if (token.tokenType == Tokens.READ) { ...
java
StatementDMQL compileCursorSpecification() { QueryExpression queryExpression = XreadQueryExpression(); queryExpression.setAsTopLevel(); queryExpression.resolve(session); if (token.tokenType == Tokens.FOR) { read(); if (token.tokenType == Tokens.READ) { ...
[ "StatementDMQL", "compileCursorSpecification", "(", ")", "{", "QueryExpression", "queryExpression", "=", "XreadQueryExpression", "(", ")", ";", "queryExpression", ".", "setAsTopLevel", "(", ")", ";", "queryExpression", ".", "resolve", "(", "session", ")", ";", "if",...
Retrieves a SELECT or other query expression Statement from this parse context.
[ "Retrieves", "a", "SELECT", "or", "other", "query", "expression", "Statement", "from", "this", "parse", "context", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L4965-L4992
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/types/BinaryData.java
BinaryData.toLong
public long toLong() { byte[] data = getBytes(); if (data == null || data.length <= 0 || data.length > 8) { // Assume that we're in a numeric context and that the user // made a typo entering a hex string. throw Error.error(ErrorCode.X_42585); // malformed numeric con...
java
public long toLong() { byte[] data = getBytes(); if (data == null || data.length <= 0 || data.length > 8) { // Assume that we're in a numeric context and that the user // made a typo entering a hex string. throw Error.error(ErrorCode.X_42585); // malformed numeric con...
[ "public", "long", "toLong", "(", ")", "{", "byte", "[", "]", "data", "=", "getBytes", "(", ")", ";", "if", "(", "data", "==", "null", "||", "data", ".", "length", "<=", "0", "||", "data", ".", "length", ">", "8", ")", "{", "// Assume that we're in ...
Given a sequence of bytes that would otherwise be a VARBINARY constant, return a long value, with the understanding that the caller has determined that this value is in a numeric context. Returns true for a successful conversion and false otherwise. We assume that the bytes are representing a 64-bit two's complement ...
[ "Given", "a", "sequence", "of", "bytes", "that", "would", "otherwise", "be", "a", "VARBINARY", "constant", "return", "a", "long", "value", "with", "the", "understanding", "that", "the", "caller", "has", "determined", "that", "this", "value", "is", "in", "a",...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/types/BinaryData.java#L298-L314
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/HSQLFileParser.java
HSQLFileParser.main
public static void main(String args[]) { Statement stmts[] = null; try { stmts = getStatements(args[0]); } catch (Throwable e) { System.out.println(e.getMessage()); return; } for (Statement s : stmts) { System.out.print(s.statement)...
java
public static void main(String args[]) { Statement stmts[] = null; try { stmts = getStatements(args[0]); } catch (Throwable e) { System.out.println(e.getMessage()); return; } for (Statement s : stmts) { System.out.print(s.statement)...
[ "public", "static", "void", "main", "(", "String", "args", "[", "]", ")", "{", "Statement", "stmts", "[", "]", "=", "null", ";", "try", "{", "stmts", "=", "getStatements", "(", "args", "[", "0", "]", ")", ";", "}", "catch", "(", "Throwable", "e", ...
Run the parser as a stand-alone tool sending output to standard out. @param arg[0] is the file of sql commands to be processed.
[ "Run", "the", "parser", "as", "a", "stand", "-", "alone", "tool", "sending", "output", "to", "standard", "out", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/HSQLFileParser.java#L122-L133
train
VoltDB/voltdb
src/frontend/org/voltdb/iv2/LeaderAppointer.java
LeaderAppointer.watchPartition
void watchPartition(int pid, ExecutorService es, boolean shouldBlock) throws InterruptedException, ExecutionException { String dir = LeaderElector.electionDirForPartition(VoltZK.leaders_initiators, pid); m_callbacks.put(pid, new PartitionCallback(pid)); BabySitter babySitter; ...
java
void watchPartition(int pid, ExecutorService es, boolean shouldBlock) throws InterruptedException, ExecutionException { String dir = LeaderElector.electionDirForPartition(VoltZK.leaders_initiators, pid); m_callbacks.put(pid, new PartitionCallback(pid)); BabySitter babySitter; ...
[ "void", "watchPartition", "(", "int", "pid", ",", "ExecutorService", "es", ",", "boolean", "shouldBlock", ")", "throws", "InterruptedException", ",", "ExecutionException", "{", "String", "dir", "=", "LeaderElector", ".", "electionDirForPartition", "(", "VoltZK", "."...
Watch the partition ZK dir in the leader appointer. This should be called on the elected leader appointer only. m_callbacks and m_partitionWatchers are only accessed on initialization, promotion, or elastic add node. @param pid The partition ID @param es The executor service to use to construct the baby sitter @param...
[ "Watch", "the", "partition", "ZK", "dir", "in", "the", "leader", "appointer", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/LeaderAppointer.java#L549-L563
train
VoltDB/voltdb
src/frontend/org/voltdb/iv2/LeaderAppointer.java
LeaderAppointer.getInitialPartitionCount
private int getInitialPartitionCount() throws IllegalAccessException { AppointerState currentState = m_state.get(); if (currentState != AppointerState.INIT && currentState != AppointerState.CLUSTER_START) { throw new IllegalAccessException("Getting cached partition count after cluster " ...
java
private int getInitialPartitionCount() throws IllegalAccessException { AppointerState currentState = m_state.get(); if (currentState != AppointerState.INIT && currentState != AppointerState.CLUSTER_START) { throw new IllegalAccessException("Getting cached partition count after cluster " ...
[ "private", "int", "getInitialPartitionCount", "(", ")", "throws", "IllegalAccessException", "{", "AppointerState", "currentState", "=", "m_state", ".", "get", "(", ")", ";", "if", "(", "currentState", "!=", "AppointerState", ".", "INIT", "&&", "currentState", "!="...
Gets the initial cluster partition count on startup. This can only be called during initialization. Calling this after initialization throws, because the partition count may not reflect the actual partition count in the cluster. @return
[ "Gets", "the", "initial", "cluster", "partition", "count", "on", "startup", ".", "This", "can", "only", "be", "called", "during", "initialization", ".", "Calling", "this", "after", "initialization", "throws", "because", "the", "partition", "count", "may", "not",...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/LeaderAppointer.java#L704-L712
train
VoltDB/voltdb
src/frontend/org/voltdb/iv2/LeaderAppointer.java
LeaderAppointer.updatePartitionLeader
public void updatePartitionLeader(int partitionId, long newMasterHISD, boolean isLeaderMigrated) { PartitionCallback cb = m_callbacks.get(partitionId); if (cb != null && cb.m_currentLeader != newMasterHISD) { cb.m_previousLeader = cb.m_currentLeader; cb.m_currentLeader = newMaste...
java
public void updatePartitionLeader(int partitionId, long newMasterHISD, boolean isLeaderMigrated) { PartitionCallback cb = m_callbacks.get(partitionId); if (cb != null && cb.m_currentLeader != newMasterHISD) { cb.m_previousLeader = cb.m_currentLeader; cb.m_currentLeader = newMaste...
[ "public", "void", "updatePartitionLeader", "(", "int", "partitionId", ",", "long", "newMasterHISD", ",", "boolean", "isLeaderMigrated", ")", "{", "PartitionCallback", "cb", "=", "m_callbacks", ".", "get", "(", "partitionId", ")", ";", "if", "(", "cb", "!=", "n...
update the partition call back with current master and replica @param partitionId partition id @param newMasterHISD new master HSID
[ "update", "the", "partition", "call", "back", "with", "current", "master", "and", "replica" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/LeaderAppointer.java#L753-L760
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/Collation.java
Collation.compare
public int compare(String a, String b) { int i; if (collator == null) { i = a.compareTo(b); } else { i = collator.compare(a, b); } return (i == 0) ? 0 : (i < 0 ? -1 : 1); }
java
public int compare(String a, String b) { int i; if (collator == null) { i = a.compareTo(b); } else { i = collator.compare(a, b); } return (i == 0) ? 0 : (i < 0 ? -1 : 1); }
[ "public", "int", "compare", "(", "String", "a", ",", "String", "b", ")", "{", "int", "i", ";", "if", "(", "collator", "==", "null", ")", "{", "i", "=", "a", ".", "compareTo", "(", "b", ")", ";", "}", "else", "{", "i", "=", "collator", ".", "c...
returns -1, 0 or +1
[ "returns", "-", "1", "0", "or", "+", "1" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Collation.java#L227-L240
train
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/persist/DataFileBlockManager.java
DataFileBlockManager.get
int get(int rowSize) { if (lookup.size() == 0) { return -1; } int index = lookup.findFirstGreaterEqualKeyIndex(rowSize); if (index == -1) { return -1; } // statistics for successful requests only - to be used later for midSize requestCo...
java
int get(int rowSize) { if (lookup.size() == 0) { return -1; } int index = lookup.findFirstGreaterEqualKeyIndex(rowSize); if (index == -1) { return -1; } // statistics for successful requests only - to be used later for midSize requestCo...
[ "int", "get", "(", "int", "rowSize", ")", "{", "if", "(", "lookup", ".", "size", "(", ")", "==", "0", ")", "{", "return", "-", "1", ";", "}", "int", "index", "=", "lookup", ".", "findFirstGreaterEqualKeyIndex", "(", "rowSize", ")", ";", "if", "(", ...
Returns the position of a free block or 0.
[ "Returns", "the", "position", "of", "a", "free", "block", "or", "0", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/DataFileBlockManager.java#L97-L129
train