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/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java | Log.processScript | private void processScript() {
ScriptReaderBase scr = null;
try {
if (database.isFilesInJar()
|| fa.isStreamElement(scriptFileName)) {
scr = ScriptReaderBase.newScriptReader(database,
scriptFileName,... | java | private void processScript() {
ScriptReaderBase scr = null;
try {
if (database.isFilesInJar()
|| fa.isStreamElement(scriptFileName)) {
scr = ScriptReaderBase.newScriptReader(database,
scriptFileName,... | [
"private",
"void",
"processScript",
"(",
")",
"{",
"ScriptReaderBase",
"scr",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"database",
".",
"isFilesInJar",
"(",
")",
"||",
"fa",
".",
"isStreamElement",
"(",
"scriptFileName",
")",
")",
"{",
"scr",
"=",
"Scrip... | Performs all the commands in the .script file. | [
"Performs",
"all",
"the",
"commands",
"in",
"the",
".",
"script",
"file",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java#L768-L808 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java | Log.processDataFile | private void processDataFile() {
// OOo related code
if (database.isStoredFileAccess()) {
return;
}
// OOo end
if (cache == null || filesReadOnly
|| !fa.isStreamElement(logFileName)) {
return;
}
File file = new File... | java | private void processDataFile() {
// OOo related code
if (database.isStoredFileAccess()) {
return;
}
// OOo end
if (cache == null || filesReadOnly
|| !fa.isStreamElement(logFileName)) {
return;
}
File file = new File... | [
"private",
"void",
"processDataFile",
"(",
")",
"{",
"// OOo related code",
"if",
"(",
"database",
".",
"isStoredFileAccess",
"(",
")",
")",
"{",
"return",
";",
"}",
"// OOo end",
"if",
"(",
"cache",
"==",
"null",
"||",
"filesReadOnly",
"||",
"!",
"fa",
".... | Defrag large data files when the sum of .log and .data files is large. | [
"Defrag",
"large",
"data",
"files",
"when",
"the",
"sum",
"of",
".",
"log",
"and",
".",
"data",
"files",
"is",
"large",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java#L813-L833 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java | Log.processLog | private void processLog() {
if (!database.isFilesInJar() && fa.isStreamElement(logFileName)) {
ScriptRunner.runScript(database, logFileName,
ScriptWriterBase.SCRIPT_TEXT_170);
}
} | java | private void processLog() {
if (!database.isFilesInJar() && fa.isStreamElement(logFileName)) {
ScriptRunner.runScript(database, logFileName,
ScriptWriterBase.SCRIPT_TEXT_170);
}
} | [
"private",
"void",
"processLog",
"(",
")",
"{",
"if",
"(",
"!",
"database",
".",
"isFilesInJar",
"(",
")",
"&&",
"fa",
".",
"isStreamElement",
"(",
"logFileName",
")",
")",
"{",
"ScriptRunner",
".",
"runScript",
"(",
"database",
",",
"logFileName",
",",
... | Performs all the commands in the .log file. | [
"Performs",
"all",
"the",
"commands",
"in",
"the",
".",
"log",
"file",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java#L838-L844 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java | Log.restoreBackup | private void restoreBackup() {
if (incBackup) {
restoreBackupIncremental();
return;
}
// in case data file cannot be deleted, reset it
DataFileCache.deleteOrResetFreePos(database, fileName + ".data");
try {
FileArchiver.unarchive(fileName +... | java | private void restoreBackup() {
if (incBackup) {
restoreBackupIncremental();
return;
}
// in case data file cannot be deleted, reset it
DataFileCache.deleteOrResetFreePos(database, fileName + ".data");
try {
FileArchiver.unarchive(fileName +... | [
"private",
"void",
"restoreBackup",
"(",
")",
"{",
"if",
"(",
"incBackup",
")",
"{",
"restoreBackupIncremental",
"(",
")",
";",
"return",
";",
"}",
"// in case data file cannot be deleted, reset it",
"DataFileCache",
".",
"deleteOrResetFreePos",
"(",
"database",
",",
... | Restores a compressed backup or the .data file. | [
"Restores",
"a",
"compressed",
"backup",
"or",
"the",
".",
"data",
"file",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java#L849-L870 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java | Log.restoreBackupIncremental | private void restoreBackupIncremental() {
try {
if (fa.isStreamElement(fileName + ".backup")) {
RAShadowFile.restoreFile(fileName + ".backup",
fileName + ".data");
} else {
/*
// this is to ensure file has been wri... | java | private void restoreBackupIncremental() {
try {
if (fa.isStreamElement(fileName + ".backup")) {
RAShadowFile.restoreFile(fileName + ".backup",
fileName + ".data");
} else {
/*
// this is to ensure file has been wri... | [
"private",
"void",
"restoreBackupIncremental",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"fa",
".",
"isStreamElement",
"(",
"fileName",
"+",
"\".backup\"",
")",
")",
"{",
"RAShadowFile",
".",
"restoreFile",
"(",
"fileName",
"+",
"\".backup\"",
",",
"fileName",
"... | Restores in from an incremental backup | [
"Restores",
"in",
"from",
"an",
"incremental",
"backup"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java#L875-L900 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/MpInitiator.java | MpInitiator.updateCatalog | public void updateCatalog(String diffCmds, CatalogContext context, boolean isReplay,
boolean requireCatalogDiffCmdsApplyToEE, boolean requiresNewExportGeneration)
{
// note this will never require snapshot isolation because the MPI has no snapshot funtionality
m_executionSite.updateCatal... | java | public void updateCatalog(String diffCmds, CatalogContext context, boolean isReplay,
boolean requireCatalogDiffCmdsApplyToEE, boolean requiresNewExportGeneration)
{
// note this will never require snapshot isolation because the MPI has no snapshot funtionality
m_executionSite.updateCatal... | [
"public",
"void",
"updateCatalog",
"(",
"String",
"diffCmds",
",",
"CatalogContext",
"context",
",",
"boolean",
"isReplay",
",",
"boolean",
"requireCatalogDiffCmdsApplyToEE",
",",
"boolean",
"requiresNewExportGeneration",
")",
"{",
"// note this will never require snapshot is... | Update the MPI's Site's catalog. Unlike the SPI, this is not going to
run from the same Site's thread; this is actually going to run from some
other local SPI's Site thread. Since the MPI's site thread is going to
be blocked running the EveryPartitionTask for the catalog update, this
is currently safe with no locking... | [
"Update",
"the",
"MPI",
"s",
"Site",
"s",
"catalog",
".",
"Unlike",
"the",
"SPI",
"this",
"is",
"not",
"going",
"to",
"run",
"from",
"the",
"same",
"Site",
"s",
"thread",
";",
"this",
"is",
"actually",
"going",
"to",
"run",
"from",
"some",
"other",
"... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/MpInitiator.java#L216-L223 | train |
VoltDB/voltdb | src/frontend/org/voltdb/AbstractTopology.java | AbstractTopology.mutateAddNewHosts | public static Pair<AbstractTopology, ImmutableList<Integer>> mutateAddNewHosts(AbstractTopology currentTopology,
Map<Integer, HostInfo> newHostInfos) {
int startingPartitionId = getNextFreePartitionId(currentTopology);
TopologyBuilder topologyBuilder = addPartitionsToHosts(newHostInfos, Col... | java | public static Pair<AbstractTopology, ImmutableList<Integer>> mutateAddNewHosts(AbstractTopology currentTopology,
Map<Integer, HostInfo> newHostInfos) {
int startingPartitionId = getNextFreePartitionId(currentTopology);
TopologyBuilder topologyBuilder = addPartitionsToHosts(newHostInfos, Col... | [
"public",
"static",
"Pair",
"<",
"AbstractTopology",
",",
"ImmutableList",
"<",
"Integer",
">",
">",
"mutateAddNewHosts",
"(",
"AbstractTopology",
"currentTopology",
",",
"Map",
"<",
"Integer",
",",
"HostInfo",
">",
"newHostInfos",
")",
"{",
"int",
"startingPartit... | Add new hosts to an existing topology and layout partitions on those hosts
@param currentTopology to extend
@param newHostInfos new hosts to add to topology
@return update {@link AbstractTopology} with new hosts and {@link ImmutableList} of new partition IDs
@throws RuntimeException if hosts are not valid for topol... | [
"Add",
"new",
"hosts",
"to",
"an",
"existing",
"topology",
"and",
"layout",
"partitions",
"on",
"those",
"hosts"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/AbstractTopology.java#L923-L936 | train |
VoltDB/voltdb | src/frontend/org/voltdb/AbstractTopology.java | AbstractTopology.mutateRemoveHosts | public static Pair<AbstractTopology, Set<Integer>> mutateRemoveHosts(AbstractTopology currentTopology,
Set<Integer> removalHosts) {
Set<Integer> removalPartitionIds = getPartitionIdsForHosts(currentTopology, removalHosts);
return ... | java | public static Pair<AbstractTopology, Set<Integer>> mutateRemoveHosts(AbstractTopology currentTopology,
Set<Integer> removalHosts) {
Set<Integer> removalPartitionIds = getPartitionIdsForHosts(currentTopology, removalHosts);
return ... | [
"public",
"static",
"Pair",
"<",
"AbstractTopology",
",",
"Set",
"<",
"Integer",
">",
">",
"mutateRemoveHosts",
"(",
"AbstractTopology",
"currentTopology",
",",
"Set",
"<",
"Integer",
">",
"removalHosts",
")",
"{",
"Set",
"<",
"Integer",
">",
"removalPartitionId... | Remove hosts from an existing topology
@param currentTopology to extend
@param removalHostInfos hosts to be removed from topology
@return update {@link AbstractTopology} with remaining hosts and removed partition IDs
@throws RuntimeException if hosts are not valid for topology | [
"Remove",
"hosts",
"from",
"an",
"existing",
"topology"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/AbstractTopology.java#L946-L950 | train |
VoltDB/voltdb | src/frontend/org/voltdb/AbstractTopology.java | AbstractTopology.getPartitionGroupPeers | public Set<Integer> getPartitionGroupPeers(int hostId) {
Set<Integer> peers = Sets.newHashSet();
for (Partition p : hostsById.get(hostId).partitions) {
peers.addAll(p.hostIds);
}
return peers;
} | java | public Set<Integer> getPartitionGroupPeers(int hostId) {
Set<Integer> peers = Sets.newHashSet();
for (Partition p : hostsById.get(hostId).partitions) {
peers.addAll(p.hostIds);
}
return peers;
} | [
"public",
"Set",
"<",
"Integer",
">",
"getPartitionGroupPeers",
"(",
"int",
"hostId",
")",
"{",
"Set",
"<",
"Integer",
">",
"peers",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
"for",
"(",
"Partition",
"p",
":",
"hostsById",
".",
"get",
"(",
"hostId... | get all the hostIds in the partition group where the host with the given host id belongs
@param hostId the given hostId
@return all the hostIds in the partition group | [
"get",
"all",
"the",
"hostIds",
"in",
"the",
"partition",
"group",
"where",
"the",
"host",
"with",
"the",
"given",
"host",
"id",
"belongs"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/AbstractTopology.java#L1393-L1399 | train |
VoltDB/voltdb | src/frontend/org/voltdb/AbstractTopology.java | AbstractTopology.sortHostIdByHGDistance | public static List<Collection<Integer>> sortHostIdByHGDistance(int hostId, Map<Integer, String> hostGroups) {
String localHostGroup = hostGroups.get(hostId);
Preconditions.checkArgument(localHostGroup != null);
HAGroup localHaGroup = new HAGroup(localHostGroup);
// Memorize the distanc... | java | public static List<Collection<Integer>> sortHostIdByHGDistance(int hostId, Map<Integer, String> hostGroups) {
String localHostGroup = hostGroups.get(hostId);
Preconditions.checkArgument(localHostGroup != null);
HAGroup localHaGroup = new HAGroup(localHostGroup);
// Memorize the distanc... | [
"public",
"static",
"List",
"<",
"Collection",
"<",
"Integer",
">",
">",
"sortHostIdByHGDistance",
"(",
"int",
"hostId",
",",
"Map",
"<",
"Integer",
",",
"String",
">",
"hostGroups",
")",
"{",
"String",
"localHostGroup",
"=",
"hostGroups",
".",
"get",
"(",
... | Sort all nodes in reverse hostGroup distance order, then group by rack-aware group, local host id is excluded.
@param hostId the local host id
@param hostGroups a host id to group map
@return sorted grouped host ids from farthest to nearest | [
"Sort",
"all",
"nodes",
"in",
"reverse",
"hostGroup",
"distance",
"order",
"then",
"group",
"by",
"rack",
"-",
"aware",
"group",
"local",
"host",
"id",
"is",
"excluded",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/AbstractTopology.java#L1435-L1452 | train |
VoltDB/voltdb | src/frontend/org/voltdb/importer/ImporterStatsCollector.java | ImporterStatsCollector.reportQueued | public void reportQueued(String importerName, String procName) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
statsInfo.m_pendingCount.incrementAndGet();
} | java | public void reportQueued(String importerName, String procName) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
statsInfo.m_pendingCount.incrementAndGet();
} | [
"public",
"void",
"reportQueued",
"(",
"String",
"importerName",
",",
"String",
"procName",
")",
"{",
"StatsInfo",
"statsInfo",
"=",
"getStatsInfo",
"(",
"importerName",
",",
"procName",
")",
";",
"statsInfo",
".",
"m_pendingCount",
".",
"incrementAndGet",
"(",
... | An insert request was queued | [
"An",
"insert",
"request",
"was",
"queued"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ImporterStatsCollector.java#L74-L77 | train |
VoltDB/voltdb | src/frontend/org/voltdb/importer/ImporterStatsCollector.java | ImporterStatsCollector.reportFailure | public void reportFailure(String importerName, String procName, boolean decrementPending) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
if (decrementPending) {
statsInfo.m_pendingCount.decrementAndGet();
}
statsInfo.m_failureCount.incrementAndGet();
} | java | public void reportFailure(String importerName, String procName, boolean decrementPending) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
if (decrementPending) {
statsInfo.m_pendingCount.decrementAndGet();
}
statsInfo.m_failureCount.incrementAndGet();
} | [
"public",
"void",
"reportFailure",
"(",
"String",
"importerName",
",",
"String",
"procName",
",",
"boolean",
"decrementPending",
")",
"{",
"StatsInfo",
"statsInfo",
"=",
"getStatsInfo",
"(",
"importerName",
",",
"procName",
")",
";",
"if",
"(",
"decrementPending",... | Use this when the insert fails even before the request is queued by the InternalConnectionHandler | [
"Use",
"this",
"when",
"the",
"insert",
"fails",
"even",
"before",
"the",
"request",
"is",
"queued",
"by",
"the",
"InternalConnectionHandler"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ImporterStatsCollector.java#L85-L91 | train |
VoltDB/voltdb | src/frontend/org/voltdb/importer/ImporterStatsCollector.java | ImporterStatsCollector.reportSuccess | private void reportSuccess(String importerName, String procName) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
statsInfo.m_pendingCount.decrementAndGet();
statsInfo.m_successCount.incrementAndGet();
} | java | private void reportSuccess(String importerName, String procName) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
statsInfo.m_pendingCount.decrementAndGet();
statsInfo.m_successCount.incrementAndGet();
} | [
"private",
"void",
"reportSuccess",
"(",
"String",
"importerName",
",",
"String",
"procName",
")",
"{",
"StatsInfo",
"statsInfo",
"=",
"getStatsInfo",
"(",
"importerName",
",",
"procName",
")",
";",
"statsInfo",
".",
"m_pendingCount",
".",
"decrementAndGet",
"(",
... | One insert succeeded | [
"One",
"insert",
"succeeded"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ImporterStatsCollector.java#L99-L103 | train |
VoltDB/voltdb | src/frontend/org/voltdb/importer/ImporterStatsCollector.java | ImporterStatsCollector.reportRetry | private void reportRetry(String importerName, String procName) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
statsInfo.m_retryCount.incrementAndGet();
} | java | private void reportRetry(String importerName, String procName) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
statsInfo.m_retryCount.incrementAndGet();
} | [
"private",
"void",
"reportRetry",
"(",
"String",
"importerName",
",",
"String",
"procName",
")",
"{",
"StatsInfo",
"statsInfo",
"=",
"getStatsInfo",
"(",
"importerName",
",",
"procName",
")",
";",
"statsInfo",
".",
"m_retryCount",
".",
"incrementAndGet",
"(",
")... | One insert was retried | [
"One",
"insert",
"was",
"retried"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ImporterStatsCollector.java#L106-L109 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/tar/TarFileOutputStream.java | TarFileOutputStream.writeBlock | public void writeBlock(byte[] block) throws IOException {
if (block.length != 512) {
throw new IllegalArgumentException(
RB.singleton.getString(RB.BAD_BLOCK_WRITE_LEN, block.length));
}
write(block, block.length);
} | java | public void writeBlock(byte[] block) throws IOException {
if (block.length != 512) {
throw new IllegalArgumentException(
RB.singleton.getString(RB.BAD_BLOCK_WRITE_LEN, block.length));
}
write(block, block.length);
} | [
"public",
"void",
"writeBlock",
"(",
"byte",
"[",
"]",
"block",
")",
"throws",
"IOException",
"{",
"if",
"(",
"block",
".",
"length",
"!=",
"512",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"RB",
".",
"singleton",
".",
"getString",
"(",
"... | Write a user-specified 512-byte block.
For efficiency, write(int) should be used when writing file body content.
@see #write(int) | [
"Write",
"a",
"user",
"-",
"specified",
"512",
"-",
"byte",
"block",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/tar/TarFileOutputStream.java#L219-L227 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/tar/TarFileOutputStream.java | TarFileOutputStream.writePadBlocks | public void writePadBlocks(int blockCount) throws IOException {
for (int i = 0; i < blockCount; i++) {
write(ZERO_BLOCK, ZERO_BLOCK.length);
}
} | java | public void writePadBlocks(int blockCount) throws IOException {
for (int i = 0; i < blockCount; i++) {
write(ZERO_BLOCK, ZERO_BLOCK.length);
}
} | [
"public",
"void",
"writePadBlocks",
"(",
"int",
"blockCount",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"blockCount",
";",
"i",
"++",
")",
"{",
"write",
"(",
"ZERO_BLOCK",
",",
"ZERO_BLOCK",
".",
"length",
")",... | Writes the specified quantity of zero'd blocks. | [
"Writes",
"the",
"specified",
"quantity",
"of",
"zero",
"d",
"blocks",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/tar/TarFileOutputStream.java#L232-L237 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java | ZaurusEditor.getAllTables | private Vector getAllTables() {
Vector result = new Vector(20);
try {
if (cConn == null) {
return null;
}
dbmeta = cConn.getMetaData();
String[] tableTypes = { "TABLE" };
ResultSet allTables = dbmeta.getTables(null, null, nu... | java | private Vector getAllTables() {
Vector result = new Vector(20);
try {
if (cConn == null) {
return null;
}
dbmeta = cConn.getMetaData();
String[] tableTypes = { "TABLE" };
ResultSet allTables = dbmeta.getTables(null, null, nu... | [
"private",
"Vector",
"getAllTables",
"(",
")",
"{",
"Vector",
"result",
"=",
"new",
"Vector",
"(",
"20",
")",
";",
"try",
"{",
"if",
"(",
"cConn",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"dbmeta",
"=",
"cConn",
".",
"getMetaData",
"(",
... | exclude tables without primary key | [
"exclude",
"tables",
"without",
"primary",
"key"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java#L572-L607 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java | ZaurusEditor.getChoosenTableIndex | private int getChoosenTableIndex() {
String tableName = cTables.getSelectedItem();
// System.out.println("in getChoosenTableIndex, selected Item is "+tableName);
int index = getTableIndex(tableName);
if (index >= 0) {
// System.out.println("table found, index: " + index);... | java | private int getChoosenTableIndex() {
String tableName = cTables.getSelectedItem();
// System.out.println("in getChoosenTableIndex, selected Item is "+tableName);
int index = getTableIndex(tableName);
if (index >= 0) {
// System.out.println("table found, index: " + index);... | [
"private",
"int",
"getChoosenTableIndex",
"(",
")",
"{",
"String",
"tableName",
"=",
"cTables",
".",
"getSelectedItem",
"(",
")",
";",
"// System.out.println(\"in getChoosenTableIndex, selected Item is \"+tableName);",
"int",
"index",
"=",
"getTableIndex",
"(",
"tableName",... | if the table name is not in vHoldTableNames, create a ZaurusTableForm for it | [
"if",
"the",
"table",
"name",
"is",
"not",
"in",
"vHoldTableNames",
"create",
"a",
"ZaurusTableForm",
"for",
"it"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java#L611-L632 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java | ZaurusEditor.getTableIndex | private int getTableIndex(String tableName) {
int index;
// System.out.println("begin searching for "+tableName);
for (index = 0; index < vHoldTableNames.size(); index++) {
// System.out.println("in getTableIndex searching for "+tableName+", index: "+index);
if (tableN... | java | private int getTableIndex(String tableName) {
int index;
// System.out.println("begin searching for "+tableName);
for (index = 0; index < vHoldTableNames.size(); index++) {
// System.out.println("in getTableIndex searching for "+tableName+", index: "+index);
if (tableN... | [
"private",
"int",
"getTableIndex",
"(",
"String",
"tableName",
")",
"{",
"int",
"index",
";",
"// System.out.println(\"begin searching for \"+tableName);",
"for",
"(",
"index",
"=",
"0",
";",
"index",
"<",
"vHoldTableNames",
".",
"size",
"(",
")",
";",
"index",
... | if the name is not in vHoldTableNames, answer -1 | [
"if",
"the",
"name",
"is",
"not",
"in",
"vHoldTableNames",
"answer",
"-",
"1"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java#L636-L650 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java | ZaurusEditor.getWords | private String[] getWords() {
StringTokenizer tokenizer =
new StringTokenizer(fSearchWords.getText());
String[] result = new String[tokenizer.countTokens()];
int i = 0;
while (tokenizer.hasMoreTokens()) {
result[i++] = tokenizer.nextToken();
} ... | java | private String[] getWords() {
StringTokenizer tokenizer =
new StringTokenizer(fSearchWords.getText());
String[] result = new String[tokenizer.countTokens()];
int i = 0;
while (tokenizer.hasMoreTokens()) {
result[i++] = tokenizer.nextToken();
} ... | [
"private",
"String",
"[",
"]",
"getWords",
"(",
")",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"fSearchWords",
".",
"getText",
"(",
")",
")",
";",
"String",
"[",
"]",
"result",
"=",
"new",
"String",
"[",
"tokenizer",
".",
"... | convert the search words in the textfield to an array of words | [
"convert",
"the",
"search",
"words",
"in",
"the",
"textfield",
"to",
"an",
"array",
"of",
"words"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java#L653-L665 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java | ZaurusEditor.initButtons | private void initButtons() {
// the buttons for the search form
bSearchRow = new Button("Search Rows");
bNewRow = new Button("Insert New Row");
bSearchRow.addActionListener(this);
bNewRow.addActionListener(this);
pSearchButs = new Panel();
pSearchButs.setLa... | java | private void initButtons() {
// the buttons for the search form
bSearchRow = new Button("Search Rows");
bNewRow = new Button("Insert New Row");
bSearchRow.addActionListener(this);
bNewRow.addActionListener(this);
pSearchButs = new Panel();
pSearchButs.setLa... | [
"private",
"void",
"initButtons",
"(",
")",
"{",
"// the buttons for the search form",
"bSearchRow",
"=",
"new",
"Button",
"(",
"\"Search Rows\"",
")",
";",
"bNewRow",
"=",
"new",
"Button",
"(",
"\"Insert New Row\"",
")",
";",
"bSearchRow",
".",
"addActionListener",... | init the three boxes for buttons | [
"init",
"the",
"three",
"boxes",
"for",
"buttons"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java#L668-L721 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java | ZaurusEditor.resetTableForms | private void resetTableForms() {
lForm.show(pForm, "search");
lButton.show(pButton, "search");
Vector vAllTables = getAllTables();
// fill the drop down list again
// get all table names and show a drop down list of them in cTables
cTables.removeAll();
for (En... | java | private void resetTableForms() {
lForm.show(pForm, "search");
lButton.show(pButton, "search");
Vector vAllTables = getAllTables();
// fill the drop down list again
// get all table names and show a drop down list of them in cTables
cTables.removeAll();
for (En... | [
"private",
"void",
"resetTableForms",
"(",
")",
"{",
"lForm",
".",
"show",
"(",
"pForm",
",",
"\"search\"",
")",
";",
"lButton",
".",
"show",
"(",
"pButton",
",",
"\"search\"",
")",
";",
"Vector",
"vAllTables",
"=",
"getAllTables",
"(",
")",
";",
"// fil... | reset everything after changes in the database | [
"reset",
"everything",
"after",
"changes",
"in",
"the",
"database"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/ZaurusEditor.java#L735-L758 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/ParsedUnionStmt.java | ParsedUnionStmt.getLeftmostSelectStmt | private ParsedSelectStmt getLeftmostSelectStmt() {
assert (!m_children.isEmpty());
AbstractParsedStmt firstChild = m_children.get(0);
if (firstChild instanceof ParsedSelectStmt) {
return (ParsedSelectStmt) firstChild;
} else {
assert(firstChild instanceof ParsedUn... | java | private ParsedSelectStmt getLeftmostSelectStmt() {
assert (!m_children.isEmpty());
AbstractParsedStmt firstChild = m_children.get(0);
if (firstChild instanceof ParsedSelectStmt) {
return (ParsedSelectStmt) firstChild;
} else {
assert(firstChild instanceof ParsedUn... | [
"private",
"ParsedSelectStmt",
"getLeftmostSelectStmt",
"(",
")",
"{",
"assert",
"(",
"!",
"m_children",
".",
"isEmpty",
"(",
")",
")",
";",
"AbstractParsedStmt",
"firstChild",
"=",
"m_children",
".",
"get",
"(",
"0",
")",
";",
"if",
"(",
"firstChild",
"inst... | Return the leftmost child SELECT statement
@return ParsedSelectStmt | [
"Return",
"the",
"leftmost",
"child",
"SELECT",
"statement"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/ParsedUnionStmt.java#L353-L362 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/ParsedUnionStmt.java | ParsedUnionStmt.calculateContentDeterminismMessage | @Override
public String calculateContentDeterminismMessage() {
String ans = null;
for (AbstractParsedStmt child : m_children) {
ans = child.getContentDeterminismMessage();
if (ans != null) {
return ans;
}
}
return null;
} | java | @Override
public String calculateContentDeterminismMessage() {
String ans = null;
for (AbstractParsedStmt child : m_children) {
ans = child.getContentDeterminismMessage();
if (ans != null) {
return ans;
}
}
return null;
} | [
"@",
"Override",
"public",
"String",
"calculateContentDeterminismMessage",
"(",
")",
"{",
"String",
"ans",
"=",
"null",
";",
"for",
"(",
"AbstractParsedStmt",
"child",
":",
"m_children",
")",
"{",
"ans",
"=",
"child",
".",
"getContentDeterminismMessage",
"(",
")... | Here we search all the children, finding if each is content
deterministic. If it is we return right away. | [
"Here",
"we",
"search",
"all",
"the",
"children",
"finding",
"if",
"each",
"is",
"content",
"deterministic",
".",
"If",
"it",
"is",
"we",
"return",
"right",
"away",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/ParsedUnionStmt.java#L477-L487 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java | FileTxnLog.rollLog | public synchronized void rollLog() throws IOException {
if (logStream != null) {
this.logStream.flush();
this.logStream = null;
oa = null;
}
} | java | public synchronized void rollLog() throws IOException {
if (logStream != null) {
this.logStream.flush();
this.logStream = null;
oa = null;
}
} | [
"public",
"synchronized",
"void",
"rollLog",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"logStream",
"!=",
"null",
")",
"{",
"this",
".",
"logStream",
".",
"flush",
"(",
")",
";",
"this",
".",
"logStream",
"=",
"null",
";",
"oa",
"=",
"null",
... | rollover the current log file to a new one.
@throws IOException | [
"rollover",
"the",
"current",
"log",
"file",
"to",
"a",
"new",
"one",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java#L163-L169 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java | FileTxnLog.close | public synchronized void close() throws IOException {
if (logStream != null) {
logStream.close();
}
for (FileOutputStream log : streamsToFlush) {
log.close();
}
} | java | public synchronized void close() throws IOException {
if (logStream != null) {
logStream.close();
}
for (FileOutputStream log : streamsToFlush) {
log.close();
}
} | [
"public",
"synchronized",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"logStream",
"!=",
"null",
")",
"{",
"logStream",
".",
"close",
"(",
")",
";",
"}",
"for",
"(",
"FileOutputStream",
"log",
":",
"streamsToFlush",
")",
"{",
"log... | close all the open file handles
@throws IOException | [
"close",
"all",
"the",
"open",
"file",
"handles"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java#L175-L182 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java | FileTxnLog.append | public synchronized boolean append(TxnHeader hdr, Record txn)
throws IOException
{
if (hdr != null) {
if (hdr.getZxid() <= lastZxidSeen) {
LOG.warn("Current zxid " + hdr.getZxid()
+ " is <= " + lastZxidSeen + " for "
+ hdr.g... | java | public synchronized boolean append(TxnHeader hdr, Record txn)
throws IOException
{
if (hdr != null) {
if (hdr.getZxid() <= lastZxidSeen) {
LOG.warn("Current zxid " + hdr.getZxid()
+ " is <= " + lastZxidSeen + " for "
+ hdr.g... | [
"public",
"synchronized",
"boolean",
"append",
"(",
"TxnHeader",
"hdr",
",",
"Record",
"txn",
")",
"throws",
"IOException",
"{",
"if",
"(",
"hdr",
"!=",
"null",
")",
"{",
"if",
"(",
"hdr",
".",
"getZxid",
"(",
")",
"<=",
"lastZxidSeen",
")",
"{",
"LOG"... | append an entry to the transaction log
@param hdr the header of the transaction
@param txn the transaction part of the entry
returns true iff something appended, otw false | [
"append",
"an",
"entry",
"to",
"the",
"transaction",
"log"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java#L190-L229 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java | FileTxnLog.padFile | private void padFile(FileOutputStream out) throws IOException {
currentSize = Util.padLogFile(out, currentSize, preAllocSize);
} | java | private void padFile(FileOutputStream out) throws IOException {
currentSize = Util.padLogFile(out, currentSize, preAllocSize);
} | [
"private",
"void",
"padFile",
"(",
"FileOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"currentSize",
"=",
"Util",
".",
"padLogFile",
"(",
"out",
",",
"currentSize",
",",
"preAllocSize",
")",
";",
"}"
] | pad the current file to increase its size
@param out the outputstream to be padded
@throws IOException | [
"pad",
"the",
"current",
"file",
"to",
"increase",
"its",
"size"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java#L236-L238 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java | FileTxnLog.getLogFiles | public static File[] getLogFiles(File[] logDirList,long snapshotZxid) {
List<File> files = Util.sortDataDir(logDirList, "log", true);
long logZxid = 0;
// Find the log file that starts before or at the same time as the
// zxid of the snapshot
for (File f : files) {
lo... | java | public static File[] getLogFiles(File[] logDirList,long snapshotZxid) {
List<File> files = Util.sortDataDir(logDirList, "log", true);
long logZxid = 0;
// Find the log file that starts before or at the same time as the
// zxid of the snapshot
for (File f : files) {
lo... | [
"public",
"static",
"File",
"[",
"]",
"getLogFiles",
"(",
"File",
"[",
"]",
"logDirList",
",",
"long",
"snapshotZxid",
")",
"{",
"List",
"<",
"File",
">",
"files",
"=",
"Util",
".",
"sortDataDir",
"(",
"logDirList",
",",
"\"log\"",
",",
"true",
")",
";... | Find the log file that starts at, or just before, the snapshot. Return
this and all subsequent logs. Results are ordered by zxid of file,
ascending order.
@param logDirList array of files
@param snapshotZxid return files at, or before this zxid
@return | [
"Find",
"the",
"log",
"file",
"that",
"starts",
"at",
"or",
"just",
"before",
"the",
"snapshot",
".",
"Return",
"this",
"and",
"all",
"subsequent",
"logs",
".",
"Results",
"are",
"ordered",
"by",
"zxid",
"of",
"file",
"ascending",
"order",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java#L248-L274 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java | FileTxnLog.getLastLoggedZxid | public long getLastLoggedZxid() {
File[] files = getLogFiles(logDir.listFiles(), 0);
long maxLog=files.length>0?
Util.getZxidFromName(files[files.length-1].getName(),"log"):-1;
// if a log file is more recent we must scan it to find
// the highest zxid
long zxid ... | java | public long getLastLoggedZxid() {
File[] files = getLogFiles(logDir.listFiles(), 0);
long maxLog=files.length>0?
Util.getZxidFromName(files[files.length-1].getName(),"log"):-1;
// if a log file is more recent we must scan it to find
// the highest zxid
long zxid ... | [
"public",
"long",
"getLastLoggedZxid",
"(",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"getLogFiles",
"(",
"logDir",
".",
"listFiles",
"(",
")",
",",
"0",
")",
";",
"long",
"maxLog",
"=",
"files",
".",
"length",
">",
"0",
"?",
"Util",
".",
"getZxidFro... | get the last zxid that was logged in the transaction logs
@return the last zxid logged in the transaction logs | [
"get",
"the",
"last",
"zxid",
"that",
"was",
"logged",
"in",
"the",
"transaction",
"logs"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java#L280-L301 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java | FileTxnLog.commit | public synchronized void commit() throws IOException {
if (logStream != null) {
logStream.flush();
}
for (FileOutputStream log : streamsToFlush) {
log.flush();
if (forceSync) {
log.getChannel().force(false);
}
}
whil... | java | public synchronized void commit() throws IOException {
if (logStream != null) {
logStream.flush();
}
for (FileOutputStream log : streamsToFlush) {
log.flush();
if (forceSync) {
log.getChannel().force(false);
}
}
whil... | [
"public",
"synchronized",
"void",
"commit",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"logStream",
"!=",
"null",
")",
"{",
"logStream",
".",
"flush",
"(",
")",
";",
"}",
"for",
"(",
"FileOutputStream",
"log",
":",
"streamsToFlush",
")",
"{",
"lo... | commit the logs. make sure that evertyhing hits the
disk | [
"commit",
"the",
"logs",
".",
"make",
"sure",
"that",
"evertyhing",
"hits",
"the",
"disk"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java#L307-L320 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java | FileTxnLog.truncate | public boolean truncate(long zxid) throws IOException {
FileTxnIterator itr = new FileTxnIterator(this.logDir, zxid);
PositionInputStream input = itr.inputStream;
long pos = input.getPosition();
// now, truncate at the current position
RandomAccessFile raf=new RandomAccessFile(it... | java | public boolean truncate(long zxid) throws IOException {
FileTxnIterator itr = new FileTxnIterator(this.logDir, zxid);
PositionInputStream input = itr.inputStream;
long pos = input.getPosition();
// now, truncate at the current position
RandomAccessFile raf=new RandomAccessFile(it... | [
"public",
"boolean",
"truncate",
"(",
"long",
"zxid",
")",
"throws",
"IOException",
"{",
"FileTxnIterator",
"itr",
"=",
"new",
"FileTxnIterator",
"(",
"this",
".",
"logDir",
",",
"zxid",
")",
";",
"PositionInputStream",
"input",
"=",
"itr",
".",
"inputStream",... | truncate the current transaction logs
@param zxid the zxid to truncate the logs to
@return true if successful false if not | [
"truncate",
"the",
"current",
"transaction",
"logs"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java#L337-L351 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java | FileTxnLog.readHeader | private static FileHeader readHeader(File file) throws IOException {
InputStream is =null;
try {
is = new BufferedInputStream(new FileInputStream(file));
InputArchive ia=BinaryInputArchive.getArchive(is);
FileHeader hdr = new FileHeader();
hdr.deserialize(... | java | private static FileHeader readHeader(File file) throws IOException {
InputStream is =null;
try {
is = new BufferedInputStream(new FileInputStream(file));
InputArchive ia=BinaryInputArchive.getArchive(is);
FileHeader hdr = new FileHeader();
hdr.deserialize(... | [
"private",
"static",
"FileHeader",
"readHeader",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
"is",
"=",
"new",
"BufferedInputStream",
"(",
"new",
"FileInputStream",
"(",
"file",
")",
")",
";",
... | read the header of the transaction file
@param file the transaction file to read
@return header that was read fomr the file
@throws IOException | [
"read",
"the",
"header",
"of",
"the",
"transaction",
"file"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java#L359-L374 | train |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java | FileTxnLog.getDbId | public long getDbId() throws IOException {
FileTxnIterator itr = new FileTxnIterator(logDir, 0);
FileHeader fh=readHeader(itr.logFile);
itr.close();
if(fh==null)
throw new IOException("Unsupported Format.");
return fh.getDbid();
} | java | public long getDbId() throws IOException {
FileTxnIterator itr = new FileTxnIterator(logDir, 0);
FileHeader fh=readHeader(itr.logFile);
itr.close();
if(fh==null)
throw new IOException("Unsupported Format.");
return fh.getDbid();
} | [
"public",
"long",
"getDbId",
"(",
")",
"throws",
"IOException",
"{",
"FileTxnIterator",
"itr",
"=",
"new",
"FileTxnIterator",
"(",
"logDir",
",",
"0",
")",
";",
"FileHeader",
"fh",
"=",
"readHeader",
"(",
"itr",
".",
"logFile",
")",
";",
"itr",
".",
"clo... | the dbid of this transaction database
@return the dbid of this database | [
"the",
"dbid",
"of",
"this",
"transaction",
"database"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/FileTxnLog.java#L380-L387 | train |
VoltDB/voltdb | src/frontend/org/voltdb/exportclient/decode/EndpointExpander.java | EndpointExpander.verifyForHdfsUse | public static void verifyForHdfsUse(String sb) throws IllegalArgumentException {
Preconditions.checkArgument(
sb != null && !sb.trim().isEmpty(),
"null or empty hdfs endpoint"
);
int mask = conversionMaskFor(sb);
boolean hasDateConversion = (mask ... | java | public static void verifyForHdfsUse(String sb) throws IllegalArgumentException {
Preconditions.checkArgument(
sb != null && !sb.trim().isEmpty(),
"null or empty hdfs endpoint"
);
int mask = conversionMaskFor(sb);
boolean hasDateConversion = (mask ... | [
"public",
"static",
"void",
"verifyForHdfsUse",
"(",
"String",
"sb",
")",
"throws",
"IllegalArgumentException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"sb",
"!=",
"null",
"&&",
"!",
"sb",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
",",
"\"n... | Verifies that given endpoint format string specifies all the required hdfs
conversions in the path portion of the endpoint.
@param sb format string
@throws IllegalArgumentException when verification fails | [
"Verifies",
"that",
"given",
"endpoint",
"format",
"string",
"specifies",
"all",
"the",
"required",
"hdfs",
"conversions",
"in",
"the",
"path",
"portion",
"of",
"the",
"endpoint",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/exportclient/decode/EndpointExpander.java#L259-L296 | train |
VoltDB/voltdb | src/frontend/org/voltdb/exportclient/decode/EndpointExpander.java | EndpointExpander.verifyForBatchUse | public static void verifyForBatchUse(String sb) throws IllegalArgumentException {
Preconditions.checkArgument(
sb != null && !sb.trim().isEmpty(),
"null or empty hdfs endpoint"
);
int mask = conversionMaskFor(sb);
Preconditions.checkArgument(
... | java | public static void verifyForBatchUse(String sb) throws IllegalArgumentException {
Preconditions.checkArgument(
sb != null && !sb.trim().isEmpty(),
"null or empty hdfs endpoint"
);
int mask = conversionMaskFor(sb);
Preconditions.checkArgument(
... | [
"public",
"static",
"void",
"verifyForBatchUse",
"(",
"String",
"sb",
")",
"throws",
"IllegalArgumentException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"sb",
"!=",
"null",
"&&",
"!",
"sb",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
",",
"\"... | Verifies that given endpoint format string specifies all the required batch mode
conversions.
@param sb format string
@throws IllegalArgumentException when verification fails | [
"Verifies",
"that",
"given",
"endpoint",
"format",
"string",
"specifies",
"all",
"the",
"required",
"batch",
"mode",
"conversions",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/exportclient/decode/EndpointExpander.java#L305-L317 | train |
VoltDB/voltdb | src/frontend/org/voltdb/SystemCatalogAgent.java | SystemCatalogAgent.handleJSONMessage | @Override
protected void handleJSONMessage(JSONObject obj) throws Exception {
hostLog.warn("SystemCatalogAgent received a JSON message, which should be impossible.");
VoltTable[] results = null;
sendOpsResponse(results, obj);
} | java | @Override
protected void handleJSONMessage(JSONObject obj) throws Exception {
hostLog.warn("SystemCatalogAgent received a JSON message, which should be impossible.");
VoltTable[] results = null;
sendOpsResponse(results, obj);
} | [
"@",
"Override",
"protected",
"void",
"handleJSONMessage",
"(",
"JSONObject",
"obj",
")",
"throws",
"Exception",
"{",
"hostLog",
".",
"warn",
"(",
"\"SystemCatalogAgent received a JSON message, which should be impossible.\"",
")",
";",
"VoltTable",
"[",
"]",
"results",
... | SystemCatalog shouldn't currently get here, make it so we don't die or do anything | [
"SystemCatalog",
"shouldn",
"t",
"currently",
"get",
"here",
"make",
"it",
"so",
"we",
"don",
"t",
"die",
"or",
"do",
"anything"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/SystemCatalogAgent.java#L87-L92 | train |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/MapConstraints.java | MapConstraints.constrainedMap | public static <K, V> Map<K, V> constrainedMap(
Map<K, V> map, MapConstraint<? super K, ? super V> constraint) {
return new ConstrainedMap<K, V>(map, constraint);
} | java | public static <K, V> Map<K, V> constrainedMap(
Map<K, V> map, MapConstraint<? super K, ? super V> constraint) {
return new ConstrainedMap<K, V>(map, constraint);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"constrainedMap",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"MapConstraint",
"<",
"?",
"super",
"K",
",",
"?",
"super",
"V",
">",
"constraint",
")",
"{",
"retur... | Returns a constrained view of the specified map, using the specified
constraint. Any operations that add new mappings will call the provided
constraint. However, this method does not verify that existing mappings
satisfy the constraint.
<p>The returned map is not serializable.
@param map the map to constrain
@param c... | [
"Returns",
"a",
"constrained",
"view",
"of",
"the",
"specified",
"map",
"using",
"the",
"specified",
"constraint",
".",
"Any",
"operations",
"that",
"add",
"new",
"mappings",
"will",
"call",
"the",
"provided",
"constraint",
".",
"However",
"this",
"method",
"d... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/MapConstraints.java#L65-L68 | train |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/MapConstraints.java | MapConstraints.constrainedListMultimap | public static <K, V> ListMultimap<K, V> constrainedListMultimap(
ListMultimap<K, V> multimap, MapConstraint<? super K, ? super V> constraint) {
return new ConstrainedListMultimap<K, V>(multimap, constraint);
} | java | public static <K, V> ListMultimap<K, V> constrainedListMultimap(
ListMultimap<K, V> multimap, MapConstraint<? super K, ? super V> constraint) {
return new ConstrainedListMultimap<K, V>(multimap, constraint);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"ListMultimap",
"<",
"K",
",",
"V",
">",
"constrainedListMultimap",
"(",
"ListMultimap",
"<",
"K",
",",
"V",
">",
"multimap",
",",
"MapConstraint",
"<",
"?",
"super",
"K",
",",
"?",
"super",
"V",
">",
"con... | Returns a constrained view of the specified list multimap, using the
specified constraint. Any operations that add new mappings will call the
provided constraint. However, this method does not verify that existing
mappings satisfy the constraint.
<p>Note that the generated multimap's {@link Multimap#removeAll} and
{@l... | [
"Returns",
"a",
"constrained",
"view",
"of",
"the",
"specified",
"list",
"multimap",
"using",
"the",
"specified",
"constraint",
".",
"Any",
"operations",
"that",
"add",
"new",
"mappings",
"will",
"call",
"the",
"provided",
"constraint",
".",
"However",
"this",
... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/MapConstraints.java#L86-L89 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/ExpressionWindowed.java | ExpressionWindowed.validateWindowedSyntax | private void validateWindowedSyntax() {
// Check that the aggregate is one of the supported ones, and
// that the number of aggregate parameters is right.
switch (opType) {
case OpTypes.WINDOWED_RANK:
case OpTypes.WINDOWED_DENSE_RANK:
case OpTypes.WINDOWED_ROW_NUMBER:
... | java | private void validateWindowedSyntax() {
// Check that the aggregate is one of the supported ones, and
// that the number of aggregate parameters is right.
switch (opType) {
case OpTypes.WINDOWED_RANK:
case OpTypes.WINDOWED_DENSE_RANK:
case OpTypes.WINDOWED_ROW_NUMBER:
... | [
"private",
"void",
"validateWindowedSyntax",
"(",
")",
"{",
"// Check that the aggregate is one of the supported ones, and",
"// that the number of aggregate parameters is right.",
"switch",
"(",
"opType",
")",
"{",
"case",
"OpTypes",
".",
"WINDOWED_RANK",
":",
"case",
"OpTypes... | Validate that this is a collection of values. | [
"Validate",
"that",
"this",
"is",
"a",
"collection",
"of",
"values",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ExpressionWindowed.java#L68-L87 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/StatementInsert.java | StatementInsert.getResult | Result getResult(Session session) {
Table table = baseTable;
Result resultOut = null;
RowSetNavigator generatedNavigator = null;
PersistentStore store = session.sessionData.getRowStore(baseTable);
if (generatedIndexes != null) {
... | java | Result getResult(Session session) {
Table table = baseTable;
Result resultOut = null;
RowSetNavigator generatedNavigator = null;
PersistentStore store = session.sessionData.getRowStore(baseTable);
if (generatedIndexes != null) {
... | [
"Result",
"getResult",
"(",
"Session",
"session",
")",
"{",
"Table",
"table",
"=",
"baseTable",
";",
"Result",
"resultOut",
"=",
"null",
";",
"RowSetNavigator",
"generatedNavigator",
"=",
"null",
";",
"PersistentStore",
"store",
"=",
"session",
".",
"sessionData... | Executes an INSERT_SELECT statement. It is assumed that the argument
is of the correct type.
@return the result of executing the statement | [
"Executes",
"an",
"INSERT_SELECT",
"statement",
".",
"It",
"is",
"assumed",
"that",
"the",
"argument",
"is",
"of",
"the",
"correct",
"type",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/StatementInsert.java#L99-L164 | train |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/TupleValueExpression.java | TupleValueExpression.resolveForTable | @Override
public void resolveForTable(Table table) {
assert(table != null);
// It MAY be that for the case in which this function is called (expression indexes), the column's
// table name is not specified (and not missed?).
// It is possible to "correct" that here by cribbing it fro... | java | @Override
public void resolveForTable(Table table) {
assert(table != null);
// It MAY be that for the case in which this function is called (expression indexes), the column's
// table name is not specified (and not missed?).
// It is possible to "correct" that here by cribbing it fro... | [
"@",
"Override",
"public",
"void",
"resolveForTable",
"(",
"Table",
"table",
")",
"{",
"assert",
"(",
"table",
"!=",
"null",
")",
";",
"// It MAY be that for the case in which this function is called (expression indexes), the column's",
"// table name is not specified (and not mi... | Resolve a TVE in the context of the given table. Since
this is a TVE, it is a leaf node in the expression tree.
We just look up the metadata from the table and copy it
here, to this object. | [
"Resolve",
"a",
"TVE",
"in",
"the",
"context",
"of",
"the",
"given",
"table",
".",
"Since",
"this",
"is",
"a",
"TVE",
"it",
"is",
"a",
"leaf",
"node",
"in",
"the",
"expression",
"tree",
".",
"We",
"just",
"look",
"up",
"the",
"metadata",
"from",
"the... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/TupleValueExpression.java#L400-L412 | train |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/TupleValueExpression.java | TupleValueExpression.setColumnIndexUsingSchema | public int setColumnIndexUsingSchema(NodeSchema inputSchema) {
int index = inputSchema.getIndexOfTve(this);
if (index < 0) {
//* enable to debug*/ System.out.println("DEBUG: setColumnIndex miss: " + this);
//* enable to debug*/ System.out.println("DEBUG: setColumnIndex candidates... | java | public int setColumnIndexUsingSchema(NodeSchema inputSchema) {
int index = inputSchema.getIndexOfTve(this);
if (index < 0) {
//* enable to debug*/ System.out.println("DEBUG: setColumnIndex miss: " + this);
//* enable to debug*/ System.out.println("DEBUG: setColumnIndex candidates... | [
"public",
"int",
"setColumnIndexUsingSchema",
"(",
"NodeSchema",
"inputSchema",
")",
"{",
"int",
"index",
"=",
"inputSchema",
".",
"getIndexOfTve",
"(",
"this",
")",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"//* enable to debug*/ System.out.println(\"DEBUG: setC... | Given an input schema, resolve this TVE expression. | [
"Given",
"an",
"input",
"schema",
"resolve",
"this",
"TVE",
"expression",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/TupleValueExpression.java#L417-L433 | train |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4ResultSetMetaData.java | JDBC4ResultSetMetaData.getColumnClassName | public String getColumnClassName(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
String result = type.getJdbcClass();
if (result == null) {
throw SQLError.get(SQLError.TRANSLATIO... | java | public String getColumnClassName(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
String result = type.getJdbcClass();
if (result == null) {
throw SQLError.get(SQLError.TRANSLATIO... | [
"public",
"String",
"getColumnClassName",
"(",
"int",
"column",
")",
"throws",
"SQLException",
"{",
"sourceResultSet",
".",
"checkColumnBounds",
"(",
"column",
")",
";",
"VoltType",
"type",
"=",
"sourceResultSet",
".",
"table",
".",
"getColumnType",
"(",
"column",... | Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet.getObject is called to retrieve a value from the column. | [
"Returns",
"the",
"fully",
"-",
"qualified",
"name",
"of",
"the",
"Java",
"class",
"whose",
"instances",
"are",
"manufactured",
"if",
"the",
"method",
"ResultSet",
".",
"getObject",
"is",
"called",
"to",
"retrieve",
"a",
"value",
"from",
"the",
"column",
"."... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4ResultSetMetaData.java#L42-L51 | train |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4ResultSetMetaData.java | JDBC4ResultSetMetaData.getPrecision | public int getPrecision(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
Integer result = type.getTypePrecisionAndRadix()[0];
if (result == null) {
result = 0;
}
... | java | public int getPrecision(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
Integer result = type.getTypePrecisionAndRadix()[0];
if (result == null) {
result = 0;
}
... | [
"public",
"int",
"getPrecision",
"(",
"int",
"column",
")",
"throws",
"SQLException",
"{",
"sourceResultSet",
".",
"checkColumnBounds",
"(",
"column",
")",
";",
"VoltType",
"type",
"=",
"sourceResultSet",
".",
"table",
".",
"getColumnType",
"(",
"column",
"-",
... | Get the designated column's specified column size. | [
"Get",
"the",
"designated",
"column",
"s",
"specified",
"column",
"size",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4ResultSetMetaData.java#L133-L142 | train |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4ResultSetMetaData.java | JDBC4ResultSetMetaData.getScale | public int getScale(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
Integer result = type.getMaximumScale();
if (result == null) {
result = 0;
}
return result;
... | java | public int getScale(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
Integer result = type.getMaximumScale();
if (result == null) {
result = 0;
}
return result;
... | [
"public",
"int",
"getScale",
"(",
"int",
"column",
")",
"throws",
"SQLException",
"{",
"sourceResultSet",
".",
"checkColumnBounds",
"(",
"column",
")",
";",
"VoltType",
"type",
"=",
"sourceResultSet",
".",
"table",
".",
"getColumnType",
"(",
"column",
"-",
"1"... | Gets the designated column's number of digits to right of the decimal point. | [
"Gets",
"the",
"designated",
"column",
"s",
"number",
"of",
"digits",
"to",
"right",
"of",
"the",
"decimal",
"point",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4ResultSetMetaData.java#L145-L154 | train |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4ResultSetMetaData.java | JDBC4ResultSetMetaData.isCaseSensitive | public boolean isCaseSensitive(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
return type.isCaseSensitive();
} | java | public boolean isCaseSensitive(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
return type.isCaseSensitive();
} | [
"public",
"boolean",
"isCaseSensitive",
"(",
"int",
"column",
")",
"throws",
"SQLException",
"{",
"sourceResultSet",
".",
"checkColumnBounds",
"(",
"column",
")",
";",
"VoltType",
"type",
"=",
"sourceResultSet",
".",
"table",
".",
"getColumnType",
"(",
"column",
... | Indicates whether a column's case matters. | [
"Indicates",
"whether",
"a",
"column",
"s",
"case",
"matters",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4ResultSetMetaData.java#L180-L185 | train |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4ResultSetMetaData.java | JDBC4ResultSetMetaData.isSigned | public boolean isSigned(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
Boolean result = type.isUnsigned();
if (result == null) {
// Null return value means 'not signed' as far a... | java | public boolean isSigned(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
Boolean result = type.isUnsigned();
if (result == null) {
// Null return value means 'not signed' as far a... | [
"public",
"boolean",
"isSigned",
"(",
"int",
"column",
")",
"throws",
"SQLException",
"{",
"sourceResultSet",
".",
"checkColumnBounds",
"(",
"column",
")",
";",
"VoltType",
"type",
"=",
"sourceResultSet",
".",
"table",
".",
"getColumnType",
"(",
"column",
"-",
... | Indicates whether values in the designated column are signed numbers. | [
"Indicates",
"whether",
"values",
"in",
"the",
"designated",
"column",
"are",
"signed",
"numbers",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4ResultSetMetaData.java#L222-L232 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/microoptimizations/InlineOrderByIntoMergeReceive.java | InlineOrderByIntoMergeReceive.applyOptimization | private AbstractPlanNode applyOptimization(WindowFunctionPlanNode plan) {
assert(plan.getChildCount() == 1);
assert(plan.getChild(0) != null);
AbstractPlanNode child = plan.getChild(0);
assert(child != null);
// SP Plans which have an index which can provide
// the window... | java | private AbstractPlanNode applyOptimization(WindowFunctionPlanNode plan) {
assert(plan.getChildCount() == 1);
assert(plan.getChild(0) != null);
AbstractPlanNode child = plan.getChild(0);
assert(child != null);
// SP Plans which have an index which can provide
// the window... | [
"private",
"AbstractPlanNode",
"applyOptimization",
"(",
"WindowFunctionPlanNode",
"plan",
")",
"{",
"assert",
"(",
"plan",
".",
"getChildCount",
"(",
")",
"==",
"1",
")",
";",
"assert",
"(",
"plan",
".",
"getChild",
"(",
"0",
")",
"!=",
"null",
")",
";",
... | Convert ReceivePlanNodes into MergeReceivePlanNodes when the
RECEIVE node's nearest parent is a window function. We won't
have any inline limits or aggregates here, so this is somewhat
simpler than the order by case.
@param plan
@return | [
"Convert",
"ReceivePlanNodes",
"into",
"MergeReceivePlanNodes",
"when",
"the",
"RECEIVE",
"node",
"s",
"nearest",
"parent",
"is",
"a",
"window",
"function",
".",
"We",
"won",
"t",
"have",
"any",
"inline",
"limits",
"or",
"aggregates",
"here",
"so",
"this",
"is... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/microoptimizations/InlineOrderByIntoMergeReceive.java#L113-L169 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/microoptimizations/InlineOrderByIntoMergeReceive.java | InlineOrderByIntoMergeReceive.convertToSerialAggregation | AbstractPlanNode convertToSerialAggregation(AbstractPlanNode aggregateNode, OrderByPlanNode orderbyNode) {
assert(aggregateNode instanceof HashAggregatePlanNode);
HashAggregatePlanNode hashAggr = (HashAggregatePlanNode) aggregateNode;
List<AbstractExpression> groupbys = new ArrayList<>(hashAggr.... | java | AbstractPlanNode convertToSerialAggregation(AbstractPlanNode aggregateNode, OrderByPlanNode orderbyNode) {
assert(aggregateNode instanceof HashAggregatePlanNode);
HashAggregatePlanNode hashAggr = (HashAggregatePlanNode) aggregateNode;
List<AbstractExpression> groupbys = new ArrayList<>(hashAggr.... | [
"AbstractPlanNode",
"convertToSerialAggregation",
"(",
"AbstractPlanNode",
"aggregateNode",
",",
"OrderByPlanNode",
"orderbyNode",
")",
"{",
"assert",
"(",
"aggregateNode",
"instanceof",
"HashAggregatePlanNode",
")",
";",
"HashAggregatePlanNode",
"hashAggr",
"=",
"(",
"Hash... | The Hash aggregate can be converted to a Serial or Partial aggregate if
- all GROUP BY and ORDER BY expressions bind to each other - Serial Aggregate
- a subset of the GROUP BY expressions covers all of the ORDER BY - Partial
- anything else - remains a Hash Aggregate
@param aggregateNode
@param orderbyNode
@return ne... | [
"The",
"Hash",
"aggregate",
"can",
"be",
"converted",
"to",
"a",
"Serial",
"or",
"Partial",
"aggregate",
"if",
"-",
"all",
"GROUP",
"BY",
"and",
"ORDER",
"BY",
"expressions",
"bind",
"to",
"each",
"other",
"-",
"Serial",
"Aggregate",
"-",
"a",
"subset",
... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/microoptimizations/InlineOrderByIntoMergeReceive.java#L311-L344 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java | LockFile.startHeartbeat | private final void startHeartbeat() {
if (timerTask == null || HsqlTimer.isCancelled(timerTask)) {
Runnable runner = new HeartbeatRunner();
timerTask = timer.schedulePeriodicallyAfter(0, HEARTBEAT_INTERVAL,
runner, true);
}
} | java | private final void startHeartbeat() {
if (timerTask == null || HsqlTimer.isCancelled(timerTask)) {
Runnable runner = new HeartbeatRunner();
timerTask = timer.schedulePeriodicallyAfter(0, HEARTBEAT_INTERVAL,
runner, true);
}
} | [
"private",
"final",
"void",
"startHeartbeat",
"(",
")",
"{",
"if",
"(",
"timerTask",
"==",
"null",
"||",
"HsqlTimer",
".",
"isCancelled",
"(",
"timerTask",
")",
")",
"{",
"Runnable",
"runner",
"=",
"new",
"HeartbeatRunner",
"(",
")",
";",
"timerTask",
"=",... | Schedules the lock heartbeat task. | [
"Schedules",
"the",
"lock",
"heartbeat",
"task",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java#L1177-L1185 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java | LockFile.stopHeartbeat | private final void stopHeartbeat() {
if (timerTask != null && !HsqlTimer.isCancelled(timerTask)) {
HsqlTimer.cancel(timerTask);
timerTask = null;
}
} | java | private final void stopHeartbeat() {
if (timerTask != null && !HsqlTimer.isCancelled(timerTask)) {
HsqlTimer.cancel(timerTask);
timerTask = null;
}
} | [
"private",
"final",
"void",
"stopHeartbeat",
"(",
")",
"{",
"if",
"(",
"timerTask",
"!=",
"null",
"&&",
"!",
"HsqlTimer",
".",
"isCancelled",
"(",
"timerTask",
")",
")",
"{",
"HsqlTimer",
".",
"cancel",
"(",
"timerTask",
")",
";",
"timerTask",
"=",
"null... | Cancels the lock heartbeat task. | [
"Cancels",
"the",
"lock",
"heartbeat",
"task",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java#L1190-L1197 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java | LockFile.isLocked | public final static boolean isLocked(final String path) {
boolean locked = true;
try {
LockFile lockFile = LockFile.newLockFile(path);
lockFile.checkHeartbeat(false);
locked = false;
} catch (Exception e) {}
return locked;
} | java | public final static boolean isLocked(final String path) {
boolean locked = true;
try {
LockFile lockFile = LockFile.newLockFile(path);
lockFile.checkHeartbeat(false);
locked = false;
} catch (Exception e) {}
return locked;
} | [
"public",
"final",
"static",
"boolean",
"isLocked",
"(",
"final",
"String",
"path",
")",
"{",
"boolean",
"locked",
"=",
"true",
";",
"try",
"{",
"LockFile",
"lockFile",
"=",
"LockFile",
".",
"newLockFile",
"(",
"path",
")",
";",
"lockFile",
".",
"checkHear... | Retrieves whether there is potentially already a cooperative lock,
operating system lock or some other situation preventing a cooperative
lock condition from being aquired using the specified path.
@param path the path to test
@return <tt>true</tt> if there is currently something preventing the
acquisition of a cooper... | [
"Retrieves",
"whether",
"there",
"is",
"potentially",
"already",
"a",
"cooperative",
"lock",
"operating",
"system",
"lock",
"or",
"some",
"other",
"situation",
"preventing",
"a",
"cooperative",
"lock",
"condition",
"from",
"being",
"aquired",
"using",
"the",
"spec... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java#L1384-L1397 | train |
VoltDB/voltdb | src/frontend/org/voltdb/probe/MeshProber.java | MeshProber.hosts | public static ImmutableSortedSet<String> hosts(String option) {
checkArgument(option != null, "option is null");
if (option.trim().isEmpty()) {
return ImmutableSortedSet.of(
HostAndPort.fromParts("", Constants.DEFAULT_INTERNAL_PORT).toString());
}
Splitter... | java | public static ImmutableSortedSet<String> hosts(String option) {
checkArgument(option != null, "option is null");
if (option.trim().isEmpty()) {
return ImmutableSortedSet.of(
HostAndPort.fromParts("", Constants.DEFAULT_INTERNAL_PORT).toString());
}
Splitter... | [
"public",
"static",
"ImmutableSortedSet",
"<",
"String",
">",
"hosts",
"(",
"String",
"option",
")",
"{",
"checkArgument",
"(",
"option",
"!=",
"null",
",",
"\"option is null\"",
")",
";",
"if",
"(",
"option",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
... | Helper method that takes a comma delimited list of host specs, validates it,
and converts it to a set of valid coordinators
@param option a string that contains comma delimited list of host specs
@return a set of valid coordinators | [
"Helper",
"method",
"that",
"takes",
"a",
"comma",
"delimited",
"list",
"of",
"host",
"specs",
"validates",
"it",
"and",
"converts",
"it",
"to",
"a",
"set",
"of",
"valid",
"coordinators"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/probe/MeshProber.java#L104-L117 | train |
VoltDB/voltdb | src/frontend/org/voltdb/probe/MeshProber.java | MeshProber.hosts | public static ImmutableSortedSet<String> hosts(int...ports) {
if (ports.length == 0) {
return ImmutableSortedSet.of(
HostAndPort.fromParts("", Constants.DEFAULT_INTERNAL_PORT).toString());
}
ImmutableSortedSet.Builder<String> sbld = ImmutableSortedSet.naturalOrder... | java | public static ImmutableSortedSet<String> hosts(int...ports) {
if (ports.length == 0) {
return ImmutableSortedSet.of(
HostAndPort.fromParts("", Constants.DEFAULT_INTERNAL_PORT).toString());
}
ImmutableSortedSet.Builder<String> sbld = ImmutableSortedSet.naturalOrder... | [
"public",
"static",
"ImmutableSortedSet",
"<",
"String",
">",
"hosts",
"(",
"int",
"...",
"ports",
")",
"{",
"if",
"(",
"ports",
".",
"length",
"==",
"0",
")",
"{",
"return",
"ImmutableSortedSet",
".",
"of",
"(",
"HostAndPort",
".",
"fromParts",
"(",
"\"... | Convenience method mainly used in local cluster testing
@param ports a list of ports
@return a set of coordinator specs | [
"Convenience",
"method",
"mainly",
"used",
"in",
"local",
"cluster",
"testing"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/probe/MeshProber.java#L125-L135 | train |
VoltDB/voltdb | src/frontend/org/voltdb/ProcedureRunner.java | ProcedureRunner.call | public ClientResponseImpl call(Object... paramListIn) {
m_perCallStats = m_statsCollector.beginProcedure();
// if we're keeping track, calculate parameter size
if (m_perCallStats != null) {
StoredProcedureInvocation invoc = (m_txnState != null ? m_txnState.getInvocation() : null);
... | java | public ClientResponseImpl call(Object... paramListIn) {
m_perCallStats = m_statsCollector.beginProcedure();
// if we're keeping track, calculate parameter size
if (m_perCallStats != null) {
StoredProcedureInvocation invoc = (m_txnState != null ? m_txnState.getInvocation() : null);
... | [
"public",
"ClientResponseImpl",
"call",
"(",
"Object",
"...",
"paramListIn",
")",
"{",
"m_perCallStats",
"=",
"m_statsCollector",
".",
"beginProcedure",
"(",
")",
";",
"// if we're keeping track, calculate parameter size",
"if",
"(",
"m_perCallStats",
"!=",
"null",
")",... | Wraps coreCall with statistics code. | [
"Wraps",
"coreCall",
"with",
"statistics",
"code",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ProcedureRunner.java#L279-L304 | train |
VoltDB/voltdb | src/frontend/org/voltdb/ProcedureRunner.java | ProcedureRunner.checkPartition | public boolean checkPartition(TransactionState txnState, TheHashinator hashinator) {
if (m_isSinglePartition) {
// can happen when a proc changes from multi-to-single after it's routed
if (hashinator == null) {
return false; // this will kick it back to CI for re-routing
... | java | public boolean checkPartition(TransactionState txnState, TheHashinator hashinator) {
if (m_isSinglePartition) {
// can happen when a proc changes from multi-to-single after it's routed
if (hashinator == null) {
return false; // this will kick it back to CI for re-routing
... | [
"public",
"boolean",
"checkPartition",
"(",
"TransactionState",
"txnState",
",",
"TheHashinator",
"hashinator",
")",
"{",
"if",
"(",
"m_isSinglePartition",
")",
"{",
"// can happen when a proc changes from multi-to-single after it's routed",
"if",
"(",
"hashinator",
"==",
"... | Check if the txn hashes to this partition. If not, it should be restarted.
@param txnState
@return true if the txn hashes to the current partition, false otherwise | [
"Check",
"if",
"the",
"txn",
"hashes",
"to",
"this",
"partition",
".",
"If",
"not",
"it",
"should",
"be",
"restarted",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ProcedureRunner.java#L517-L598 | train |
VoltDB/voltdb | src/frontend/org/voltdb/ProcedureRunner.java | ProcedureRunner.isProcedureStackTraceElement | public static boolean isProcedureStackTraceElement(String procedureName, StackTraceElement stel) {
int lastPeriodPos = stel.getClassName().lastIndexOf('.');
if (lastPeriodPos == -1) {
lastPeriodPos = 0;
} else {
++lastPeriodPos;
}
// Account for inner cl... | java | public static boolean isProcedureStackTraceElement(String procedureName, StackTraceElement stel) {
int lastPeriodPos = stel.getClassName().lastIndexOf('.');
if (lastPeriodPos == -1) {
lastPeriodPos = 0;
} else {
++lastPeriodPos;
}
// Account for inner cl... | [
"public",
"static",
"boolean",
"isProcedureStackTraceElement",
"(",
"String",
"procedureName",
",",
"StackTraceElement",
"stel",
")",
"{",
"int",
"lastPeriodPos",
"=",
"stel",
".",
"getClassName",
"(",
")",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(... | Test whether or not the given stack frame is within a procedure invocation
@param The name of the procedure
@param stel a stack trace element
@return true if it is, false it is not | [
"Test",
"whether",
"or",
"not",
"the",
"given",
"stack",
"frame",
"is",
"within",
"a",
"procedure",
"invocation"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ProcedureRunner.java#L1174-L1188 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/DeploymentRequestServlet.java | DeploymentRequestServlet.handleUpdateDeployment | public void handleUpdateDeployment(String jsonp,
HttpServletRequest request,
HttpServletResponse response, AuthenticationResult ar)
throws IOException, ServletException {
String deployment = request.getParameter("deployment");
if (deployment == null || deployment.leng... | java | public void handleUpdateDeployment(String jsonp,
HttpServletRequest request,
HttpServletResponse response, AuthenticationResult ar)
throws IOException, ServletException {
String deployment = request.getParameter("deployment");
if (deployment == null || deployment.leng... | [
"public",
"void",
"handleUpdateDeployment",
"(",
"String",
"jsonp",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"AuthenticationResult",
"ar",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"String",
"deployment",
"=",
... | Update the deployment | [
"Update",
"the",
"deployment"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/DeploymentRequestServlet.java#L296-L343 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/DeploymentRequestServlet.java | DeploymentRequestServlet.handleRemoveUser | public void handleRemoveUser(String jsonp, String target,
HttpServletRequest request,
HttpServletResponse response, AuthenticationResult ar)
throws IOException, ServletException {
try {
DeploymentType newDeployment = CatalogUtil.getDeployment(new ByteArrayInputStr... | java | public void handleRemoveUser(String jsonp, String target,
HttpServletRequest request,
HttpServletResponse response, AuthenticationResult ar)
throws IOException, ServletException {
try {
DeploymentType newDeployment = CatalogUtil.getDeployment(new ByteArrayInputStr... | [
"public",
"void",
"handleRemoveUser",
"(",
"String",
"jsonp",
",",
"String",
"target",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"AuthenticationResult",
"ar",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"try",
... | Handle DELETE for users | [
"Handle",
"DELETE",
"for",
"users"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/DeploymentRequestServlet.java#L475-L520 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/DeploymentRequestServlet.java | DeploymentRequestServlet.handleGetUsers | public void handleGetUsers(String jsonp, String target,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
ObjectMapper mapper = new ObjectMapper();
User user = null;
String[] splitTarget = target.split("/");
... | java | public void handleGetUsers(String jsonp, String target,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
ObjectMapper mapper = new ObjectMapper();
User user = null;
String[] splitTarget = target.split("/");
... | [
"public",
"void",
"handleGetUsers",
"(",
"String",
"jsonp",
",",
"String",
"target",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"Obje... | Handle GET for users | [
"Handle",
"GET",
"for",
"users"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/DeploymentRequestServlet.java#L523-L562 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/DeploymentRequestServlet.java | DeploymentRequestServlet.handleGetExportTypes | public void handleGetExportTypes(String jsonp, HttpServletResponse response)
throws IOException, ServletException {
if (jsonp != null) {
response.getWriter().write(jsonp + "(");
}
JSONObject exportTypes = new JSONObject();
HashSet<String> exportList = new HashSet<... | java | public void handleGetExportTypes(String jsonp, HttpServletResponse response)
throws IOException, ServletException {
if (jsonp != null) {
response.getWriter().write(jsonp + "(");
}
JSONObject exportTypes = new JSONObject();
HashSet<String> exportList = new HashSet<... | [
"public",
"void",
"handleGetExportTypes",
"(",
"String",
"jsonp",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"jsonp",
"!=",
"null",
")",
"{",
"response",
".",
"getWriter",
"(",
")",
".",
"writ... | Handle GET for export types | [
"Handle",
"GET",
"for",
"export",
"types"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/DeploymentRequestServlet.java#L565-L587 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.createZKDirectory | void createZKDirectory(String path) {
try {
try {
m_zk.create(path, new byte[0],
Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
} catch (KeeperException e) {
if (e.code() != Code.NODEEXISTS) {
throw e;
... | java | void createZKDirectory(String path) {
try {
try {
m_zk.create(path, new byte[0],
Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
} catch (KeeperException e) {
if (e.code() != Code.NODEEXISTS) {
throw e;
... | [
"void",
"createZKDirectory",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"try",
"{",
"m_zk",
".",
"create",
"(",
"path",
",",
"new",
"byte",
"[",
"0",
"]",
",",
"Ids",
".",
"OPEN_ACL_UNSAFE",
",",
"CreateMode",
".",
"PERSISTENT",
")",
";",
"}",
"cat... | Creates a ZooKeeper directory if it doesn't exist. Crashes VoltDB if the
creation fails for any reason other then the path already existing.
@param path | [
"Creates",
"a",
"ZooKeeper",
"directory",
"if",
"it",
"doesn",
"t",
"exist",
".",
"Crashes",
"VoltDB",
"if",
"the",
"creation",
"fails",
"for",
"any",
"reason",
"other",
"then",
"the",
"path",
"already",
"existing",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L420-L434 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.findRestoreCatalog | public Pair<Integer, String> findRestoreCatalog() {
enterRestore();
try {
m_snapshotToRestore = generatePlans();
} catch (Exception e) {
VoltDB.crashGlobalVoltDB(e.getMessage(), true, e);
}
if (m_snapshotToRestore != null) {
int hostId = m_sn... | java | public Pair<Integer, String> findRestoreCatalog() {
enterRestore();
try {
m_snapshotToRestore = generatePlans();
} catch (Exception e) {
VoltDB.crashGlobalVoltDB(e.getMessage(), true, e);
}
if (m_snapshotToRestore != null) {
int hostId = m_sn... | [
"public",
"Pair",
"<",
"Integer",
",",
"String",
">",
"findRestoreCatalog",
"(",
")",
"{",
"enterRestore",
"(",
")",
";",
"try",
"{",
"m_snapshotToRestore",
"=",
"generatePlans",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"VoltDB",
"."... | Generate restore and replay plans and return the catalog associated with
the snapshot to restore if there is anything to restore.
@return The (host ID, catalog path) pair, or null if there is no snapshot
to restore. | [
"Generate",
"restore",
"and",
"replay",
"plans",
"and",
"return",
"the",
"catalog",
"associated",
"with",
"the",
"snapshot",
"to",
"restore",
"if",
"there",
"is",
"anything",
"to",
"restore",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L529-L547 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.enterRestore | void enterRestore() {
createZKDirectory(VoltZK.restore);
createZKDirectory(VoltZK.restore_barrier);
createZKDirectory(VoltZK.restore_barrier2);
try {
m_generatedRestoreBarrier2 = m_zk.create(VoltZK.restore_barrier2 + "/counter", null,
Ids.OPEN_ACL_UNS... | java | void enterRestore() {
createZKDirectory(VoltZK.restore);
createZKDirectory(VoltZK.restore_barrier);
createZKDirectory(VoltZK.restore_barrier2);
try {
m_generatedRestoreBarrier2 = m_zk.create(VoltZK.restore_barrier2 + "/counter", null,
Ids.OPEN_ACL_UNS... | [
"void",
"enterRestore",
"(",
")",
"{",
"createZKDirectory",
"(",
"VoltZK",
".",
"restore",
")",
";",
"createZKDirectory",
"(",
"VoltZK",
".",
"restore_barrier",
")",
";",
"createZKDirectory",
"(",
"VoltZK",
".",
"restore_barrier2",
")",
";",
"try",
"{",
"m_gen... | Enters the restore process. Creates ZooKeeper barrier node for this host. | [
"Enters",
"the",
"restore",
"process",
".",
"Creates",
"ZooKeeper",
"barrier",
"node",
"for",
"this",
"host",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L552-L564 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.exitRestore | void exitRestore() {
try {
m_zk.delete(m_generatedRestoreBarrier2, -1);
} catch (Exception e) {
VoltDB.crashLocalVoltDB("Unable to delete zk node " + m_generatedRestoreBarrier2, false, e);
}
if (m_callback != null) {
m_callback.onSnapshotRestoreComple... | java | void exitRestore() {
try {
m_zk.delete(m_generatedRestoreBarrier2, -1);
} catch (Exception e) {
VoltDB.crashLocalVoltDB("Unable to delete zk node " + m_generatedRestoreBarrier2, false, e);
}
if (m_callback != null) {
m_callback.onSnapshotRestoreComple... | [
"void",
"exitRestore",
"(",
")",
"{",
"try",
"{",
"m_zk",
".",
"delete",
"(",
"m_generatedRestoreBarrier2",
",",
"-",
"1",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"VoltDB",
".",
"crashLocalVoltDB",
"(",
"\"Unable to delete zk node \"",
"+",
... | Exists the restore process. Waits for all other hosts to complete first.
This method blocks. | [
"Exists",
"the",
"restore",
"process",
".",
"Waits",
"for",
"all",
"other",
"hosts",
"to",
"complete",
"first",
".",
"This",
"method",
"blocks",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L570-L607 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.consolidateSnapshotInfos | static SnapshotInfo consolidateSnapshotInfos(Collection<SnapshotInfo> lastSnapshot)
{
SnapshotInfo chosen = null;
if (lastSnapshot != null) {
Iterator<SnapshotInfo> i = lastSnapshot.iterator();
while (i.hasNext()) {
SnapshotInfo next = i.next();
... | java | static SnapshotInfo consolidateSnapshotInfos(Collection<SnapshotInfo> lastSnapshot)
{
SnapshotInfo chosen = null;
if (lastSnapshot != null) {
Iterator<SnapshotInfo> i = lastSnapshot.iterator();
while (i.hasNext()) {
SnapshotInfo next = i.next();
... | [
"static",
"SnapshotInfo",
"consolidateSnapshotInfos",
"(",
"Collection",
"<",
"SnapshotInfo",
">",
"lastSnapshot",
")",
"{",
"SnapshotInfo",
"chosen",
"=",
"null",
";",
"if",
"(",
"lastSnapshot",
"!=",
"null",
")",
"{",
"Iterator",
"<",
"SnapshotInfo",
">",
"i",... | Picks a snapshot info for restore. A single snapshot might have different
files scattered across multiple machines. All nodes must pick the same
SnapshotInfo or different nodes will pick different catalogs to restore.
Pick one SnapshotInfo and consolidate the per-node state into it. | [
"Picks",
"a",
"snapshot",
"info",
"for",
"restore",
".",
"A",
"single",
"snapshot",
"might",
"have",
"different",
"files",
"scattered",
"across",
"multiple",
"machines",
".",
"All",
"nodes",
"must",
"pick",
"the",
"same",
"SnapshotInfo",
"or",
"different",
"no... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L906-L926 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.sendSnapshotTxnId | private void sendSnapshotTxnId(SnapshotInfo toRestore) {
long txnId = toRestore != null ? toRestore.txnId : 0;
String jsonData = toRestore != null ? toRestore.toJSONObject().toString() : "{}";
LOG.debug("Sending snapshot ID " + txnId + " for restore to other nodes");
try {
m_... | java | private void sendSnapshotTxnId(SnapshotInfo toRestore) {
long txnId = toRestore != null ? toRestore.txnId : 0;
String jsonData = toRestore != null ? toRestore.toJSONObject().toString() : "{}";
LOG.debug("Sending snapshot ID " + txnId + " for restore to other nodes");
try {
m_... | [
"private",
"void",
"sendSnapshotTxnId",
"(",
"SnapshotInfo",
"toRestore",
")",
"{",
"long",
"txnId",
"=",
"toRestore",
"!=",
"null",
"?",
"toRestore",
".",
"txnId",
":",
"0",
";",
"String",
"jsonData",
"=",
"toRestore",
"!=",
"null",
"?",
"toRestore",
".",
... | Send the txnId of the snapshot that was picked to restore from to the
other hosts. If there was no snapshot to restore from, send 0.
@param txnId | [
"Send",
"the",
"txnId",
"of",
"the",
"snapshot",
"that",
"was",
"picked",
"to",
"restore",
"from",
"to",
"the",
"other",
"hosts",
".",
"If",
"there",
"was",
"no",
"snapshot",
"to",
"restore",
"from",
"send",
"0",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L934-L945 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.sendLocalRestoreInformation | private void sendLocalRestoreInformation(Long max, Set<SnapshotInfo> snapshots) {
String jsonData = serializeRestoreInformation(max, snapshots);
String zkNode = VoltZK.restore + "/" + m_hostId;
try {
m_zk.create(zkNode, jsonData.getBytes(StandardCharsets.UTF_8),
... | java | private void sendLocalRestoreInformation(Long max, Set<SnapshotInfo> snapshots) {
String jsonData = serializeRestoreInformation(max, snapshots);
String zkNode = VoltZK.restore + "/" + m_hostId;
try {
m_zk.create(zkNode, jsonData.getBytes(StandardCharsets.UTF_8),
... | [
"private",
"void",
"sendLocalRestoreInformation",
"(",
"Long",
"max",
",",
"Set",
"<",
"SnapshotInfo",
">",
"snapshots",
")",
"{",
"String",
"jsonData",
"=",
"serializeRestoreInformation",
"(",
"max",
",",
"snapshots",
")",
";",
"String",
"zkNode",
"=",
"VoltZK"... | Send the information about the local snapshot files to the other hosts to
generate restore plan.
@param max
The maximum txnId of the last txn across all initiators in the
local command log.
@param snapshots
The information of the local snapshot files. | [
"Send",
"the",
"information",
"about",
"the",
"local",
"snapshot",
"files",
"to",
"the",
"other",
"hosts",
"to",
"generate",
"restore",
"plan",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L987-L997 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.deserializeRestoreInformation | private Long deserializeRestoreInformation(List<String> children,
Map<String, Set<SnapshotInfo>> snapshotFragments) throws Exception
{
try {
int recover = m_action.ordinal();
Long clStartTxnId = null;
for (String node : children) {
//This might... | java | private Long deserializeRestoreInformation(List<String> children,
Map<String, Set<SnapshotInfo>> snapshotFragments) throws Exception
{
try {
int recover = m_action.ordinal();
Long clStartTxnId = null;
for (String node : children) {
//This might... | [
"private",
"Long",
"deserializeRestoreInformation",
"(",
"List",
"<",
"String",
">",
"children",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"SnapshotInfo",
">",
">",
"snapshotFragments",
")",
"throws",
"Exception",
"{",
"try",
"{",
"int",
"recover",
"=",
"m... | This function, like all good functions, does three things.
It produces the command log start transaction Id.
It produces a map of SnapshotInfo objects.
And, it errors if the remote start action does not match the local action. | [
"This",
"function",
"like",
"all",
"good",
"functions",
"does",
"three",
"things",
".",
"It",
"produces",
"the",
"command",
"log",
"start",
"transaction",
"Id",
".",
"It",
"produces",
"a",
"map",
"of",
"SnapshotInfo",
"objects",
".",
"And",
"it",
"errors",
... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L1180-L1228 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.changeState | private void changeState() {
if (m_state == State.RESTORE) {
fetchSnapshotTxnId();
exitRestore();
m_state = State.REPLAY;
/*
* Add the interest here so that we can use the barriers in replay
* agent to synchronize.
*/
... | java | private void changeState() {
if (m_state == State.RESTORE) {
fetchSnapshotTxnId();
exitRestore();
m_state = State.REPLAY;
/*
* Add the interest here so that we can use the barriers in replay
* agent to synchronize.
*/
... | [
"private",
"void",
"changeState",
"(",
")",
"{",
"if",
"(",
"m_state",
"==",
"State",
".",
"RESTORE",
")",
"{",
"fetchSnapshotTxnId",
"(",
")",
";",
"exitRestore",
"(",
")",
";",
"m_state",
"=",
"State",
".",
"REPLAY",
";",
"/*\n * Add the intere... | Change the state of the restore agent based on the current state. | [
"Change",
"the",
"state",
"of",
"the",
"restore",
"agent",
"based",
"on",
"the",
"current",
"state",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L1285-L1311 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.getSnapshots | private Map<String, Snapshot> getSnapshots() {
/*
* Use the individual snapshot directories instead of voltroot, because
* they can be set individually
*/
Map<String, SnapshotPathType> paths = new HashMap<String, SnapshotPathType>();
if (VoltDB.instance().getConfig().m... | java | private Map<String, Snapshot> getSnapshots() {
/*
* Use the individual snapshot directories instead of voltroot, because
* they can be set individually
*/
Map<String, SnapshotPathType> paths = new HashMap<String, SnapshotPathType>();
if (VoltDB.instance().getConfig().m... | [
"private",
"Map",
"<",
"String",
",",
"Snapshot",
">",
"getSnapshots",
"(",
")",
"{",
"/*\n * Use the individual snapshot directories instead of voltroot, because\n * they can be set individually\n */",
"Map",
"<",
"String",
",",
"SnapshotPathType",
">",
"... | Finds all the snapshots in all the places we know of which could possibly
store snapshots, like command log snapshots, auto snapshots, etc.
@return All snapshots | [
"Finds",
"all",
"the",
"snapshots",
"in",
"all",
"the",
"places",
"we",
"know",
"of",
"which",
"could",
"possibly",
"store",
"snapshots",
"like",
"command",
"log",
"snapshots",
"auto",
"snapshots",
"etc",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L1383-L1405 | train |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.snapshotCompleted | @Override
public CountDownLatch snapshotCompleted(SnapshotCompletionEvent event) {
if (!event.truncationSnapshot || !event.didSucceed) {
VoltDB.crashGlobalVoltDB("Failed to truncate command logs by snapshot",
false, null);
} else {
m_trunc... | java | @Override
public CountDownLatch snapshotCompleted(SnapshotCompletionEvent event) {
if (!event.truncationSnapshot || !event.didSucceed) {
VoltDB.crashGlobalVoltDB("Failed to truncate command logs by snapshot",
false, null);
} else {
m_trunc... | [
"@",
"Override",
"public",
"CountDownLatch",
"snapshotCompleted",
"(",
"SnapshotCompletionEvent",
"event",
")",
"{",
"if",
"(",
"!",
"event",
".",
"truncationSnapshot",
"||",
"!",
"event",
".",
"didSucceed",
")",
"{",
"VoltDB",
".",
"crashGlobalVoltDB",
"(",
"\"... | All nodes will be notified about the completion of the truncation
snapshot. | [
"All",
"nodes",
"will",
"be",
"notified",
"about",
"the",
"completion",
"of",
"the",
"truncation",
"snapshot",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L1411-L1423 | train |
VoltDB/voltdb | src/frontend/org/voltcore/network/VoltNetwork.java | VoltNetwork.shutdown | void shutdown() throws InterruptedException {
m_shouldStop = true;
if (m_thread != null) {
m_selector.wakeup();
m_thread.join();
}
} | java | void shutdown() throws InterruptedException {
m_shouldStop = true;
if (m_thread != null) {
m_selector.wakeup();
m_thread.join();
}
} | [
"void",
"shutdown",
"(",
")",
"throws",
"InterruptedException",
"{",
"m_shouldStop",
"=",
"true",
";",
"if",
"(",
"m_thread",
"!=",
"null",
")",
"{",
"m_selector",
".",
"wakeup",
"(",
")",
";",
"m_thread",
".",
"join",
"(",
")",
";",
"}",
"}"
] | Instruct the network to stop after the current loop | [
"Instruct",
"the",
"network",
"to",
"stop",
"after",
"the",
"current",
"loop"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/network/VoltNetwork.java#L148-L154 | train |
VoltDB/voltdb | src/frontend/org/voltcore/network/VoltNetwork.java | VoltNetwork.registerChannel | Connection registerChannel(
final SocketChannel channel,
final InputHandler handler,
final int interestOps,
final ReverseDNSPolicy dns,
final CipherExecutor cipherService,
final SSLEngine sslEngine) throws IOException {
synchronized(channe... | java | Connection registerChannel(
final SocketChannel channel,
final InputHandler handler,
final int interestOps,
final ReverseDNSPolicy dns,
final CipherExecutor cipherService,
final SSLEngine sslEngine) throws IOException {
synchronized(channe... | [
"Connection",
"registerChannel",
"(",
"final",
"SocketChannel",
"channel",
",",
"final",
"InputHandler",
"handler",
",",
"final",
"int",
"interestOps",
",",
"final",
"ReverseDNSPolicy",
"dns",
",",
"final",
"CipherExecutor",
"cipherService",
",",
"final",
"SSLEngine",... | Register a channel with the selector and create a Connection that will pass incoming events
to the provided handler.
@param channel
@param handler
@throws IOException | [
"Register",
"a",
"channel",
"with",
"the",
"selector",
"and",
"create",
"a",
"Connection",
"that",
"will",
"pass",
"incoming",
"events",
"to",
"the",
"provided",
"handler",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/network/VoltNetwork.java#L170-L235 | train |
VoltDB/voltdb | src/frontend/org/voltcore/network/VoltNetwork.java | VoltNetwork.unregisterChannel | Future<?> unregisterChannel (Connection c) {
FutureTask<Object> ft = new FutureTask<Object>(getUnregisterRunnable(c), null);
m_tasks.offer(ft);
m_selector.wakeup();
return ft;
} | java | Future<?> unregisterChannel (Connection c) {
FutureTask<Object> ft = new FutureTask<Object>(getUnregisterRunnable(c), null);
m_tasks.offer(ft);
m_selector.wakeup();
return ft;
} | [
"Future",
"<",
"?",
">",
"unregisterChannel",
"(",
"Connection",
"c",
")",
"{",
"FutureTask",
"<",
"Object",
">",
"ft",
"=",
"new",
"FutureTask",
"<",
"Object",
">",
"(",
"getUnregisterRunnable",
"(",
"c",
")",
",",
"null",
")",
";",
"m_tasks",
".",
"o... | Unregister a channel. The connections streams are not drained before finishing.
@param c | [
"Unregister",
"a",
"channel",
".",
"The",
"connections",
"streams",
"are",
"not",
"drained",
"before",
"finishing",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/network/VoltNetwork.java#L271-L276 | train |
VoltDB/voltdb | src/frontend/org/voltcore/network/VoltNetwork.java | VoltNetwork.addToChangeList | void addToChangeList(final VoltPort port, final boolean runFirst) {
if (runFirst) {
m_tasks.offer(new Runnable() {
@Override
public void run() {
callPort(port);
}
});
} else {
m_tasks.offer(new Runnab... | java | void addToChangeList(final VoltPort port, final boolean runFirst) {
if (runFirst) {
m_tasks.offer(new Runnable() {
@Override
public void run() {
callPort(port);
}
});
} else {
m_tasks.offer(new Runnab... | [
"void",
"addToChangeList",
"(",
"final",
"VoltPort",
"port",
",",
"final",
"boolean",
"runFirst",
")",
"{",
"if",
"(",
"runFirst",
")",
"{",
"m_tasks",
".",
"offer",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
... | Set interest registrations for a port | [
"Set",
"interest",
"registrations",
"for",
"a",
"port"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/network/VoltNetwork.java#L283-L300 | train |
VoltDB/voltdb | src/frontend/org/voltcore/network/VoltNetwork.java | VoltNetwork.invokeCallbacks | protected void invokeCallbacks(ThreadLocalRandom r) {
final Set<SelectionKey> selectedKeys = m_selector.selectedKeys();
final int keyCount = selectedKeys.size();
int startInx = r.nextInt(keyCount);
int itInx = 0;
Iterator<SelectionKey> it = selectedKeys.iterator();
while(... | java | protected void invokeCallbacks(ThreadLocalRandom r) {
final Set<SelectionKey> selectedKeys = m_selector.selectedKeys();
final int keyCount = selectedKeys.size();
int startInx = r.nextInt(keyCount);
int itInx = 0;
Iterator<SelectionKey> it = selectedKeys.iterator();
while(... | [
"protected",
"void",
"invokeCallbacks",
"(",
"ThreadLocalRandom",
"r",
")",
"{",
"final",
"Set",
"<",
"SelectionKey",
">",
"selectedKeys",
"=",
"m_selector",
".",
"selectedKeys",
"(",
")",
";",
"final",
"int",
"keyCount",
"=",
"selectedKeys",
".",
"size",
"(",... | Set the selected interest set on the port and run it. | [
"Set",
"the",
"selected",
"interest",
"set",
"on",
"the",
"port",
"and",
"run",
"it",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/network/VoltNetwork.java#L444-L475 | train |
VoltDB/voltdb | src/frontend/org/voltcore/zk/ZKUtil.java | ZKUtil.path | public static String path(String... components)
{
String path = components[0];
for (int i=1; i < components.length; i++) {
path = ZKUtil.joinZKPath(path, components[i]);
}
return path;
} | java | public static String path(String... components)
{
String path = components[0];
for (int i=1; i < components.length; i++) {
path = ZKUtil.joinZKPath(path, components[i]);
}
return path;
} | [
"public",
"static",
"String",
"path",
"(",
"String",
"...",
"components",
")",
"{",
"String",
"path",
"=",
"components",
"[",
"0",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"components",
".",
"length",
";",
"i",
"++",
")",
"{",
"... | Helper to produce a valid path from variadic strings. | [
"Helper",
"to",
"produce",
"a",
"valid",
"path",
"from",
"variadic",
"strings",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/zk/ZKUtil.java#L78-L85 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/PersistentBinaryDeque.java | PersistentBinaryDeque.getSegmentFileName | private String getSegmentFileName(long currentId, long previousId) {
return PbdSegmentName.createName(m_nonce, currentId, previousId, false);
} | java | private String getSegmentFileName(long currentId, long previousId) {
return PbdSegmentName.createName(m_nonce, currentId, previousId, false);
} | [
"private",
"String",
"getSegmentFileName",
"(",
"long",
"currentId",
",",
"long",
"previousId",
")",
"{",
"return",
"PbdSegmentName",
".",
"createName",
"(",
"m_nonce",
",",
"currentId",
",",
"previousId",
",",
"false",
")",
";",
"}"
] | Return a segment file name from m_nonce and current + previous segment ids.
@see parseFiles for file name structure
@param currentId current segment id
@param previousId previous segment id
@return segment file name | [
"Return",
"a",
"segment",
"file",
"name",
"from",
"m_nonce",
"and",
"current",
"+",
"previous",
"segment",
"ids",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/PersistentBinaryDeque.java#L463-L465 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/PersistentBinaryDeque.java | PersistentBinaryDeque.getPreviousSegmentId | private long getPreviousSegmentId(File file) {
PbdSegmentName segmentName = PbdSegmentName.parseFile(m_usageSpecificLog, file);
if (segmentName.m_result != PbdSegmentName.Result.OK) {
throw new IllegalStateException("Invalid file name: " + file.getName());
}
return segmentNam... | java | private long getPreviousSegmentId(File file) {
PbdSegmentName segmentName = PbdSegmentName.parseFile(m_usageSpecificLog, file);
if (segmentName.m_result != PbdSegmentName.Result.OK) {
throw new IllegalStateException("Invalid file name: " + file.getName());
}
return segmentNam... | [
"private",
"long",
"getPreviousSegmentId",
"(",
"File",
"file",
")",
"{",
"PbdSegmentName",
"segmentName",
"=",
"PbdSegmentName",
".",
"parseFile",
"(",
"m_usageSpecificLog",
",",
"file",
")",
";",
"if",
"(",
"segmentName",
".",
"m_result",
"!=",
"PbdSegmentName",... | Extract the previous segment id from a file name.
Note that the filename is assumed valid at this point.
@see parseFiles for file name structure
@param file
@return | [
"Extract",
"the",
"previous",
"segment",
"id",
"from",
"a",
"file",
"name",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/PersistentBinaryDeque.java#L476-L482 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/PersistentBinaryDeque.java | PersistentBinaryDeque.deleteStalePbdFile | private void deleteStalePbdFile(File file) throws IOException {
try {
PBDSegment.setFinal(file, false);
if (m_usageSpecificLog.isDebugEnabled()) {
m_usageSpecificLog.debug("Segment " + file.getName()
+ " (final: " + PBDSegment.isFinal(file) + "), will be c... | java | private void deleteStalePbdFile(File file) throws IOException {
try {
PBDSegment.setFinal(file, false);
if (m_usageSpecificLog.isDebugEnabled()) {
m_usageSpecificLog.debug("Segment " + file.getName()
+ " (final: " + PBDSegment.isFinal(file) + "), will be c... | [
"private",
"void",
"deleteStalePbdFile",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"{",
"PBDSegment",
".",
"setFinal",
"(",
"file",
",",
"false",
")",
";",
"if",
"(",
"m_usageSpecificLog",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"m_... | Delete a PBD segment that was identified as 'stale' i.e. produced by earlier VoltDB releases
Note that this file may be concurrently deleted from multiple instances so we ignore
NoSuchFileException.
@param file
@throws IOException | [
"Delete",
"a",
"PBD",
"segment",
"that",
"was",
"identified",
"as",
"stale",
"i",
".",
"e",
".",
"produced",
"by",
"earlier",
"VoltDB",
"releases"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/PersistentBinaryDeque.java#L595-L610 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/PersistentBinaryDeque.java | PersistentBinaryDeque.recoverSegment | private void recoverSegment(long segmentIndex, long segmentId, PbdSegmentName segmentName) throws IOException {
PBDSegment segment;
if (segmentName.m_quarantined) {
segment = new PbdQuarantinedSegment(segmentName.m_file, segmentIndex, segmentId);
} else {
segment = newSeg... | java | private void recoverSegment(long segmentIndex, long segmentId, PbdSegmentName segmentName) throws IOException {
PBDSegment segment;
if (segmentName.m_quarantined) {
segment = new PbdQuarantinedSegment(segmentName.m_file, segmentIndex, segmentId);
} else {
segment = newSeg... | [
"private",
"void",
"recoverSegment",
"(",
"long",
"segmentIndex",
",",
"long",
"segmentId",
",",
"PbdSegmentName",
"segmentName",
")",
"throws",
"IOException",
"{",
"PBDSegment",
"segment",
";",
"if",
"(",
"segmentName",
".",
"m_quarantined",
")",
"{",
"segment",
... | Recover a PBD segment and add it to m_segments
@param segment
@param deleteEmpty
@throws IOException | [
"Recover",
"a",
"PBD",
"segment",
"and",
"add",
"it",
"to",
"m_segments"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/PersistentBinaryDeque.java#L663-L702 | train |
VoltDB/voltdb | src/frontend/org/voltdb/utils/PersistentBinaryDeque.java | PersistentBinaryDeque.numOpenSegments | int numOpenSegments() {
int numOpen = 0;
for (PBDSegment segment : m_segments.values()) {
if (!segment.isClosed()) {
numOpen++;
}
}
return numOpen;
} | java | int numOpenSegments() {
int numOpen = 0;
for (PBDSegment segment : m_segments.values()) {
if (!segment.isClosed()) {
numOpen++;
}
}
return numOpen;
} | [
"int",
"numOpenSegments",
"(",
")",
"{",
"int",
"numOpen",
"=",
"0",
";",
"for",
"(",
"PBDSegment",
"segment",
":",
"m_segments",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"!",
"segment",
".",
"isClosed",
"(",
")",
")",
"{",
"numOpen",
"++",
";... | Used by test only | [
"Used",
"by",
"test",
"only"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/PersistentBinaryDeque.java#L1252-L1261 | train |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/cache/CacheBuilder.java | CacheBuilder.expireAfterWrite | public CacheBuilder<K, V> expireAfterWrite(long duration, TimeUnit unit) {
checkState(
expireAfterWriteNanos == UNSET_INT,
"expireAfterWrite was already set to %s ns",
expireAfterWriteNanos);
checkArgument(duration >= 0, "duration cannot be negative: %s %s", duration, unit);
this.exp... | java | public CacheBuilder<K, V> expireAfterWrite(long duration, TimeUnit unit) {
checkState(
expireAfterWriteNanos == UNSET_INT,
"expireAfterWrite was already set to %s ns",
expireAfterWriteNanos);
checkArgument(duration >= 0, "duration cannot be negative: %s %s", duration, unit);
this.exp... | [
"public",
"CacheBuilder",
"<",
"K",
",",
"V",
">",
"expireAfterWrite",
"(",
"long",
"duration",
",",
"TimeUnit",
"unit",
")",
"{",
"checkState",
"(",
"expireAfterWriteNanos",
"==",
"UNSET_INT",
",",
"\"expireAfterWrite was already set to %s ns\"",
",",
"expireAfterWri... | Specifies that each entry should be automatically removed from the cache once a fixed duration
has elapsed after the entry's creation, or the most recent replacement of its value.
<p>When {@code duration} is zero, this method hands off to {@link #maximumSize(long)
maximumSize}{@code (0)}, ignoring any otherwise-specif... | [
"Specifies",
"that",
"each",
"entry",
"should",
"be",
"automatically",
"removed",
"from",
"the",
"cache",
"once",
"a",
"fixed",
"duration",
"has",
"elapsed",
"after",
"the",
"entry",
"s",
"creation",
"or",
"the",
"most",
"recent",
"replacement",
"of",
"its",
... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/cache/CacheBuilder.java#L621-L629 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java | Grantee.revoke | public void revoke(Grantee role) {
if (!hasRoleDirect(role)) {
throw Error.error(ErrorCode.X_0P503, role.getNameString());
}
roles.remove(role);
} | java | public void revoke(Grantee role) {
if (!hasRoleDirect(role)) {
throw Error.error(ErrorCode.X_0P503, role.getNameString());
}
roles.remove(role);
} | [
"public",
"void",
"revoke",
"(",
"Grantee",
"role",
")",
"{",
"if",
"(",
"!",
"hasRoleDirect",
"(",
"role",
")",
")",
"{",
"throw",
"Error",
".",
"error",
"(",
"ErrorCode",
".",
"X_0P503",
",",
"role",
".",
"getNameString",
"(",
")",
")",
";",
"}",
... | Revoke a direct role only | [
"Revoke",
"a",
"direct",
"role",
"only"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java#L224-L231 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java | Grantee.addGranteeAndRoles | private OrderedHashSet addGranteeAndRoles(OrderedHashSet set) {
Grantee candidateRole;
set.add(this);
for (int i = 0; i < roles.size(); i++) {
candidateRole = (Grantee) roles.get(i);
if (!set.contains(candidateRole)) {
candidateRole.addGranteeAndRoles(... | java | private OrderedHashSet addGranteeAndRoles(OrderedHashSet set) {
Grantee candidateRole;
set.add(this);
for (int i = 0; i < roles.size(); i++) {
candidateRole = (Grantee) roles.get(i);
if (!set.contains(candidateRole)) {
candidateRole.addGranteeAndRoles(... | [
"private",
"OrderedHashSet",
"addGranteeAndRoles",
"(",
"OrderedHashSet",
"set",
")",
"{",
"Grantee",
"candidateRole",
";",
"set",
".",
"add",
"(",
"this",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"roles",
".",
"size",
"(",
")",
";",
... | Adds to given Set this.sName plus all roles and nested roles.
@return Given role with new elements added. | [
"Adds",
"to",
"given",
"Set",
"this",
".",
"sName",
"plus",
"all",
"roles",
"and",
"nested",
"roles",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java#L302-L317 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java | Grantee.addAllRoles | public void addAllRoles(HashMap map) {
for (int i = 0; i < roles.size(); i++) {
Grantee role = (Grantee) roles.get(i);
map.put(role.granteeName.name, role.roles);
}
} | java | public void addAllRoles(HashMap map) {
for (int i = 0; i < roles.size(); i++) {
Grantee role = (Grantee) roles.get(i);
map.put(role.granteeName.name, role.roles);
}
} | [
"public",
"void",
"addAllRoles",
"(",
"HashMap",
"map",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"roles",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Grantee",
"role",
"=",
"(",
"Grantee",
")",
"roles",
".",
"get",
"(",
... | returns a map with grantee name keys and sets of granted roles as value | [
"returns",
"a",
"map",
"with",
"grantee",
"name",
"keys",
"and",
"sets",
"of",
"granted",
"roles",
"as",
"value"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java#L322-L329 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java | Grantee.clearPrivileges | void clearPrivileges() {
roles.clear();
directRightsMap.clear();
grantedRightsMap.clear();
fullRightsMap.clear();
isAdmin = false;
} | java | void clearPrivileges() {
roles.clear();
directRightsMap.clear();
grantedRightsMap.clear();
fullRightsMap.clear();
isAdmin = false;
} | [
"void",
"clearPrivileges",
"(",
")",
"{",
"roles",
".",
"clear",
"(",
")",
";",
"directRightsMap",
".",
"clear",
"(",
")",
";",
"grantedRightsMap",
".",
"clear",
"(",
")",
";",
"fullRightsMap",
".",
"clear",
"(",
")",
";",
"isAdmin",
"=",
"false",
";",... | Revokes all rights from this Grantee object. The map is cleared and
the database administrator role attribute is set false. | [
"Revokes",
"all",
"rights",
"from",
"this",
"Grantee",
"object",
".",
"The",
"map",
"is",
"cleared",
"and",
"the",
"database",
"administrator",
"role",
"attribute",
"is",
"set",
"false",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java#L473-L481 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java | Grantee.updateNestedRoles | boolean updateNestedRoles(Grantee role) {
boolean hasNested = false;
if (role != this) {
for (int i = 0; i < roles.size(); i++) {
Grantee currentRole = (Grantee) roles.get(i);
hasNested |= currentRole.updateNestedRoles(role);
}
}
... | java | boolean updateNestedRoles(Grantee role) {
boolean hasNested = false;
if (role != this) {
for (int i = 0; i < roles.size(); i++) {
Grantee currentRole = (Grantee) roles.get(i);
hasNested |= currentRole.updateNestedRoles(role);
}
}
... | [
"boolean",
"updateNestedRoles",
"(",
"Grantee",
"role",
")",
"{",
"boolean",
"hasNested",
"=",
"false",
";",
"if",
"(",
"role",
"!=",
"this",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"roles",
".",
"size",
"(",
")",
";",
"i",
"++... | Recursive method used with ROLE Grantee objects to set the fullRightsMap
and admin flag for all the roles.
If a new ROLE is granted to a ROLE Grantee object, the ROLE should first
be added to the Set of ROLE Grantee objects (roles) for the grantee.
The grantee will be the parameter.
If the direct permissions granted ... | [
"Recursive",
"method",
"used",
"with",
"ROLE",
"Grantee",
"objects",
"to",
"set",
"the",
"fullRightsMap",
"and",
"admin",
"flag",
"for",
"all",
"the",
"roles",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java#L805-L822 | train |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java | Grantee.addToFullRights | void addToFullRights(HashMap map) {
Iterator it = map.keySet().iterator();
while (it.hasNext()) {
Object key = it.next();
Right add = (Right) map.get(key);
Right existing = (Right) fullRightsMap.get(key);
if (existing == null) {
... | java | void addToFullRights(HashMap map) {
Iterator it = map.keySet().iterator();
while (it.hasNext()) {
Object key = it.next();
Right add = (Right) map.get(key);
Right existing = (Right) fullRightsMap.get(key);
if (existing == null) {
... | [
"void",
"addToFullRights",
"(",
"HashMap",
"map",
")",
"{",
"Iterator",
"it",
"=",
"map",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"key",
"=",
"it",
".",
"next",
"(... | Full or partial rights are added to existing | [
"Full",
"or",
"partial",
"rights",
"are",
"added",
"to",
"existing"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/rights/Grantee.java#L858-L885 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/parseinfo/BranchNode.java | BranchNode.toLeftJoin | public void toLeftJoin() {
assert((m_leftNode != null && m_rightNode != null) || (m_leftNode == null && m_rightNode == null));
if (m_leftNode == null && m_rightNode == null) {
// End of recursion
return;
}
// recursive calls
if (m_leftNode instanceof Branc... | java | public void toLeftJoin() {
assert((m_leftNode != null && m_rightNode != null) || (m_leftNode == null && m_rightNode == null));
if (m_leftNode == null && m_rightNode == null) {
// End of recursion
return;
}
// recursive calls
if (m_leftNode instanceof Branc... | [
"public",
"void",
"toLeftJoin",
"(",
")",
"{",
"assert",
"(",
"(",
"m_leftNode",
"!=",
"null",
"&&",
"m_rightNode",
"!=",
"null",
")",
"||",
"(",
"m_leftNode",
"==",
"null",
"&&",
"m_rightNode",
"==",
"null",
")",
")",
";",
"if",
"(",
"m_leftNode",
"==... | Transform all RIGHT joins from the tree into the LEFT ones by swapping the nodes and their join types | [
"Transform",
"all",
"RIGHT",
"joins",
"from",
"the",
"tree",
"into",
"the",
"LEFT",
"ones",
"by",
"swapping",
"the",
"nodes",
"and",
"their",
"join",
"types"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/BranchNode.java#L321-L342 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/parseinfo/BranchNode.java | BranchNode.extractSubTree | @Override
protected void extractSubTree(List<JoinNode> leafNodes) {
JoinNode[] children = {m_leftNode, m_rightNode};
for (JoinNode child : children) {
// Leaf nodes don't have a significant join type,
// test for them first and never attempt to start a new tree at a leaf.
... | java | @Override
protected void extractSubTree(List<JoinNode> leafNodes) {
JoinNode[] children = {m_leftNode, m_rightNode};
for (JoinNode child : children) {
// Leaf nodes don't have a significant join type,
// test for them first and never attempt to start a new tree at a leaf.
... | [
"@",
"Override",
"protected",
"void",
"extractSubTree",
"(",
"List",
"<",
"JoinNode",
">",
"leafNodes",
")",
"{",
"JoinNode",
"[",
"]",
"children",
"=",
"{",
"m_leftNode",
",",
"m_rightNode",
"}",
";",
"for",
"(",
"JoinNode",
"child",
":",
"children",
")",... | Starting from the root recurse to its children stopping at the first join node
of the different type and discontinue the tree at this point by replacing the join node with
the temporary node which id matches the join node id. This join node is the root of the next
sub-tree.
@param root - The root of the join tree
@para... | [
"Starting",
"from",
"the",
"root",
"recurse",
"to",
"its",
"children",
"stopping",
"at",
"the",
"first",
"join",
"node",
"of",
"the",
"different",
"type",
"and",
"discontinue",
"the",
"tree",
"at",
"this",
"point",
"by",
"replacing",
"the",
"join",
"node",
... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/BranchNode.java#L352-L381 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/parseinfo/BranchNode.java | BranchNode.hasOuterJoin | @Override
public boolean hasOuterJoin() {
assert(m_leftNode != null && m_rightNode != null);
return m_joinType != JoinType.INNER ||
m_leftNode.hasOuterJoin() || m_rightNode.hasOuterJoin();
} | java | @Override
public boolean hasOuterJoin() {
assert(m_leftNode != null && m_rightNode != null);
return m_joinType != JoinType.INNER ||
m_leftNode.hasOuterJoin() || m_rightNode.hasOuterJoin();
} | [
"@",
"Override",
"public",
"boolean",
"hasOuterJoin",
"(",
")",
"{",
"assert",
"(",
"m_leftNode",
"!=",
"null",
"&&",
"m_rightNode",
"!=",
"null",
")",
";",
"return",
"m_joinType",
"!=",
"JoinType",
".",
"INNER",
"||",
"m_leftNode",
".",
"hasOuterJoin",
"(",... | Returns true if one of the tree nodes has outer join | [
"Returns",
"true",
"if",
"one",
"of",
"the",
"tree",
"nodes",
"has",
"outer",
"join"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/BranchNode.java#L386-L391 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/parseinfo/BranchNode.java | BranchNode.extractEphemeralTableQueries | @Override
public void extractEphemeralTableQueries(List<StmtEphemeralTableScan> scans) {
if (m_leftNode != null) {
m_leftNode.extractEphemeralTableQueries(scans);
}
if (m_rightNode != null) {
m_rightNode.extractEphemeralTableQueries(scans);
}
} | java | @Override
public void extractEphemeralTableQueries(List<StmtEphemeralTableScan> scans) {
if (m_leftNode != null) {
m_leftNode.extractEphemeralTableQueries(scans);
}
if (m_rightNode != null) {
m_rightNode.extractEphemeralTableQueries(scans);
}
} | [
"@",
"Override",
"public",
"void",
"extractEphemeralTableQueries",
"(",
"List",
"<",
"StmtEphemeralTableScan",
">",
"scans",
")",
"{",
"if",
"(",
"m_leftNode",
"!=",
"null",
")",
"{",
"m_leftNode",
".",
"extractEphemeralTableQueries",
"(",
"scans",
")",
";",
"}"... | Returns a list of immediate sub-queries which are part of this query.
@return List<AbstractParsedStmt> - list of sub-queries from this query | [
"Returns",
"a",
"list",
"of",
"immediate",
"sub",
"-",
"queries",
"which",
"are",
"part",
"of",
"this",
"query",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/BranchNode.java#L397-L405 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/parseinfo/BranchNode.java | BranchNode.allInnerJoins | @Override
public boolean allInnerJoins() {
return m_joinType == JoinType.INNER &&
(m_leftNode == null || m_leftNode.allInnerJoins()) &&
(m_rightNode == null || m_rightNode.allInnerJoins());
} | java | @Override
public boolean allInnerJoins() {
return m_joinType == JoinType.INNER &&
(m_leftNode == null || m_leftNode.allInnerJoins()) &&
(m_rightNode == null || m_rightNode.allInnerJoins());
} | [
"@",
"Override",
"public",
"boolean",
"allInnerJoins",
"(",
")",
"{",
"return",
"m_joinType",
"==",
"JoinType",
".",
"INNER",
"&&",
"(",
"m_leftNode",
"==",
"null",
"||",
"m_leftNode",
".",
"allInnerJoins",
"(",
")",
")",
"&&",
"(",
"m_rightNode",
"==",
"n... | Returns if all the join operations within this join tree are inner joins.
@return true or false. | [
"Returns",
"if",
"all",
"the",
"join",
"operations",
"within",
"this",
"join",
"tree",
"are",
"inner",
"joins",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/BranchNode.java#L455-L460 | train |
VoltDB/voltdb | src/frontend/org/voltdb/planner/ScanDeterminizer.java | ScanDeterminizer.apply | public static void apply(CompiledPlan plan, DeterminismMode detMode)
{
if (detMode == DeterminismMode.FASTER) {
return;
}
if (plan.hasDeterministicStatement()) {
return;
}
AbstractPlanNode planGraph = plan.rootPlanGraph;
if (planGraph.isOrderDe... | java | public static void apply(CompiledPlan plan, DeterminismMode detMode)
{
if (detMode == DeterminismMode.FASTER) {
return;
}
if (plan.hasDeterministicStatement()) {
return;
}
AbstractPlanNode planGraph = plan.rootPlanGraph;
if (planGraph.isOrderDe... | [
"public",
"static",
"void",
"apply",
"(",
"CompiledPlan",
"plan",
",",
"DeterminismMode",
"detMode",
")",
"{",
"if",
"(",
"detMode",
"==",
"DeterminismMode",
".",
"FASTER",
")",
"{",
"return",
";",
"}",
"if",
"(",
"plan",
".",
"hasDeterministicStatement",
"(... | Only applies when stronger determinism is needed. | [
"Only",
"applies",
"when",
"stronger",
"determinism",
"is",
"needed",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/ScanDeterminizer.java#L45-L61 | train |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/Scheduler.java | Scheduler.updateLastSeenUniqueIds | public void updateLastSeenUniqueIds(VoltMessage message)
{
long sequenceWithUniqueId = Long.MIN_VALUE;
boolean commandLog = (message instanceof TransactionInfoBaseMessage &&
(((TransactionInfoBaseMessage)message).isForReplay()));
boolean sentinel = message instanceof MultiP... | java | public void updateLastSeenUniqueIds(VoltMessage message)
{
long sequenceWithUniqueId = Long.MIN_VALUE;
boolean commandLog = (message instanceof TransactionInfoBaseMessage &&
(((TransactionInfoBaseMessage)message).isForReplay()));
boolean sentinel = message instanceof MultiP... | [
"public",
"void",
"updateLastSeenUniqueIds",
"(",
"VoltMessage",
"message",
")",
"{",
"long",
"sequenceWithUniqueId",
"=",
"Long",
".",
"MIN_VALUE",
";",
"boolean",
"commandLog",
"=",
"(",
"message",
"instanceof",
"TransactionInfoBaseMessage",
"&&",
"(",
"(",
"(",
... | Update last seen uniqueIds in the replay sequencer. This is used on MPI repair.
@param message | [
"Update",
"last",
"seen",
"uniqueIds",
"in",
"the",
"replay",
"sequencer",
".",
"This",
"is",
"used",
"on",
"MPI",
"repair",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/Scheduler.java#L185-L203 | train |
VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/SnapshotRestoreResultSet.java | SnapshotRestoreResultSet.parseRestoreResultRow | public void parseRestoreResultRow(VoltTable vt)
{
RestoreResultKey key = new RestoreResultKey(
(int)vt.getLong("HOST_ID"),
(int)vt.getLong("PARTITION_ID"),
vt.getString("TABLE"));
if (containsKey(key)) {
get(key).mergeData(vt.getString("RES... | java | public void parseRestoreResultRow(VoltTable vt)
{
RestoreResultKey key = new RestoreResultKey(
(int)vt.getLong("HOST_ID"),
(int)vt.getLong("PARTITION_ID"),
vt.getString("TABLE"));
if (containsKey(key)) {
get(key).mergeData(vt.getString("RES... | [
"public",
"void",
"parseRestoreResultRow",
"(",
"VoltTable",
"vt",
")",
"{",
"RestoreResultKey",
"key",
"=",
"new",
"RestoreResultKey",
"(",
"(",
"int",
")",
"vt",
".",
"getLong",
"(",
"\"HOST_ID\"",
")",
",",
"(",
"int",
")",
"vt",
".",
"getLong",
"(",
... | Parse a restore result table row and add to the set.
@param vt restore result table | [
"Parse",
"a",
"restore",
"result",
"table",
"row",
"and",
"add",
"to",
"the",
"set",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/SnapshotRestoreResultSet.java#L157-L173 | train |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/SortedLists.java | SortedLists.binarySearch | public static <E extends Comparable> int binarySearch(
List<? extends E> list,
E e,
KeyPresentBehavior presentBehavior,
KeyAbsentBehavior absentBehavior) {
checkNotNull(e);
return binarySearch(list, e, Ordering.natural(), presentBehavior, absentBehavior);
} | java | public static <E extends Comparable> int binarySearch(
List<? extends E> list,
E e,
KeyPresentBehavior presentBehavior,
KeyAbsentBehavior absentBehavior) {
checkNotNull(e);
return binarySearch(list, e, Ordering.natural(), presentBehavior, absentBehavior);
} | [
"public",
"static",
"<",
"E",
"extends",
"Comparable",
">",
"int",
"binarySearch",
"(",
"List",
"<",
"?",
"extends",
"E",
">",
"list",
",",
"E",
"e",
",",
"KeyPresentBehavior",
"presentBehavior",
",",
"KeyAbsentBehavior",
"absentBehavior",
")",
"{",
"checkNotN... | Searches the specified naturally ordered list for the specified object using the binary search
algorithm.
<p>Equivalent to {@link #binarySearch(List, Function, Object, Comparator, KeyPresentBehavior,
KeyAbsentBehavior)} using {@link Ordering#natural}. | [
"Searches",
"the",
"specified",
"naturally",
"ordered",
"list",
"for",
"the",
"specified",
"object",
"using",
"the",
"binary",
"search",
"algorithm",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/SortedLists.java#L188-L195 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.