id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
60,800
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
60,801
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
60,802
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
60,803
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
60,804
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
60,805
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
60,806
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
60,807
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
60,808
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
60,809
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
60,810
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
60,811
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
60,812
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
60,813
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
60,814
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
60,815
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
60,816
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
60,817
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
60,818
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
60,819
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
60,820
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
60,821
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
60,822
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
60,823
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
60,824
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
60,825
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
60,826
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
60,827
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
60,828
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
60,829
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
60,830
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
60,831
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
60,832
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
60,833
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
60,834
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
60,835
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
60,836
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
60,837
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
60,838
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
60,839
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
60,840
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
60,841
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
60,842
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
60,843
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
60,844
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
60,845
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
60,846
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
60,847
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
60,848
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
60,849
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
60,850
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
60,851
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
60,852
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
60,853
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
60,854
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
60,855
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
60,856
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
60,857
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
60,858
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
60,859
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
60,860
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
60,861
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
60,862
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
60,863
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
60,864
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
60,865
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
60,866
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
60,867
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
60,868
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
60,869
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/persist/ScaledRAFile.java
ScaledRAFile.seek
public void seek(long position) throws IOException { if (!readOnly && file.length() < position) { long tempSize = position - file.length(); if (tempSize > 1 << 18) { tempSize = 1 << 18; } byte[] temp = new byte[(int) tempSize]; try ...
java
public void seek(long position) throws IOException { if (!readOnly && file.length() < position) { long tempSize = position - file.length(); if (tempSize > 1 << 18) { tempSize = 1 << 18; } byte[] temp = new byte[(int) tempSize]; try ...
[ "public", "void", "seek", "(", "long", "position", ")", "throws", "IOException", "{", "if", "(", "!", "readOnly", "&&", "file", ".", "length", "(", ")", "<", "position", ")", "{", "long", "tempSize", "=", "position", "-", "file", ".", "length", "(", ...
Some JVM's do not allow seek beyond end of file, so zeros are written first in that case. Reported by bohgammer@users in Open Disucssion Forum.
[ "Some", "JVM", "s", "do", "not", "allow", "seek", "beyond", "end", "of", "file", "so", "zeros", "are", "written", "first", "in", "that", "case", ".", "Reported", "by", "bohgammer" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/ScaledRAFile.java#L188-L219
60,870
VoltDB/voltdb
src/frontend/org/voltcore/network/NIOReadStream.java
NIOReadStream.getBytes
void getBytes(byte[] output) { if (m_totalAvailable < output.length) { throw new IllegalStateException("Requested " + output.length + " bytes; only have " + m_totalAvailable + " bytes; call tryRead() first"); } int bytesCopied = 0; while (bytesCopied < ou...
java
void getBytes(byte[] output) { if (m_totalAvailable < output.length) { throw new IllegalStateException("Requested " + output.length + " bytes; only have " + m_totalAvailable + " bytes; call tryRead() first"); } int bytesCopied = 0; while (bytesCopied < ou...
[ "void", "getBytes", "(", "byte", "[", "]", "output", ")", "{", "if", "(", "m_totalAvailable", "<", "output", ".", "length", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Requested \"", "+", "output", ".", "length", "+", "\" bytes; only have \"", ...
Move all bytes in current read buffers to output array, free read buffers back to thread local memory pool. @param output
[ "Move", "all", "bytes", "in", "current", "read", "buffers", "to", "output", "array", "free", "read", "buffers", "back", "to", "thread", "local", "memory", "pool", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/network/NIOReadStream.java#L87-L120
60,871
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/persist/RowStoreAVLMemory.java
RowStoreAVLMemory.reindex
void reindex(Session session, Index index) { setAccessor(index, null); RowIterator it = table.rowIterator(session); while (it.hasNext()) { Row row = it.getNextRow(); // may need to clear the node before insert index.insert(session, this, row); } ...
java
void reindex(Session session, Index index) { setAccessor(index, null); RowIterator it = table.rowIterator(session); while (it.hasNext()) { Row row = it.getNextRow(); // may need to clear the node before insert index.insert(session, this, row); } ...
[ "void", "reindex", "(", "Session", "session", ",", "Index", "index", ")", "{", "setAccessor", "(", "index", ",", "null", ")", ";", "RowIterator", "it", "=", "table", ".", "rowIterator", "(", "session", ")", ";", "while", "(", "it", ".", "hasNext", "(",...
for result tables
[ "for", "result", "tables" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/RowStoreAVLMemory.java#L279-L291
60,872
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/pool/JDBCXADataSource.java
JDBCXADataSource.getXAConnection
public XAConnection getXAConnection() throws SQLException { // Comment out before public release: System.err.print("Executing " + getClass().getName() + ".getXAConnection()..."); try { Class.forName(driver).newInstance(); } catch (ClassNotFoundExcep...
java
public XAConnection getXAConnection() throws SQLException { // Comment out before public release: System.err.print("Executing " + getClass().getName() + ".getXAConnection()..."); try { Class.forName(driver).newInstance(); } catch (ClassNotFoundExcep...
[ "public", "XAConnection", "getXAConnection", "(", ")", "throws", "SQLException", "{", "// Comment out before public release:", "System", ".", "err", ".", "print", "(", "\"Executing \"", "+", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\".getXAConnection()....
Get new PHYSICAL connection, to be managed by a connection manager.
[ "Get", "new", "PHYSICAL", "connection", "to", "be", "managed", "by", "a", "connection", "manager", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/pool/JDBCXADataSource.java#L122-L157
60,873
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/pool/JDBCXADataSource.java
JDBCXADataSource.getXAConnection
public XAConnection getXAConnection(String user, String password) throws SQLException { validateSpecifiedUserAndPassword(user, password); return getXAConnection(); }
java
public XAConnection getXAConnection(String user, String password) throws SQLException { validateSpecifiedUserAndPassword(user, password); return getXAConnection(); }
[ "public", "XAConnection", "getXAConnection", "(", "String", "user", ",", "String", "password", ")", "throws", "SQLException", "{", "validateSpecifiedUserAndPassword", "(", "user", ",", "password", ")", ";", "return", "getXAConnection", "(", ")", ";", "}" ]
Gets a new physical connection after validating the given username and password. @param user String which must match the 'user' configured for this JDBCXADataSource. @param password String which must match the 'password' configured for this JDBCXADataSource. @see #getXAConnection()
[ "Gets", "a", "new", "physical", "connection", "after", "validating", "the", "given", "username", "and", "password", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/pool/JDBCXADataSource.java#L170-L176
60,874
VoltDB/voltdb
src/frontend/org/voltdb/importer/ChannelDistributer.java
ChannelDistributer.id
static String id(Object o) { if (o == null) return "(null)"; Thread t = Thread.currentThread(); StringBuilder sb = new StringBuilder(128); sb.append("(T[").append(t.getName()).append("]@"); sb.append(Long.toString(t.getId(), Character.MAX_RADIX)); sb.append(":O[").append(...
java
static String id(Object o) { if (o == null) return "(null)"; Thread t = Thread.currentThread(); StringBuilder sb = new StringBuilder(128); sb.append("(T[").append(t.getName()).append("]@"); sb.append(Long.toString(t.getId(), Character.MAX_RADIX)); sb.append(":O[").append(...
[ "static", "String", "id", "(", "Object", "o", ")", "{", "if", "(", "o", "==", "null", ")", "return", "\"(null)\"", ";", "Thread", "t", "=", "Thread", ".", "currentThread", "(", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "128", ...
Tracing utility method useful for debugging @param o and object @return string with information on the given object
[ "Tracing", "utility", "method", "useful", "for", "debugging" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ChannelDistributer.java#L220-L231
60,875
VoltDB/voltdb
src/frontend/org/voltdb/importer/ChannelDistributer.java
ChannelDistributer.registerCallback
public void registerCallback(String importer, ChannelChangeCallback callback) { Preconditions.checkArgument( importer != null && !importer.trim().isEmpty(), "importer is null or empty" ); callback = checkNotNull(callback, "callback is null"); if (...
java
public void registerCallback(String importer, ChannelChangeCallback callback) { Preconditions.checkArgument( importer != null && !importer.trim().isEmpty(), "importer is null or empty" ); callback = checkNotNull(callback, "callback is null"); if (...
[ "public", "void", "registerCallback", "(", "String", "importer", ",", "ChannelChangeCallback", "callback", ")", "{", "Preconditions", ".", "checkArgument", "(", "importer", "!=", "null", "&&", "!", "importer", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ...
Registers a (@link ChannelChangeCallback} for the given importer. @param importer @param callback a (@link ChannelChangeCallback}
[ "Registers", "a", "(" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ChannelDistributer.java#L412-L460
60,876
VoltDB/voltdb
src/frontend/org/voltdb/importer/ChannelDistributer.java
ChannelDistributer.unregisterCallback
public void unregisterCallback(String importer) { if ( importer == null || !m_callbacks.getReference().containsKey(importer) || m_unregistered.getReference().contains(importer)) { return; } if (m_done.get()) return; int [] rstamp = new int[]...
java
public void unregisterCallback(String importer) { if ( importer == null || !m_callbacks.getReference().containsKey(importer) || m_unregistered.getReference().contains(importer)) { return; } if (m_done.get()) return; int [] rstamp = new int[]...
[ "public", "void", "unregisterCallback", "(", "String", "importer", ")", "{", "if", "(", "importer", "==", "null", "||", "!", "m_callbacks", ".", "getReference", "(", ")", ".", "containsKey", "(", "importer", ")", "||", "m_unregistered", ".", "getReference", ...
Unregisters the callback assigned to given importer. Once it is unregistered it can no longer be re-registered @param importer
[ "Unregisters", "the", "callback", "assigned", "to", "given", "importer", ".", "Once", "it", "is", "unregistered", "it", "can", "no", "longer", "be", "re", "-", "registered" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ChannelDistributer.java#L468-L509
60,877
VoltDB/voltdb
src/frontend/org/voltdb/importer/ChannelDistributer.java
ChannelDistributer.shutdown
public void shutdown() { if (m_done.compareAndSet(false, true)) { m_es.shutdown(); m_buses.shutdown(); DeleteNode deleteHost = new DeleteNode(joinZKPath(HOST_DN, m_hostId)); DeleteNode deleteCandidate = new DeleteNode(m_candidate); try { ...
java
public void shutdown() { if (m_done.compareAndSet(false, true)) { m_es.shutdown(); m_buses.shutdown(); DeleteNode deleteHost = new DeleteNode(joinZKPath(HOST_DN, m_hostId)); DeleteNode deleteCandidate = new DeleteNode(m_candidate); try { ...
[ "public", "void", "shutdown", "(", ")", "{", "if", "(", "m_done", ".", "compareAndSet", "(", "false", ",", "true", ")", ")", "{", "m_es", ".", "shutdown", "(", ")", ";", "m_buses", ".", "shutdown", "(", ")", ";", "DeleteNode", "deleteHost", "=", "new...
Sets the done flag, shuts down its executor thread, and deletes its own host and candidate nodes
[ "Sets", "the", "done", "flag", "shuts", "down", "its", "executor", "thread", "and", "deletes", "its", "own", "host", "and", "candidate", "nodes" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ChannelDistributer.java#L515-L534
60,878
VoltDB/voltdb
src/frontend/org/voltdb/importer/ChannelDistributer.java
ChannelDistributer.undispatched
@Subscribe public void undispatched(DeadEvent e) { if (!m_done.get() && e.getEvent() instanceof ImporterChannelAssignment) { ImporterChannelAssignment assignment = (ImporterChannelAssignment)e.getEvent(); synchronized (m_undispatched) { NavigableSet<String> registere...
java
@Subscribe public void undispatched(DeadEvent e) { if (!m_done.get() && e.getEvent() instanceof ImporterChannelAssignment) { ImporterChannelAssignment assignment = (ImporterChannelAssignment)e.getEvent(); synchronized (m_undispatched) { NavigableSet<String> registere...
[ "@", "Subscribe", "public", "void", "undispatched", "(", "DeadEvent", "e", ")", "{", "if", "(", "!", "m_done", ".", "get", "(", ")", "&&", "e", ".", "getEvent", "(", ")", "instanceof", "ImporterChannelAssignment", ")", "{", "ImporterChannelAssignment", "assi...
Keeps assignments for unregistered importers @param e
[ "Keeps", "assignments", "for", "unregistered", "importers" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ChannelDistributer.java#L540-L560
60,879
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/WrapperIterator.java
WrapperIterator.next
public Object next() { // for chained iterators if (chained) { if (it1 == null) { if (it2 == null) { throw new NoSuchElementException(); } if (it2.hasNext()) { return it2.next(); } ...
java
public Object next() { // for chained iterators if (chained) { if (it1 == null) { if (it2 == null) { throw new NoSuchElementException(); } if (it2.hasNext()) { return it2.next(); } ...
[ "public", "Object", "next", "(", ")", "{", "// for chained iterators", "if", "(", "chained", ")", "{", "if", "(", "it1", "==", "null", ")", "{", "if", "(", "it2", "==", "null", ")", "{", "throw", "new", "NoSuchElementException", "(", ")", ";", "}", "...
Returns the next element. @return the next element @throws NoSuchElementException if there is no next element
[ "Returns", "the", "next", "element", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/WrapperIterator.java#L164-L197
60,880
VoltDB/voltdb
src/frontend/org/voltdb/dtxn/SiteTracker.java
SiteTracker.getSitesForPartitions
public List<Long> getSitesForPartitions(int[] partitions) { ArrayList<Long> all_sites = new ArrayList<Long>(); for (int p : partitions) { List<Long> sites = getSitesForPartition(p); for (long site : sites) { all_sites.add(site); } }...
java
public List<Long> getSitesForPartitions(int[] partitions) { ArrayList<Long> all_sites = new ArrayList<Long>(); for (int p : partitions) { List<Long> sites = getSitesForPartition(p); for (long site : sites) { all_sites.add(site); } }...
[ "public", "List", "<", "Long", ">", "getSitesForPartitions", "(", "int", "[", "]", "partitions", ")", "{", "ArrayList", "<", "Long", ">", "all_sites", "=", "new", "ArrayList", "<", "Long", ">", "(", ")", ";", "for", "(", "int", "p", ":", "partitions", ...
Get the ids of all sites that contain a copy of ANY of the given partitions. @param partitions as ArrayList
[ "Get", "the", "ids", "of", "all", "sites", "that", "contain", "a", "copy", "of", "ANY", "of", "the", "given", "partitions", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/dtxn/SiteTracker.java#L346-L356
60,881
VoltDB/voltdb
src/frontend/org/voltdb/dtxn/SiteTracker.java
SiteTracker.getSitesForPartitionsAsArray
public long[] getSitesForPartitionsAsArray(int[] partitions) { ArrayList<Long> all_sites = new ArrayList<Long>(); for (int p : partitions) { List<Long> sites = getSitesForPartition(p); for (long site : sites) { all_sites.add(site); } ...
java
public long[] getSitesForPartitionsAsArray(int[] partitions) { ArrayList<Long> all_sites = new ArrayList<Long>(); for (int p : partitions) { List<Long> sites = getSitesForPartition(p); for (long site : sites) { all_sites.add(site); } ...
[ "public", "long", "[", "]", "getSitesForPartitionsAsArray", "(", "int", "[", "]", "partitions", ")", "{", "ArrayList", "<", "Long", ">", "all_sites", "=", "new", "ArrayList", "<", "Long", ">", "(", ")", ";", "for", "(", "int", "p", ":", "partitions", "...
Get the ids of all live sites that contain a copy of ANY of the given partitions. @param partitions A set of unique, non-null VoltDB partition ids. @return An array of VoltDB site ids.
[ "Get", "the", "ids", "of", "all", "live", "sites", "that", "contain", "a", "copy", "of", "ANY", "of", "the", "given", "partitions", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/dtxn/SiteTracker.java#L377-L387
60,882
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/tar/TarFileInputStream.java
TarFileInputStream.readCompressedBlocks
protected void readCompressedBlocks(int blocks) throws IOException { int bytesSoFar = 0; int requiredBytes = 512 * blocks; // This method works with individual bytes! int i; while (bytesSoFar < requiredBytes) { i = readStream.read(readBuffer, bytesSoFar, ...
java
protected void readCompressedBlocks(int blocks) throws IOException { int bytesSoFar = 0; int requiredBytes = 512 * blocks; // This method works with individual bytes! int i; while (bytesSoFar < requiredBytes) { i = readStream.read(readBuffer, bytesSoFar, ...
[ "protected", "void", "readCompressedBlocks", "(", "int", "blocks", ")", "throws", "IOException", "{", "int", "bytesSoFar", "=", "0", ";", "int", "requiredBytes", "=", "512", "*", "blocks", ";", "// This method works with individual bytes!", "int", "i", ";", "while...
Work-around for the problem that compressed InputReaders don't fill the read buffer before returning. Has visibility 'protected' so that subclasses may override with different algorithms, or use different algorithms for different compression stream.
[ "Work", "-", "around", "for", "the", "problem", "that", "compressed", "InputReaders", "don", "t", "fill", "the", "read", "buffer", "before", "returning", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/tar/TarFileInputStream.java#L210-L236
60,883
VoltDB/voltdb
third_party/java/src/com/google_voltpatches/common/collect/ObjectArrays.java
ObjectArrays.arraysCopyOf
static <T> T[] arraysCopyOf(T[] original, int newLength) { T[] copy = newArray(original, newLength); System.arraycopy(original, 0, copy, 0, Math.min(original.length, newLength)); return copy; }
java
static <T> T[] arraysCopyOf(T[] original, int newLength) { T[] copy = newArray(original, newLength); System.arraycopy(original, 0, copy, 0, Math.min(original.length, newLength)); return copy; }
[ "static", "<", "T", ">", "T", "[", "]", "arraysCopyOf", "(", "T", "[", "]", "original", ",", "int", "newLength", ")", "{", "T", "[", "]", "copy", "=", "newArray", "(", "original", ",", "newLength", ")", ";", "System", ".", "arraycopy", "(", "origin...
GWT safe version of Arrays.copyOf.
[ "GWT", "safe", "version", "of", "Arrays", ".", "copyOf", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/ObjectArrays.java#L110-L114
60,884
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.initialize
public static void initialize(Class<? extends TheHashinator> hashinatorImplementation, byte config[]) { TheHashinator hashinator = constructHashinator( hashinatorImplementation, config, false); m_pristineHashinator = hashinator; m_cachedHashinators.put(0L, hashinator); instance.set(Pair....
java
public static void initialize(Class<? extends TheHashinator> hashinatorImplementation, byte config[]) { TheHashinator hashinator = constructHashinator( hashinatorImplementation, config, false); m_pristineHashinator = hashinator; m_cachedHashinators.put(0L, hashinator); instance.set(Pair....
[ "public", "static", "void", "initialize", "(", "Class", "<", "?", "extends", "TheHashinator", ">", "hashinatorImplementation", ",", "byte", "config", "[", "]", ")", "{", "TheHashinator", "hashinator", "=", "constructHashinator", "(", "hashinatorImplementation", ",",...
Initialize TheHashinator with the specified implementation class and configuration. The starting version number will be 0.
[ "Initialize", "TheHashinator", "with", "the", "specified", "implementation", "class", "and", "configuration", ".", "The", "starting", "version", "number", "will", "be", "0", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L114-L119
60,885
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.getHashinator
public static TheHashinator getHashinator(Class<? extends TheHashinator> hashinatorImplementation, byte config[], boolean cooked) { return constructHashinator(hashinatorImplementation, config, cooked); }
java
public static TheHashinator getHashinator(Class<? extends TheHashinator> hashinatorImplementation, byte config[], boolean cooked) { return constructHashinator(hashinatorImplementation, config, cooked); }
[ "public", "static", "TheHashinator", "getHashinator", "(", "Class", "<", "?", "extends", "TheHashinator", ">", "hashinatorImplementation", ",", "byte", "config", "[", "]", ",", "boolean", "cooked", ")", "{", "return", "constructHashinator", "(", "hashinatorImplement...
Get TheHashinator instanced based on known implementation and configuration. Used by client after asking server what it is running. @param hashinatorImplementation @param config @return
[ "Get", "TheHashinator", "instanced", "based", "on", "known", "implementation", "and", "configuration", ".", "Used", "by", "client", "after", "asking", "server", "what", "it", "is", "running", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L129-L132
60,886
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.constructHashinator
public static TheHashinator constructHashinator( Class<? extends TheHashinator> hashinatorImplementation, byte configBytes[], boolean cooked) { try { Constructor<? extends TheHashinator> constructor = hashinatorImplementation.getConstructor...
java
public static TheHashinator constructHashinator( Class<? extends TheHashinator> hashinatorImplementation, byte configBytes[], boolean cooked) { try { Constructor<? extends TheHashinator> constructor = hashinatorImplementation.getConstructor...
[ "public", "static", "TheHashinator", "constructHashinator", "(", "Class", "<", "?", "extends", "TheHashinator", ">", "hashinatorImplementation", ",", "byte", "configBytes", "[", "]", ",", "boolean", "cooked", ")", "{", "try", "{", "Constructor", "<", "?", "exten...
Helper method to do the reflection boilerplate to call the constructor of the selected hashinator and convert the exceptions to runtime exceptions. @param hashinatorImplementation hashinator class @param configBytes config data (raw or cooked) @param cooked true if configBytes is cooked, i.e. in wire serialization f...
[ "Helper", "method", "to", "do", "the", "reflection", "boilerplate", "to", "call", "the", "constructor", "of", "the", "selected", "hashinator", "and", "convert", "the", "exceptions", "to", "runtime", "exceptions", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L142-L154
60,887
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.computeConfigurationSignature
static public long computeConfigurationSignature(byte [] config) { PureJavaCrc32C crc = new PureJavaCrc32C(); crc.update(config); return crc.getValue(); }
java
static public long computeConfigurationSignature(byte [] config) { PureJavaCrc32C crc = new PureJavaCrc32C(); crc.update(config); return crc.getValue(); }
[ "static", "public", "long", "computeConfigurationSignature", "(", "byte", "[", "]", "config", ")", "{", "PureJavaCrc32C", "crc", "=", "new", "PureJavaCrc32C", "(", ")", ";", "crc", ".", "update", "(", "config", ")", ";", "return", "crc", ".", "getValue", "...
It computes a signature from the given configuration bytes @param config configuration byte array @return signature from the given configuration bytes
[ "It", "computes", "a", "signature", "from", "the", "given", "configuration", "bytes" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L207-L211
60,888
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.getPartitionForParameter
public static int getPartitionForParameter(VoltType partitionType, Object invocationParameter) { return instance.get().getSecond().getHashedPartitionForParameter(partitionType, invocationParameter); }
java
public static int getPartitionForParameter(VoltType partitionType, Object invocationParameter) { return instance.get().getSecond().getHashedPartitionForParameter(partitionType, invocationParameter); }
[ "public", "static", "int", "getPartitionForParameter", "(", "VoltType", "partitionType", ",", "Object", "invocationParameter", ")", "{", "return", "instance", ".", "get", "(", ")", ".", "getSecond", "(", ")", ".", "getHashedPartitionForParameter", "(", "partitionTyp...
Given the type of the targeting partition parameter and an object, coerce the object to the correct type and hash it. NOTE NOTE NOTE NOTE! THIS SHOULD BE THE ONLY WAY THAT YOU FIGURE OUT THE PARTITIONING FOR A PARAMETER! ON SERVER @return The partition best set up to execute the procedure. @throws VoltTypeException
[ "Given", "the", "type", "of", "the", "targeting", "partition", "parameter", "and", "an", "object", "coerce", "the", "object", "to", "the", "correct", "type", "and", "hash", "it", ".", "NOTE", "NOTE", "NOTE", "NOTE!", "THIS", "SHOULD", "BE", "THE", "ONLY", ...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L238-L240
60,889
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.updateHashinator
public static Pair<? extends UndoAction, TheHashinator> updateHashinator( Class<? extends TheHashinator> hashinatorImplementation, long version, byte configBytes[], boolean cooked) { //Use a cached/canonical hashinator if possible TheHashinator existingHas...
java
public static Pair<? extends UndoAction, TheHashinator> updateHashinator( Class<? extends TheHashinator> hashinatorImplementation, long version, byte configBytes[], boolean cooked) { //Use a cached/canonical hashinator if possible TheHashinator existingHas...
[ "public", "static", "Pair", "<", "?", "extends", "UndoAction", ",", "TheHashinator", ">", "updateHashinator", "(", "Class", "<", "?", "extends", "TheHashinator", ">", "hashinatorImplementation", ",", "long", "version", ",", "byte", "configBytes", "[", "]", ",", ...
Update the hashinator in a thread safe manner with a newer version of the hash function. A version number must be provided and the new config will only be used if it is greater than the current version of the hash function. Returns an action for undoing the hashinator update @param hashinatorImplementation hashinator...
[ "Update", "the", "hashinator", "in", "a", "thread", "safe", "manner", "with", "a", "newer", "version", "of", "the", "hash", "function", ".", "A", "version", "number", "must", "be", "provided", "and", "the", "new", "config", "will", "only", "be", "used", ...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L325-L382
60,890
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.getRanges
public static Map<Integer, Integer> getRanges(int partition) { return instance.get().getSecond().pGetRanges(partition); }
java
public static Map<Integer, Integer> getRanges(int partition) { return instance.get().getSecond().pGetRanges(partition); }
[ "public", "static", "Map", "<", "Integer", ",", "Integer", ">", "getRanges", "(", "int", "partition", ")", "{", "return", "instance", ".", "get", "(", ")", ".", "getSecond", "(", ")", ".", "pGetRanges", "(", "partition", ")", ";", "}" ]
Get the ranges the given partition is assigned to. @param partition @return A map of ranges, the key is the start of a range, the value is the corresponding end. Ranges returned in the map are [start, end). The ranges may or may not be contiguous.
[ "Get", "the", "ranges", "the", "given", "partition", "is", "assigned", "to", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L418-L420
60,891
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.serializeConfiguredHashinator
public static HashinatorSnapshotData serializeConfiguredHashinator() throws IOException { Pair<Long, ? extends TheHashinator> currentInstance = instance.get(); byte[] cookedData = currentInstance.getSecond().getCookedBytes(); return new HashinatorSnapshotData(cookedData, currentI...
java
public static HashinatorSnapshotData serializeConfiguredHashinator() throws IOException { Pair<Long, ? extends TheHashinator> currentInstance = instance.get(); byte[] cookedData = currentInstance.getSecond().getCookedBytes(); return new HashinatorSnapshotData(cookedData, currentI...
[ "public", "static", "HashinatorSnapshotData", "serializeConfiguredHashinator", "(", ")", "throws", "IOException", "{", "Pair", "<", "Long", ",", "?", "extends", "TheHashinator", ">", "currentInstance", "=", "instance", ".", "get", "(", ")", ";", "byte", "[", "]"...
Get optimized configuration data for wire serialization. @return optimized configuration data @throws IOException
[ "Get", "optimized", "configuration", "data", "for", "wire", "serialization", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L427-L433
60,892
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.updateConfiguredHashinator
public static Pair< ? extends UndoAction, TheHashinator> updateConfiguredHashinator(long version, byte config[]) { return updateHashinator(getConfiguredHashinatorClass(), version, config, true); }
java
public static Pair< ? extends UndoAction, TheHashinator> updateConfiguredHashinator(long version, byte config[]) { return updateHashinator(getConfiguredHashinatorClass(), version, config, true); }
[ "public", "static", "Pair", "<", "?", "extends", "UndoAction", ",", "TheHashinator", ">", "updateConfiguredHashinator", "(", "long", "version", ",", "byte", "config", "[", "]", ")", "{", "return", "updateHashinator", "(", "getConfiguredHashinatorClass", "(", ")", ...
Update the current configured hashinator class. Used by snapshot restore. @param version @param config @return Pair<UndoAction, TheHashinator> Undo action to revert hashinator update and the hashinator that was requested which may actually be an older one (although the one requested) during live rejoin
[ "Update", "the", "current", "configured", "hashinator", "class", ".", "Used", "by", "snapshot", "restore", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L442-L444
60,893
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.getPartitionKeys
public static VoltTable getPartitionKeys(TheHashinator hashinator, VoltType type) { // get partitionKeys response table so we can copy it final VoltTable partitionKeys; switch (type) { case INTEGER: partitionKeys = hashinator.m_integerPartitionKeys.get(); ...
java
public static VoltTable getPartitionKeys(TheHashinator hashinator, VoltType type) { // get partitionKeys response table so we can copy it final VoltTable partitionKeys; switch (type) { case INTEGER: partitionKeys = hashinator.m_integerPartitionKeys.get(); ...
[ "public", "static", "VoltTable", "getPartitionKeys", "(", "TheHashinator", "hashinator", ",", "VoltType", "type", ")", "{", "// get partitionKeys response table so we can copy it", "final", "VoltTable", "partitionKeys", ";", "switch", "(", "type", ")", "{", "case", "INT...
Get a VoltTable containing the partition keys for each partition that can be found for the given hashinator. May be missing some partitions during elastic rebalance when the partitions don't own enough of the ring to be probed If the type is not supported returns null @param hashinator a particular hashinator to get p...
[ "Get", "a", "VoltTable", "containing", "the", "partition", "keys", "for", "each", "partition", "that", "can", "be", "found", "for", "the", "given", "hashinator", ".", "May", "be", "missing", "some", "partitions", "during", "elastic", "rebalance", "when", "the"...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L529-L551
60,894
VoltDB/voltdb
src/frontend/org/voltdb/DRConsumerDrIdTracker.java
DRConsumerDrIdTracker.append
public void append(long startDrId, long endDrId, long spUniqueId, long mpUniqueId) { assert(startDrId <= endDrId && (m_map.isEmpty() || startDrId > end(m_map.span()))); addRange(startDrId, endDrId, spUniqueId, mpUniqueId); }
java
public void append(long startDrId, long endDrId, long spUniqueId, long mpUniqueId) { assert(startDrId <= endDrId && (m_map.isEmpty() || startDrId > end(m_map.span()))); addRange(startDrId, endDrId, spUniqueId, mpUniqueId); }
[ "public", "void", "append", "(", "long", "startDrId", ",", "long", "endDrId", ",", "long", "spUniqueId", ",", "long", "mpUniqueId", ")", "{", "assert", "(", "startDrId", "<=", "endDrId", "&&", "(", "m_map", ".", "isEmpty", "(", ")", "||", "startDrId", ">...
Appends a range to the tracker. The range has to be after the last DrId of the tracker. @param startDrId @param endDrId @param spUniqueId @param mpUniqueId
[ "Appends", "a", "range", "to", "the", "tracker", ".", "The", "range", "has", "to", "be", "after", "the", "last", "DrId", "of", "the", "tracker", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/DRConsumerDrIdTracker.java#L328-L332
60,895
VoltDB/voltdb
src/frontend/org/voltdb/DRConsumerDrIdTracker.java
DRConsumerDrIdTracker.truncate
public void truncate(long newTruncationPoint) { if (newTruncationPoint < getFirstDrId()) { return; } final Iterator<Range<Long>> iter = m_map.asRanges().iterator(); while (iter.hasNext()) { final Range<Long> next = iter.next(); if (end(next) < newTrunc...
java
public void truncate(long newTruncationPoint) { if (newTruncationPoint < getFirstDrId()) { return; } final Iterator<Range<Long>> iter = m_map.asRanges().iterator(); while (iter.hasNext()) { final Range<Long> next = iter.next(); if (end(next) < newTrunc...
[ "public", "void", "truncate", "(", "long", "newTruncationPoint", ")", "{", "if", "(", "newTruncationPoint", "<", "getFirstDrId", "(", ")", ")", "{", "return", ";", "}", "final", "Iterator", "<", "Range", "<", "Long", ">", ">", "iter", "=", "m_map", ".", ...
Truncate the tracker to the given safe point. After truncation, the new safe point will be the first DrId of the tracker. If the new safe point is before the first DrId of the tracker, it's a no-op. @param newTruncationPoint New safe point
[ "Truncate", "the", "tracker", "to", "the", "given", "safe", "point", ".", "After", "truncation", "the", "new", "safe", "point", "will", "be", "the", "first", "DrId", "of", "the", "tracker", ".", "If", "the", "new", "safe", "point", "is", "before", "the",...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/DRConsumerDrIdTracker.java#L340-L358
60,896
VoltDB/voltdb
src/frontend/org/voltdb/DRConsumerDrIdTracker.java
DRConsumerDrIdTracker.mergeTracker
public void mergeTracker(DRConsumerDrIdTracker tracker) { final long newSafePoint = Math.max(tracker.getSafePointDrId(), getSafePointDrId()); m_map.addAll(tracker.m_map); truncate(newSafePoint); m_lastSpUniqueId = Math.max(m_lastSpUniqueId, tracker.m_lastSpUniqueId); m_lastMpUniq...
java
public void mergeTracker(DRConsumerDrIdTracker tracker) { final long newSafePoint = Math.max(tracker.getSafePointDrId(), getSafePointDrId()); m_map.addAll(tracker.m_map); truncate(newSafePoint); m_lastSpUniqueId = Math.max(m_lastSpUniqueId, tracker.m_lastSpUniqueId); m_lastMpUniq...
[ "public", "void", "mergeTracker", "(", "DRConsumerDrIdTracker", "tracker", ")", "{", "final", "long", "newSafePoint", "=", "Math", ".", "max", "(", "tracker", ".", "getSafePointDrId", "(", ")", ",", "getSafePointDrId", "(", ")", ")", ";", "m_map", ".", "addA...
Merge the given tracker with the current tracker. Ranges can overlap. After the merge, the current tracker will be truncated to the larger safe point. @param tracker
[ "Merge", "the", "given", "tracker", "with", "the", "current", "tracker", ".", "Ranges", "can", "overlap", ".", "After", "the", "merge", "the", "current", "tracker", "will", "be", "truncated", "to", "the", "larger", "safe", "point", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/DRConsumerDrIdTracker.java#L366-L372
60,897
VoltDB/voltdb
src/frontend/org/voltcore/messaging/SocketJoiner.java
SocketJoiner.readJSONObjFromWire
private JSONObject readJSONObjFromWire(MessagingChannel messagingChannel) throws IOException, JSONException { ByteBuffer messageBytes = messagingChannel.readMessage(); JSONObject jsObj = new JSONObject(new String(messageBytes.array(), StandardCharsets.UTF_8)); return jsObj; }
java
private JSONObject readJSONObjFromWire(MessagingChannel messagingChannel) throws IOException, JSONException { ByteBuffer messageBytes = messagingChannel.readMessage(); JSONObject jsObj = new JSONObject(new String(messageBytes.array(), StandardCharsets.UTF_8)); return jsObj; }
[ "private", "JSONObject", "readJSONObjFromWire", "(", "MessagingChannel", "messagingChannel", ")", "throws", "IOException", ",", "JSONException", "{", "ByteBuffer", "messageBytes", "=", "messagingChannel", ".", "readMessage", "(", ")", ";", "JSONObject", "jsObj", "=", ...
Read a length prefixed JSON message
[ "Read", "a", "length", "prefixed", "JSON", "message" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/messaging/SocketJoiner.java#L428-L433
60,898
VoltDB/voltdb
src/frontend/org/voltcore/messaging/SocketJoiner.java
SocketJoiner.processJSONResponse
private JSONObject processJSONResponse(MessagingChannel messagingChannel, Set<String> activeVersions, boolean checkVersion) throws IOException, JSONException { // read the json response from socketjoiner with version inf...
java
private JSONObject processJSONResponse(MessagingChannel messagingChannel, Set<String> activeVersions, boolean checkVersion) throws IOException, JSONException { // read the json response from socketjoiner with version inf...
[ "private", "JSONObject", "processJSONResponse", "(", "MessagingChannel", "messagingChannel", ",", "Set", "<", "String", ">", "activeVersions", ",", "boolean", "checkVersion", ")", "throws", "IOException", ",", "JSONException", "{", "// read the json response from socketjoin...
Read version info from a socket and check compatibility. After verifying versions return if "paused" start is indicated. True if paused start otherwise normal start.
[ "Read", "version", "info", "from", "a", "socket", "and", "check", "compatibility", ".", "After", "verifying", "versions", "return", "if", "paused", "start", "is", "indicated", ".", "True", "if", "paused", "start", "otherwise", "normal", "start", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/messaging/SocketJoiner.java#L657-L694
60,899
VoltDB/voltdb
src/frontend/org/voltcore/messaging/SocketJoiner.java
SocketJoiner.createLeaderSocket
private SocketChannel createLeaderSocket( SocketAddress hostAddr, ConnectStrategy mode) throws IOException { SocketChannel socket; int connectAttempts = 0; do { try { socket = SocketChannel.open(); socket.socket().connect(ho...
java
private SocketChannel createLeaderSocket( SocketAddress hostAddr, ConnectStrategy mode) throws IOException { SocketChannel socket; int connectAttempts = 0; do { try { socket = SocketChannel.open(); socket.socket().connect(ho...
[ "private", "SocketChannel", "createLeaderSocket", "(", "SocketAddress", "hostAddr", ",", "ConnectStrategy", "mode", ")", "throws", "IOException", "{", "SocketChannel", "socket", ";", "int", "connectAttempts", "=", "0", ";", "do", "{", "try", "{", "socket", "=", ...
Create socket to the leader node
[ "Create", "socket", "to", "the", "leader", "node" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/messaging/SocketJoiner.java#L699-L731