repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
VoltDB/voltdb | src/frontend/org/voltdb/iv2/SysprocFragmentTask.java | SysprocFragmentTask.respondWithDummy | private void respondWithDummy()
{
final FragmentResponseMessage response =
new FragmentResponseMessage(m_fragmentMsg, m_initiator.getHSId());
response.m_sourceHSId = m_initiator.getHSId();
response.setRecovering(true);
response.setStatus(FragmentResponseMessage.SUCCESS, n... | java | private void respondWithDummy()
{
final FragmentResponseMessage response =
new FragmentResponseMessage(m_fragmentMsg, m_initiator.getHSId());
response.m_sourceHSId = m_initiator.getHSId();
response.setRecovering(true);
response.setStatus(FragmentResponseMessage.SUCCESS, n... | [
"private",
"void",
"respondWithDummy",
"(",
")",
"{",
"final",
"FragmentResponseMessage",
"response",
"=",
"new",
"FragmentResponseMessage",
"(",
"m_fragmentMsg",
",",
"m_initiator",
".",
"getHSId",
"(",
")",
")",
";",
"response",
".",
"m_sourceHSId",
"=",
"m_init... | Respond with a dummy fragment response. | [
"Respond",
"with",
"a",
"dummy",
"fragment",
"response",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/SysprocFragmentTask.java#L96-L113 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/SysprocFragmentTask.java | SysprocFragmentTask.processFragmentTask | public FragmentResponseMessage processFragmentTask(SiteProcedureConnection siteConnection)
{
final FragmentResponseMessage currentFragResponse =
new FragmentResponseMessage(m_fragmentMsg, m_initiator.getHSId());
currentFragResponse.setStatus(FragmentResponseMessage.SUCCESS, null);
... | java | public FragmentResponseMessage processFragmentTask(SiteProcedureConnection siteConnection)
{
final FragmentResponseMessage currentFragResponse =
new FragmentResponseMessage(m_fragmentMsg, m_initiator.getHSId());
currentFragResponse.setStatus(FragmentResponseMessage.SUCCESS, null);
... | [
"public",
"FragmentResponseMessage",
"processFragmentTask",
"(",
"SiteProcedureConnection",
"siteConnection",
")",
"{",
"final",
"FragmentResponseMessage",
"currentFragResponse",
"=",
"new",
"FragmentResponseMessage",
"(",
"m_fragmentMsg",
",",
"m_initiator",
".",
"getHSId",
... | modified to work in the new world | [
"modified",
"to",
"work",
"in",
"the",
"new",
"world"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/SysprocFragmentTask.java#L216-L280 | train |
VoltDB/voltdb | examples/geospatial/client/geospatial/NibbleDeleter.java | NibbleDeleter.run | @Override
public void run() {
try {
VoltTable partitionKeys = null;
partitionKeys = m_client.callProcedure("@GetPartitionKeys", "INTEGER").getResults()[0];
while (partitionKeys.advanceRow()) {
m_client.callProcedure(new NullCallback(), "DeleteOldAdRequest... | java | @Override
public void run() {
try {
VoltTable partitionKeys = null;
partitionKeys = m_client.callProcedure("@GetPartitionKeys", "INTEGER").getResults()[0];
while (partitionKeys.advanceRow()) {
m_client.callProcedure(new NullCallback(), "DeleteOldAdRequest... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"VoltTable",
"partitionKeys",
"=",
"null",
";",
"partitionKeys",
"=",
"m_client",
".",
"callProcedure",
"(",
"\"@GetPartitionKeys\"",
",",
"\"INTEGER\"",
")",
".",
"getResults",
"(",
")",
"... | Remove aged-out data from the ad_requests table. This table is partitioned,
and may be large, so use the "run-everywhere" pattern to minimize impact
to throughput.
Also remove old expired bids from the bids table. | [
"Remove",
"aged",
"-",
"out",
"data",
"from",
"the",
"ad_requests",
"table",
".",
"This",
"table",
"is",
"partitioned",
"and",
"may",
"be",
"large",
"so",
"use",
"the",
"run",
"-",
"everywhere",
"pattern",
"to",
"minimize",
"impact",
"to",
"throughput",
".... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/geospatial/client/geospatial/NibbleDeleter.java#L60-L77 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/SessionData.java | SessionData.updateLobUsage | public void updateLobUsage(boolean commit) {
if (!hasLobOps) {
return;
}
hasLobOps = false;
if (commit) {
for (int i = 0; i < createdLobs.size(); i++) {
long lobID = createdLobs.get(i);
int delta = lobUsageCount.get(lobID, 0);
... | java | public void updateLobUsage(boolean commit) {
if (!hasLobOps) {
return;
}
hasLobOps = false;
if (commit) {
for (int i = 0; i < createdLobs.size(); i++) {
long lobID = createdLobs.get(i);
int delta = lobUsageCount.get(lobID, 0);
... | [
"public",
"void",
"updateLobUsage",
"(",
"boolean",
"commit",
")",
"{",
"if",
"(",
"!",
"hasLobOps",
")",
"{",
"return",
";",
"}",
"hasLobOps",
"=",
"false",
";",
"if",
"(",
"commit",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cr... | update LobManager user counts, delete lobs that have no usage | [
"update",
"LobManager",
"user",
"counts",
"delete",
"lobs",
"that",
"have",
"no",
"usage"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/SessionData.java#L332-L385 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/SessionData.java | SessionData.allocateLobForResult | public void allocateLobForResult(ResultLob result,
InputStream inputStream) {
long resultLobId = result.getLobID();
CountdownInputStream countStream;
switch (result.getSubType()) {
case ResultLob.LobResultTypes.REQUEST_CREATE_BY... | java | public void allocateLobForResult(ResultLob result,
InputStream inputStream) {
long resultLobId = result.getLobID();
CountdownInputStream countStream;
switch (result.getSubType()) {
case ResultLob.LobResultTypes.REQUEST_CREATE_BY... | [
"public",
"void",
"allocateLobForResult",
"(",
"ResultLob",
"result",
",",
"InputStream",
"inputStream",
")",
"{",
"long",
"resultLobId",
"=",
"result",
".",
"getLobID",
"(",
")",
";",
"CountdownInputStream",
"countStream",
";",
"switch",
"(",
"result",
".",
"ge... | allocate storage for a new LOB | [
"allocate",
"storage",
"for",
"a",
"new",
"LOB"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/SessionData.java#L426-L487 | train |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/AbstractJoinPlanNode.java | AbstractJoinPlanNode.resolveColumnIndexes | @Override
public void resolveColumnIndexes()
{
// First, assert that our topology is sane and then
// recursively resolve all child/inline column indexes
IndexScanPlanNode index_scan =
(IndexScanPlanNode) getInlinePlanNode(PlanNodeType.INDEXSCAN);
assert(m_children.si... | java | @Override
public void resolveColumnIndexes()
{
// First, assert that our topology is sane and then
// recursively resolve all child/inline column indexes
IndexScanPlanNode index_scan =
(IndexScanPlanNode) getInlinePlanNode(PlanNodeType.INDEXSCAN);
assert(m_children.si... | [
"@",
"Override",
"public",
"void",
"resolveColumnIndexes",
"(",
")",
"{",
"// First, assert that our topology is sane and then",
"// recursively resolve all child/inline column indexes",
"IndexScanPlanNode",
"index_scan",
"=",
"(",
"IndexScanPlanNode",
")",
"getInlinePlanNode",
"("... | order and TVE indexes for the output SchemaColumns. | [
"order",
"and",
"TVE",
"indexes",
"for",
"the",
"output",
"SchemaColumns",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/AbstractJoinPlanNode.java#L193-L252 | train |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/AbstractJoinPlanNode.java | AbstractJoinPlanNode.resolveSortDirection | public void resolveSortDirection() {
AbstractPlanNode outerTable = m_children.get(0);
if (m_joinType == JoinType.FULL) {
// Disable the usual optimizations for ordering join output by
// outer table only. In case of FULL join, the unmatched inner table tuples
// get a... | java | public void resolveSortDirection() {
AbstractPlanNode outerTable = m_children.get(0);
if (m_joinType == JoinType.FULL) {
// Disable the usual optimizations for ordering join output by
// outer table only. In case of FULL join, the unmatched inner table tuples
// get a... | [
"public",
"void",
"resolveSortDirection",
"(",
")",
"{",
"AbstractPlanNode",
"outerTable",
"=",
"m_children",
".",
"get",
"(",
"0",
")",
";",
"if",
"(",
"m_joinType",
"==",
"JoinType",
".",
"FULL",
")",
"{",
"// Disable the usual optimizations for ordering join outp... | right now, only consider the sort direction on the outer table | [
"right",
"now",
"only",
"consider",
"the",
"sort",
"direction",
"on",
"the",
"outer",
"table"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/AbstractJoinPlanNode.java#L284-L297 | train |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/AbstractJoinPlanNode.java | AbstractJoinPlanNode.discountEstimatedProcessedTupleCount | protected long discountEstimatedProcessedTupleCount(AbstractPlanNode childNode) {
// Discount estimated processed tuple count for the outer child based on the number of
// filter expressions this child has with a rapidly diminishing effect
// that ranges from a discount of 0.09 (ORETATION_EQAUL)... | java | protected long discountEstimatedProcessedTupleCount(AbstractPlanNode childNode) {
// Discount estimated processed tuple count for the outer child based on the number of
// filter expressions this child has with a rapidly diminishing effect
// that ranges from a discount of 0.09 (ORETATION_EQAUL)... | [
"protected",
"long",
"discountEstimatedProcessedTupleCount",
"(",
"AbstractPlanNode",
"childNode",
")",
"{",
"// Discount estimated processed tuple count for the outer child based on the number of",
"// filter expressions this child has with a rapidly diminishing effect",
"// that ranges from a ... | Discount join node child estimates based on the number of its filters
@param childNode
@return discounted estimates | [
"Discount",
"join",
"node",
"child",
"estimates",
"based",
"on",
"the",
"number",
"of",
"its",
"filters"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/AbstractJoinPlanNode.java#L404-L445 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/types/JavaObjectData.java | JavaObjectData.getObject | public Serializable getObject() {
try {
return InOutUtil.deserialize(data);
} catch (Exception e) {
throw Error.error(ErrorCode.X_22521, e.toString());
}
} | java | public Serializable getObject() {
try {
return InOutUtil.deserialize(data);
} catch (Exception e) {
throw Error.error(ErrorCode.X_22521, e.toString());
}
} | [
"public",
"Serializable",
"getObject",
"(",
")",
"{",
"try",
"{",
"return",
"InOutUtil",
".",
"deserialize",
"(",
"data",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"Error",
".",
"error",
"(",
"ErrorCode",
".",
"X_22521",
",",
"e... | This method is called from classes implementing the JDBC
interfaces. Inside the engine it is used for conversion from a value of
type OTHER to another type. It will throw if the OTHER is an instance
of a classe that is not available. | [
"This",
"method",
"is",
"called",
"from",
"classes",
"implementing",
"the",
"JDBC",
"interfaces",
".",
"Inside",
"the",
"engine",
"it",
"is",
"used",
"for",
"conversion",
"from",
"a",
"value",
"of",
"type",
"OTHER",
"to",
"another",
"type",
".",
"It",
"wil... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/types/JavaObjectData.java#L109-L116 | train |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/escape/ArrayBasedEscaperMap.java | ArrayBasedEscaperMap.createReplacementArray | @VisibleForTesting
static char[][] createReplacementArray(Map<Character, String> map) {
checkNotNull(map); // GWT specific check (do not optimize)
if (map.isEmpty()) {
return EMPTY_REPLACEMENT_ARRAY;
}
char max = Collections.max(map.keySet());
char[][] replacements = new char[max + 1][];
... | java | @VisibleForTesting
static char[][] createReplacementArray(Map<Character, String> map) {
checkNotNull(map); // GWT specific check (do not optimize)
if (map.isEmpty()) {
return EMPTY_REPLACEMENT_ARRAY;
}
char max = Collections.max(map.keySet());
char[][] replacements = new char[max + 1][];
... | [
"@",
"VisibleForTesting",
"static",
"char",
"[",
"]",
"[",
"]",
"createReplacementArray",
"(",
"Map",
"<",
"Character",
",",
"String",
">",
"map",
")",
"{",
"checkNotNull",
"(",
"map",
")",
";",
"// GWT specific check (do not optimize)",
"if",
"(",
"map",
".",... | original character value. | [
"original",
"character",
"value",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/escape/ArrayBasedEscaperMap.java#L68-L80 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCParameterMetaData.java | JDBCParameterMetaData.getPrecision | public int getPrecision(int param) throws SQLException {
checkRange(param);
Type type = rmd.columnTypes[--param];
if (type.isDateTimeType()) {
return type.displaySize();
} else {
long size = type.precision;
if (size > Integer.MAX_VALUE) {
... | java | public int getPrecision(int param) throws SQLException {
checkRange(param);
Type type = rmd.columnTypes[--param];
if (type.isDateTimeType()) {
return type.displaySize();
} else {
long size = type.precision;
if (size > Integer.MAX_VALUE) {
... | [
"public",
"int",
"getPrecision",
"(",
"int",
"param",
")",
"throws",
"SQLException",
"{",
"checkRange",
"(",
"param",
")",
";",
"Type",
"type",
"=",
"rmd",
".",
"columnTypes",
"[",
"--",
"param",
"]",
";",
"if",
"(",
"type",
".",
"isDateTimeType",
"(",
... | Retrieves the designated parameter's specified column size.
<P>The returned value represents the maximum column size for the given parameter.
For numeric data, this is the maximum precision. For character data, this is the length in characters.
For datetime datatypes, this is the length in characters of the String re... | [
"Retrieves",
"the",
"designated",
"parameter",
"s",
"specified",
"column",
"size",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCParameterMetaData.java#L144-L161 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCParameterMetaData.java | JDBCParameterMetaData.getParameterTypeName | public String getParameterTypeName(int param) throws SQLException {
checkRange(param);
return rmd.columnTypes[--param].getNameString();
} | java | public String getParameterTypeName(int param) throws SQLException {
checkRange(param);
return rmd.columnTypes[--param].getNameString();
} | [
"public",
"String",
"getParameterTypeName",
"(",
"int",
"param",
")",
"throws",
"SQLException",
"{",
"checkRange",
"(",
"param",
")",
";",
"return",
"rmd",
".",
"columnTypes",
"[",
"--",
"param",
"]",
".",
"getNameString",
"(",
")",
";",
"}"
] | Retrieves the designated parameter's database-specific type name.
@param param the first parameter is 1, the second is 2, ...
@return type the name used by the database. If the parameter type is
a user-defined type, then a fully-qualified type name is returned.
@exception SQLException if a database access error occurs... | [
"Retrieves",
"the",
"designated",
"parameter",
"s",
"database",
"-",
"specific",
"type",
"name",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCParameterMetaData.java#L204-L209 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/JoinProducerBase.java | JoinProducerBase.initializeTaskLog | protected static TaskLog initializeTaskLog(String voltroot, int pid)
{
// Construct task log and start logging task messages
File overflowDir = new File(voltroot, "join_overflow");
return ProClass.newInstanceOf("org.voltdb.rejoin.TaskLogImpl", "Join", ProClass.HANDLER_LOG, pid,
... | java | protected static TaskLog initializeTaskLog(String voltroot, int pid)
{
// Construct task log and start logging task messages
File overflowDir = new File(voltroot, "join_overflow");
return ProClass.newInstanceOf("org.voltdb.rejoin.TaskLogImpl", "Join", ProClass.HANDLER_LOG, pid,
... | [
"protected",
"static",
"TaskLog",
"initializeTaskLog",
"(",
"String",
"voltroot",
",",
"int",
"pid",
")",
"{",
"// Construct task log and start logging task messages",
"File",
"overflowDir",
"=",
"new",
"File",
"(",
"voltroot",
",",
"\"join_overflow\"",
")",
";",
"ret... | Load the pro task log | [
"Load",
"the",
"pro",
"task",
"log"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/JoinProducerBase.java#L144-L150 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/JoinProducerBase.java | JoinProducerBase.restoreBlock | protected void restoreBlock(RestoreWork rejoinWork, SiteProcedureConnection siteConnection)
{
kickWatchdog(true);
rejoinWork.restore(siteConnection);
} | java | protected void restoreBlock(RestoreWork rejoinWork, SiteProcedureConnection siteConnection)
{
kickWatchdog(true);
rejoinWork.restore(siteConnection);
} | [
"protected",
"void",
"restoreBlock",
"(",
"RestoreWork",
"rejoinWork",
",",
"SiteProcedureConnection",
"siteConnection",
")",
"{",
"kickWatchdog",
"(",
"true",
")",
";",
"rejoinWork",
".",
"restore",
"(",
"siteConnection",
")",
";",
"}"
] | Received a datablock. Reset the watchdog timer and hand the block to the Site. | [
"Received",
"a",
"datablock",
".",
"Reset",
"the",
"watchdog",
"timer",
"and",
"hand",
"the",
"block",
"to",
"the",
"Site",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/JoinProducerBase.java#L153-L157 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/JoinProducerBase.java | JoinProducerBase.returnToTaskQueue | protected void returnToTaskQueue(boolean sourcesReady)
{
if (sourcesReady) {
// If we've done something meaningful, go ahead and return ourselves to the queue immediately
m_taskQueue.offer(this);
} else {
// Otherwise, avoid spinning too aggressively, so wait a mi... | java | protected void returnToTaskQueue(boolean sourcesReady)
{
if (sourcesReady) {
// If we've done something meaningful, go ahead and return ourselves to the queue immediately
m_taskQueue.offer(this);
} else {
// Otherwise, avoid spinning too aggressively, so wait a mi... | [
"protected",
"void",
"returnToTaskQueue",
"(",
"boolean",
"sourcesReady",
")",
"{",
"if",
"(",
"sourcesReady",
")",
"{",
"// If we've done something meaningful, go ahead and return ourselves to the queue immediately",
"m_taskQueue",
".",
"offer",
"(",
"this",
")",
";",
"}",... | or after waiting a few milliseconds | [
"or",
"after",
"waiting",
"a",
"few",
"milliseconds"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/JoinProducerBase.java#L199-L208 | train |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/ZigZagEncoding.java | ZigZagEncoding.putLong | static void putLong(ByteBuffer buffer, long value) {
value = (value << 1) ^ (value >> 63);
if (value >>> 7 == 0) {
buffer.put((byte) value);
} else {
buffer.put((byte) ((value & 0x7F) | 0x80));
if (value >>> 14 == 0) {
buffer.put((byte) (value ... | java | static void putLong(ByteBuffer buffer, long value) {
value = (value << 1) ^ (value >> 63);
if (value >>> 7 == 0) {
buffer.put((byte) value);
} else {
buffer.put((byte) ((value & 0x7F) | 0x80));
if (value >>> 14 == 0) {
buffer.put((byte) (value ... | [
"static",
"void",
"putLong",
"(",
"ByteBuffer",
"buffer",
",",
"long",
"value",
")",
"{",
"value",
"=",
"(",
"value",
"<<",
"1",
")",
"^",
"(",
"value",
">>",
"63",
")",
";",
"if",
"(",
"value",
">>>",
"7",
"==",
"0",
")",
"{",
"buffer",
".",
"... | Writes a long value to the given buffer in LEB128 ZigZag encoded format
@param buffer the buffer to write to
@param value the value to write to the buffer | [
"Writes",
"a",
"long",
"value",
"to",
"the",
"given",
"buffer",
"in",
"LEB128",
"ZigZag",
"encoded",
"format"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/ZigZagEncoding.java#L35-L78 | train |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/ZigZagEncoding.java | ZigZagEncoding.putInt | static void putInt(ByteBuffer buffer, int value) {
value = (value << 1) ^ (value >> 31);
if (value >>> 7 == 0) {
buffer.put((byte) value);
} else {
buffer.put((byte) ((value & 0x7F) | 0x80));
if (value >>> 14 == 0) {
buffer.put((byte) (value >>... | java | static void putInt(ByteBuffer buffer, int value) {
value = (value << 1) ^ (value >> 31);
if (value >>> 7 == 0) {
buffer.put((byte) value);
} else {
buffer.put((byte) ((value & 0x7F) | 0x80));
if (value >>> 14 == 0) {
buffer.put((byte) (value >>... | [
"static",
"void",
"putInt",
"(",
"ByteBuffer",
"buffer",
",",
"int",
"value",
")",
"{",
"value",
"=",
"(",
"value",
"<<",
"1",
")",
"^",
"(",
"value",
">>",
"31",
")",
";",
"if",
"(",
"value",
">>>",
"7",
"==",
"0",
")",
"{",
"buffer",
".",
"pu... | Writes an int value to the given buffer in LEB128-64b9B ZigZag encoded format
@param buffer the buffer to write to
@param value the value to write to the buffer | [
"Writes",
"an",
"int",
"value",
"to",
"the",
"given",
"buffer",
"in",
"LEB128",
"-",
"64b9B",
"ZigZag",
"encoded",
"format"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/ZigZagEncoding.java#L85-L108 | train |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/ZigZagEncoding.java | ZigZagEncoding.getLong | static long getLong(ByteBuffer buffer) {
long v = buffer.get();
long value = v & 0x7F;
if ((v & 0x80) != 0) {
v = buffer.get();
value |= (v & 0x7F) << 7;
if ((v & 0x80) != 0) {
v = buffer.get();
value |= (v & 0x7F) << 14;
... | java | static long getLong(ByteBuffer buffer) {
long v = buffer.get();
long value = v & 0x7F;
if ((v & 0x80) != 0) {
v = buffer.get();
value |= (v & 0x7F) << 7;
if ((v & 0x80) != 0) {
v = buffer.get();
value |= (v & 0x7F) << 14;
... | [
"static",
"long",
"getLong",
"(",
"ByteBuffer",
"buffer",
")",
"{",
"long",
"v",
"=",
"buffer",
".",
"get",
"(",
")",
";",
"long",
"value",
"=",
"v",
"&",
"0x7F",
";",
"if",
"(",
"(",
"v",
"&",
"0x80",
")",
"!=",
"0",
")",
"{",
"v",
"=",
"buf... | Read an LEB128-64b9B ZigZag encoded long value from the given buffer
@param buffer the buffer to read from
@return the value read from the buffer | [
"Read",
"an",
"LEB128",
"-",
"64b9B",
"ZigZag",
"encoded",
"long",
"value",
"from",
"the",
"given",
"buffer"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/ZigZagEncoding.java#L115-L152 | train |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/ZigZagEncoding.java | ZigZagEncoding.getInt | static int getInt (ByteBuffer buffer) {
int v = buffer.get();
int value = v & 0x7F;
if ((v & 0x80) != 0) {
v = buffer.get();
value |= (v & 0x7F) << 7;
if ((v & 0x80) != 0) {
v = buffer.get();
value |= (v & 0x7F) << 14;
... | java | static int getInt (ByteBuffer buffer) {
int v = buffer.get();
int value = v & 0x7F;
if ((v & 0x80) != 0) {
v = buffer.get();
value |= (v & 0x7F) << 7;
if ((v & 0x80) != 0) {
v = buffer.get();
value |= (v & 0x7F) << 14;
... | [
"static",
"int",
"getInt",
"(",
"ByteBuffer",
"buffer",
")",
"{",
"int",
"v",
"=",
"buffer",
".",
"get",
"(",
")",
";",
"int",
"value",
"=",
"v",
"&",
"0x7F",
";",
"if",
"(",
"(",
"v",
"&",
"0x80",
")",
"!=",
"0",
")",
"{",
"v",
"=",
"buffer"... | Read an LEB128-64b9B ZigZag encoded int value from the given buffer
@param buffer the buffer to read from
@return the value read from the buffer | [
"Read",
"an",
"LEB128",
"-",
"64b9B",
"ZigZag",
"encoded",
"int",
"value",
"from",
"the",
"given",
"buffer"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/ZigZagEncoding.java#L159-L180 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/tar/TarReader.java | TarReader.main | static public void main(String[] sa)
throws IOException, TarMalformatException {
if (sa.length < 1) {
System.out.println(RB.singleton.getString(RB.TARREADER_SYNTAX,
TarReader.class.getName()));
System.out.println(RB.singleton.getString(RB.LISTING_FORMAT));
... | java | static public void main(String[] sa)
throws IOException, TarMalformatException {
if (sa.length < 1) {
System.out.println(RB.singleton.getString(RB.TARREADER_SYNTAX,
TarReader.class.getName()));
System.out.println(RB.singleton.getString(RB.LISTING_FORMAT));
... | [
"static",
"public",
"void",
"main",
"(",
"String",
"[",
"]",
"sa",
")",
"throws",
"IOException",
",",
"TarMalformatException",
"{",
"if",
"(",
"sa",
".",
"length",
"<",
"1",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"RB",
".",
"singleton",
... | Reads a specified tar file or stdin in order to either list or extract
the file tar entries, depending on the first argument being "t" or "x",
using default read buffer blocks. | [
"Reads",
"a",
"specified",
"tar",
"file",
"or",
"stdin",
"in",
"order",
"to",
"either",
"list",
"or",
"extract",
"the",
"file",
"tar",
"entries",
"depending",
"on",
"the",
"first",
"argument",
"being",
"t",
"or",
"x",
"using",
"default",
"read",
"buffer",
... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/tar/TarReader.java#L79-L124 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/UniqueIdGenerator.java | UniqueIdGenerator.getDateFromUniqueId | public static Date getDateFromUniqueId(long uniqueId) {
long time = uniqueId >> (COUNTER_BITS + PARTITIONID_BITS);
time += VOLT_EPOCH;
return new Date(time);
} | java | public static Date getDateFromUniqueId(long uniqueId) {
long time = uniqueId >> (COUNTER_BITS + PARTITIONID_BITS);
time += VOLT_EPOCH;
return new Date(time);
} | [
"public",
"static",
"Date",
"getDateFromUniqueId",
"(",
"long",
"uniqueId",
")",
"{",
"long",
"time",
"=",
"uniqueId",
">>",
"(",
"COUNTER_BITS",
"+",
"PARTITIONID_BITS",
")",
";",
"time",
"+=",
"VOLT_EPOCH",
";",
"return",
"new",
"Date",
"(",
"time",
")",
... | Given a unique id, return the time of its creation
by examining the embedded timestamp.
@param uniqueId The unique id value to examine.
@return The Date object representing the time this unique
id was created. | [
"Given",
"a",
"unique",
"id",
"return",
"the",
"time",
"of",
"its",
"creation",
"by",
"examining",
"the",
"embedded",
"timestamp",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/UniqueIdGenerator.java#L273-L277 | train |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/TypeHandler.java | TypeHandler.createObject | public static Object createObject(String classname) throws ParseException
{
Class<?> cl;
try
{
cl = Class.forName(classname);
}
catch (ClassNotFoundException cnfe)
{
throw new ParseException("Unable to find the class: " + classname);
}... | java | public static Object createObject(String classname) throws ParseException
{
Class<?> cl;
try
{
cl = Class.forName(classname);
}
catch (ClassNotFoundException cnfe)
{
throw new ParseException("Unable to find the class: " + classname);
}... | [
"public",
"static",
"Object",
"createObject",
"(",
"String",
"classname",
")",
"throws",
"ParseException",
"{",
"Class",
"<",
"?",
">",
"cl",
";",
"try",
"{",
"cl",
"=",
"Class",
".",
"forName",
"(",
"classname",
")",
";",
"}",
"catch",
"(",
"ClassNotFou... | Create an Object from the classname and empty constructor.
@param classname the argument value
@return the initialised object
@throws ParseException if the class could not be found or the object could not be created | [
"Create",
"an",
"Object",
"from",
"the",
"classname",
"and",
"empty",
"constructor",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/TypeHandler.java#L113-L134 | train |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/TypeHandler.java | TypeHandler.createNumber | public static Number createNumber(String str) throws ParseException
{
try
{
if (str.indexOf('.') != -1)
{
return Double.valueOf(str);
}
return Long.valueOf(str);
}
catch (NumberFormatException e)
{
th... | java | public static Number createNumber(String str) throws ParseException
{
try
{
if (str.indexOf('.') != -1)
{
return Double.valueOf(str);
}
return Long.valueOf(str);
}
catch (NumberFormatException e)
{
th... | [
"public",
"static",
"Number",
"createNumber",
"(",
"String",
"str",
")",
"throws",
"ParseException",
"{",
"try",
"{",
"if",
"(",
"str",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"{",
"return",
"Double",
".",
"valueOf",
"(",
"str",
")",... | Create a number from a String. If a . is present, it creates a
Double, otherwise a Long.
@param str the value
@return the number represented by <code>str</code>
@throws ParseException if <code>str</code> is not a number | [
"Create",
"a",
"number",
"from",
"a",
"String",
".",
"If",
"a",
".",
"is",
"present",
"it",
"creates",
"a",
"Double",
"otherwise",
"a",
"Long",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/TypeHandler.java#L144-L158 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/ZooKeeperServer.java | ZooKeeperServer.fixupACL | private boolean fixupACL(List<Id> authInfo, List<ACL> acl) {
if (skipACL) {
return true;
}
if (acl == null || acl.size() == 0) {
return false;
}
Iterator<ACL> it = acl.iterator();
LinkedList<ACL> toAdd = null;
while (it.hasNext()) {
... | java | private boolean fixupACL(List<Id> authInfo, List<ACL> acl) {
if (skipACL) {
return true;
}
if (acl == null || acl.size() == 0) {
return false;
}
Iterator<ACL> it = acl.iterator();
LinkedList<ACL> toAdd = null;
while (it.hasNext()) {
... | [
"private",
"boolean",
"fixupACL",
"(",
"List",
"<",
"Id",
">",
"authInfo",
",",
"List",
"<",
"ACL",
">",
"acl",
")",
"{",
"if",
"(",
"skipACL",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"acl",
"==",
"null",
"||",
"acl",
".",
"size",
"(",
... | This method checks out the acl making sure it isn't null or empty, it has
valid schemes and ids, and expanding any relative ids that depend on the
requestor's authentication information.
@param authInfo
list of ACL IDs associated with the client connection
@param acl
list of ACLs being assigned to the node (create or ... | [
"This",
"method",
"checks",
"out",
"the",
"acl",
"making",
"sure",
"it",
"isn",
"t",
"null",
"or",
"empty",
"it",
"has",
"valid",
"schemes",
"and",
"ids",
"and",
"expanding",
"any",
"relative",
"ids",
"that",
"depend",
"on",
"the",
"requestor",
"s",
"aut... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/ZooKeeperServer.java#L1141-L1194 | train |
VoltDB/voltdb | src/frontend/org/voltdb/security/AuthenticationRequest.java | AuthenticationRequest.authenticate | public boolean authenticate(ClientAuthScheme scheme, String fromAddress) {
if (m_done) throw new IllegalStateException("this authentication request has a result");
boolean authenticated = false;
try {
authenticated = authenticateImpl(scheme, fromAddress);
} catch (Exception e... | java | public boolean authenticate(ClientAuthScheme scheme, String fromAddress) {
if (m_done) throw new IllegalStateException("this authentication request has a result");
boolean authenticated = false;
try {
authenticated = authenticateImpl(scheme, fromAddress);
} catch (Exception e... | [
"public",
"boolean",
"authenticate",
"(",
"ClientAuthScheme",
"scheme",
",",
"String",
"fromAddress",
")",
"{",
"if",
"(",
"m_done",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"this authentication request has a result\"",
")",
";",
"boolean",
"authenticated",
... | Perform the authentication request
@param scheme is the type of Hash scheme
@param fromAddress is the remote IP address of this authenticate request
@return true if authenticated, false if not
@throws {@link IllegalStateException} if this request was already made | [
"Perform",
"the",
"authentication",
"request"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/security/AuthenticationRequest.java#L35-L47 | train |
VoltDB/voltdb | examples/nbbo/procedures/nbbo/ProcessTick.java | ProcessTick.run | public long run(
String symbol,
TimestampType time,
long seq_number,
String exchange,
int bidPrice,
int bidSize,
int askPrice,
int askSize) throws VoltAbortException
{
// convert bid and ask 0 values to null
... | java | public long run(
String symbol,
TimestampType time,
long seq_number,
String exchange,
int bidPrice,
int bidSize,
int askPrice,
int askSize) throws VoltAbortException
{
// convert bid and ask 0 values to null
... | [
"public",
"long",
"run",
"(",
"String",
"symbol",
",",
"TimestampType",
"time",
",",
"long",
"seq_number",
",",
"String",
"exchange",
",",
"int",
"bidPrice",
",",
"int",
"bidSize",
",",
"int",
"askPrice",
",",
"int",
"askSize",
")",
"throws",
"VoltAbortExcep... | "main method" the procedure starts here. | [
"main",
"method",
"the",
"procedure",
"starts",
"here",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/nbbo/procedures/nbbo/ProcessTick.java#L64-L139 | train |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/ImmutableRangeMap.java | ImmutableRangeMap.builder | public static <K extends Comparable<?>, V> Builder<K, V> builder() {
return new Builder<K, V>();
} | java | public static <K extends Comparable<?>, V> Builder<K, V> builder() {
return new Builder<K, V>();
} | [
"public",
"static",
"<",
"K",
"extends",
"Comparable",
"<",
"?",
">",
",",
"V",
">",
"Builder",
"<",
"K",
",",
"V",
">",
"builder",
"(",
")",
"{",
"return",
"new",
"Builder",
"<",
"K",
",",
"V",
">",
"(",
")",
";",
"}"
] | Returns a new builder for an immutable range map. | [
"Returns",
"a",
"new",
"builder",
"for",
"an",
"immutable",
"range",
"map",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/ImmutableRangeMap.java#L81-L83 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/RepairLog.java | RepairLog.setLeaderState | void setLeaderState(boolean isLeader)
{
m_isLeader = isLeader;
// The leader doesn't truncate its own SP log; if promoted,
// wipe out the SP portion of the existing log. This promotion
// action always happens after repair is completed.
if (m_isLeader) {
if (!m_l... | java | void setLeaderState(boolean isLeader)
{
m_isLeader = isLeader;
// The leader doesn't truncate its own SP log; if promoted,
// wipe out the SP portion of the existing log. This promotion
// action always happens after repair is completed.
if (m_isLeader) {
if (!m_l... | [
"void",
"setLeaderState",
"(",
"boolean",
"isLeader",
")",
"{",
"m_isLeader",
"=",
"isLeader",
";",
"// The leader doesn't truncate its own SP log; if promoted,",
"// wipe out the SP portion of the existing log. This promotion",
"// action always happens after repair is completed.",
"if"... | leaders log differently | [
"leaders",
"log",
"differently"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/RepairLog.java#L140-L151 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/RepairLog.java | RepairLog.deliver | public void deliver(VoltMessage msg)
{
if (!m_isLeader && msg instanceof Iv2InitiateTaskMessage) {
final Iv2InitiateTaskMessage m = (Iv2InitiateTaskMessage) msg;
// We can't repair read only SP transactions. Just don't log them to the repair log.
if (m.isReadOnly()) {
... | java | public void deliver(VoltMessage msg)
{
if (!m_isLeader && msg instanceof Iv2InitiateTaskMessage) {
final Iv2InitiateTaskMessage m = (Iv2InitiateTaskMessage) msg;
// We can't repair read only SP transactions. Just don't log them to the repair log.
if (m.isReadOnly()) {
... | [
"public",
"void",
"deliver",
"(",
"VoltMessage",
"msg",
")",
"{",
"if",
"(",
"!",
"m_isLeader",
"&&",
"msg",
"instanceof",
"Iv2InitiateTaskMessage",
")",
"{",
"final",
"Iv2InitiateTaskMessage",
"m",
"=",
"(",
"Iv2InitiateTaskMessage",
")",
"msg",
";",
"// We can... | the repairLog if the message includes a truncation hint. | [
"the",
"repairLog",
"if",
"the",
"message",
"includes",
"a",
"truncation",
"hint",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/RepairLog.java#L165-L234 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/RepairLog.java | RepairLog.truncate | private void truncate(long handle, boolean isSP)
{
// MIN value means no work to do, is a startup condition
if (handle == Long.MIN_VALUE) {
return;
}
Deque<RepairLog.Item> deq = null;
if (isSP) {
deq = m_logSP;
if (m_truncationHandle < han... | java | private void truncate(long handle, boolean isSP)
{
// MIN value means no work to do, is a startup condition
if (handle == Long.MIN_VALUE) {
return;
}
Deque<RepairLog.Item> deq = null;
if (isSP) {
deq = m_logSP;
if (m_truncationHandle < han... | [
"private",
"void",
"truncate",
"(",
"long",
"handle",
",",
"boolean",
"isSP",
")",
"{",
"// MIN value means no work to do, is a startup condition",
"if",
"(",
"handle",
"==",
"Long",
".",
"MIN_VALUE",
")",
"{",
"return",
";",
"}",
"Deque",
"<",
"RepairLog",
".",... | trim unnecessary log messages. | [
"trim",
"unnecessary",
"log",
"messages",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/RepairLog.java#L237-L264 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/RepairLog.java | RepairLog.contents | public List<Iv2RepairLogResponseMessage> contents(long requestId, boolean forMPI)
{
List<Item> items = new LinkedList<Item>();
// All cases include the log of MP transactions
items.addAll(m_logMP);
// SP repair requests also want the SP transactions
if (!forMPI) {
... | java | public List<Iv2RepairLogResponseMessage> contents(long requestId, boolean forMPI)
{
List<Item> items = new LinkedList<Item>();
// All cases include the log of MP transactions
items.addAll(m_logMP);
// SP repair requests also want the SP transactions
if (!forMPI) {
... | [
"public",
"List",
"<",
"Iv2RepairLogResponseMessage",
">",
"contents",
"(",
"long",
"requestId",
",",
"boolean",
"forMPI",
")",
"{",
"List",
"<",
"Item",
">",
"items",
"=",
"new",
"LinkedList",
"<",
"Item",
">",
"(",
")",
";",
"// All cases include the log of ... | produce the contents of the repair log. | [
"produce",
"the",
"contents",
"of",
"the",
"repair",
"log",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/RepairLog.java#L288-L335 | train |
VoltDB/voltdb | src/frontend/org/voltdb/ProcedureStatsCollector.java | ProcedureStatsCollector.endProcedure | public final synchronized void endProcedure(boolean aborted, boolean failed, SingleCallStatsToken statsToken) {
if (aborted) {
m_procStatsData.m_abortCount++;
}
if (failed) {
m_procStatsData.m_failureCount++;
}
m_procStatsData.m_invocations++;
// ... | java | public final synchronized void endProcedure(boolean aborted, boolean failed, SingleCallStatsToken statsToken) {
if (aborted) {
m_procStatsData.m_abortCount++;
}
if (failed) {
m_procStatsData.m_failureCount++;
}
m_procStatsData.m_invocations++;
// ... | [
"public",
"final",
"synchronized",
"void",
"endProcedure",
"(",
"boolean",
"aborted",
",",
"boolean",
"failed",
",",
"SingleCallStatsToken",
"statsToken",
")",
"{",
"if",
"(",
"aborted",
")",
"{",
"m_procStatsData",
".",
"m_abortCount",
"++",
";",
"}",
"if",
"... | Called after a procedure is finished executing. Compares the start and end time and calculates
the statistics.
Synchronized because it modifies internal state and (for NT procs) can be called from multiple
threads. For transactional procs the lock should be uncontended., | [
"Called",
"after",
"a",
"procedure",
"is",
"finished",
"executing",
".",
"Compares",
"the",
"start",
"and",
"end",
"time",
"and",
"calculates",
"the",
"statistics",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ProcedureStatsCollector.java#L138-L207 | train |
VoltDB/voltdb | src/frontend/org/voltdb/ProcedureStatsCollector.java | ProcedureStatsCollector.endFragment | public final synchronized void endFragment(String stmtName,
boolean isCoordinatorTask,
boolean failed,
boolean sampledStmt,
long dur... | java | public final synchronized void endFragment(String stmtName,
boolean isCoordinatorTask,
boolean failed,
boolean sampledStmt,
long dur... | [
"public",
"final",
"synchronized",
"void",
"endFragment",
"(",
"String",
"stmtName",
",",
"boolean",
"isCoordinatorTask",
",",
"boolean",
"failed",
",",
"boolean",
"sampledStmt",
",",
"long",
"duration",
",",
"int",
"resultSize",
",",
"int",
"parameterSetSize",
")... | This function will be called after a statement finish running.
It updates the data structures to maintain the statistics. | [
"This",
"function",
"will",
"be",
"called",
"after",
"a",
"statement",
"finish",
"running",
".",
"It",
"updates",
"the",
"data",
"structures",
"to",
"maintain",
"the",
"statistics",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ProcedureStatsCollector.java#L213-L272 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/SessionManager.java | SessionManager.newSession | public synchronized Session newSession(Database db, User user,
boolean readonly, boolean forLog,
int timeZoneSeconds) {
Session s = new Session(db, user, !forLog, !forLog, readonly,
sessionIdCo... | java | public synchronized Session newSession(Database db, User user,
boolean readonly, boolean forLog,
int timeZoneSeconds) {
Session s = new Session(db, user, !forLog, !forLog, readonly,
sessionIdCo... | [
"public",
"synchronized",
"Session",
"newSession",
"(",
"Database",
"db",
",",
"User",
"user",
",",
"boolean",
"readonly",
",",
"boolean",
"forLog",
",",
"int",
"timeZoneSeconds",
")",
"{",
"Session",
"s",
"=",
"new",
"Session",
"(",
"db",
",",
"user",
","... | Binds the specified Session object into this SessionManager's active
Session registry. This method is typically called internally as
the final step, when a successful connection has been made.
@param db the database to which the new Session is initially connected
@param user the Session User
@param readonly the ReadOn... | [
"Binds",
"the",
"specified",
"Session",
"object",
"into",
"this",
"SessionManager",
"s",
"active",
"Session",
"registry",
".",
"This",
"method",
"is",
"typically",
"called",
"internally",
"as",
"the",
"final",
"step",
"when",
"a",
"successful",
"connection",
"ha... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/SessionManager.java#L101-L115 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/SessionManager.java | SessionManager.getSysSessionForScript | public Session getSysSessionForScript(Database db) {
Session session = new Session(db, db.getUserManager().getSysUser(),
false, false, false, 0, 0);
session.isProcessingScript = true;
return session;
} | java | public Session getSysSessionForScript(Database db) {
Session session = new Session(db, db.getUserManager().getSysUser(),
false, false, false, 0, 0);
session.isProcessingScript = true;
return session;
} | [
"public",
"Session",
"getSysSessionForScript",
"(",
"Database",
"db",
")",
"{",
"Session",
"session",
"=",
"new",
"Session",
"(",
"db",
",",
"db",
".",
"getUserManager",
"(",
")",
".",
"getSysUser",
"(",
")",
",",
"false",
",",
"false",
",",
"false",
","... | Retrieves a new SYS Session. | [
"Retrieves",
"a",
"new",
"SYS",
"Session",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/SessionManager.java#L120-L128 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/SessionManager.java | SessionManager.closeAllSessions | public synchronized void closeAllSessions() {
// don't disconnect system user; need it to save database
Session[] sessions = getAllSessions();
for (int i = 0; i < sessions.length; i++) {
sessions[i].close();
}
} | java | public synchronized void closeAllSessions() {
// don't disconnect system user; need it to save database
Session[] sessions = getAllSessions();
for (int i = 0; i < sessions.length; i++) {
sessions[i].close();
}
} | [
"public",
"synchronized",
"void",
"closeAllSessions",
"(",
")",
"{",
"// don't disconnect system user; need it to save database",
"Session",
"[",
"]",
"sessions",
"=",
"getAllSessions",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sessions",
... | Closes all Sessions registered with this SessionManager. | [
"Closes",
"all",
"Sessions",
"registered",
"with",
"this",
"SessionManager",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/SessionManager.java#L177-L185 | train |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/net/HostAndPort.java | HostAndPort.withDefaultPort | public HostAndPort withDefaultPort(int defaultPort) {
checkArgument(isValidPort(defaultPort));
if (hasPort() || port == defaultPort) {
return this;
}
return new HostAndPort(host, defaultPort, hasBracketlessColons);
} | java | public HostAndPort withDefaultPort(int defaultPort) {
checkArgument(isValidPort(defaultPort));
if (hasPort() || port == defaultPort) {
return this;
}
return new HostAndPort(host, defaultPort, hasBracketlessColons);
} | [
"public",
"HostAndPort",
"withDefaultPort",
"(",
"int",
"defaultPort",
")",
"{",
"checkArgument",
"(",
"isValidPort",
"(",
"defaultPort",
")",
")",
";",
"if",
"(",
"hasPort",
"(",
")",
"||",
"port",
"==",
"defaultPort",
")",
"{",
"return",
"this",
";",
"}"... | Provide a default port if the parsed string contained only a host.
You can chain this after {@link #fromString(String)} to include a port in case the port was
omitted from the input string. If a port was already provided, then this method is a no-op.
@param defaultPort a port number, from [0..65535]
@return a HostAnd... | [
"Provide",
"a",
"default",
"port",
"if",
"the",
"parsed",
"string",
"contained",
"only",
"a",
"host",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/net/HostAndPort.java#L263-L269 | train |
VoltDB/voltdb | src/frontend/org/voltdb/CatalogContext.java | CatalogContext.writeCatalogJarToFile | public Runnable writeCatalogJarToFile(String path, String name, CatalogJarWriteMode mode) throws IOException
{
File catalogFile = new VoltFile(path, name);
File catalogTmpFile = new VoltFile(path, name + ".tmp");
if (mode == CatalogJarWriteMode.CATALOG_UPDATE) {
// This means a ... | java | public Runnable writeCatalogJarToFile(String path, String name, CatalogJarWriteMode mode) throws IOException
{
File catalogFile = new VoltFile(path, name);
File catalogTmpFile = new VoltFile(path, name + ".tmp");
if (mode == CatalogJarWriteMode.CATALOG_UPDATE) {
// This means a ... | [
"public",
"Runnable",
"writeCatalogJarToFile",
"(",
"String",
"path",
",",
"String",
"name",
",",
"CatalogJarWriteMode",
"mode",
")",
"throws",
"IOException",
"{",
"File",
"catalogFile",
"=",
"new",
"VoltFile",
"(",
"path",
",",
"name",
")",
";",
"File",
"cata... | Write, replace or update the catalog jar based on different cases. This function
assumes any IOException should lead to fatal crash.
@param path
@param name
@throws IOException | [
"Write",
"replace",
"or",
"update",
"the",
"catalog",
"jar",
"based",
"on",
"different",
"cases",
".",
"This",
"function",
"assumes",
"any",
"IOException",
"should",
"lead",
"to",
"fatal",
"crash",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/CatalogContext.java#L340-L374 | train |
VoltDB/voltdb | src/frontend/org/voltdb/CatalogContext.java | CatalogContext.classForProcedureOrUDF | public Class<?> classForProcedureOrUDF(String procedureClassName)
throws LinkageError, ExceptionInInitializerError, ClassNotFoundException {
return classForProcedureOrUDF(procedureClassName, m_catalogInfo.m_jarfile.getLoader());
} | java | public Class<?> classForProcedureOrUDF(String procedureClassName)
throws LinkageError, ExceptionInInitializerError, ClassNotFoundException {
return classForProcedureOrUDF(procedureClassName, m_catalogInfo.m_jarfile.getLoader());
} | [
"public",
"Class",
"<",
"?",
">",
"classForProcedureOrUDF",
"(",
"String",
"procedureClassName",
")",
"throws",
"LinkageError",
",",
"ExceptionInInitializerError",
",",
"ClassNotFoundException",
"{",
"return",
"classForProcedureOrUDF",
"(",
"procedureClassName",
",",
"m_c... | Given a class name in the catalog jar, loads it from the jar, even if the
jar is served from an URL and isn't in the classpath.
@param procedureClassName The name of the class to load.
@return A java Class variable associated with the class.
@throws ClassNotFoundException if the class is not in the jar file. | [
"Given",
"a",
"class",
"name",
"in",
"the",
"catalog",
"jar",
"loads",
"it",
"from",
"the",
"jar",
"even",
"if",
"the",
"jar",
"is",
"served",
"from",
"an",
"URL",
"and",
"isn",
"t",
"in",
"the",
"classpath",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/CatalogContext.java#L384-L387 | train |
VoltDB/voltdb | src/frontend/org/voltdb/CatalogContext.java | CatalogContext.getDeployment | public DeploymentType getDeployment()
{
if (m_memoizedDeployment == null) {
m_memoizedDeployment = CatalogUtil.getDeployment(
new ByteArrayInputStream(m_catalogInfo.m_deploymentBytes));
// This should NEVER happen
if (m_memoizedDeployment == null) {
... | java | public DeploymentType getDeployment()
{
if (m_memoizedDeployment == null) {
m_memoizedDeployment = CatalogUtil.getDeployment(
new ByteArrayInputStream(m_catalogInfo.m_deploymentBytes));
// This should NEVER happen
if (m_memoizedDeployment == null) {
... | [
"public",
"DeploymentType",
"getDeployment",
"(",
")",
"{",
"if",
"(",
"m_memoizedDeployment",
"==",
"null",
")",
"{",
"m_memoizedDeployment",
"=",
"CatalogUtil",
".",
"getDeployment",
"(",
"new",
"ByteArrayInputStream",
"(",
"m_catalogInfo",
".",
"m_deploymentBytes",... | Get the JAXB XML Deployment object, which is memoized | [
"Get",
"the",
"JAXB",
"XML",
"Deployment",
"object",
"which",
"is",
"memoized"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/CatalogContext.java#L533-L544 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/HsqlLinkedList.java | HsqlLinkedList.removeAfter | public boolean removeAfter(Node node) {
if (node == null || node.next == null) {
return false;
}
if (node.next == last) {
last = node;
}
node.next = node.next.next;
return true;
} | java | public boolean removeAfter(Node node) {
if (node == null || node.next == null) {
return false;
}
if (node.next == last) {
last = node;
}
node.next = node.next.next;
return true;
} | [
"public",
"boolean",
"removeAfter",
"(",
"Node",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"null",
"||",
"node",
".",
"next",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"node",
".",
"next",
"==",
"last",
")",
"{",
"last",
"=... | Removes the given node to allow removel from iterators | [
"Removes",
"the",
"given",
"node",
"to",
"allow",
"removel",
"from",
"iterators"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/HsqlLinkedList.java#L74-L87 | train |
VoltDB/voltdb | src/frontend/org/voltdb/compiler/statements/CreateProcedure.java | CreateProcedure.parseCreateProcedureClauses | protected ProcedurePartitionData parseCreateProcedureClauses(
ProcedureDescriptor descriptor,
String clauses) throws VoltCompilerException {
// Nothing to do if there were no clauses.
// Null means there's no partition data to return.
// There's also no roles to add.... | java | protected ProcedurePartitionData parseCreateProcedureClauses(
ProcedureDescriptor descriptor,
String clauses) throws VoltCompilerException {
// Nothing to do if there were no clauses.
// Null means there's no partition data to return.
// There's also no roles to add.... | [
"protected",
"ProcedurePartitionData",
"parseCreateProcedureClauses",
"(",
"ProcedureDescriptor",
"descriptor",
",",
"String",
"clauses",
")",
"throws",
"VoltCompilerException",
"{",
"// Nothing to do if there were no clauses.",
"// Null means there's no partition data to return.",
"//... | Parse and validate the substring containing ALLOW and PARTITION
clauses for CREATE PROCEDURE.
@param clauses the substring to parse
@param descriptor procedure descriptor populated with role names from ALLOW clause
@return parsed and validated partition data or null if there was no PARTITION clause
@throws VoltCompi... | [
"Parse",
"and",
"validate",
"the",
"substring",
"containing",
"ALLOW",
"and",
"PARTITION",
"clauses",
"for",
"CREATE",
"PROCEDURE",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/statements/CreateProcedure.java#L48-L87 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/SQLCommand.java | SQLCommand.interactWithTheUser | public static void interactWithTheUser() throws Exception
{
final SQLConsoleReader interactiveReader =
new SQLConsoleReader(new FileInputStream(FileDescriptor.in), System.out);
interactiveReader.setBellEnabled(false);
FileHistory historyFile = null;
try {
... | java | public static void interactWithTheUser() throws Exception
{
final SQLConsoleReader interactiveReader =
new SQLConsoleReader(new FileInputStream(FileDescriptor.in), System.out);
interactiveReader.setBellEnabled(false);
FileHistory historyFile = null;
try {
... | [
"public",
"static",
"void",
"interactWithTheUser",
"(",
")",
"throws",
"Exception",
"{",
"final",
"SQLConsoleReader",
"interactiveReader",
"=",
"new",
"SQLConsoleReader",
"(",
"new",
"FileInputStream",
"(",
"FileDescriptor",
".",
"in",
")",
",",
"System",
".",
"ou... | The main loop for interactive mode. | [
"The",
"main",
"loop",
"for",
"interactive",
"mode",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SQLCommand.java#L171-L221 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/SQLCommand.java | SQLCommand.executeScriptFiles | static void executeScriptFiles(List<FileInfo> filesInfo, SQLCommandLineReader parentLineReader, DDLParserCallback callback) throws IOException
{
LineReaderAdapter adapter = null;
SQLCommandLineReader reader = null;
StringBuilder statements = new StringBuilder();
if ( ! m_interactive... | java | static void executeScriptFiles(List<FileInfo> filesInfo, SQLCommandLineReader parentLineReader, DDLParserCallback callback) throws IOException
{
LineReaderAdapter adapter = null;
SQLCommandLineReader reader = null;
StringBuilder statements = new StringBuilder();
if ( ! m_interactive... | [
"static",
"void",
"executeScriptFiles",
"(",
"List",
"<",
"FileInfo",
">",
"filesInfo",
",",
"SQLCommandLineReader",
"parentLineReader",
",",
"DDLParserCallback",
"callback",
")",
"throws",
"IOException",
"{",
"LineReaderAdapter",
"adapter",
"=",
"null",
";",
"SQLComm... | Reads a script file and executes its content.
Note that the "script file" could be an inline batch,
i.e., a "here document" that is coming from the same input stream
as the "file" directive.
@param fileInfo Info on the file directive being processed
@param parentLineReader The current input stream, to be used for ... | [
"Reads",
"a",
"script",
"file",
"and",
"executes",
"its",
"content",
".",
"Note",
"that",
"the",
"script",
"file",
"could",
"be",
"an",
"inline",
"batch",
"i",
".",
"e",
".",
"a",
"here",
"document",
"that",
"is",
"coming",
"from",
"the",
"same",
"inpu... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SQLCommand.java#L724-L803 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/SQLCommand.java | SQLCommand.printUsage | private static void printUsage(String msg)
{
System.out.print(msg);
System.out.println("\n");
m_exitCode = -1;
printUsage();
} | java | private static void printUsage(String msg)
{
System.out.print(msg);
System.out.println("\n");
m_exitCode = -1;
printUsage();
} | [
"private",
"static",
"void",
"printUsage",
"(",
"String",
"msg",
")",
"{",
"System",
".",
"out",
".",
"print",
"(",
"msg",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"\\n\"",
")",
";",
"m_exitCode",
"=",
"-",
"1",
";",
"printUsage",
"(",
... | General application support | [
"General",
"application",
"support"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SQLCommand.java#L1287-L1293 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/SQLCommand.java | SQLCommand.printHelp | static void printHelp(OutputStream prtStr)
{
try {
InputStream is = SQLCommand.class.getResourceAsStream(m_readme);
while (is.available() > 0) {
byte[] bytes = new byte[is.available()]; // Fix for ENG-3440
is.read(bytes, 0, bytes.length);
... | java | static void printHelp(OutputStream prtStr)
{
try {
InputStream is = SQLCommand.class.getResourceAsStream(m_readme);
while (is.available() > 0) {
byte[] bytes = new byte[is.available()]; // Fix for ENG-3440
is.read(bytes, 0, bytes.length);
... | [
"static",
"void",
"printHelp",
"(",
"OutputStream",
"prtStr",
")",
"{",
"try",
"{",
"InputStream",
"is",
"=",
"SQLCommand",
".",
"class",
".",
"getResourceAsStream",
"(",
"m_readme",
")",
";",
"while",
"(",
"is",
".",
"available",
"(",
")",
">",
"0",
")"... | Default visibility is for test purposes. | [
"Default",
"visibility",
"is",
"for",
"test",
"purposes",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SQLCommand.java#L1362-L1377 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/SQLCommand.java | SQLCommand.main | public static void main(String args[])
{
System.setProperty("voltdb_no_logging", "true");
int exitCode = mainWithReturnCode(args);
System.exit(exitCode);
} | java | public static void main(String args[])
{
System.setProperty("voltdb_no_logging", "true");
int exitCode = mainWithReturnCode(args);
System.exit(exitCode);
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"args",
"[",
"]",
")",
"{",
"System",
".",
"setProperty",
"(",
"\"voltdb_no_logging\"",
",",
"\"true\"",
")",
";",
"int",
"exitCode",
"=",
"mainWithReturnCode",
"(",
"args",
")",
";",
"System",
".",
"exit"... | Application entry point | [
"Application",
"entry",
"point"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/SQLCommand.java#L1800-L1805 | train |
VoltDB/voltdb | src/frontend/org/voltdb/rejoin/StreamSnapshotDataTarget.java | StreamSnapshotDataTarget.checkTimeout | private synchronized void checkTimeout(final long timeoutMs) {
final Entry<Integer, SendWork> oldest = m_outstandingWork.firstEntry();
if (oldest != null) {
final long now = System.currentTimeMillis();
SendWork work = oldest.getValue();
if ((now - work.m_ts) > timeout... | java | private synchronized void checkTimeout(final long timeoutMs) {
final Entry<Integer, SendWork> oldest = m_outstandingWork.firstEntry();
if (oldest != null) {
final long now = System.currentTimeMillis();
SendWork work = oldest.getValue();
if ((now - work.m_ts) > timeout... | [
"private",
"synchronized",
"void",
"checkTimeout",
"(",
"final",
"long",
"timeoutMs",
")",
"{",
"final",
"Entry",
"<",
"Integer",
",",
"SendWork",
">",
"oldest",
"=",
"m_outstandingWork",
".",
"firstEntry",
"(",
")",
";",
"if",
"(",
"oldest",
"!=",
"null",
... | Called by the watchdog from the periodic work thread to check if the
oldest unacked block is older than the timeout interval. | [
"Called",
"by",
"the",
"watchdog",
"from",
"the",
"periodic",
"work",
"thread",
"to",
"check",
"if",
"the",
"oldest",
"unacked",
"block",
"is",
"older",
"than",
"the",
"timeout",
"interval",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/rejoin/StreamSnapshotDataTarget.java#L347-L362 | train |
VoltDB/voltdb | src/frontend/org/voltdb/rejoin/StreamSnapshotDataTarget.java | StreamSnapshotDataTarget.clearOutstanding | synchronized void clearOutstanding() {
if (m_outstandingWork.isEmpty() && (m_outstandingWorkCount.get() == 0)) {
return;
}
rejoinLog.trace("Clearing outstanding work.");
for (Entry<Integer, SendWork> e : m_outstandingWork.entrySet()) {
e.getValue().discard();
... | java | synchronized void clearOutstanding() {
if (m_outstandingWork.isEmpty() && (m_outstandingWorkCount.get() == 0)) {
return;
}
rejoinLog.trace("Clearing outstanding work.");
for (Entry<Integer, SendWork> e : m_outstandingWork.entrySet()) {
e.getValue().discard();
... | [
"synchronized",
"void",
"clearOutstanding",
"(",
")",
"{",
"if",
"(",
"m_outstandingWork",
".",
"isEmpty",
"(",
")",
"&&",
"(",
"m_outstandingWorkCount",
".",
"get",
"(",
")",
"==",
"0",
")",
")",
"{",
"return",
";",
"}",
"rejoinLog",
".",
"trace",
"(",
... | Idempotent, synchronized method to perform all cleanup of outstanding
work so buffers aren't leaked. | [
"Idempotent",
"synchronized",
"method",
"to",
"perform",
"all",
"cleanup",
"of",
"outstanding",
"work",
"so",
"buffers",
"aren",
"t",
"leaked",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/rejoin/StreamSnapshotDataTarget.java#L368-L380 | train |
VoltDB/voltdb | src/frontend/org/voltdb/rejoin/StreamSnapshotDataTarget.java | StreamSnapshotDataTarget.receiveAck | @Override
public synchronized void receiveAck(int blockIndex) {
SendWork work = m_outstandingWork.get(blockIndex);
// releases the BBContainers and cleans up
if (work == null || work.m_ackCounter == null) {
rejoinLog.warn("Received invalid blockIndex ack for targetId " + m_targe... | java | @Override
public synchronized void receiveAck(int blockIndex) {
SendWork work = m_outstandingWork.get(blockIndex);
// releases the BBContainers and cleans up
if (work == null || work.m_ackCounter == null) {
rejoinLog.warn("Received invalid blockIndex ack for targetId " + m_targe... | [
"@",
"Override",
"public",
"synchronized",
"void",
"receiveAck",
"(",
"int",
"blockIndex",
")",
"{",
"SendWork",
"work",
"=",
"m_outstandingWork",
".",
"get",
"(",
"blockIndex",
")",
";",
"// releases the BBContainers and cleans up",
"if",
"(",
"work",
"==",
"null... | Synchronized method to handle the arrival of an Ack.
@param blockIndex The index of the block that is being acked. | [
"Synchronized",
"method",
"to",
"handle",
"the",
"arrival",
"of",
"an",
"Ack",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/rejoin/StreamSnapshotDataTarget.java#L386-L408 | train |
VoltDB/voltdb | src/frontend/org/voltdb/rejoin/StreamSnapshotDataTarget.java | StreamSnapshotDataTarget.send | synchronized ListenableFuture<Boolean> send(StreamSnapshotMessageType type, int blockIndex, BBContainer chunk, boolean replicatedTable) {
SettableFuture<Boolean> sendFuture = SettableFuture.create();
rejoinLog.trace("Sending block " + blockIndex + " of type " + (replicatedTable?"REPLICATED ":"PARTITIONE... | java | synchronized ListenableFuture<Boolean> send(StreamSnapshotMessageType type, int blockIndex, BBContainer chunk, boolean replicatedTable) {
SettableFuture<Boolean> sendFuture = SettableFuture.create();
rejoinLog.trace("Sending block " + blockIndex + " of type " + (replicatedTable?"REPLICATED ":"PARTITIONE... | [
"synchronized",
"ListenableFuture",
"<",
"Boolean",
">",
"send",
"(",
"StreamSnapshotMessageType",
"type",
",",
"int",
"blockIndex",
",",
"BBContainer",
"chunk",
",",
"boolean",
"replicatedTable",
")",
"{",
"SettableFuture",
"<",
"Boolean",
">",
"sendFuture",
"=",
... | Send data to the rejoining node, tracking what was sent for ack tracking.
Synchronized to protect access to m_outstandingWork and to keep
m_outstandingWorkCount in sync with m_outstandingWork.
@param blockIndex Index useful for ack tracking and debugging
@param schemaContainer Optional schema for table (can be null)
@... | [
"Send",
"data",
"to",
"the",
"rejoining",
"node",
"tracking",
"what",
"was",
"sent",
"for",
"ack",
"tracking",
".",
"Synchronized",
"to",
"protect",
"access",
"to",
"m_outstandingWork",
"and",
"to",
"keep",
"m_outstandingWorkCount",
"in",
"sync",
"with",
"m_outs... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/rejoin/StreamSnapshotDataTarget.java#L582-L593 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogSchemaTools.java | CatalogSchemaTools.toSchemaWithoutInlineBatches | public static String toSchemaWithoutInlineBatches(String schema) {
StringBuilder sb = new StringBuilder(schema);
int i = sb.indexOf(batchSpecificComments);
if (i != -1) {
sb.delete(i, i + batchSpecificComments.length());
}
i = sb.indexOf(startBatch);
if (i != ... | java | public static String toSchemaWithoutInlineBatches(String schema) {
StringBuilder sb = new StringBuilder(schema);
int i = sb.indexOf(batchSpecificComments);
if (i != -1) {
sb.delete(i, i + batchSpecificComments.length());
}
i = sb.indexOf(startBatch);
if (i != ... | [
"public",
"static",
"String",
"toSchemaWithoutInlineBatches",
"(",
"String",
"schema",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"schema",
")",
";",
"int",
"i",
"=",
"sb",
".",
"indexOf",
"(",
"batchSpecificComments",
")",
";",
"if",
... | Given a schema, strips out inline batch statements and associated comments.
@param schema The given schema
@return The given schema without batch statements and comments. | [
"Given",
"a",
"schema",
"strips",
"out",
"inline",
"batch",
"statements",
"and",
"associated",
"comments",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogSchemaTools.java#L646-L661 | train |
VoltDB/voltdb | src/frontend/org/voltdb/client/Distributer.java | Distributer.shutdown | final void shutdown() throws InterruptedException {
// stop the old proc call reaper
m_timeoutReaperHandle.cancel(false);
m_ex.shutdown();
if (CoreUtils.isJunitTest()) {
m_ex.awaitTermination(1, TimeUnit.SECONDS);
} else {
m_ex.awaitTermination(365, TimeUn... | java | final void shutdown() throws InterruptedException {
// stop the old proc call reaper
m_timeoutReaperHandle.cancel(false);
m_ex.shutdown();
if (CoreUtils.isJunitTest()) {
m_ex.awaitTermination(1, TimeUnit.SECONDS);
} else {
m_ex.awaitTermination(365, TimeUn... | [
"final",
"void",
"shutdown",
"(",
")",
"throws",
"InterruptedException",
"{",
"// stop the old proc call reaper",
"m_timeoutReaperHandle",
".",
"cancel",
"(",
"false",
")",
";",
"m_ex",
".",
"shutdown",
"(",
")",
";",
"if",
"(",
"CoreUtils",
".",
"isJunitTest",
... | Shutdown the VoltNetwork allowing the Ports to close and free resources
like memory pools
@throws InterruptedException | [
"Shutdown",
"the",
"VoltNetwork",
"allowing",
"the",
"Ports",
"to",
"close",
"and",
"free",
"resources",
"like",
"memory",
"pools"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/client/Distributer.java#L1287-L1302 | train |
VoltDB/voltdb | src/frontend/org/voltdb/client/Distributer.java | Distributer.getPartitionForParameter | public long getPartitionForParameter(byte typeValue, Object value) {
if (m_hashinator == null) {
return -1;
}
return m_hashinator.getHashedPartitionForParameter(typeValue, value);
} | java | public long getPartitionForParameter(byte typeValue, Object value) {
if (m_hashinator == null) {
return -1;
}
return m_hashinator.getHashedPartitionForParameter(typeValue, value);
} | [
"public",
"long",
"getPartitionForParameter",
"(",
"byte",
"typeValue",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"m_hashinator",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"return",
"m_hashinator",
".",
"getHashedPartitionForParameter",
"(",
"ty... | This is used by clients such as CSVLoader which puts processing into buckets.
@param typeValue volt Type
@param value the representative value
@return | [
"This",
"is",
"used",
"by",
"clients",
"such",
"as",
"CSVLoader",
"which",
"puts",
"processing",
"into",
"buckets",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/client/Distributer.java#L1546-L1551 | train |
VoltDB/voltdb | src/frontend/org/voltdb/client/Distributer.java | Distributer.refreshPartitionKeys | private void refreshPartitionKeys(boolean topologyUpdate) {
long interval = System.currentTimeMillis() - m_lastPartitionKeyFetched.get();
if (!m_useClientAffinity && interval < PARTITION_KEYS_INFO_REFRESH_FREQUENCY) {
return;
}
try {
ProcedureInvocation invocat... | java | private void refreshPartitionKeys(boolean topologyUpdate) {
long interval = System.currentTimeMillis() - m_lastPartitionKeyFetched.get();
if (!m_useClientAffinity && interval < PARTITION_KEYS_INFO_REFRESH_FREQUENCY) {
return;
}
try {
ProcedureInvocation invocat... | [
"private",
"void",
"refreshPartitionKeys",
"(",
"boolean",
"topologyUpdate",
")",
"{",
"long",
"interval",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"m_lastPartitionKeyFetched",
".",
"get",
"(",
")",
";",
"if",
"(",
"!",
"m_useClientAffinity",
"&&"... | Set up partitions.
@param topologyUpdate if true, it is called from topology update
@throws ProcCallException on any VoltDB specific failure.
@throws NoConnectionsException if this {@link Client} instance is not connected to any servers.
@throws IOException if there is a Java network or connection problem. | [
"Set",
"up",
"partitions",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/client/Distributer.java#L1582-L1609 | train |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/OrderByPlanNode.java | OrderByPlanNode.addSortExpressions | public void addSortExpressions(List<AbstractExpression> sortExprs, List<SortDirectionType> sortDirs) {
assert(sortExprs.size() == sortDirs.size());
for (int i = 0; i < sortExprs.size(); ++i) {
addSortExpression(sortExprs.get(i), sortDirs.get(i));
}
} | java | public void addSortExpressions(List<AbstractExpression> sortExprs, List<SortDirectionType> sortDirs) {
assert(sortExprs.size() == sortDirs.size());
for (int i = 0; i < sortExprs.size(); ++i) {
addSortExpression(sortExprs.get(i), sortDirs.get(i));
}
} | [
"public",
"void",
"addSortExpressions",
"(",
"List",
"<",
"AbstractExpression",
">",
"sortExprs",
",",
"List",
"<",
"SortDirectionType",
">",
"sortDirs",
")",
"{",
"assert",
"(",
"sortExprs",
".",
"size",
"(",
")",
"==",
"sortDirs",
".",
"size",
"(",
")",
... | Add multiple sort expressions to the order-by
@param sortExprs List of the input expression on which to order the rows
@param sortDirs List of the corresponding sort order for each input expression | [
"Add",
"multiple",
"sort",
"expressions",
"to",
"the",
"order",
"-",
"by"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/OrderByPlanNode.java#L87-L92 | train |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/OrderByPlanNode.java | OrderByPlanNode.addSortExpression | public void addSortExpression(AbstractExpression sortExpr, SortDirectionType sortDir)
{
assert(sortExpr != null);
// PlanNodes all need private deep copies of expressions
// so that the resolveColumnIndexes results
// don't get bashed by other nodes or subsequent planner runs
... | java | public void addSortExpression(AbstractExpression sortExpr, SortDirectionType sortDir)
{
assert(sortExpr != null);
// PlanNodes all need private deep copies of expressions
// so that the resolveColumnIndexes results
// don't get bashed by other nodes or subsequent planner runs
... | [
"public",
"void",
"addSortExpression",
"(",
"AbstractExpression",
"sortExpr",
",",
"SortDirectionType",
"sortDir",
")",
"{",
"assert",
"(",
"sortExpr",
"!=",
"null",
")",
";",
"// PlanNodes all need private deep copies of expressions",
"// so that the resolveColumnIndexes resul... | Add a sort expression to the order-by
@param sortExpr The input expression on which to order the rows
@param sortDir | [
"Add",
"a",
"sort",
"expression",
"to",
"the",
"order",
"-",
"by"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/OrderByPlanNode.java#L99-L107 | train |
VoltDB/voltdb | src/frontend/org/voltcore/logging/VoltUtilLoggingLogger.java | VoltUtilLoggingLogger.getPriorityForLevel | static java.util.logging.Level getPriorityForLevel(Level level) {
switch (level) {
case DEBUG:
return java.util.logging.Level.FINEST;
case ERROR:
return java.util.logging.Level.SEVERE;
case FATAL:
return java.util.logging.Level... | java | static java.util.logging.Level getPriorityForLevel(Level level) {
switch (level) {
case DEBUG:
return java.util.logging.Level.FINEST;
case ERROR:
return java.util.logging.Level.SEVERE;
case FATAL:
return java.util.logging.Level... | [
"static",
"java",
".",
"util",
".",
"logging",
".",
"Level",
"getPriorityForLevel",
"(",
"Level",
"level",
")",
"{",
"switch",
"(",
"level",
")",
"{",
"case",
"DEBUG",
":",
"return",
"java",
".",
"util",
".",
"logging",
".",
"Level",
".",
"FINEST",
";"... | Convert the VoltLogger Level to the java.ulil.logging Level | [
"Convert",
"the",
"VoltLogger",
"Level",
"to",
"the",
"java",
".",
"ulil",
".",
"logging",
"Level"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/logging/VoltUtilLoggingLogger.java#L32-L49 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.checkAddColumn | void checkAddColumn(ColumnSchema col) {
if (table.isText() && !table.isEmpty(session)) {
throw Error.error(ErrorCode.X_S0521);
}
if (table.findColumn(col.getName().name) != -1) {
throw Error.error(ErrorCode.X_42504);
}
if (col.isPrimaryKey() && table.ha... | java | void checkAddColumn(ColumnSchema col) {
if (table.isText() && !table.isEmpty(session)) {
throw Error.error(ErrorCode.X_S0521);
}
if (table.findColumn(col.getName().name) != -1) {
throw Error.error(ErrorCode.X_42504);
}
if (col.isPrimaryKey() && table.ha... | [
"void",
"checkAddColumn",
"(",
"ColumnSchema",
"col",
")",
"{",
"if",
"(",
"table",
".",
"isText",
"(",
")",
"&&",
"!",
"table",
".",
"isEmpty",
"(",
"session",
")",
")",
"{",
"throw",
"Error",
".",
"error",
"(",
"ErrorCode",
".",
"X_S0521",
")",
";"... | Checks if the attributes of the Column argument, c, are compatible with
the operation of adding such a Column to the Table argument, table.
@param col the Column to add to the Table, t | [
"Checks",
"if",
"the",
"attributes",
"of",
"the",
"Column",
"argument",
"c",
"are",
"compatible",
"with",
"the",
"operation",
"of",
"adding",
"such",
"a",
"Column",
"to",
"the",
"Table",
"argument",
"table",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L216-L239 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.makeNewTable | void makeNewTable(OrderedHashSet dropConstraintSet,
OrderedHashSet dropIndexSet) {
Table tn = table.moveDefinition(session, table.tableType, null, null,
null, -1, 0, dropConstraintSet,
dropIndexSet);
... | java | void makeNewTable(OrderedHashSet dropConstraintSet,
OrderedHashSet dropIndexSet) {
Table tn = table.moveDefinition(session, table.tableType, null, null,
null, -1, 0, dropConstraintSet,
dropIndexSet);
... | [
"void",
"makeNewTable",
"(",
"OrderedHashSet",
"dropConstraintSet",
",",
"OrderedHashSet",
"dropIndexSet",
")",
"{",
"Table",
"tn",
"=",
"table",
".",
"moveDefinition",
"(",
"session",
",",
"table",
".",
"tableType",
",",
"null",
",",
"null",
",",
"null",
",",... | Drops constriants and their indexes in table. Uses set of names. | [
"Drops",
"constriants",
"and",
"their",
"indexes",
"in",
"table",
".",
"Uses",
"set",
"of",
"names",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L452-L469 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.addIndex | Index addIndex(int[] col, HsqlName name, boolean unique, boolean migrating) {
Index newindex;
if (table.isEmpty(session) || table.isIndexingMutable()) {
PersistentStore store = session.sessionData.getRowStore(table);
newindex = table.createIndex(store, name, col, null, null, u... | java | Index addIndex(int[] col, HsqlName name, boolean unique, boolean migrating) {
Index newindex;
if (table.isEmpty(session) || table.isIndexingMutable()) {
PersistentStore store = session.sessionData.getRowStore(table);
newindex = table.createIndex(store, name, col, null, null, u... | [
"Index",
"addIndex",
"(",
"int",
"[",
"]",
"col",
",",
"HsqlName",
"name",
",",
"boolean",
"unique",
",",
"boolean",
"migrating",
")",
"{",
"Index",
"newindex",
";",
"if",
"(",
"table",
".",
"isEmpty",
"(",
"session",
")",
"||",
"table",
".",
"isIndexi... | Because of the way indexes and column data are held in memory and on
disk, it is necessary to recreate the table when an index is added to a
non-empty cached table.
<p> With empty tables, Index objects are simply added
<p> With MEOMRY and TEXT tables, a new index is built up and nodes for
earch row are interlinked (f... | [
"Because",
"of",
"the",
"way",
"indexes",
"and",
"column",
"data",
"are",
"held",
"in",
"memory",
"and",
"on",
"disk",
"it",
"is",
"necessary",
"to",
"recreate",
"the",
"table",
"when",
"an",
"index",
"is",
"added",
"to",
"a",
"non",
"-",
"empty",
"cac... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L486-L517 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.dropIndex | void dropIndex(String indexName) {
Index index;
index = table.getIndex(indexName);
if (table.isIndexingMutable()) {
table.dropIndex(session, indexName);
} else {
OrderedHashSet indexSet = new OrderedHashSet();
indexSet.add(table.getIndex(indexName)... | java | void dropIndex(String indexName) {
Index index;
index = table.getIndex(indexName);
if (table.isIndexingMutable()) {
table.dropIndex(session, indexName);
} else {
OrderedHashSet indexSet = new OrderedHashSet();
indexSet.add(table.getIndex(indexName)... | [
"void",
"dropIndex",
"(",
"String",
"indexName",
")",
"{",
"Index",
"index",
";",
"index",
"=",
"table",
".",
"getIndex",
"(",
"indexName",
")",
";",
"if",
"(",
"table",
".",
"isIndexingMutable",
"(",
")",
")",
"{",
"table",
".",
"dropIndex",
"(",
"ses... | Because of the way indexes and column data are held in memory and on
disk, it is necessary to recreate the table when an index is added to or
removed from a non-empty table.
<p> Originally, this method would break existing foreign keys as the
table order in the DB was changed. The new table is now linked in place
of t... | [
"Because",
"of",
"the",
"way",
"indexes",
"and",
"column",
"data",
"are",
"held",
"in",
"memory",
"and",
"on",
"disk",
"it",
"is",
"necessary",
"to",
"recreate",
"the",
"table",
"when",
"an",
"index",
"is",
"added",
"to",
"or",
"removed",
"from",
"a",
... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L615-L645 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.retypeColumn | void retypeColumn(ColumnSchema oldCol, ColumnSchema newCol) {
boolean allowed = true;
int oldType = oldCol.getDataType().typeCode;
int newType = newCol.getDataType().typeCode;
if (!table.isEmpty(session) && oldType != newType) {
allowed =
newCol.getD... | java | void retypeColumn(ColumnSchema oldCol, ColumnSchema newCol) {
boolean allowed = true;
int oldType = oldCol.getDataType().typeCode;
int newType = newCol.getDataType().typeCode;
if (!table.isEmpty(session) && oldType != newType) {
allowed =
newCol.getD... | [
"void",
"retypeColumn",
"(",
"ColumnSchema",
"oldCol",
",",
"ColumnSchema",
"newCol",
")",
"{",
"boolean",
"allowed",
"=",
"true",
";",
"int",
"oldType",
"=",
"oldCol",
".",
"getDataType",
"(",
")",
".",
"typeCode",
";",
"int",
"newType",
"=",
"newCol",
".... | Allows changing the type or addition of an IDENTITY sequence.
@param oldCol Column
@param newCol Column | [
"Allows",
"changing",
"the",
"type",
"or",
"addition",
"of",
"an",
"IDENTITY",
"sequence",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L895-L977 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.setColNullability | void setColNullability(ColumnSchema column, boolean nullable) {
Constraint c = null;
int colIndex = table.getColumnIndex(column.getName().name);
if (column.isNullable() == nullable) {
return;
}
if (nullable) {
if (column.isPrimaryKey()) {
... | java | void setColNullability(ColumnSchema column, boolean nullable) {
Constraint c = null;
int colIndex = table.getColumnIndex(column.getName().name);
if (column.isNullable() == nullable) {
return;
}
if (nullable) {
if (column.isPrimaryKey()) {
... | [
"void",
"setColNullability",
"(",
"ColumnSchema",
"column",
",",
"boolean",
"nullable",
")",
"{",
"Constraint",
"c",
"=",
"null",
";",
"int",
"colIndex",
"=",
"table",
".",
"getColumnIndex",
"(",
"column",
".",
"getName",
"(",
")",
".",
"name",
")",
";",
... | performs the work for changing the nullability of a column
@param column Column
@param nullable boolean | [
"performs",
"the",
"work",
"for",
"changing",
"the",
"nullability",
"of",
"a",
"column"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L1028-L1058 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.setColDefaultExpression | void setColDefaultExpression(int colIndex, Expression def) {
if (def == null) {
table.checkColumnInFKConstraint(colIndex, Constraint.SET_DEFAULT);
}
table.setDefaultExpression(colIndex, def);
} | java | void setColDefaultExpression(int colIndex, Expression def) {
if (def == null) {
table.checkColumnInFKConstraint(colIndex, Constraint.SET_DEFAULT);
}
table.setDefaultExpression(colIndex, def);
} | [
"void",
"setColDefaultExpression",
"(",
"int",
"colIndex",
",",
"Expression",
"def",
")",
"{",
"if",
"(",
"def",
"==",
"null",
")",
"{",
"table",
".",
"checkColumnInFKConstraint",
"(",
"colIndex",
",",
"Constraint",
".",
"SET_DEFAULT",
")",
";",
"}",
"table"... | performs the work for changing the default value of a column
@param colIndex int
@param def Expression | [
"performs",
"the",
"work",
"for",
"changing",
"the",
"default",
"value",
"of",
"a",
"column"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L1066-L1073 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.setTableType | public boolean setTableType(Session session, int newType) {
int currentType = table.getTableType();
if (currentType == newType) {
return false;
}
switch (newType) {
case TableBase.CACHED_TABLE :
break;
case TableBase.MEMORY_TABLE :... | java | public boolean setTableType(Session session, int newType) {
int currentType = table.getTableType();
if (currentType == newType) {
return false;
}
switch (newType) {
case TableBase.CACHED_TABLE :
break;
case TableBase.MEMORY_TABLE :... | [
"public",
"boolean",
"setTableType",
"(",
"Session",
"session",
",",
"int",
"newType",
")",
"{",
"int",
"currentType",
"=",
"table",
".",
"getTableType",
"(",
")",
";",
"if",
"(",
"currentType",
"==",
"newType",
")",
"{",
"return",
"false",
";",
"}",
"sw... | Changes the type of a table
@param session Session
@param newType int
@return boolean | [
"Changes",
"the",
"type",
"of",
"a",
"table"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L1082-L1122 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.addExprIndex | Index addExprIndex(int[] col, Expression[] indexExprs, HsqlName name, boolean unique, boolean migrating, Expression predicate) {
Index newindex;
if (table.isEmpty(session) || table.isIndexingMutable()) {
newindex = table.createAndAddExprIndexStructure(name, col, indexExprs, unique, migrati... | java | Index addExprIndex(int[] col, Expression[] indexExprs, HsqlName name, boolean unique, boolean migrating, Expression predicate) {
Index newindex;
if (table.isEmpty(session) || table.isIndexingMutable()) {
newindex = table.createAndAddExprIndexStructure(name, col, indexExprs, unique, migrati... | [
"Index",
"addExprIndex",
"(",
"int",
"[",
"]",
"col",
",",
"Expression",
"[",
"]",
"indexExprs",
",",
"HsqlName",
"name",
",",
"boolean",
"unique",
",",
"boolean",
"migrating",
",",
"Expression",
"predicate",
")",
"{",
"Index",
"newindex",
";",
"if",
"(",
... | A VoltDB extended variant of addIndex that supports indexed generalized non-column expressions.
@param cols int[]
@param indexExprs Expression[]
@param name HsqlName
@param unique boolean
@param predicate Expression
@return new index | [
"A",
"VoltDB",
"extended",
"variant",
"of",
"addIndex",
"that",
"supports",
"indexed",
"generalized",
"non",
"-",
"column",
"expressions",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L1172-L1203 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.addIndex | Index addIndex(int[] col, HsqlName name, boolean unique, boolean migrating, Expression predicate) {
return addIndex(col, name, unique, migrating).withPredicate(predicate);
} | java | Index addIndex(int[] col, HsqlName name, boolean unique, boolean migrating, Expression predicate) {
return addIndex(col, name, unique, migrating).withPredicate(predicate);
} | [
"Index",
"addIndex",
"(",
"int",
"[",
"]",
"col",
",",
"HsqlName",
"name",
",",
"boolean",
"unique",
",",
"boolean",
"migrating",
",",
"Expression",
"predicate",
")",
"{",
"return",
"addIndex",
"(",
"col",
",",
"name",
",",
"unique",
",",
"migrating",
")... | A VoltDB extended variant of addIndex that supports partial index predicate.
@param col int[]
@param name HsqlName
@param unique boolean
@param migrating is MIGRATING INDEX being created
@param predicate Expression
@return new index | [
"A",
"VoltDB",
"extended",
"variant",
"of",
"addIndex",
"that",
"supports",
"partial",
"index",
"predicate",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L1215-L1217 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/ParsedColInfo.java | ParsedColInfo.fromOrderByXml | static public ParsedColInfo fromOrderByXml(AbstractParsedStmt parsedStmt,
VoltXMLElement orderByXml) {
// A generic adjuster that just calls finalizeValueTypes
ExpressionAdjuster adjuster = new ExpressionAdjuster() {
@Override
public AbstractExpression adjust(Abstract... | java | static public ParsedColInfo fromOrderByXml(AbstractParsedStmt parsedStmt,
VoltXMLElement orderByXml) {
// A generic adjuster that just calls finalizeValueTypes
ExpressionAdjuster adjuster = new ExpressionAdjuster() {
@Override
public AbstractExpression adjust(Abstract... | [
"static",
"public",
"ParsedColInfo",
"fromOrderByXml",
"(",
"AbstractParsedStmt",
"parsedStmt",
",",
"VoltXMLElement",
"orderByXml",
")",
"{",
"// A generic adjuster that just calls finalizeValueTypes",
"ExpressionAdjuster",
"adjuster",
"=",
"new",
"ExpressionAdjuster",
"(",
")... | Construct a ParsedColInfo from Volt XML. | [
"Construct",
"a",
"ParsedColInfo",
"from",
"Volt",
"XML",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/ParsedColInfo.java#L72-L84 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/ParsedColInfo.java | ParsedColInfo.fromOrderByXml | static public ParsedColInfo fromOrderByXml(AbstractParsedStmt parsedStmt,
VoltXMLElement orderByXml, ExpressionAdjuster adjuster) {
// make sure everything is kosher
assert(orderByXml.name.equalsIgnoreCase("orderby"));
// get desc/asc
String desc = orderByXml.attributes.get... | java | static public ParsedColInfo fromOrderByXml(AbstractParsedStmt parsedStmt,
VoltXMLElement orderByXml, ExpressionAdjuster adjuster) {
// make sure everything is kosher
assert(orderByXml.name.equalsIgnoreCase("orderby"));
// get desc/asc
String desc = orderByXml.attributes.get... | [
"static",
"public",
"ParsedColInfo",
"fromOrderByXml",
"(",
"AbstractParsedStmt",
"parsedStmt",
",",
"VoltXMLElement",
"orderByXml",
",",
"ExpressionAdjuster",
"adjuster",
")",
"{",
"// make sure everything is kosher",
"assert",
"(",
"orderByXml",
".",
"name",
".",
"equal... | Construct a ParsedColInfo from Volt XML.
Allow caller to specify actions to finalize the parsed expression. | [
"Construct",
"a",
"ParsedColInfo",
"from",
"Volt",
"XML",
".",
"Allow",
"caller",
"to",
"specify",
"actions",
"to",
"finalize",
"the",
"parsed",
"expression",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/ParsedColInfo.java#L122-L184 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/ParsedColInfo.java | ParsedColInfo.asSchemaColumn | public SchemaColumn asSchemaColumn() {
String columnAlias = (m_alias == null) ? m_columnName : m_alias;
return new SchemaColumn(m_tableName, m_tableAlias,
m_columnName, columnAlias,
m_expression, m_differentiator);
} | java | public SchemaColumn asSchemaColumn() {
String columnAlias = (m_alias == null) ? m_columnName : m_alias;
return new SchemaColumn(m_tableName, m_tableAlias,
m_columnName, columnAlias,
m_expression, m_differentiator);
} | [
"public",
"SchemaColumn",
"asSchemaColumn",
"(",
")",
"{",
"String",
"columnAlias",
"=",
"(",
"m_alias",
"==",
"null",
")",
"?",
"m_columnName",
":",
"m_alias",
";",
"return",
"new",
"SchemaColumn",
"(",
"m_tableName",
",",
"m_tableAlias",
",",
"m_columnName",
... | Return this as an instance of SchemaColumn | [
"Return",
"this",
"as",
"an",
"instance",
"of",
"SchemaColumn"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/ParsedColInfo.java#L187-L192 | train |
VoltDB/voltdb | src/frontend/org/voltdb/jni/ExecutionEngine.java | ExecutionEngine.crashVoltDB | public static void crashVoltDB(String reason, String traces[], String filename, int lineno) {
VoltLogger hostLog = new VoltLogger("HOST");
String fn = (filename == null) ? "unknown" : filename;
String re = (reason == null) ? "Fatal EE error." : reason;
hostLog.fatal(re + " In " + fn + ":... | java | public static void crashVoltDB(String reason, String traces[], String filename, int lineno) {
VoltLogger hostLog = new VoltLogger("HOST");
String fn = (filename == null) ? "unknown" : filename;
String re = (reason == null) ? "Fatal EE error." : reason;
hostLog.fatal(re + " In " + fn + ":... | [
"public",
"static",
"void",
"crashVoltDB",
"(",
"String",
"reason",
",",
"String",
"traces",
"[",
"]",
",",
"String",
"filename",
",",
"int",
"lineno",
")",
"{",
"VoltLogger",
"hostLog",
"=",
"new",
"VoltLogger",
"(",
"\"HOST\"",
")",
";",
"String",
"fn",
... | Call VoltDB.crashVoltDB on behalf of the EE
@param reason Reason the EE crashed | [
"Call",
"VoltDB",
".",
"crashVoltDB",
"on",
"behalf",
"of",
"the",
"EE"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngine.java#L385-L396 | train |
VoltDB/voltdb | src/frontend/org/voltdb/jni/ExecutionEngine.java | ExecutionEngine.nextDependencyAsBytes | public byte[] nextDependencyAsBytes(final int dependencyId) {
final VoltTable vt = m_dependencyTracker.nextDependency(dependencyId);
if (vt != null) {
final ByteBuffer buf2 = PrivateVoltTableFactory.getTableDataReference(vt);
int pos = buf2.position();
byte[] bytes =... | java | public byte[] nextDependencyAsBytes(final int dependencyId) {
final VoltTable vt = m_dependencyTracker.nextDependency(dependencyId);
if (vt != null) {
final ByteBuffer buf2 = PrivateVoltTableFactory.getTableDataReference(vt);
int pos = buf2.position();
byte[] bytes =... | [
"public",
"byte",
"[",
"]",
"nextDependencyAsBytes",
"(",
"final",
"int",
"dependencyId",
")",
"{",
"final",
"VoltTable",
"vt",
"=",
"m_dependencyTracker",
".",
"nextDependency",
"(",
"dependencyId",
")",
";",
"if",
"(",
"vt",
"!=",
"null",
")",
"{",
"final"... | Called from the ExecutionEngine to request serialized dependencies. | [
"Called",
"from",
"the",
"ExecutionEngine",
"to",
"request",
"serialized",
"dependencies",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngine.java#L401-L414 | train |
VoltDB/voltdb | src/frontend/org/voltdb/jni/ExecutionEngine.java | ExecutionEngine.loadCatalog | public void loadCatalog(long timestamp, String serializedCatalog) {
try {
setupProcedure(null);
m_fragmentContext = FragmentContext.CATALOG_LOAD;
coreLoadCatalog(timestamp, getStringBytes(serializedCatalog));
}
finally {
m_fragmentContext = Fragmen... | java | public void loadCatalog(long timestamp, String serializedCatalog) {
try {
setupProcedure(null);
m_fragmentContext = FragmentContext.CATALOG_LOAD;
coreLoadCatalog(timestamp, getStringBytes(serializedCatalog));
}
finally {
m_fragmentContext = Fragmen... | [
"public",
"void",
"loadCatalog",
"(",
"long",
"timestamp",
",",
"String",
"serializedCatalog",
")",
"{",
"try",
"{",
"setupProcedure",
"(",
"null",
")",
";",
"m_fragmentContext",
"=",
"FragmentContext",
".",
"CATALOG_LOAD",
";",
"coreLoadCatalog",
"(",
"timestamp"... | Pass the catalog to the engine | [
"Pass",
"the",
"catalog",
"to",
"the",
"engine"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngine.java#L610-L619 | train |
VoltDB/voltdb | src/frontend/org/voltdb/jni/ExecutionEngine.java | ExecutionEngine.updateCatalog | public final void updateCatalog(final long timestamp, final boolean isStreamUpdate, final String diffCommands) throws EEException {
try {
setupProcedure(null);
m_fragmentContext = FragmentContext.CATALOG_UPDATE;
coreUpdateCatalog(timestamp, isStreamUpdate, diffCommands);
... | java | public final void updateCatalog(final long timestamp, final boolean isStreamUpdate, final String diffCommands) throws EEException {
try {
setupProcedure(null);
m_fragmentContext = FragmentContext.CATALOG_UPDATE;
coreUpdateCatalog(timestamp, isStreamUpdate, diffCommands);
... | [
"public",
"final",
"void",
"updateCatalog",
"(",
"final",
"long",
"timestamp",
",",
"final",
"boolean",
"isStreamUpdate",
",",
"final",
"String",
"diffCommands",
")",
"throws",
"EEException",
"{",
"try",
"{",
"setupProcedure",
"(",
"null",
")",
";",
"m_fragmentC... | Pass diffs to apply to the EE's catalog to update it | [
"Pass",
"diffs",
"to",
"apply",
"to",
"the",
"EE",
"s",
"catalog",
"to",
"update",
"it"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngine.java#L624-L633 | train |
VoltDB/voltdb | src/frontend/org/voltdb/jni/ExecutionEngine.java | ExecutionEngine.executePlanFragments | public FastDeserializer executePlanFragments(
int numFragmentIds,
long[] planFragmentIds,
long[] inputDepIds,
Object[] parameterSets,
DeterminismHash determinismHash,
String[] sqlTexts,
boolean[] isWriteFrags,
int[] sqlCRCs,... | java | public FastDeserializer executePlanFragments(
int numFragmentIds,
long[] planFragmentIds,
long[] inputDepIds,
Object[] parameterSets,
DeterminismHash determinismHash,
String[] sqlTexts,
boolean[] isWriteFrags,
int[] sqlCRCs,... | [
"public",
"FastDeserializer",
"executePlanFragments",
"(",
"int",
"numFragmentIds",
",",
"long",
"[",
"]",
"planFragmentIds",
",",
"long",
"[",
"]",
"inputDepIds",
",",
"Object",
"[",
"]",
"parameterSets",
",",
"DeterminismHash",
"determinismHash",
",",
"String",
... | Run multiple plan fragments | [
"Run",
"multiple",
"plan",
"fragments"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngine.java#L652-L709 | train |
VoltDB/voltdb | src/frontend/org/voltdb/client/VoltBulkLoader/VoltBulkLoader.java | VoltBulkLoader.setFlushInterval | public synchronized void setFlushInterval(long delay, long seconds) {
if (m_flush != null) {
m_flush.cancel(false);
m_flush = null;
}
if (seconds > 0) {
m_flush = m_ses.scheduleAtFixedRate(new Runnable() {
@Override
public void ... | java | public synchronized void setFlushInterval(long delay, long seconds) {
if (m_flush != null) {
m_flush.cancel(false);
m_flush = null;
}
if (seconds > 0) {
m_flush = m_ses.scheduleAtFixedRate(new Runnable() {
@Override
public void ... | [
"public",
"synchronized",
"void",
"setFlushInterval",
"(",
"long",
"delay",
",",
"long",
"seconds",
")",
"{",
"if",
"(",
"m_flush",
"!=",
"null",
")",
"{",
"m_flush",
".",
"cancel",
"(",
"false",
")",
";",
"m_flush",
"=",
"null",
";",
"}",
"if",
"(",
... | Set periodic flush interval and initial delay in seconds.
@param delay Initial delay in seconds
@param seconds Interval in seconds, passing <code>seconds <= 0</code> value will cancel periodic flush | [
"Set",
"periodic",
"flush",
"interval",
"and",
"initial",
"delay",
"in",
"seconds",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/client/VoltBulkLoader/VoltBulkLoader.java#L275-L292 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.close | @Override
public synchronized void close() {
if (isClosed) {
return;
}
rollback(false);
try {
database.logger.writeToLog(this, Tokens.T_DISCONNECT);
} catch (HsqlException e) {}
sessionData.closeAllNavigators();
sessionData.persiste... | java | @Override
public synchronized void close() {
if (isClosed) {
return;
}
rollback(false);
try {
database.logger.writeToLog(this, Tokens.T_DISCONNECT);
} catch (HsqlException e) {}
sessionData.closeAllNavigators();
sessionData.persiste... | [
"@",
"Override",
"public",
"synchronized",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"isClosed",
")",
"{",
"return",
";",
"}",
"rollback",
"(",
"false",
")",
";",
"try",
"{",
"database",
".",
"logger",
".",
"writeToLog",
"(",
"this",
",",
"Tokens",
... | Closes this Session. | [
"Closes",
"this",
"Session",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L231-L259 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.setIsolation | public void setIsolation(int level) {
if (isInMidTransaction()) {
throw Error.error(ErrorCode.X_25001);
}
if (level == SessionInterface.TX_READ_UNCOMMITTED) {
isReadOnly = true;
}
isolationMode = level;
if (isolationMode != isolationModeDefault... | java | public void setIsolation(int level) {
if (isInMidTransaction()) {
throw Error.error(ErrorCode.X_25001);
}
if (level == SessionInterface.TX_READ_UNCOMMITTED) {
isReadOnly = true;
}
isolationMode = level;
if (isolationMode != isolationModeDefault... | [
"public",
"void",
"setIsolation",
"(",
"int",
"level",
")",
"{",
"if",
"(",
"isInMidTransaction",
"(",
")",
")",
"{",
"throw",
"Error",
".",
"error",
"(",
"ErrorCode",
".",
"X_25001",
")",
";",
"}",
"if",
"(",
"level",
"==",
"SessionInterface",
".",
"T... | sets ISOLATION for the next transaction only | [
"sets",
"ISOLATION",
"for",
"the",
"next",
"transaction",
"only"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L294-L309 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.checkDDLWrite | void checkDDLWrite() {
checkReadWrite();
if (isProcessingScript || isProcessingLog) {
return;
}
if (database.isFilesReadOnly()) {
throw Error.error(ErrorCode.DATABASE_IS_READONLY);
}
} | java | void checkDDLWrite() {
checkReadWrite();
if (isProcessingScript || isProcessingLog) {
return;
}
if (database.isFilesReadOnly()) {
throw Error.error(ErrorCode.DATABASE_IS_READONLY);
}
} | [
"void",
"checkDDLWrite",
"(",
")",
"{",
"checkReadWrite",
"(",
")",
";",
"if",
"(",
"isProcessingScript",
"||",
"isProcessingLog",
")",
"{",
"return",
";",
"}",
"if",
"(",
"database",
".",
"isFilesReadOnly",
"(",
")",
")",
"{",
"throw",
"Error",
".",
"er... | This is used for creating new database objects such as tables.
@throws HsqlException | [
"This",
"is",
"used",
"for",
"creating",
"new",
"database",
"objects",
"such",
"as",
"tables",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L420-L431 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.addDeleteAction | void addDeleteAction(Table table, Row row) {
// tempActionHistory.add("add delete action " + actionTimestamp);
if (abortTransaction) {
// throw Error.error(ErrorCode.X_40001);
}
database.txManager.addDeleteAction(this, table, row);
} | java | void addDeleteAction(Table table, Row row) {
// tempActionHistory.add("add delete action " + actionTimestamp);
if (abortTransaction) {
// throw Error.error(ErrorCode.X_40001);
}
database.txManager.addDeleteAction(this, table, row);
} | [
"void",
"addDeleteAction",
"(",
"Table",
"table",
",",
"Row",
"row",
")",
"{",
"// tempActionHistory.add(\"add delete action \" + actionTimestamp);",
"if",
"(",
"abortTransaction",
")",
"{",
"// throw Error.error(ErrorCode.X_40001);",
"}",
"database",
".",
"... | Adds a delete action to the row and the transaction manager.
@param table the table of the row
@param row the deleted row
@throws HsqlException | [
"Adds",
"a",
"delete",
"action",
"to",
"the",
"row",
"and",
"the",
"transaction",
"manager",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L444-L453 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.setAutoCommit | @Override
public synchronized void setAutoCommit(boolean autocommit) {
if (isClosed) {
return;
}
if (autocommit != isAutoCommit) {
commit(false);
isAutoCommit = autocommit;
}
} | java | @Override
public synchronized void setAutoCommit(boolean autocommit) {
if (isClosed) {
return;
}
if (autocommit != isAutoCommit) {
commit(false);
isAutoCommit = autocommit;
}
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"setAutoCommit",
"(",
"boolean",
"autocommit",
")",
"{",
"if",
"(",
"isClosed",
")",
"{",
"return",
";",
"}",
"if",
"(",
"autocommit",
"!=",
"isAutoCommit",
")",
"{",
"commit",
"(",
"false",
")",
";",
"i... | Setter for the autocommit attribute.
@param autocommit the new value
@throws HsqlException | [
"Setter",
"for",
"the",
"autocommit",
"attribute",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L473-L485 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.commit | @Override
public synchronized void commit(boolean chain) {
// tempActionHistory.add("commit " + actionTimestamp);
if (isClosed) {
return;
}
if (!isTransaction) {
isReadOnly = isReadOnlyDefault;
isolationMode = isolationModeDefault;
... | java | @Override
public synchronized void commit(boolean chain) {
// tempActionHistory.add("commit " + actionTimestamp);
if (isClosed) {
return;
}
if (!isTransaction) {
isReadOnly = isReadOnlyDefault;
isolationMode = isolationModeDefault;
... | [
"@",
"Override",
"public",
"synchronized",
"void",
"commit",
"(",
"boolean",
"chain",
")",
"{",
"// tempActionHistory.add(\"commit \" + actionTimestamp);",
"if",
"(",
"isClosed",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"isTransaction",
")",
"{",
"isRe... | Commits any uncommited transaction this Session may have open
@throws HsqlException | [
"Commits",
"any",
"uncommited",
"transaction",
"this",
"Session",
"may",
"have",
"open"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L548-L572 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.rollback | @Override
public synchronized void rollback(boolean chain) {
// tempActionHistory.add("rollback " + actionTimestamp);
if (isClosed) {
return;
}
if (!isTransaction) {
isReadOnly = isReadOnlyDefault;
isolationMode = isolationModeDefault;
... | java | @Override
public synchronized void rollback(boolean chain) {
// tempActionHistory.add("rollback " + actionTimestamp);
if (isClosed) {
return;
}
if (!isTransaction) {
isReadOnly = isReadOnlyDefault;
isolationMode = isolationModeDefault;
... | [
"@",
"Override",
"public",
"synchronized",
"void",
"rollback",
"(",
"boolean",
"chain",
")",
"{",
"// tempActionHistory.add(\"rollback \" + actionTimestamp);",
"if",
"(",
"isClosed",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"isTransaction",
")",
"{",
"... | Rolls back any uncommited transaction this Session may have open.
@throws HsqlException | [
"Rolls",
"back",
"any",
"uncommited",
"transaction",
"this",
"Session",
"may",
"have",
"open",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L579-L600 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.savepoint | @Override
public synchronized void savepoint(String name) {
int index = sessionContext.savepoints.getIndex(name);
if (index != -1) {
sessionContext.savepoints.remove(name);
sessionContext.savepointTimestamps.remove(index);
}
sessionContext.savepoints.add(na... | java | @Override
public synchronized void savepoint(String name) {
int index = sessionContext.savepoints.getIndex(name);
if (index != -1) {
sessionContext.savepoints.remove(name);
sessionContext.savepointTimestamps.remove(index);
}
sessionContext.savepoints.add(na... | [
"@",
"Override",
"public",
"synchronized",
"void",
"savepoint",
"(",
"String",
"name",
")",
"{",
"int",
"index",
"=",
"sessionContext",
".",
"savepoints",
".",
"getIndex",
"(",
"name",
")",
";",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"sessionConte... | Registers a transaction SAVEPOINT. A new SAVEPOINT with the
name of an existing one replaces the old SAVEPOINT.
@param name name of the savepoint
@throws HsqlException if there is no current transaction | [
"Registers",
"a",
"transaction",
"SAVEPOINT",
".",
"A",
"new",
"SAVEPOINT",
"with",
"the",
"name",
"of",
"an",
"existing",
"one",
"replaces",
"the",
"old",
"SAVEPOINT",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L644-L661 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.rollbackToSavepoint | @Override
public synchronized void rollbackToSavepoint(String name) {
if (isClosed) {
return;
}
int index = sessionContext.savepoints.getIndex(name);
if (index < 0) {
throw Error.error(ErrorCode.X_3B001, name);
}
database.txManager.rollback... | java | @Override
public synchronized void rollbackToSavepoint(String name) {
if (isClosed) {
return;
}
int index = sessionContext.savepoints.getIndex(name);
if (index < 0) {
throw Error.error(ErrorCode.X_3B001, name);
}
database.txManager.rollback... | [
"@",
"Override",
"public",
"synchronized",
"void",
"rollbackToSavepoint",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"isClosed",
")",
"{",
"return",
";",
"}",
"int",
"index",
"=",
"sessionContext",
".",
"savepoints",
".",
"getIndex",
"(",
"name",
")",
";"... | Performs a partial transaction ROLLBACK to savepoint.
@param name name of savepoint
@throws HsqlException | [
"Performs",
"a",
"partial",
"transaction",
"ROLLBACK",
"to",
"savepoint",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L669-L687 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.rollbackToSavepoint | public synchronized void rollbackToSavepoint() {
if (isClosed) {
return;
}
String name = (String) sessionContext.savepoints.getKey(0);
database.txManager.rollbackSavepoint(this, 0);
try {
database.logger.writeToLog(this, getSavepointRollbackSQL(name));... | java | public synchronized void rollbackToSavepoint() {
if (isClosed) {
return;
}
String name = (String) sessionContext.savepoints.getKey(0);
database.txManager.rollbackSavepoint(this, 0);
try {
database.logger.writeToLog(this, getSavepointRollbackSQL(name));... | [
"public",
"synchronized",
"void",
"rollbackToSavepoint",
"(",
")",
"{",
"if",
"(",
"isClosed",
")",
"{",
"return",
";",
"}",
"String",
"name",
"=",
"(",
"String",
")",
"sessionContext",
".",
"savepoints",
".",
"getKey",
"(",
"0",
")",
";",
"database",
".... | Performs a partial transaction ROLLBACK of current savepoint level.
@throws HsqlException | [
"Performs",
"a",
"partial",
"transaction",
"ROLLBACK",
"of",
"current",
"savepoint",
"level",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L694-L707 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.releaseSavepoint | @Override
public synchronized void releaseSavepoint(String name) {
// remove this and all later savepoints
int index = sessionContext.savepoints.getIndex(name);
if (index < 0) {
throw Error.error(ErrorCode.X_3B001, name);
}
while (sessionContext.savepoints.size... | java | @Override
public synchronized void releaseSavepoint(String name) {
// remove this and all later savepoints
int index = sessionContext.savepoints.getIndex(name);
if (index < 0) {
throw Error.error(ErrorCode.X_3B001, name);
}
while (sessionContext.savepoints.size... | [
"@",
"Override",
"public",
"synchronized",
"void",
"releaseSavepoint",
"(",
"String",
"name",
")",
"{",
"// remove this and all later savepoints",
"int",
"index",
"=",
"sessionContext",
".",
"savepoints",
".",
"getIndex",
"(",
"name",
")",
";",
"if",
"(",
"index",... | Releases a savepoint
@param name name of savepoint
@throws HsqlException if name does not correspond to a savepoint | [
"Releases",
"a",
"savepoint"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L715-L730 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.setReadOnly | public void setReadOnly(boolean readonly) {
if (!readonly && database.databaseReadOnly) {
throw Error.error(ErrorCode.DATABASE_IS_READONLY);
}
if (isInMidTransaction()) {
throw Error.error(ErrorCode.X_25001);
}
isReadOnly = readonly;
} | java | public void setReadOnly(boolean readonly) {
if (!readonly && database.databaseReadOnly) {
throw Error.error(ErrorCode.DATABASE_IS_READONLY);
}
if (isInMidTransaction()) {
throw Error.error(ErrorCode.X_25001);
}
isReadOnly = readonly;
} | [
"public",
"void",
"setReadOnly",
"(",
"boolean",
"readonly",
")",
"{",
"if",
"(",
"!",
"readonly",
"&&",
"database",
".",
"databaseReadOnly",
")",
"{",
"throw",
"Error",
".",
"error",
"(",
"ErrorCode",
".",
"DATABASE_IS_READONLY",
")",
";",
"}",
"if",
"(",... | sets READ ONLY for next transaction only
@param readonly the new value | [
"sets",
"READ",
"ONLY",
"for",
"next",
"transaction",
"only"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L737-L748 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.executeResultUpdate | private Result executeResultUpdate(Result cmd) {
long id = cmd.getResultId();
int actionType = cmd.getActionType();
Result result = sessionData.getDataResult(id);
if (result == null) {
return Result.newErrorResult(Error.error(ErrorCode.X_24501));
}
... | java | private Result executeResultUpdate(Result cmd) {
long id = cmd.getResultId();
int actionType = cmd.getActionType();
Result result = sessionData.getDataResult(id);
if (result == null) {
return Result.newErrorResult(Error.error(ErrorCode.X_24501));
}
... | [
"private",
"Result",
"executeResultUpdate",
"(",
"Result",
"cmd",
")",
"{",
"long",
"id",
"=",
"cmd",
".",
"getResultId",
"(",
")",
";",
"int",
"actionType",
"=",
"cmd",
".",
"getActionType",
"(",
")",
";",
"Result",
"result",
"=",
"sessionData",
".",
"g... | Retrieves the result of inserting, updating or deleting a row
from an updatable result.
@return the result of executing the statement | [
"Retrieves",
"the",
"result",
"of",
"inserting",
"updating",
"or",
"deleting",
"a",
"row",
"from",
"an",
"updatable",
"result",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L1419-L1443 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.getSchemaHsqlName | HsqlName getSchemaHsqlName(String name) {
return name == null ? currentSchema
: database.schemaManager.getSchemaHsqlName(name);
} | java | HsqlName getSchemaHsqlName(String name) {
return name == null ? currentSchema
: database.schemaManager.getSchemaHsqlName(name);
} | [
"HsqlName",
"getSchemaHsqlName",
"(",
"String",
"name",
")",
"{",
"return",
"name",
"==",
"null",
"?",
"currentSchema",
":",
"database",
".",
"schemaManager",
".",
"getSchemaHsqlName",
"(",
"name",
")",
";",
"}"
] | If schemaName is null, return the current schema name, else return
the HsqlName object for the schema. If schemaName does not exist,
throw. | [
"If",
"schemaName",
"is",
"null",
"return",
"the",
"current",
"schema",
"name",
"else",
"return",
"the",
"HsqlName",
"object",
"for",
"the",
"schema",
".",
"If",
"schemaName",
"does",
"not",
"exist",
"throw",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L1817-L1820 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.getSchemaName | public String getSchemaName(String name) {
return name == null ? currentSchema.name
: database.schemaManager.getSchemaName(name);
} | java | public String getSchemaName(String name) {
return name == null ? currentSchema.name
: database.schemaManager.getSchemaName(name);
} | [
"public",
"String",
"getSchemaName",
"(",
"String",
"name",
")",
"{",
"return",
"name",
"==",
"null",
"?",
"currentSchema",
".",
"name",
":",
"database",
".",
"schemaManager",
".",
"getSchemaName",
"(",
"name",
")",
";",
"}"
] | Same as above, but return string | [
"Same",
"as",
"above",
"but",
"return",
"string"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L1825-L1828 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.defineLocalTable | public Table defineLocalTable(HsqlName tableName, HsqlName[] colNames, Type[] colTypes) {
// I'm not sure the table type, here TableBase.CACHED_TABLE, matters
// all that much.
assert(localTables != null);
Table newTable = TableUtil.newTable(database, TableBase.CACHED_TABLE, tableName);
... | java | public Table defineLocalTable(HsqlName tableName, HsqlName[] colNames, Type[] colTypes) {
// I'm not sure the table type, here TableBase.CACHED_TABLE, matters
// all that much.
assert(localTables != null);
Table newTable = TableUtil.newTable(database, TableBase.CACHED_TABLE, tableName);
... | [
"public",
"Table",
"defineLocalTable",
"(",
"HsqlName",
"tableName",
",",
"HsqlName",
"[",
"]",
"colNames",
",",
"Type",
"[",
"]",
"colTypes",
")",
"{",
"// I'm not sure the table type, here TableBase.CACHED_TABLE, matters",
"// all that much.",
"assert",
"(",
"localTable... | Define a local table with the given name, column names and column types.
@param tableName
@param colNames
@param colTypes
@return | [
"Define",
"a",
"local",
"table",
"with",
"the",
"given",
"name",
"column",
"names",
"and",
"column",
"types",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L1860-L1869 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.updateLocalTable | public void updateLocalTable(HsqlName queryName, Type[] finalTypes) {
assert(localTables != null);
Table tbl = getLocalTable(queryName.name);
assert (tbl != null);
TableUtil.updateColumnTypes(tbl, finalTypes);
} | java | public void updateLocalTable(HsqlName queryName, Type[] finalTypes) {
assert(localTables != null);
Table tbl = getLocalTable(queryName.name);
assert (tbl != null);
TableUtil.updateColumnTypes(tbl, finalTypes);
} | [
"public",
"void",
"updateLocalTable",
"(",
"HsqlName",
"queryName",
",",
"Type",
"[",
"]",
"finalTypes",
")",
"{",
"assert",
"(",
"localTables",
"!=",
"null",
")",
";",
"Table",
"tbl",
"=",
"getLocalTable",
"(",
"queryName",
".",
"name",
")",
";",
"assert"... | Update the local table with new types. This is very dubious.
@param queryName
@param finalTypes | [
"Update",
"the",
"local",
"table",
"with",
"new",
"types",
".",
"This",
"is",
"very",
"dubious",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L1884-L1889 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.logSequences | void logSequences() {
OrderedHashSet set = sessionData.sequenceUpdateSet;
if (set == null || set.isEmpty()) {
return;
}
for (int i = 0, size = set.size(); i < size; i++) {
NumberSequence sequence = (NumberSequence) set.get(i);
database.logger.write... | java | void logSequences() {
OrderedHashSet set = sessionData.sequenceUpdateSet;
if (set == null || set.isEmpty()) {
return;
}
for (int i = 0, size = set.size(); i < size; i++) {
NumberSequence sequence = (NumberSequence) set.get(i);
database.logger.write... | [
"void",
"logSequences",
"(",
")",
"{",
"OrderedHashSet",
"set",
"=",
"sessionData",
".",
"sequenceUpdateSet",
";",
"if",
"(",
"set",
"==",
"null",
"||",
"set",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
... | SEQUENCE current values | [
"SEQUENCE",
"current",
"values"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L2016-L2031 | train |
VoltDB/voltdb | src/frontend/org/voltdb/compiler/CatalogBuilder.java | CatalogBuilder.addLiteralSchema | public void addLiteralSchema(String ddlText) throws IOException {
File temp = File.createTempFile("literalschema", "sql");
temp.deleteOnExit();
FileWriter out = new FileWriter(temp);
out.write(ddlText);
out.close();
addSchema(URLEncoder.encode(temp.getAbsolutePath(), "UTF... | java | public void addLiteralSchema(String ddlText) throws IOException {
File temp = File.createTempFile("literalschema", "sql");
temp.deleteOnExit();
FileWriter out = new FileWriter(temp);
out.write(ddlText);
out.close();
addSchema(URLEncoder.encode(temp.getAbsolutePath(), "UTF... | [
"public",
"void",
"addLiteralSchema",
"(",
"String",
"ddlText",
")",
"throws",
"IOException",
"{",
"File",
"temp",
"=",
"File",
".",
"createTempFile",
"(",
"\"literalschema\"",
",",
"\"sql\"",
")",
";",
"temp",
".",
"deleteOnExit",
"(",
")",
";",
"FileWriter",... | This is test code written by Ryan, even though it was
committed by John. | [
"This",
"is",
"test",
"code",
"written",
"by",
"Ryan",
"even",
"though",
"it",
"was",
"committed",
"by",
"John",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/CatalogBuilder.java#L150-L157 | train |
VoltDB/voltdb | src/frontend/org/voltdb/compiler/CatalogBuilder.java | CatalogBuilder.addSchema | public void addSchema(String schemaURL) {
try {
schemaURL = URLDecoder.decode(schemaURL, "UTF-8");
} catch (final UnsupportedEncodingException e) {
e.printStackTrace();
System.exit(-1);
}
assert(m_schemas.contains(schemaURL) == false);
final Fi... | java | public void addSchema(String schemaURL) {
try {
schemaURL = URLDecoder.decode(schemaURL, "UTF-8");
} catch (final UnsupportedEncodingException e) {
e.printStackTrace();
System.exit(-1);
}
assert(m_schemas.contains(schemaURL) == false);
final Fi... | [
"public",
"void",
"addSchema",
"(",
"String",
"schemaURL",
")",
"{",
"try",
"{",
"schemaURL",
"=",
"URLDecoder",
".",
"decode",
"(",
"schemaURL",
",",
"\"UTF-8\"",
")",
";",
"}",
"catch",
"(",
"final",
"UnsupportedEncodingException",
"e",
")",
"{",
"e",
".... | Add a schema based on a URL.
@param schemaURL Schema file URL | [
"Add",
"a",
"schema",
"based",
"on",
"a",
"URL",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/CatalogBuilder.java#L163-L179 | train |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/ExpressionUtil.java | ExpressionUtil.isParameterized | private static boolean isParameterized(VoltXMLElement elm) {
final String name = elm.name;
if (name.equals("value")) {
return elm.getBoolAttribute("isparam", false);
} else if (name.equals("vector") || name.equals("row")) {
return elm.children.stream().anyMatch(Expression... | java | private static boolean isParameterized(VoltXMLElement elm) {
final String name = elm.name;
if (name.equals("value")) {
return elm.getBoolAttribute("isparam", false);
} else if (name.equals("vector") || name.equals("row")) {
return elm.children.stream().anyMatch(Expression... | [
"private",
"static",
"boolean",
"isParameterized",
"(",
"VoltXMLElement",
"elm",
")",
"{",
"final",
"String",
"name",
"=",
"elm",
".",
"name",
";",
"if",
"(",
"name",
".",
"equals",
"(",
"\"value\"",
")",
")",
"{",
"return",
"elm",
".",
"getBoolAttribute",... | Helper to check if a VoltXMLElement contains parameter.
@param elm element under inspection
@return if elm contains parameter | [
"Helper",
"to",
"check",
"if",
"a",
"VoltXMLElement",
"contains",
"parameter",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L72-L112 | train |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/ExpressionUtil.java | ExpressionUtil.getType | private static String getType(Database db, VoltXMLElement elm) {
final String type = elm.getStringAttribute("valuetype", "");
if (! type.isEmpty()) {
return type;
} else if (elm.name.equals("columnref")) {
final String tblName = elm.getStringAttribute("table", "");
... | java | private static String getType(Database db, VoltXMLElement elm) {
final String type = elm.getStringAttribute("valuetype", "");
if (! type.isEmpty()) {
return type;
} else if (elm.name.equals("columnref")) {
final String tblName = elm.getStringAttribute("table", "");
... | [
"private",
"static",
"String",
"getType",
"(",
"Database",
"db",
",",
"VoltXMLElement",
"elm",
")",
"{",
"final",
"String",
"type",
"=",
"elm",
".",
"getStringAttribute",
"(",
"\"valuetype\"",
",",
"\"\"",
")",
";",
"if",
"(",
"!",
"type",
".",
"isEmpty",
... | Get the underlying type of the VoltXMLElement node. Need reference to the catalog for PVE
@param db catalog
@param elm element under inspection
@return string representation of the element node | [
"Get",
"the",
"underlying",
"type",
"of",
"the",
"VoltXMLElement",
"node",
".",
"Need",
"reference",
"to",
"the",
"catalog",
"for",
"PVE"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L120-L140 | train |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/ExpressionUtil.java | ExpressionUtil.guessParameterType | private static String guessParameterType(Database db, VoltXMLElement elm) {
if (! isParameterized(elm) || ! elm.name.equals("operation")) {
return "";
} else {
final ExpressionType op = mapOfVoltXMLOpType.get(elm.attributes.get("optype"));
assert op != null;
... | java | private static String guessParameterType(Database db, VoltXMLElement elm) {
if (! isParameterized(elm) || ! elm.name.equals("operation")) {
return "";
} else {
final ExpressionType op = mapOfVoltXMLOpType.get(elm.attributes.get("optype"));
assert op != null;
... | [
"private",
"static",
"String",
"guessParameterType",
"(",
"Database",
"db",
",",
"VoltXMLElement",
"elm",
")",
"{",
"if",
"(",
"!",
"isParameterized",
"(",
"elm",
")",
"||",
"!",
"elm",
".",
"name",
".",
"equals",
"(",
"\"operation\"",
")",
")",
"{",
"re... | Guess from a parent node what are the parameter type of its child node, should one of its child node
contain parameter.
@param db catalog
@param elm node under inspection
@return string representation of the type of its child node. | [
"Guess",
"from",
"a",
"parent",
"node",
"what",
"are",
"the",
"parameter",
"type",
"of",
"its",
"child",
"node",
"should",
"one",
"of",
"its",
"child",
"node",
"contain",
"parameter",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ExpressionUtil.java#L149-L185 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.