id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
60,900 | VoltDB/voltdb | src/frontend/org/voltcore/messaging/SocketJoiner.java | SocketJoiner.connectToHost | private SocketChannel connectToHost(SocketAddress hostAddr)
throws IOException
{
SocketChannel socket = null;
while (socket == null) {
try {
socket = SocketChannel.open(hostAddr);
}
catch (java.net.ConnectException e) {
... | java | private SocketChannel connectToHost(SocketAddress hostAddr)
throws IOException
{
SocketChannel socket = null;
while (socket == null) {
try {
socket = SocketChannel.open(hostAddr);
}
catch (java.net.ConnectException e) {
... | [
"private",
"SocketChannel",
"connectToHost",
"(",
"SocketAddress",
"hostAddr",
")",
"throws",
"IOException",
"{",
"SocketChannel",
"socket",
"=",
"null",
";",
"while",
"(",
"socket",
"==",
"null",
")",
"{",
"try",
"{",
"socket",
"=",
"SocketChannel",
".",
"ope... | Create socket to the given host | [
"Create",
"socket",
"to",
"the",
"given",
"host"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/messaging/SocketJoiner.java#L736-L753 |
60,901 | VoltDB/voltdb | src/frontend/org/voltcore/messaging/SocketJoiner.java | SocketJoiner.requestHostId | private RequestHostIdResponse requestHostId (
MessagingChannel messagingChannel,
Set<String> activeVersions) throws Exception
{
VersionChecker versionChecker = m_acceptor.getVersionChecker();
activeVersions.add(versionChecker.getVersionString());
JSONObject jsObj = n... | java | private RequestHostIdResponse requestHostId (
MessagingChannel messagingChannel,
Set<String> activeVersions) throws Exception
{
VersionChecker versionChecker = m_acceptor.getVersionChecker();
activeVersions.add(versionChecker.getVersionString());
JSONObject jsObj = n... | [
"private",
"RequestHostIdResponse",
"requestHostId",
"(",
"MessagingChannel",
"messagingChannel",
",",
"Set",
"<",
"String",
">",
"activeVersions",
")",
"throws",
"Exception",
"{",
"VersionChecker",
"versionChecker",
"=",
"m_acceptor",
".",
"getVersionChecker",
"(",
")"... | Connection handshake to the leader, ask the leader to assign a host Id
for current node.
@param
@return array of two JSON objects, first is leader info, second is
the response to our request
@throws Exception | [
"Connection",
"handshake",
"to",
"the",
"leader",
"ask",
"the",
"leader",
"to",
"assign",
"a",
"host",
"Id",
"for",
"current",
"node",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/messaging/SocketJoiner.java#L763-L801 |
60,902 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FragmentTaskMessage.java | FragmentTaskMessage.addFragment | public void addFragment(byte[] planHash, int outputDepId, ByteBuffer parameterSet) {
addFragment(planHash, null, outputDepId, parameterSet);
} | java | public void addFragment(byte[] planHash, int outputDepId, ByteBuffer parameterSet) {
addFragment(planHash, null, outputDepId, parameterSet);
} | [
"public",
"void",
"addFragment",
"(",
"byte",
"[",
"]",
"planHash",
",",
"int",
"outputDepId",
",",
"ByteBuffer",
"parameterSet",
")",
"{",
"addFragment",
"(",
"planHash",
",",
"null",
",",
"outputDepId",
",",
"parameterSet",
")",
";",
"}"
] | Add a pre-planned fragment.
@param fragmentId
@param outputDepId
@param parameterSet | [
"Add",
"a",
"pre",
"-",
"planned",
"fragment",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FragmentTaskMessage.java#L289-L291 |
60,903 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FragmentTaskMessage.java | FragmentTaskMessage.addCustomFragment | public void addCustomFragment(byte[] planHash, int outputDepId, ByteBuffer parameterSet, byte[] fragmentPlan, String stmtText) {
FragmentData item = new FragmentData();
item.m_planHash = planHash;
item.m_outputDepId = outputDepId;
item.m_parameterSet = parameterSet;
item.m_fragme... | java | public void addCustomFragment(byte[] planHash, int outputDepId, ByteBuffer parameterSet, byte[] fragmentPlan, String stmtText) {
FragmentData item = new FragmentData();
item.m_planHash = planHash;
item.m_outputDepId = outputDepId;
item.m_parameterSet = parameterSet;
item.m_fragme... | [
"public",
"void",
"addCustomFragment",
"(",
"byte",
"[",
"]",
"planHash",
",",
"int",
"outputDepId",
",",
"ByteBuffer",
"parameterSet",
",",
"byte",
"[",
"]",
"fragmentPlan",
",",
"String",
"stmtText",
")",
"{",
"FragmentData",
"item",
"=",
"new",
"FragmentDat... | Add an unplanned fragment.
@param fragmentId
@param outputDepId
@param parameterSet
@param fragmentPlan | [
"Add",
"an",
"unplanned",
"fragment",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FragmentTaskMessage.java#L312-L320 |
60,904 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FragmentTaskMessage.java | FragmentTaskMessage.createWithOneFragment | public static FragmentTaskMessage createWithOneFragment(long initiatorHSId,
long coordinatorHSId,
long txnId,
long uniqueId,
... | java | public static FragmentTaskMessage createWithOneFragment(long initiatorHSId,
long coordinatorHSId,
long txnId,
long uniqueId,
... | [
"public",
"static",
"FragmentTaskMessage",
"createWithOneFragment",
"(",
"long",
"initiatorHSId",
",",
"long",
"coordinatorHSId",
",",
"long",
"txnId",
",",
"long",
"uniqueId",
",",
"boolean",
"isReadOnly",
",",
"byte",
"[",
"]",
"planHash",
",",
"int",
"outputDep... | Convenience factory method to replace constructor that includes arrays of stuff.
@param initiatorHSId
@param coordinatorHSId
@param txnId
@param isReadOnly
@param fragmentId
@param outputDepId
@param parameterSet
@param isFinal
@return new FragmentTaskMessage | [
"Convenience",
"factory",
"method",
"to",
"replace",
"constructor",
"that",
"includes",
"arrays",
"of",
"stuff",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FragmentTaskMessage.java#L337-L366 |
60,905 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FragmentTaskMessage.java | FragmentTaskMessage.setEmptyForRestart | public void setEmptyForRestart(int outputDepId) {
m_emptyForRestart = true;
ParameterSet blank = ParameterSet.emptyParameterSet();
ByteBuffer mt = ByteBuffer.allocate(blank.getSerializedSize());
try {
blank.flattenToBuffer(mt);
}
catch (IOException ioe) {
... | java | public void setEmptyForRestart(int outputDepId) {
m_emptyForRestart = true;
ParameterSet blank = ParameterSet.emptyParameterSet();
ByteBuffer mt = ByteBuffer.allocate(blank.getSerializedSize());
try {
blank.flattenToBuffer(mt);
}
catch (IOException ioe) {
... | [
"public",
"void",
"setEmptyForRestart",
"(",
"int",
"outputDepId",
")",
"{",
"m_emptyForRestart",
"=",
"true",
";",
"ParameterSet",
"blank",
"=",
"ParameterSet",
".",
"emptyParameterSet",
"(",
")",
";",
"ByteBuffer",
"mt",
"=",
"ByteBuffer",
".",
"allocate",
"("... | fragment with the provided outputDepId | [
"fragment",
"with",
"the",
"provided",
"outputDepId"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FragmentTaskMessage.java#L457-L470 |
60,906 | VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/ImmutableTable.java | ImmutableTable.copyOf | public static <R, C, V> ImmutableTable<R, C, V> copyOf(
Table<? extends R, ? extends C, ? extends V> table) {
if (table instanceof ImmutableTable) {
@SuppressWarnings("unchecked")
ImmutableTable<R, C, V> parameterizedTable = (ImmutableTable<R, C, V>) table;
return parameterizedTable;
} e... | java | public static <R, C, V> ImmutableTable<R, C, V> copyOf(
Table<? extends R, ? extends C, ? extends V> table) {
if (table instanceof ImmutableTable) {
@SuppressWarnings("unchecked")
ImmutableTable<R, C, V> parameterizedTable = (ImmutableTable<R, C, V>) table;
return parameterizedTable;
} e... | [
"public",
"static",
"<",
"R",
",",
"C",
",",
"V",
">",
"ImmutableTable",
"<",
"R",
",",
"C",
",",
"V",
">",
"copyOf",
"(",
"Table",
"<",
"?",
"extends",
"R",
",",
"?",
"extends",
"C",
",",
"?",
"extends",
"V",
">",
"table",
")",
"{",
"if",
"(... | Returns an immutable copy of the provided table.
<p>The {@link Table#cellSet()} iteration order of the provided table
determines the iteration ordering of all views in the returned table. Note
that some views of the original table and the copied table may have
different iteration orders. For more control over the orde... | [
"Returns",
"an",
"immutable",
"copy",
"of",
"the",
"provided",
"table",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/ImmutableTable.java#L70-L100 |
60,907 | VoltDB/voltdb | src/frontend/org/voltdb/importclient/socket/PullSocketImporter.java | PullSocketImporter.replaceSocket | private void replaceSocket(Socket newSocket) {
synchronized (m_socketLock) {
closeSocket(m_socket);
if (m_eos.get()) {
closeSocket(newSocket);
m_socket = null;
} else {
m_socket = newSocket;
}
}
} | java | private void replaceSocket(Socket newSocket) {
synchronized (m_socketLock) {
closeSocket(m_socket);
if (m_eos.get()) {
closeSocket(newSocket);
m_socket = null;
} else {
m_socket = newSocket;
}
}
} | [
"private",
"void",
"replaceSocket",
"(",
"Socket",
"newSocket",
")",
"{",
"synchronized",
"(",
"m_socketLock",
")",
"{",
"closeSocket",
"(",
"m_socket",
")",
";",
"if",
"(",
"m_eos",
".",
"get",
"(",
")",
")",
"{",
"closeSocket",
"(",
"newSocket",
")",
"... | Set the socket to newSocket, unless we're shutting down.
The most reliable way to ensure the importer thread exits is to close its socket.
@param newSocket socket to replace any previous socket. May be null. | [
"Set",
"the",
"socket",
"to",
"newSocket",
"unless",
"we",
"re",
"shutting",
"down",
".",
"The",
"most",
"reliable",
"way",
"to",
"ensure",
"the",
"importer",
"thread",
"exits",
"is",
"to",
"close",
"its",
"socket",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importclient/socket/PullSocketImporter.java#L92-L102 |
60,908 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/WatchManager.java | WatchManager.dumpWatches | public synchronized void dumpWatches(PrintWriter pwriter, boolean byPath) {
if (byPath) {
for (Entry<String, HashSet<Watcher>> e : watchTable.entrySet()) {
pwriter.println(e.getKey());
for (Watcher w : e.getValue()) {
pwriter.print("\t0x");
... | java | public synchronized void dumpWatches(PrintWriter pwriter, boolean byPath) {
if (byPath) {
for (Entry<String, HashSet<Watcher>> e : watchTable.entrySet()) {
pwriter.println(e.getKey());
for (Watcher w : e.getValue()) {
pwriter.print("\t0x");
... | [
"public",
"synchronized",
"void",
"dumpWatches",
"(",
"PrintWriter",
"pwriter",
",",
"boolean",
"byPath",
")",
"{",
"if",
"(",
"byPath",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"HashSet",
"<",
"Watcher",
">",
">",
"e",
":",
"watchTable",
".",
... | String representation of watches. Warning, may be large!
@param byPath iff true output watches by paths, otw output
watches by connection
@return string representation of watches | [
"String",
"representation",
"of",
"watches",
".",
"Warning",
"may",
"be",
"large!"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/WatchManager.java#L148-L168 |
60,909 | VoltDB/voltdb | src/catgen/in/javasrc/CatalogType.java | CatalogType.setBaseValues | void setBaseValues(CatalogMap<? extends CatalogType> parentMap, String name) {
if (name == null) {
throw new CatalogException("Null value where it shouldn't be.");
}
m_parentMap = parentMap;
m_typename = name;
} | java | void setBaseValues(CatalogMap<? extends CatalogType> parentMap, String name) {
if (name == null) {
throw new CatalogException("Null value where it shouldn't be.");
}
m_parentMap = parentMap;
m_typename = name;
} | [
"void",
"setBaseValues",
"(",
"CatalogMap",
"<",
"?",
"extends",
"CatalogType",
">",
"parentMap",
",",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"CatalogException",
"(",
"\"Null value where it shouldn't be.\"",
")",
... | This is my lazy hack to avoid using reflection to instantiate records. | [
"This",
"is",
"my",
"lazy",
"hack",
"to",
"avoid",
"using",
"reflection",
"to",
"instantiate",
"records",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/catgen/in/javasrc/CatalogType.java#L215-L221 |
60,910 | VoltDB/voltdb | src/catgen/in/javasrc/CatalogType.java | CatalogType.validate | public void validate() throws IllegalArgumentException, IllegalAccessException {
for (Field field : getClass().getDeclaredFields()) {
if (CatalogType.class.isAssignableFrom(field.getType())) {
CatalogType ct = (CatalogType) field.get(this);
assert(ct.getCatalog() == g... | java | public void validate() throws IllegalArgumentException, IllegalAccessException {
for (Field field : getClass().getDeclaredFields()) {
if (CatalogType.class.isAssignableFrom(field.getType())) {
CatalogType ct = (CatalogType) field.get(this);
assert(ct.getCatalog() == g... | [
"public",
"void",
"validate",
"(",
")",
"throws",
"IllegalArgumentException",
",",
"IllegalAccessException",
"{",
"for",
"(",
"Field",
"field",
":",
"getClass",
"(",
")",
".",
"getDeclaredFields",
"(",
")",
")",
"{",
"if",
"(",
"CatalogType",
".",
"class",
"... | Fails an assertion if any child of this object doesn't think
it's part of the same catalog.
@throws IllegalAccessException
@throws IllegalArgumentException | [
"Fails",
"an",
"assertion",
"if",
"any",
"child",
"of",
"this",
"object",
"doesn",
"t",
"think",
"it",
"s",
"part",
"of",
"the",
"same",
"catalog",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/catgen/in/javasrc/CatalogType.java#L294-L316 |
60,911 | VoltDB/voltdb | src/frontend/org/voltdb/ExtensibleSnapshotDigestData.java | ExtensibleSnapshotDigestData.writeExternalStreamStates | private void writeExternalStreamStates(JSONStringer stringer) throws JSONException {
stringer.key(DISABLED_EXTERNAL_STREAMS).array();
for (int partition : m_disabledExternalStreams) {
stringer.value(partition);
}
stringer.endArray();
} | java | private void writeExternalStreamStates(JSONStringer stringer) throws JSONException {
stringer.key(DISABLED_EXTERNAL_STREAMS).array();
for (int partition : m_disabledExternalStreams) {
stringer.value(partition);
}
stringer.endArray();
} | [
"private",
"void",
"writeExternalStreamStates",
"(",
"JSONStringer",
"stringer",
")",
"throws",
"JSONException",
"{",
"stringer",
".",
"key",
"(",
"DISABLED_EXTERNAL_STREAMS",
")",
".",
"array",
"(",
")",
";",
"for",
"(",
"int",
"partition",
":",
"m_disabledExtern... | Writes external streams state for partitions into snapshot digest. | [
"Writes",
"external",
"streams",
"state",
"for",
"partitions",
"into",
"snapshot",
"digest",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ExtensibleSnapshotDigestData.java#L365-L371 |
60,912 | VoltDB/voltdb | src/frontend/org/voltdb/utils/VoltTableUtil.java | VoltTableUtil.unionTables | public static VoltTable unionTables(Collection<VoltTable> operands) {
VoltTable result = null;
// Locate the first non-null table to get the schema
for (VoltTable vt : operands) {
if (vt != null) {
result = new VoltTable(vt.getTableSchema());
result.s... | java | public static VoltTable unionTables(Collection<VoltTable> operands) {
VoltTable result = null;
// Locate the first non-null table to get the schema
for (VoltTable vt : operands) {
if (vt != null) {
result = new VoltTable(vt.getTableSchema());
result.s... | [
"public",
"static",
"VoltTable",
"unionTables",
"(",
"Collection",
"<",
"VoltTable",
">",
"operands",
")",
"{",
"VoltTable",
"result",
"=",
"null",
";",
"// Locate the first non-null table to get the schema",
"for",
"(",
"VoltTable",
"vt",
":",
"operands",
")",
"{",... | Utility to aggregate a list of tables sharing a schema. Common for
sysprocs to do this, to aggregate results. | [
"Utility",
"to",
"aggregate",
"a",
"list",
"of",
"tables",
"sharing",
"a",
"schema",
".",
"Common",
"for",
"sysprocs",
"to",
"do",
"this",
"to",
"aggregate",
"results",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltTableUtil.java#L194-L212 |
60,913 | VoltDB/voltdb | src/frontend/org/voltdb/utils/VoltTableUtil.java | VoltTableUtil.tableContainsString | public static boolean tableContainsString(VoltTable t, String s, boolean caseSenstive) {
if (t.getRowCount() == 0) {
return false;
}
if (!caseSenstive) {
s = s.toLowerCase();
}
VoltTableRow row = t.fetchRow(0);
do {
for (int i = 0; i <... | java | public static boolean tableContainsString(VoltTable t, String s, boolean caseSenstive) {
if (t.getRowCount() == 0) {
return false;
}
if (!caseSenstive) {
s = s.toLowerCase();
}
VoltTableRow row = t.fetchRow(0);
do {
for (int i = 0; i <... | [
"public",
"static",
"boolean",
"tableContainsString",
"(",
"VoltTable",
"t",
",",
"String",
"s",
",",
"boolean",
"caseSenstive",
")",
"{",
"if",
"(",
"t",
".",
"getRowCount",
"(",
")",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
... | Return true if any string field in the table contains param s. | [
"Return",
"true",
"if",
"any",
"string",
"field",
"in",
"the",
"table",
"contains",
"param",
"s",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltTableUtil.java#L217-L245 |
60,914 | VoltDB/voltdb | src/frontend/org/voltdb/utils/VoltTableUtil.java | VoltTableUtil.tableRowAsObjects | public static Object[] tableRowAsObjects(VoltTableRow row) {
Object[] result = new Object[row.getColumnCount()];
for (int i = 0; i < row.getColumnCount(); i++) {
result[i] = row.get(i, row.getColumnType(i));
}
return result;
} | java | public static Object[] tableRowAsObjects(VoltTableRow row) {
Object[] result = new Object[row.getColumnCount()];
for (int i = 0; i < row.getColumnCount(); i++) {
result[i] = row.get(i, row.getColumnType(i));
}
return result;
} | [
"public",
"static",
"Object",
"[",
"]",
"tableRowAsObjects",
"(",
"VoltTableRow",
"row",
")",
"{",
"Object",
"[",
"]",
"result",
"=",
"new",
"Object",
"[",
"row",
".",
"getColumnCount",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Get a VoltTableRow as an array of Objects of the right type | [
"Get",
"a",
"VoltTableRow",
"as",
"an",
"array",
"of",
"Objects",
"of",
"the",
"right",
"type"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltTableUtil.java#L250-L256 |
60,915 | VoltDB/voltdb | src/frontend/org/voltdb/utils/VoltTableUtil.java | VoltTableUtil.stream | public static Stream<VoltTableRow> stream(VoltTable table) {
return StreamSupport.stream(new VoltTableSpliterator(table, 0, table.getRowCount()), false);
} | java | public static Stream<VoltTableRow> stream(VoltTable table) {
return StreamSupport.stream(new VoltTableSpliterator(table, 0, table.getRowCount()), false);
} | [
"public",
"static",
"Stream",
"<",
"VoltTableRow",
">",
"stream",
"(",
"VoltTable",
"table",
")",
"{",
"return",
"StreamSupport",
".",
"stream",
"(",
"new",
"VoltTableSpliterator",
"(",
"table",
",",
"0",
",",
"table",
".",
"getRowCount",
"(",
")",
")",
",... | Not yet public API for VoltTable and Java 8 streams | [
"Not",
"yet",
"public",
"API",
"for",
"VoltTable",
"and",
"Java",
"8",
"streams"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltTableUtil.java#L315-L317 |
60,916 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java | MBeanRegistry.register | public void register(ZKMBeanInfo bean, ZKMBeanInfo parent)
throws JMException
{
assert bean != null;
String path = null;
if (parent != null) {
path = mapBean2Path.get(parent);
assert path != null;
}
path = makeFullPath(path, parent);
ma... | java | public void register(ZKMBeanInfo bean, ZKMBeanInfo parent)
throws JMException
{
assert bean != null;
String path = null;
if (parent != null) {
path = mapBean2Path.get(parent);
assert path != null;
}
path = makeFullPath(path, parent);
ma... | [
"public",
"void",
"register",
"(",
"ZKMBeanInfo",
"bean",
",",
"ZKMBeanInfo",
"parent",
")",
"throws",
"JMException",
"{",
"assert",
"bean",
"!=",
"null",
";",
"String",
"path",
"=",
"null",
";",
"if",
"(",
"parent",
"!=",
"null",
")",
"{",
"path",
"=",
... | Registers a new MBean with the platform MBean server.
@param bean the bean being registered
@param parent if not null, the new bean will be registered as a child
node of this parent. | [
"Registers",
"a",
"new",
"MBean",
"with",
"the",
"platform",
"MBean",
"server",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java#L61-L83 |
60,917 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java | MBeanRegistry.unregister | private void unregister(String path,ZKMBeanInfo bean) throws JMException {
if(path==null)
return;
if (!bean.isHidden()) {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
try {
mbs.unregisterMBean(makeObjectName(path, bean));
}... | java | private void unregister(String path,ZKMBeanInfo bean) throws JMException {
if(path==null)
return;
if (!bean.isHidden()) {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
try {
mbs.unregisterMBean(makeObjectName(path, bean));
}... | [
"private",
"void",
"unregister",
"(",
"String",
"path",
",",
"ZKMBeanInfo",
"bean",
")",
"throws",
"JMException",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"return",
";",
"if",
"(",
"!",
"bean",
".",
"isHidden",
"(",
")",
")",
"{",
"MBeanServer",
"mbs... | Unregister the MBean identified by the path.
@param path
@param bean | [
"Unregister",
"the",
"MBean",
"identified",
"by",
"the",
"path",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java#L90-L102 |
60,918 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java | MBeanRegistry.unregister | public void unregister(ZKMBeanInfo bean) {
if(bean==null)
return;
String path=mapBean2Path.get(bean);
try {
unregister(path,bean);
}
catch (InstanceNotFoundException e) {
LOG.warn("InstanceNotFoundException during unregister usually means more ... | java | public void unregister(ZKMBeanInfo bean) {
if(bean==null)
return;
String path=mapBean2Path.get(bean);
try {
unregister(path,bean);
}
catch (InstanceNotFoundException e) {
LOG.warn("InstanceNotFoundException during unregister usually means more ... | [
"public",
"void",
"unregister",
"(",
"ZKMBeanInfo",
"bean",
")",
"{",
"if",
"(",
"bean",
"==",
"null",
")",
"return",
";",
"String",
"path",
"=",
"mapBean2Path",
".",
"get",
"(",
"bean",
")",
";",
"try",
"{",
"unregister",
"(",
"path",
",",
"bean",
"... | Unregister MBean.
@param bean | [
"Unregister",
"MBean",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java#L108-L124 |
60,919 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java | MBeanRegistry.unregisterAll | public void unregisterAll() {
for(Map.Entry<ZKMBeanInfo,String> e: mapBean2Path.entrySet()) {
try {
unregister(e.getValue(), e.getKey());
} catch (JMException e1) {
LOG.warn("Error during unregister", e1);
}
}
mapBean2Path.clear... | java | public void unregisterAll() {
for(Map.Entry<ZKMBeanInfo,String> e: mapBean2Path.entrySet()) {
try {
unregister(e.getValue(), e.getKey());
} catch (JMException e1) {
LOG.warn("Error during unregister", e1);
}
}
mapBean2Path.clear... | [
"public",
"void",
"unregisterAll",
"(",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"ZKMBeanInfo",
",",
"String",
">",
"e",
":",
"mapBean2Path",
".",
"entrySet",
"(",
")",
")",
"{",
"try",
"{",
"unregister",
"(",
"e",
".",
"getValue",
"(",
")",
... | Unregister all currently registered MBeans | [
"Unregister",
"all",
"currently",
"registered",
"MBeans"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java#L128-L138 |
60,920 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java | MBeanRegistry.makeFullPath | public String makeFullPath(String prefix, String... name) {
StringBuilder sb=new StringBuilder(prefix == null ? "/" : (prefix.equals("/")?prefix:prefix+"/"));
boolean first=true;
for (String s : name) {
if(s==null) continue;
if(!first){
sb.append("/");
... | java | public String makeFullPath(String prefix, String... name) {
StringBuilder sb=new StringBuilder(prefix == null ? "/" : (prefix.equals("/")?prefix:prefix+"/"));
boolean first=true;
for (String s : name) {
if(s==null) continue;
if(!first){
sb.append("/");
... | [
"public",
"String",
"makeFullPath",
"(",
"String",
"prefix",
",",
"String",
"...",
"name",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"prefix",
"==",
"null",
"?",
"\"/\"",
":",
"(",
"prefix",
".",
"equals",
"(",
"\"/\"",
")",
"?",... | Generate a filesystem-like path.
@param prefix path prefix
@param name path elements
@return absolute path | [
"Generate",
"a",
"filesystem",
"-",
"like",
"path",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java#L145-L157 |
60,921 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java | MBeanRegistry.makeObjectName | protected ObjectName makeObjectName(String path, ZKMBeanInfo bean)
throws MalformedObjectNameException
{
if(path==null)
return null;
StringBuilder beanName = new StringBuilder(CommonNames.DOMAIN + ":");
int counter=0;
counter=tokenize(beanName,path,counter);
... | java | protected ObjectName makeObjectName(String path, ZKMBeanInfo bean)
throws MalformedObjectNameException
{
if(path==null)
return null;
StringBuilder beanName = new StringBuilder(CommonNames.DOMAIN + ":");
int counter=0;
counter=tokenize(beanName,path,counter);
... | [
"protected",
"ObjectName",
"makeObjectName",
"(",
"String",
"path",
",",
"ZKMBeanInfo",
"bean",
")",
"throws",
"MalformedObjectNameException",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"return",
"null",
";",
"StringBuilder",
"beanName",
"=",
"new",
"StringBuilder... | Builds an MBean path and creates an ObjectName instance using the path.
@param path MBean path
@param bean the MBean instance
@return ObjectName to be registered with the platform MBean server | [
"Builds",
"an",
"MBean",
"path",
"and",
"creates",
"an",
"ObjectName",
"instance",
"using",
"the",
"path",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/jmx/MBeanRegistry.java#L183-L200 |
60,922 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java | Type.getType | @Override
public final int getType() {
if (userTypeModifier == null) {
throw Error.runtimeError(ErrorCode.U_S0500, "Type");
}
return userTypeModifier.getType();
} | java | @Override
public final int getType() {
if (userTypeModifier == null) {
throw Error.runtimeError(ErrorCode.U_S0500, "Type");
}
return userTypeModifier.getType();
} | [
"@",
"Override",
"public",
"final",
"int",
"getType",
"(",
")",
"{",
"if",
"(",
"userTypeModifier",
"==",
"null",
")",
"{",
"throw",
"Error",
".",
"runtimeError",
"(",
"ErrorCode",
".",
"U_S0500",
",",
"\"Type\"",
")",
";",
"}",
"return",
"userTypeModifier... | interface specific methods | [
"interface",
"specific",
"methods"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java#L75-L83 |
60,923 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java | Type.castToType | public Object castToType(SessionInterface session, Object a, Type type) {
return convertToType(session, a, type);
} | java | public Object castToType(SessionInterface session, Object a, Type type) {
return convertToType(session, a, type);
} | [
"public",
"Object",
"castToType",
"(",
"SessionInterface",
"session",
",",
"Object",
"a",
",",
"Type",
"type",
")",
"{",
"return",
"convertToType",
"(",
"session",
",",
"a",
",",
"type",
")",
";",
"}"
] | Explicit casts are handled by this method.
SQL standard 6.12 rules for enforcement of size, precision and scale
are implemented. For CHARACTER values, it performs truncation in all
cases of long strings. | [
"Explicit",
"casts",
"are",
"handled",
"by",
"this",
"method",
".",
"SQL",
"standard",
"6",
".",
"12",
"rules",
"for",
"enforcement",
"of",
"size",
"precision",
"and",
"scale",
"are",
"implemented",
".",
"For",
"CHARACTER",
"values",
"it",
"performs",
"trunc... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java#L253-L255 |
60,924 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java | Type.convertToTypeJDBC | public Object convertToTypeJDBC(SessionInterface session, Object a,
Type type) {
return convertToType(session, a, type);
} | java | public Object convertToTypeJDBC(SessionInterface session, Object a,
Type type) {
return convertToType(session, a, type);
} | [
"public",
"Object",
"convertToTypeJDBC",
"(",
"SessionInterface",
"session",
",",
"Object",
"a",
",",
"Type",
"type",
")",
"{",
"return",
"convertToType",
"(",
"session",
",",
"a",
",",
"type",
")",
";",
"}"
] | Convert type for JDBC. Same as convertToType, but supports non-standard
SQL conversions supported by JDBC | [
"Convert",
"type",
"for",
"JDBC",
".",
"Same",
"as",
"convertToType",
"but",
"supports",
"non",
"-",
"standard",
"SQL",
"conversions",
"supported",
"by",
"JDBC"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java#L269-L272 |
60,925 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java | Type.getJDBCTypeCode | public static int getJDBCTypeCode(int type) {
switch (type) {
case Types.SQL_BLOB :
return Types.BLOB;
case Types.SQL_CLOB :
return Types.CLOB;
case Types.SQL_BIGINT :
return Types.BIGINT;
case Types.SQL_BINARY ... | java | public static int getJDBCTypeCode(int type) {
switch (type) {
case Types.SQL_BLOB :
return Types.BLOB;
case Types.SQL_CLOB :
return Types.CLOB;
case Types.SQL_BIGINT :
return Types.BIGINT;
case Types.SQL_BINARY ... | [
"public",
"static",
"int",
"getJDBCTypeCode",
"(",
"int",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"Types",
".",
"SQL_BLOB",
":",
"return",
"Types",
".",
"BLOB",
";",
"case",
"Types",
".",
"SQL_CLOB",
":",
"return",
"Types",
".",
"CLO... | translate an internal type number to JDBC type number if a type is not
supported internally, it is returned without translation
@param type int
@return int | [
"translate",
"an",
"internal",
"type",
"number",
"to",
"JDBC",
"type",
"number",
"if",
"a",
"type",
"is",
"not",
"supported",
"internally",
"it",
"is",
"returned",
"without",
"translation"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java#L837-L863 |
60,926 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java | Type.getType | public static Type getType(int type, int collation, long precision,
int scale) {
switch (type) {
case Types.SQL_ALL_TYPES :
return SQL_ALL_TYPES;
// return SQL_ALL_TYPES; // needs changes to Expression type resolution
case... | java | public static Type getType(int type, int collation, long precision,
int scale) {
switch (type) {
case Types.SQL_ALL_TYPES :
return SQL_ALL_TYPES;
// return SQL_ALL_TYPES; // needs changes to Expression type resolution
case... | [
"public",
"static",
"Type",
"getType",
"(",
"int",
"type",
",",
"int",
"collation",
",",
"long",
"precision",
",",
"int",
"scale",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"Types",
".",
"SQL_ALL_TYPES",
":",
"return",
"SQL_ALL_TYPES",
";",
"// ... | Enforces precision and scale limits on type | [
"Enforces",
"precision",
"and",
"scale",
"limits",
"on",
"type"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java#L868-L962 |
60,927 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/util/Grid.java | Grid.handleEvent | public boolean handleEvent(Event e) {
switch (e.id) {
case Event.SCROLL_LINE_UP :
case Event.SCROLL_LINE_DOWN :
case Event.SCROLL_PAGE_UP :
case Event.SCROLL_PAGE_DOWN :
case Event.SCROLL_ABSOLUTE :
iX = sbHoriz.getValue();
... | java | public boolean handleEvent(Event e) {
switch (e.id) {
case Event.SCROLL_LINE_UP :
case Event.SCROLL_LINE_DOWN :
case Event.SCROLL_PAGE_UP :
case Event.SCROLL_PAGE_DOWN :
case Event.SCROLL_ABSOLUTE :
iX = sbHoriz.getValue();
... | [
"public",
"boolean",
"handleEvent",
"(",
"Event",
"e",
")",
"{",
"switch",
"(",
"e",
".",
"id",
")",
"{",
"case",
"Event",
".",
"SCROLL_LINE_UP",
":",
"case",
"Event",
".",
"SCROLL_LINE_DOWN",
":",
"case",
"Event",
".",
"SCROLL_PAGE_UP",
":",
"case",
"Ev... | would require browsers to use the Java plugin. | [
"would",
"require",
"browsers",
"to",
"use",
"the",
"Java",
"plugin",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/util/Grid.java#L302-L320 |
60,928 | VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.getConfigureBytes | public static byte[] getConfigureBytes(int partitionCount, int tokenCount) {
Preconditions.checkArgument(partitionCount > 0);
Preconditions.checkArgument(tokenCount > partitionCount);
Buckets buckets = new Buckets(partitionCount, tokenCount);
ElasticHashinator hashinator = new ElasticHas... | java | public static byte[] getConfigureBytes(int partitionCount, int tokenCount) {
Preconditions.checkArgument(partitionCount > 0);
Preconditions.checkArgument(tokenCount > partitionCount);
Buckets buckets = new Buckets(partitionCount, tokenCount);
ElasticHashinator hashinator = new ElasticHas... | [
"public",
"static",
"byte",
"[",
"]",
"getConfigureBytes",
"(",
"int",
"partitionCount",
",",
"int",
"tokenCount",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"partitionCount",
">",
"0",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"tokenCount... | Convenience method for generating a deterministic token distribution for the ring based
on a given partition count and tokens per partition. Each partition will have N tokens
placed randomly on the ring. | [
"Convenience",
"method",
"for",
"generating",
"a",
"deterministic",
"token",
"distribution",
"for",
"the",
"ring",
"based",
"on",
"a",
"given",
"partition",
"count",
"and",
"tokens",
"per",
"partition",
".",
"Each",
"partition",
"will",
"have",
"N",
"tokens",
... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L200-L206 |
60,929 | VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.toBytes | private byte[] toBytes() {
ByteBuffer buf = ByteBuffer.allocate(4 + (m_tokenCount * 8));
buf.putInt(m_tokenCount);
int lastToken = Integer.MIN_VALUE;
for (int ii = 0; ii < m_tokenCount; ii++) {
final long ptr = m_tokens + (ii * 8);
final int token = Bits.unsafe.ge... | java | private byte[] toBytes() {
ByteBuffer buf = ByteBuffer.allocate(4 + (m_tokenCount * 8));
buf.putInt(m_tokenCount);
int lastToken = Integer.MIN_VALUE;
for (int ii = 0; ii < m_tokenCount; ii++) {
final long ptr = m_tokens + (ii * 8);
final int token = Bits.unsafe.ge... | [
"private",
"byte",
"[",
"]",
"toBytes",
"(",
")",
"{",
"ByteBuffer",
"buf",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"4",
"+",
"(",
"m_tokenCount",
"*",
"8",
")",
")",
";",
"buf",
".",
"putInt",
"(",
"m_tokenCount",
")",
";",
"int",
"lastToken",
"=",... | Serializes the configuration into bytes, also updates the currently cached m_configBytes.
@return The byte[] of the current configuration. | [
"Serializes",
"the",
"configuration",
"into",
"bytes",
"also",
"updates",
"the",
"currently",
"cached",
"m_configBytes",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L212-L226 |
60,930 | VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.addTokens | public ElasticHashinator addTokens(NavigableMap<Integer, Integer> tokensToAdd)
{
// figure out the interval
long interval = deriveTokenInterval(m_tokensMap.get().keySet());
Map<Integer, Integer> tokens = Maps.newTreeMap();
for (Map.Entry<Integer, Integer> e : m_tokensMap.get().entry... | java | public ElasticHashinator addTokens(NavigableMap<Integer, Integer> tokensToAdd)
{
// figure out the interval
long interval = deriveTokenInterval(m_tokensMap.get().keySet());
Map<Integer, Integer> tokens = Maps.newTreeMap();
for (Map.Entry<Integer, Integer> e : m_tokensMap.get().entry... | [
"public",
"ElasticHashinator",
"addTokens",
"(",
"NavigableMap",
"<",
"Integer",
",",
"Integer",
">",
"tokensToAdd",
")",
"{",
"// figure out the interval",
"long",
"interval",
"=",
"deriveTokenInterval",
"(",
"m_tokensMap",
".",
"get",
"(",
")",
".",
"keySet",
"(... | Add the given tokens to the ring and generate the new hashinator. The current hashinator is not changed.
@param tokensToAdd Tokens to add as a map of tokens to partitions
@return The new hashinator | [
"Add",
"the",
"given",
"tokens",
"to",
"the",
"ring",
"and",
"generate",
"the",
"new",
"hashinator",
".",
"The",
"current",
"hashinator",
"is",
"not",
"changed",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L314-L342 |
60,931 | VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.pPredecessors | @Override
public Map<Integer, Integer> pPredecessors(int partition) {
Map<Integer, Integer> predecessors = new TreeMap<Integer, Integer>();
UnmodifiableIterator<Map.Entry<Integer,Integer>> iter = m_tokensMap.get().entrySet().iterator();
Set<Integer> pTokens = new HashSet<Integer>();
... | java | @Override
public Map<Integer, Integer> pPredecessors(int partition) {
Map<Integer, Integer> predecessors = new TreeMap<Integer, Integer>();
UnmodifiableIterator<Map.Entry<Integer,Integer>> iter = m_tokensMap.get().entrySet().iterator();
Set<Integer> pTokens = new HashSet<Integer>();
... | [
"@",
"Override",
"public",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"pPredecessors",
"(",
"int",
"partition",
")",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"predecessors",
"=",
"new",
"TreeMap",
"<",
"Integer",
",",
"Integer",
">",
"(",
")",
... | Find the predecessors of the given partition on the ring. This method runs in linear time,
use with caution when the set of partitions is large.
@param partition
@return The map of tokens to partitions that are the predecessors of the given partition.
If the given partition doesn't exist or it's the only partition on t... | [
"Find",
"the",
"predecessors",
"of",
"the",
"given",
"partition",
"on",
"the",
"ring",
".",
"This",
"method",
"runs",
"in",
"linear",
"time",
"use",
"with",
"caution",
"when",
"the",
"set",
"of",
"partitions",
"is",
"large",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L375-L404 |
60,932 | VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.pPredecessor | @Override
public Pair<Integer, Integer> pPredecessor(int partition, int token) {
Integer partForToken = m_tokensMap.get().get(token);
if (partForToken != null && partForToken == partition) {
Map.Entry<Integer, Integer> predecessor = m_tokensMap.get().headMap(token).lastEntry();
... | java | @Override
public Pair<Integer, Integer> pPredecessor(int partition, int token) {
Integer partForToken = m_tokensMap.get().get(token);
if (partForToken != null && partForToken == partition) {
Map.Entry<Integer, Integer> predecessor = m_tokensMap.get().headMap(token).lastEntry();
... | [
"@",
"Override",
"public",
"Pair",
"<",
"Integer",
",",
"Integer",
">",
"pPredecessor",
"(",
"int",
"partition",
",",
"int",
"token",
")",
"{",
"Integer",
"partForToken",
"=",
"m_tokensMap",
".",
"get",
"(",
")",
".",
"get",
"(",
"token",
")",
";",
"if... | Find the predecessor of the given token on the ring.
@param partition The partition that maps to the given token
@param token The token on the ring
@return The predecessor of the given token. | [
"Find",
"the",
"predecessor",
"of",
"the",
"given",
"token",
"on",
"the",
"ring",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L412-L433 |
60,933 | VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.pGetRanges | @Override
public Map<Integer, Integer> pGetRanges(int partition) {
Map<Integer, Integer> ranges = new TreeMap<Integer, Integer>();
Integer first = null; // start of the very first token on the ring
Integer start = null; // start of a range
UnmodifiableIterator<Map.Entry<Integer,Integ... | java | @Override
public Map<Integer, Integer> pGetRanges(int partition) {
Map<Integer, Integer> ranges = new TreeMap<Integer, Integer>();
Integer first = null; // start of the very first token on the ring
Integer start = null; // start of a range
UnmodifiableIterator<Map.Entry<Integer,Integ... | [
"@",
"Override",
"public",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"pGetRanges",
"(",
"int",
"partition",
")",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"ranges",
"=",
"new",
"TreeMap",
"<",
"Integer",
",",
"Integer",
">",
"(",
")",
";",
"... | This runs in linear time with respect to the number of tokens on the ring. | [
"This",
"runs",
"in",
"linear",
"time",
"with",
"respect",
"to",
"the",
"number",
"of",
"tokens",
"on",
"the",
"ring",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L438-L479 |
60,934 | VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.toCookedBytes | private byte[] toCookedBytes()
{
// Allocate for a int pair per token/partition ID entry, plus a size.
ByteBuffer buf = ByteBuffer.allocate(4 + (m_tokenCount * 8));
buf.putInt(m_tokenCount);
// Keep tokens and partition ids separate to aid compression.
for (int zz = 3; zz >=... | java | private byte[] toCookedBytes()
{
// Allocate for a int pair per token/partition ID entry, plus a size.
ByteBuffer buf = ByteBuffer.allocate(4 + (m_tokenCount * 8));
buf.putInt(m_tokenCount);
// Keep tokens and partition ids separate to aid compression.
for (int zz = 3; zz >=... | [
"private",
"byte",
"[",
"]",
"toCookedBytes",
"(",
")",
"{",
"// Allocate for a int pair per token/partition ID entry, plus a size.",
"ByteBuffer",
"buf",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"4",
"+",
"(",
"m_tokenCount",
"*",
"8",
")",
")",
";",
"buf",
".",
... | Returns compressed config bytes.
@return config bytes
@throws IOException | [
"Returns",
"compressed",
"config",
"bytes",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L540-L567 |
60,935 | VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.trackAllocatedHashinatorBytes | private static synchronized void trackAllocatedHashinatorBytes(long bytes) {
final long allocated = m_allocatedHashinatorBytes.addAndGet(bytes);
if (allocated > HASHINATOR_GC_THRESHHOLD) {
hostLogger.warn(allocated + " bytes of hashinator data has been allocated");
if (m_emergenc... | java | private static synchronized void trackAllocatedHashinatorBytes(long bytes) {
final long allocated = m_allocatedHashinatorBytes.addAndGet(bytes);
if (allocated > HASHINATOR_GC_THRESHHOLD) {
hostLogger.warn(allocated + " bytes of hashinator data has been allocated");
if (m_emergenc... | [
"private",
"static",
"synchronized",
"void",
"trackAllocatedHashinatorBytes",
"(",
"long",
"bytes",
")",
"{",
"final",
"long",
"allocated",
"=",
"m_allocatedHashinatorBytes",
".",
"addAndGet",
"(",
"bytes",
")",
";",
"if",
"(",
"allocated",
">",
"HASHINATOR_GC_THRES... | Track allocated bytes and invoke System.gc to encourage reclamation if it is growing large | [
"Track",
"allocated",
"bytes",
"and",
"invoke",
"System",
".",
"gc",
"to",
"encourage",
"reclamation",
"if",
"it",
"is",
"growing",
"large"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L675-L694 |
60,936 | VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.deriveTokenInterval | private static long deriveTokenInterval(ImmutableSortedSet<Integer> tokens)
{
long interval = 0;
int count = 4;
int prevToken = Integer.MIN_VALUE;
UnmodifiableIterator<Integer> tokenIter = tokens.iterator();
while (tokenIter.hasNext() && count-- > 0) {
int nextTok... | java | private static long deriveTokenInterval(ImmutableSortedSet<Integer> tokens)
{
long interval = 0;
int count = 4;
int prevToken = Integer.MIN_VALUE;
UnmodifiableIterator<Integer> tokenIter = tokens.iterator();
while (tokenIter.hasNext() && count-- > 0) {
int nextTok... | [
"private",
"static",
"long",
"deriveTokenInterval",
"(",
"ImmutableSortedSet",
"<",
"Integer",
">",
"tokens",
")",
"{",
"long",
"interval",
"=",
"0",
";",
"int",
"count",
"=",
"4",
";",
"int",
"prevToken",
"=",
"Integer",
".",
"MIN_VALUE",
";",
"Unmodifiable... | Figure out the token interval from the first 3 ranges, assuming that there is at most one token that doesn't
fall onto the bucket boundary at any given time. The largest range will be the hashinator's bucket size.
@return The bucket size, or token interval if you prefer. | [
"Figure",
"out",
"the",
"token",
"interval",
"from",
"the",
"first",
"3",
"ranges",
"assuming",
"that",
"there",
"is",
"at",
"most",
"one",
"token",
"that",
"doesn",
"t",
"fall",
"onto",
"the",
"bucket",
"boundary",
"at",
"any",
"given",
"time",
".",
"Th... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L740-L752 |
60,937 | VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.containingBucket | private static int containingBucket(int token, long interval)
{
return (int) ((((long) token - Integer.MIN_VALUE) / interval) * interval + Integer.MIN_VALUE);
} | java | private static int containingBucket(int token, long interval)
{
return (int) ((((long) token - Integer.MIN_VALUE) / interval) * interval + Integer.MIN_VALUE);
} | [
"private",
"static",
"int",
"containingBucket",
"(",
"int",
"token",
",",
"long",
"interval",
")",
"{",
"return",
"(",
"int",
")",
"(",
"(",
"(",
"(",
"long",
")",
"token",
"-",
"Integer",
".",
"MIN_VALUE",
")",
"/",
"interval",
")",
"*",
"interval",
... | Calculate the boundary of the bucket that countain the given token given the token interval.
@return The token of the bucket boundary. | [
"Calculate",
"the",
"boundary",
"of",
"the",
"bucket",
"that",
"countain",
"the",
"given",
"token",
"given",
"the",
"token",
"interval",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L767-L770 |
60,938 | VoltDB/voltdb | src/frontend/org/voltdb/plannodes/InsertPlanNode.java | InsertPlanNode.isOrderDeterministic | @Override
public boolean isOrderDeterministic() {
assert(m_children != null);
assert(m_children.size() == 1);
// This implementation is very close to AbstractPlanNode's implementation of this
// method, except that we assert just one child.
// Java doesn't allow calls to sup... | java | @Override
public boolean isOrderDeterministic() {
assert(m_children != null);
assert(m_children.size() == 1);
// This implementation is very close to AbstractPlanNode's implementation of this
// method, except that we assert just one child.
// Java doesn't allow calls to sup... | [
"@",
"Override",
"public",
"boolean",
"isOrderDeterministic",
"(",
")",
"{",
"assert",
"(",
"m_children",
"!=",
"null",
")",
";",
"assert",
"(",
"m_children",
".",
"size",
"(",
")",
"==",
"1",
")",
";",
"// This implementation is very close to AbstractPlanNode's i... | Order determinism for insert nodes depends on the determinism of child nodes. For subqueries producing
unordered rows, the insert will be considered order-nondeterministic. | [
"Order",
"determinism",
"for",
"insert",
"nodes",
"depends",
"on",
"the",
"determinism",
"of",
"child",
"nodes",
".",
"For",
"subqueries",
"producing",
"unordered",
"rows",
"the",
"insert",
"will",
"be",
"considered",
"order",
"-",
"nondeterministic",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/InsertPlanNode.java#L120-L135 |
60,939 | VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/AdHocNTBase.java | AdHocNTBase.logBatch | private void logBatch(final CatalogContext context,
final AdHocPlannedStmtBatch batch,
final Object[] userParams)
{
final int numStmts = batch.getPlannedStatementCount();
final int numParams = userParams == null ? 0 : userParams.length;
fin... | java | private void logBatch(final CatalogContext context,
final AdHocPlannedStmtBatch batch,
final Object[] userParams)
{
final int numStmts = batch.getPlannedStatementCount();
final int numParams = userParams == null ? 0 : userParams.length;
fin... | [
"private",
"void",
"logBatch",
"(",
"final",
"CatalogContext",
"context",
",",
"final",
"AdHocPlannedStmtBatch",
"batch",
",",
"final",
"Object",
"[",
"]",
"userParams",
")",
"{",
"final",
"int",
"numStmts",
"=",
"batch",
".",
"getPlannedStatementCount",
"(",
")... | Log ad hoc batch info
@param batch planned statement batch | [
"Log",
"ad",
"hoc",
"batch",
"info"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/AdHocNTBase.java#L83-L112 |
60,940 | VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/AdHocNTBase.java | AdHocNTBase.processExplainDefaultProc | static CompletableFuture<ClientResponse> processExplainDefaultProc(AdHocPlannedStmtBatch planBatch) {
Database db = VoltDB.instance().getCatalogContext().database;
// there better be one statement if this is really SQL
// from a default procedure
assert(planBatch.getPlannedStatementCoun... | java | static CompletableFuture<ClientResponse> processExplainDefaultProc(AdHocPlannedStmtBatch planBatch) {
Database db = VoltDB.instance().getCatalogContext().database;
// there better be one statement if this is really SQL
// from a default procedure
assert(planBatch.getPlannedStatementCoun... | [
"static",
"CompletableFuture",
"<",
"ClientResponse",
">",
"processExplainDefaultProc",
"(",
"AdHocPlannedStmtBatch",
"planBatch",
")",
"{",
"Database",
"db",
"=",
"VoltDB",
".",
"instance",
"(",
")",
".",
"getCatalogContext",
"(",
")",
".",
"database",
";",
"// t... | Explain Proc for a default proc is routed through the regular Explain
path using ad hoc planning and all. Take the result from that async
process and format it like other explains for procedures. | [
"Explain",
"Proc",
"for",
"a",
"default",
"proc",
"is",
"routed",
"through",
"the",
"regular",
"Explain",
"path",
"using",
"ad",
"hoc",
"planning",
"and",
"all",
".",
"Take",
"the",
"result",
"from",
"that",
"async",
"process",
"and",
"format",
"it",
"like... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/AdHocNTBase.java#L414-L440 |
60,941 | VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/AdHocNTBase.java | AdHocNTBase.createAdHocTransaction | private final CompletableFuture<ClientResponse> createAdHocTransaction(
final AdHocPlannedStmtBatch plannedStmtBatch,
final boolean isSwapTables)
throws VoltTypeException
{
ByteBuffer buf = null;
try {
buf = plannedStmtBatch.flattenPlanArrayToB... | java | private final CompletableFuture<ClientResponse> createAdHocTransaction(
final AdHocPlannedStmtBatch plannedStmtBatch,
final boolean isSwapTables)
throws VoltTypeException
{
ByteBuffer buf = null;
try {
buf = plannedStmtBatch.flattenPlanArrayToB... | [
"private",
"final",
"CompletableFuture",
"<",
"ClientResponse",
">",
"createAdHocTransaction",
"(",
"final",
"AdHocPlannedStmtBatch",
"plannedStmtBatch",
",",
"final",
"boolean",
"isSwapTables",
")",
"throws",
"VoltTypeException",
"{",
"ByteBuffer",
"buf",
"=",
"null",
... | Take a set of adhoc plans and pass them off to the right transactional
adhoc variant. | [
"Take",
"a",
"set",
"of",
"adhoc",
"plans",
"and",
"pass",
"them",
"off",
"to",
"the",
"right",
"transactional",
"adhoc",
"variant",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/AdHocNTBase.java#L446-L507 |
60,942 | VoltDB/voltdb | src/frontend/org/voltdb/expressions/RowSubqueryExpression.java | RowSubqueryExpression.collectParameterValueExpressions | private void collectParameterValueExpressions(AbstractExpression expr, List<AbstractExpression> pves) {
if (expr == null) {
return;
}
if (expr instanceof TupleValueExpression || expr instanceof AggregateExpression) {
// Create a matching PVE for this expression to be use... | java | private void collectParameterValueExpressions(AbstractExpression expr, List<AbstractExpression> pves) {
if (expr == null) {
return;
}
if (expr instanceof TupleValueExpression || expr instanceof AggregateExpression) {
// Create a matching PVE for this expression to be use... | [
"private",
"void",
"collectParameterValueExpressions",
"(",
"AbstractExpression",
"expr",
",",
"List",
"<",
"AbstractExpression",
">",
"pves",
")",
"{",
"if",
"(",
"expr",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"expr",
"instanceof",
"TupleValue... | PVE inside the Row subquery | [
"PVE",
"inside",
"the",
"Row",
"subquery"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/RowSubqueryExpression.java#L70-L88 |
60,943 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java | Result.newPSMResult | public static Result newPSMResult(int type, String label, Object value) {
Result result = newResult(ResultConstants.VALUE);
result.errorCode = type;
result.mainString = label;
result.valueData = value;
return result;
} | java | public static Result newPSMResult(int type, String label, Object value) {
Result result = newResult(ResultConstants.VALUE);
result.errorCode = type;
result.mainString = label;
result.valueData = value;
return result;
} | [
"public",
"static",
"Result",
"newPSMResult",
"(",
"int",
"type",
",",
"String",
"label",
",",
"Object",
"value",
")",
"{",
"Result",
"result",
"=",
"newResult",
"(",
"ResultConstants",
".",
"VALUE",
")",
";",
"result",
".",
"errorCode",
"=",
"type",
";",
... | For interval PSM return values | [
"For",
"interval",
"PSM",
"return",
"values"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java#L592-L601 |
60,944 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java | Result.newPreparedExecuteRequest | public static Result newPreparedExecuteRequest(Type[] types,
long statementId) {
Result result = newResult(ResultConstants.EXECUTE);
result.metaData = ResultMetaData.newSimpleResultMetaData(types);
result.statementID = statementId;
result.navigator.add(ValuePool.emptyOb... | java | public static Result newPreparedExecuteRequest(Type[] types,
long statementId) {
Result result = newResult(ResultConstants.EXECUTE);
result.metaData = ResultMetaData.newSimpleResultMetaData(types);
result.statementID = statementId;
result.navigator.add(ValuePool.emptyOb... | [
"public",
"static",
"Result",
"newPreparedExecuteRequest",
"(",
"Type",
"[",
"]",
"types",
",",
"long",
"statementId",
")",
"{",
"Result",
"result",
"=",
"newResult",
"(",
"ResultConstants",
".",
"EXECUTE",
")",
";",
"result",
".",
"metaData",
"=",
"ResultMeta... | For SQLEXECUTE
For execution of SQL prepared statements.
The parameters are set afterwards as the Result is reused | [
"For",
"SQLEXECUTE",
"For",
"execution",
"of",
"SQL",
"prepared",
"statements",
".",
"The",
"parameters",
"are",
"set",
"afterwards",
"as",
"the",
"Result",
"is",
"reused"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java#L616-L627 |
60,945 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java | Result.newCallResponse | public static Result newCallResponse(Type[] types, long statementId,
Object[] values) {
Result result = newResult(ResultConstants.CALL_RESPONSE);
result.metaData = ResultMetaData.newSimpleResultMetaData(types);
result.statementID = statementId;
... | java | public static Result newCallResponse(Type[] types, long statementId,
Object[] values) {
Result result = newResult(ResultConstants.CALL_RESPONSE);
result.metaData = ResultMetaData.newSimpleResultMetaData(types);
result.statementID = statementId;
... | [
"public",
"static",
"Result",
"newCallResponse",
"(",
"Type",
"[",
"]",
"types",
",",
"long",
"statementId",
",",
"Object",
"[",
"]",
"values",
")",
"{",
"Result",
"result",
"=",
"newResult",
"(",
"ResultConstants",
".",
"CALL_RESPONSE",
")",
";",
"result",
... | For CALL_RESPONSE
For execution of SQL callable statements. | [
"For",
"CALL_RESPONSE",
"For",
"execution",
"of",
"SQL",
"callable",
"statements",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java#L633-L644 |
60,946 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java | Result.newUpdateResultRequest | public static Result newUpdateResultRequest(Type[] types, long id) {
Result result = newResult(ResultConstants.UPDATE_RESULT);
result.metaData = ResultMetaData.newUpdateResultMetaData(types);
result.id = id;
result.navigator.add(new Object[]{});
return result;
} | java | public static Result newUpdateResultRequest(Type[] types, long id) {
Result result = newResult(ResultConstants.UPDATE_RESULT);
result.metaData = ResultMetaData.newUpdateResultMetaData(types);
result.id = id;
result.navigator.add(new Object[]{});
return result;
} | [
"public",
"static",
"Result",
"newUpdateResultRequest",
"(",
"Type",
"[",
"]",
"types",
",",
"long",
"id",
")",
"{",
"Result",
"result",
"=",
"newResult",
"(",
"ResultConstants",
".",
"UPDATE_RESULT",
")",
";",
"result",
".",
"metaData",
"=",
"ResultMetaData",... | For UPDATE_RESULT
The parameters are set afterwards as the Result is reused | [
"For",
"UPDATE_RESULT",
"The",
"parameters",
"are",
"set",
"afterwards",
"as",
"the",
"Result",
"is",
"reused"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java#L650-L660 |
60,947 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java | Result.setPreparedResultUpdateProperties | public void setPreparedResultUpdateProperties(Object[] parameterValues) {
if (navigator.getSize() == 1) {
((RowSetNavigatorClient) navigator).setData(0, parameterValues);
} else {
navigator.clear();
navigator.add(parameterValues);
}
} | java | public void setPreparedResultUpdateProperties(Object[] parameterValues) {
if (navigator.getSize() == 1) {
((RowSetNavigatorClient) navigator).setData(0, parameterValues);
} else {
navigator.clear();
navigator.add(parameterValues);
}
} | [
"public",
"void",
"setPreparedResultUpdateProperties",
"(",
"Object",
"[",
"]",
"parameterValues",
")",
"{",
"if",
"(",
"navigator",
".",
"getSize",
"(",
")",
"==",
"1",
")",
"{",
"(",
"(",
"RowSetNavigatorClient",
")",
"navigator",
")",
".",
"setData",
"(",... | For UPDATE_RESULT results
The parameters are set by this method as the Result is reused | [
"For",
"UPDATE_RESULT",
"results",
"The",
"parameters",
"are",
"set",
"by",
"this",
"method",
"as",
"the",
"Result",
"is",
"reused"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java#L666-L674 |
60,948 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java | Result.setPreparedExecuteProperties | public void setPreparedExecuteProperties(Object[] parameterValues,
int maxRows, int fetchSize) {
mode = ResultConstants.EXECUTE;
if (navigator.getSize() == 1) {
((RowSetNavigatorClient) navigator).setData(0, parameterValues);
} else {
navigator.clear();
... | java | public void setPreparedExecuteProperties(Object[] parameterValues,
int maxRows, int fetchSize) {
mode = ResultConstants.EXECUTE;
if (navigator.getSize() == 1) {
((RowSetNavigatorClient) navigator).setData(0, parameterValues);
} else {
navigator.clear();
... | [
"public",
"void",
"setPreparedExecuteProperties",
"(",
"Object",
"[",
"]",
"parameterValues",
",",
"int",
"maxRows",
",",
"int",
"fetchSize",
")",
"{",
"mode",
"=",
"ResultConstants",
".",
"EXECUTE",
";",
"if",
"(",
"navigator",
".",
"getSize",
"(",
")",
"==... | For SQLEXECUTE results
The parameters are set by this method as the Result is reused | [
"For",
"SQLEXECUTE",
"results",
"The",
"parameters",
"are",
"set",
"by",
"this",
"method",
"as",
"the",
"Result",
"is",
"reused"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java#L680-L694 |
60,949 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java | Result.newBatchedExecuteResponse | public static Result newBatchedExecuteResponse(int[] updateCounts,
Result generatedResult, Result e) {
Result result = newResult(ResultConstants.BATCHEXECRESPONSE);
result.addChainedResult(generatedResult);
result.addChainedResult(e);
Type[] types = new Type[]{ Type.SQL_IN... | java | public static Result newBatchedExecuteResponse(int[] updateCounts,
Result generatedResult, Result e) {
Result result = newResult(ResultConstants.BATCHEXECRESPONSE);
result.addChainedResult(generatedResult);
result.addChainedResult(e);
Type[] types = new Type[]{ Type.SQL_IN... | [
"public",
"static",
"Result",
"newBatchedExecuteResponse",
"(",
"int",
"[",
"]",
"updateCounts",
",",
"Result",
"generatedResult",
",",
"Result",
"e",
")",
"{",
"Result",
"result",
"=",
"newResult",
"(",
"ResultConstants",
".",
"BATCHEXECRESPONSE",
")",
";",
"re... | For BATCHEXERESPONSE for a BATCHEXECUTE or BATCHEXECDIRECT | [
"For",
"BATCHEXERESPONSE",
"for",
"a",
"BATCHEXECUTE",
"or",
"BATCHEXECDIRECT"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java#L729-L750 |
60,950 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java | Result.setPrepareOrExecuteProperties | public void setPrepareOrExecuteProperties(String sql, int maxRows,
int fetchSize, int statementReturnType, int resultSetType,
int resultSetConcurrency, int resultSetHoldability, int keyMode,
int[] generatedIndexes, String[] generatedNames) {
mainString = sql;
... | java | public void setPrepareOrExecuteProperties(String sql, int maxRows,
int fetchSize, int statementReturnType, int resultSetType,
int resultSetConcurrency, int resultSetHoldability, int keyMode,
int[] generatedIndexes, String[] generatedNames) {
mainString = sql;
... | [
"public",
"void",
"setPrepareOrExecuteProperties",
"(",
"String",
"sql",
",",
"int",
"maxRows",
",",
"int",
"fetchSize",
",",
"int",
"statementReturnType",
",",
"int",
"resultSetType",
",",
"int",
"resultSetConcurrency",
",",
"int",
"resultSetHoldability",
",",
"int... | For both EXECDIRECT and PREPARE | [
"For",
"both",
"EXECDIRECT",
"and",
"PREPARE"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/result/Result.java#L908-L924 |
60,951 | VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/OptionBuilder.java | OptionBuilder.reset | private static void reset()
{
description = null;
argName = null;
longopt = null;
type = String.class;
required = false;
numberOfArgs = Option.UNINITIALIZED;
optionalArg = false;
valuesep = (char) 0;
} | java | private static void reset()
{
description = null;
argName = null;
longopt = null;
type = String.class;
required = false;
numberOfArgs = Option.UNINITIALIZED;
optionalArg = false;
valuesep = (char) 0;
} | [
"private",
"static",
"void",
"reset",
"(",
")",
"{",
"description",
"=",
"null",
";",
"argName",
"=",
"null",
";",
"longopt",
"=",
"null",
";",
"type",
"=",
"String",
".",
"class",
";",
"required",
"=",
"false",
";",
"numberOfArgs",
"=",
"Option",
".",... | Resets the member variables to their default values. | [
"Resets",
"the",
"member",
"variables",
"to",
"their",
"default",
"values",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/OptionBuilder.java#L79-L89 |
60,952 | VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/OptionBuilder.java | OptionBuilder.hasOptionalArgs | public static OptionBuilder hasOptionalArgs()
{
OptionBuilder.numberOfArgs = Option.UNLIMITED_VALUES;
OptionBuilder.optionalArg = true;
return INSTANCE;
} | java | public static OptionBuilder hasOptionalArgs()
{
OptionBuilder.numberOfArgs = Option.UNLIMITED_VALUES;
OptionBuilder.optionalArg = true;
return INSTANCE;
} | [
"public",
"static",
"OptionBuilder",
"hasOptionalArgs",
"(",
")",
"{",
"OptionBuilder",
".",
"numberOfArgs",
"=",
"Option",
".",
"UNLIMITED_VALUES",
";",
"OptionBuilder",
".",
"optionalArg",
"=",
"true",
";",
"return",
"INSTANCE",
";",
"}"
] | The next Option can have an unlimited number of optional arguments.
@return the OptionBuilder instance | [
"The",
"next",
"Option",
"can",
"have",
"an",
"unlimited",
"number",
"of",
"optional",
"arguments",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/OptionBuilder.java#L261-L267 |
60,953 | VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/OptionBuilder.java | OptionBuilder.hasOptionalArgs | public static OptionBuilder hasOptionalArgs(int numArgs)
{
OptionBuilder.numberOfArgs = numArgs;
OptionBuilder.optionalArg = true;
return INSTANCE;
} | java | public static OptionBuilder hasOptionalArgs(int numArgs)
{
OptionBuilder.numberOfArgs = numArgs;
OptionBuilder.optionalArg = true;
return INSTANCE;
} | [
"public",
"static",
"OptionBuilder",
"hasOptionalArgs",
"(",
"int",
"numArgs",
")",
"{",
"OptionBuilder",
".",
"numberOfArgs",
"=",
"numArgs",
";",
"OptionBuilder",
".",
"optionalArg",
"=",
"true",
";",
"return",
"INSTANCE",
";",
"}"
] | The next Option can have the specified number of optional arguments.
@param numArgs - the maximum number of optional arguments
the next Option created can have.
@return the OptionBuilder instance | [
"The",
"next",
"Option",
"can",
"have",
"the",
"specified",
"number",
"of",
"optional",
"arguments",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/OptionBuilder.java#L276-L282 |
60,954 | VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/OptionBuilder.java | OptionBuilder.create | public static Option create() throws IllegalArgumentException
{
if (longopt == null)
{
OptionBuilder.reset();
throw new IllegalArgumentException("must specify longopt");
}
return create(null);
} | java | public static Option create() throws IllegalArgumentException
{
if (longopt == null)
{
OptionBuilder.reset();
throw new IllegalArgumentException("must specify longopt");
}
return create(null);
} | [
"public",
"static",
"Option",
"create",
"(",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"longopt",
"==",
"null",
")",
"{",
"OptionBuilder",
".",
"reset",
"(",
")",
";",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"must specify longopt\"",
... | Create an Option using the current settings
@return the Option instance
@throws IllegalArgumentException if <code>longOpt</code> has not been set. | [
"Create",
"an",
"Option",
"using",
"the",
"current",
"settings"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/OptionBuilder.java#L349-L358 |
60,955 | VoltDB/voltdb | src/frontend/org/voltdb/compiler/statements/CreateProcedureAsSQL.java | CreateProcedureAsSQL.checkProcedureIdentifier | private String checkProcedureIdentifier(
final String identifier, final String statement
) throws VoltCompilerException {
String retIdent = checkIdentifierStart(identifier, statement);
if (retIdent.contains(".")) {
String msg = String.format(
"Invalid ... | java | private String checkProcedureIdentifier(
final String identifier, final String statement
) throws VoltCompilerException {
String retIdent = checkIdentifierStart(identifier, statement);
if (retIdent.contains(".")) {
String msg = String.format(
"Invalid ... | [
"private",
"String",
"checkProcedureIdentifier",
"(",
"final",
"String",
"identifier",
",",
"final",
"String",
"statement",
")",
"throws",
"VoltCompilerException",
"{",
"String",
"retIdent",
"=",
"checkIdentifierStart",
"(",
"identifier",
",",
"statement",
")",
";",
... | Check whether or not a procedure name is acceptible.
@param identifier the identifier to check
@param statement the statement where the identifier is
@return the given identifier unmodified
@throws VoltCompilerException | [
"Check",
"whether",
"or",
"not",
"a",
"procedure",
"name",
"is",
"acceptible",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/statements/CreateProcedureAsSQL.java#L81-L92 |
60,956 | VoltDB/voltdb | src/frontend/org/voltcore/network/VoltPort.java | VoltPort.resolveHostname | void resolveHostname(boolean synchronous) {
Runnable r = new Runnable() {
@Override
public void run() {
String remoteHost = ReverseDNSCache.hostnameOrAddress(m_remoteSocketAddress.getAddress());
if (!remoteHost.equals(m_remoteSocketAddress.getAddress().get... | java | void resolveHostname(boolean synchronous) {
Runnable r = new Runnable() {
@Override
public void run() {
String remoteHost = ReverseDNSCache.hostnameOrAddress(m_remoteSocketAddress.getAddress());
if (!remoteHost.equals(m_remoteSocketAddress.getAddress().get... | [
"void",
"resolveHostname",
"(",
"boolean",
"synchronous",
")",
"{",
"Runnable",
"r",
"=",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"String",
"remoteHost",
"=",
"ReverseDNSCache",
".",
"hostnameOrAddress",
"("... | Do a reverse DNS lookup of the remote end. Done in a separate thread unless synchronous is specified.
If asynchronous lookup is requested the task may be dropped and resolution may never occur | [
"Do",
"a",
"reverse",
"DNS",
"lookup",
"of",
"the",
"remote",
"end",
".",
"Done",
"in",
"a",
"separate",
"thread",
"unless",
"synchronous",
"is",
"specified",
".",
"If",
"asynchronous",
"lookup",
"is",
"requested",
"the",
"task",
"may",
"be",
"dropped",
"a... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/network/VoltPort.java#L110-L136 |
60,957 | VoltDB/voltdb | src/frontend/org/voltcore/network/VoltPort.java | VoltPort.setInterests | public void setInterests(int opsToAdd, int opsToRemove) {
// must be done atomically with changes to m_running
synchronized(m_lock) {
int oldInterestOps = m_interestOps;
m_interestOps = (m_interestOps | opsToAdd) & (~opsToRemove);
if (oldInterestOps != m_interestOps ... | java | public void setInterests(int opsToAdd, int opsToRemove) {
// must be done atomically with changes to m_running
synchronized(m_lock) {
int oldInterestOps = m_interestOps;
m_interestOps = (m_interestOps | opsToAdd) & (~opsToRemove);
if (oldInterestOps != m_interestOps ... | [
"public",
"void",
"setInterests",
"(",
"int",
"opsToAdd",
",",
"int",
"opsToRemove",
")",
"{",
"// must be done atomically with changes to m_running",
"synchronized",
"(",
"m_lock",
")",
"{",
"int",
"oldInterestOps",
"=",
"m_interestOps",
";",
"m_interestOps",
"=",
"(... | Change the desired interest key set | [
"Change",
"the",
"desired",
"interest",
"key",
"set"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/network/VoltPort.java#L291-L305 |
60,958 | VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/AdHocBase.java | AdHocBase.adHocSQLFromInvocationForDebug | public static String adHocSQLFromInvocationForDebug(StoredProcedureInvocation invocation) {
assert(invocation.getProcName().startsWith("@AdHoc"));
ParameterSet params = invocation.getParams();
// the final param is the byte array we need
byte[] serializedBatchData = (byte[]) params.getPa... | java | public static String adHocSQLFromInvocationForDebug(StoredProcedureInvocation invocation) {
assert(invocation.getProcName().startsWith("@AdHoc"));
ParameterSet params = invocation.getParams();
// the final param is the byte array we need
byte[] serializedBatchData = (byte[]) params.getPa... | [
"public",
"static",
"String",
"adHocSQLFromInvocationForDebug",
"(",
"StoredProcedureInvocation",
"invocation",
")",
"{",
"assert",
"(",
"invocation",
".",
"getProcName",
"(",
")",
".",
"startsWith",
"(",
"\"@AdHoc\"",
")",
")",
";",
"ParameterSet",
"params",
"=",
... | Get a string containing the SQL statements and any parameters for a given
batch passed to an ad-hoc query. Used for debugging and logging. | [
"Get",
"a",
"string",
"containing",
"the",
"SQL",
"statements",
"and",
"any",
"parameters",
"for",
"a",
"given",
"batch",
"passed",
"to",
"an",
"ad",
"-",
"hoc",
"query",
".",
"Used",
"for",
"debugging",
"and",
"logging",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/AdHocBase.java#L72-L98 |
60,959 | VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/AdHocBase.java | AdHocBase.adHocSQLStringFromPlannedStatement | public static String adHocSQLStringFromPlannedStatement(AdHocPlannedStatement statement, Object[] userparams) {
final int MAX_PARAM_LINE_CHARS = 120;
StringBuilder sb = new StringBuilder();
String sql = new String(statement.sql, Charsets.UTF_8);
sb.append(sql);
Object[] params ... | java | public static String adHocSQLStringFromPlannedStatement(AdHocPlannedStatement statement, Object[] userparams) {
final int MAX_PARAM_LINE_CHARS = 120;
StringBuilder sb = new StringBuilder();
String sql = new String(statement.sql, Charsets.UTF_8);
sb.append(sql);
Object[] params ... | [
"public",
"static",
"String",
"adHocSQLStringFromPlannedStatement",
"(",
"AdHocPlannedStatement",
"statement",
",",
"Object",
"[",
"]",
"userparams",
")",
"{",
"final",
"int",
"MAX_PARAM_LINE_CHARS",
"=",
"120",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",... | Get a string containing a SQL statement and any parameters for a given
AdHocPlannedStatement. Used for debugging and logging. | [
"Get",
"a",
"string",
"containing",
"a",
"SQL",
"statement",
"and",
"any",
"parameters",
"for",
"a",
"given",
"AdHocPlannedStatement",
".",
"Used",
"for",
"debugging",
"and",
"logging",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/AdHocBase.java#L104-L127 |
60,960 | VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/AdHocBase.java | AdHocBase.decodeSerializedBatchData | public static Pair<Object[], AdHocPlannedStatement[]> decodeSerializedBatchData(byte[] serializedBatchData) {
// Collections must be the same size since they all contain slices of the same data.
assert(serializedBatchData != null);
ByteBuffer buf = ByteBuffer.wrap(serializedBatchData);
... | java | public static Pair<Object[], AdHocPlannedStatement[]> decodeSerializedBatchData(byte[] serializedBatchData) {
// Collections must be the same size since they all contain slices of the same data.
assert(serializedBatchData != null);
ByteBuffer buf = ByteBuffer.wrap(serializedBatchData);
... | [
"public",
"static",
"Pair",
"<",
"Object",
"[",
"]",
",",
"AdHocPlannedStatement",
"[",
"]",
">",
"decodeSerializedBatchData",
"(",
"byte",
"[",
"]",
"serializedBatchData",
")",
"{",
"// Collections must be the same size since they all contain slices of the same data.",
"as... | Decode binary data into structures needed to process adhoc queries.
This code was pulled out of runAdHoc so it could be shared there and with
adHocSQLStringFromPlannedStatement. | [
"Decode",
"binary",
"data",
"into",
"structures",
"needed",
"to",
"process",
"adhoc",
"queries",
".",
"This",
"code",
"was",
"pulled",
"out",
"of",
"runAdHoc",
"so",
"it",
"could",
"be",
"shared",
"there",
"and",
"with",
"adHocSQLStringFromPlannedStatement",
"."... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/AdHocBase.java#L134-L149 |
60,961 | VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/AdHocBase.java | AdHocBase.paramsForStatement | static Object[] paramsForStatement(AdHocPlannedStatement statement, Object[] userparams) {
// When there are no user-provided parameters, statements may have parameterized constants.
if (userparams.length > 0) {
return userparams;
} else {
return statement.extractedParamA... | java | static Object[] paramsForStatement(AdHocPlannedStatement statement, Object[] userparams) {
// When there are no user-provided parameters, statements may have parameterized constants.
if (userparams.length > 0) {
return userparams;
} else {
return statement.extractedParamA... | [
"static",
"Object",
"[",
"]",
"paramsForStatement",
"(",
"AdHocPlannedStatement",
"statement",
",",
"Object",
"[",
"]",
"userparams",
")",
"{",
"// When there are no user-provided parameters, statements may have parameterized constants.",
"if",
"(",
"userparams",
".",
"length... | Get the params for a specific SQL statement within a batch.
Note that there is usually a batch size of one. | [
"Get",
"the",
"params",
"for",
"a",
"specific",
"SQL",
"statement",
"within",
"a",
"batch",
".",
"Note",
"that",
"there",
"is",
"usually",
"a",
"batch",
"size",
"of",
"one",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/AdHocBase.java#L155-L162 |
60,962 | VoltDB/voltdb | src/frontend/org/voltdb/utils/InMemoryJarfile.java | InMemoryJarfile.writeToFile | public static void writeToFile(byte[] catalogBytes, File file) throws IOException {
JarOutputStream jarOut = new JarOutputStream(new FileOutputStream(file));
JarInputStream jarIn = new JarInputStream(new ByteArrayInputStream(catalogBytes));
JarEntry catEntry = null;
JarInputStreamReader... | java | public static void writeToFile(byte[] catalogBytes, File file) throws IOException {
JarOutputStream jarOut = new JarOutputStream(new FileOutputStream(file));
JarInputStream jarIn = new JarInputStream(new ByteArrayInputStream(catalogBytes));
JarEntry catEntry = null;
JarInputStreamReader... | [
"public",
"static",
"void",
"writeToFile",
"(",
"byte",
"[",
"]",
"catalogBytes",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"JarOutputStream",
"jarOut",
"=",
"new",
"JarOutputStream",
"(",
"new",
"FileOutputStream",
"(",
"file",
")",
")",
";",
... | directly transformed and written to the specified file | [
"directly",
"transformed",
"and",
"written",
"to",
"the",
"specified",
"file"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/InMemoryJarfile.java#L163-L185 |
60,963 | VoltDB/voltdb | src/frontend/org/voltdb/utils/InMemoryJarfile.java | InMemoryJarfile.getCRC | public long getCRC() {
PureJavaCrc32 crc = new PureJavaCrc32();
for (Entry<String, byte[]> e : super.entrySet()) {
if (e.getKey().equals("buildinfo.txt") || e.getKey().equals("catalog-report.html")) {
continue;
}
// Hacky way to skip the first line o... | java | public long getCRC() {
PureJavaCrc32 crc = new PureJavaCrc32();
for (Entry<String, byte[]> e : super.entrySet()) {
if (e.getKey().equals("buildinfo.txt") || e.getKey().equals("catalog-report.html")) {
continue;
}
// Hacky way to skip the first line o... | [
"public",
"long",
"getCRC",
"(",
")",
"{",
"PureJavaCrc32",
"crc",
"=",
"new",
"PureJavaCrc32",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"byte",
"[",
"]",
">",
"e",
":",
"super",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
"e",... | just replacing one method call with another, though. | [
"just",
"replacing",
"one",
"method",
"call",
"with",
"another",
"though",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/InMemoryJarfile.java#L241-L268 |
60,964 | VoltDB/voltdb | src/frontend/org/voltdb/utils/InMemoryJarfile.java | InMemoryJarfile.removeClassFromJar | public void removeClassFromJar(String classname)
{
for (String innerclass : getLoader().getInnerClassesForClass(classname)) {
remove(classToFileName(innerclass));
}
remove(classToFileName(classname));
} | java | public void removeClassFromJar(String classname)
{
for (String innerclass : getLoader().getInnerClassesForClass(classname)) {
remove(classToFileName(innerclass));
}
remove(classToFileName(classname));
} | [
"public",
"void",
"removeClassFromJar",
"(",
"String",
"classname",
")",
"{",
"for",
"(",
"String",
"innerclass",
":",
"getLoader",
"(",
")",
".",
"getInnerClassesForClass",
"(",
"classname",
")",
")",
"{",
"remove",
"(",
"classToFileName",
"(",
"innerclass",
... | Remove the provided classname and all inner classes from the jarfile and the classloader | [
"Remove",
"the",
"provided",
"classname",
"and",
"all",
"inner",
"classes",
"from",
"the",
"jarfile",
"and",
"the",
"classloader"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/InMemoryJarfile.java#L334-L340 |
60,965 | VoltDB/voltdb | src/frontend/org/voltdb/parser/JDBCParser.java | JDBCParser.parseJDBCCall | public static ParsedCall parseJDBCCall(String jdbcCall) throws SQLParser.Exception
{
Matcher m = PAT_CALL_WITH_PARAMETERS.matcher(jdbcCall);
if (m.matches()) {
String sql = m.group(1);
int parameterCount = PAT_CLEAN_CALL_PARAMETERS.matcher(m.group(2)).replaceAll("").length();... | java | public static ParsedCall parseJDBCCall(String jdbcCall) throws SQLParser.Exception
{
Matcher m = PAT_CALL_WITH_PARAMETERS.matcher(jdbcCall);
if (m.matches()) {
String sql = m.group(1);
int parameterCount = PAT_CLEAN_CALL_PARAMETERS.matcher(m.group(2)).replaceAll("").length();... | [
"public",
"static",
"ParsedCall",
"parseJDBCCall",
"(",
"String",
"jdbcCall",
")",
"throws",
"SQLParser",
".",
"Exception",
"{",
"Matcher",
"m",
"=",
"PAT_CALL_WITH_PARAMETERS",
".",
"matcher",
"(",
"jdbcCall",
")",
";",
"if",
"(",
"m",
".",
"matches",
"(",
... | Parse call statements for JDBC.
@param jdbcCall statement to parse
@return object with parsed data or null if it didn't parse
@throws SQLParser.Exception | [
"Parse",
"call",
"statements",
"for",
"JDBC",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/JDBCParser.java#L67-L80 |
60,966 | VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/SetFunction.java | SetFunction.getType | static Type getType(int setType, Type type) {
if (setType == OpTypes.COUNT) {
return Type.SQL_BIGINT;
}
// A VoltDB extension to handle aggfnc(*) syntax errors.
// If the argument node does not have
// a data type, it may be '*'. If the
// operation is COUN... | java | static Type getType(int setType, Type type) {
if (setType == OpTypes.COUNT) {
return Type.SQL_BIGINT;
}
// A VoltDB extension to handle aggfnc(*) syntax errors.
// If the argument node does not have
// a data type, it may be '*'. If the
// operation is COUN... | [
"static",
"Type",
"getType",
"(",
"int",
"setType",
",",
"Type",
"type",
")",
"{",
"if",
"(",
"setType",
"==",
"OpTypes",
".",
"COUNT",
")",
"{",
"return",
"Type",
".",
"SQL_BIGINT",
";",
"}",
"// A VoltDB extension to handle aggfnc(*) syntax errors.",
"// If th... | During parsing and before an instance of SetFunction is created,
getType is called with type parameter set to correct type when main
SELECT statements contain aggregates. | [
"During",
"parsing",
"and",
"before",
"an",
"instance",
"of",
"SetFunction",
"is",
"created",
"getType",
"is",
"called",
"with",
"type",
"parameter",
"set",
"to",
"correct",
"type",
"when",
"main",
"SELECT",
"statements",
"contain",
"aggregates",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/SetFunction.java#L379-L498 |
60,967 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java | Util.makeFileLoggerURL | public static URI makeFileLoggerURL(File dataDir, File dataLogDir){
return URI.create(makeURIString(dataDir.getPath(),dataLogDir.getPath(),null));
} | java | public static URI makeFileLoggerURL(File dataDir, File dataLogDir){
return URI.create(makeURIString(dataDir.getPath(),dataLogDir.getPath(),null));
} | [
"public",
"static",
"URI",
"makeFileLoggerURL",
"(",
"File",
"dataDir",
",",
"File",
"dataLogDir",
")",
"{",
"return",
"URI",
".",
"create",
"(",
"makeURIString",
"(",
"dataDir",
".",
"getPath",
"(",
")",
",",
"dataLogDir",
".",
"getPath",
"(",
")",
",",
... | Given two directory files the method returns a well-formed
logfile provider URI. This method is for backward compatibility with the
existing code that only supports logfile persistence and expects these two
parameters passed either on the command-line or in the configuration file.
@param dataDir snapshot directory
@pa... | [
"Given",
"two",
"directory",
"files",
"the",
"method",
"returns",
"a",
"well",
"-",
"formed",
"logfile",
"provider",
"URI",
".",
"This",
"method",
"is",
"for",
"backward",
"compatibility",
"with",
"the",
"existing",
"code",
"that",
"only",
"supports",
"logfile... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java#L73-L75 |
60,968 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java | Util.isValidSnapshot | public static boolean isValidSnapshot(File f) throws IOException {
if (f==null || Util.getZxidFromName(f.getName(), "snapshot") == -1)
return false;
// Check for a valid snapshot
RandomAccessFile raf = new RandomAccessFile(f, "r");
// including the header and the last / byte... | java | public static boolean isValidSnapshot(File f) throws IOException {
if (f==null || Util.getZxidFromName(f.getName(), "snapshot") == -1)
return false;
// Check for a valid snapshot
RandomAccessFile raf = new RandomAccessFile(f, "r");
// including the header and the last / byte... | [
"public",
"static",
"boolean",
"isValidSnapshot",
"(",
"File",
"f",
")",
"throws",
"IOException",
"{",
"if",
"(",
"f",
"==",
"null",
"||",
"Util",
".",
"getZxidFromName",
"(",
"f",
".",
"getName",
"(",
")",
",",
"\"snapshot\"",
")",
"==",
"-",
"1",
")"... | Verifies that the file is a valid snapshot. Snapshot may be invalid if
it's incomplete as in a situation when the server dies while in the process
of storing a snapshot. Any file that is not a snapshot is also
an invalid snapshot.
@param f file to verify
@return true if the snapshot is valid
@throws IOException | [
"Verifies",
"that",
"the",
"file",
"is",
"a",
"valid",
"snapshot",
".",
"Snapshot",
"may",
"be",
"invalid",
"if",
"it",
"s",
"incomplete",
"as",
"in",
"a",
"situation",
"when",
"the",
"server",
"dies",
"while",
"in",
"the",
"process",
"of",
"storing",
"a... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java#L161-L199 |
60,969 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java | Util.readTxnBytes | public static byte[] readTxnBytes(InputArchive ia) throws IOException {
try{
byte[] bytes = ia.readBuffer("txtEntry");
// Since we preallocate, we define EOF to be an
// empty transaction
if (bytes.length == 0)
return bytes;
if (ia.read... | java | public static byte[] readTxnBytes(InputArchive ia) throws IOException {
try{
byte[] bytes = ia.readBuffer("txtEntry");
// Since we preallocate, we define EOF to be an
// empty transaction
if (bytes.length == 0)
return bytes;
if (ia.read... | [
"public",
"static",
"byte",
"[",
"]",
"readTxnBytes",
"(",
"InputArchive",
"ia",
")",
"throws",
"IOException",
"{",
"try",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"ia",
".",
"readBuffer",
"(",
"\"txtEntry\"",
")",
";",
"// Since we preallocate, we define EOF to be ... | Reads a transaction entry from the input archive.
@param ia archive to read from
@return null if the entry is corrupted or EOF has been reached; a buffer
(possible empty) containing serialized transaction record.
@throws IOException | [
"Reads",
"a",
"transaction",
"entry",
"from",
"the",
"input",
"archive",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java#L231-L245 |
60,970 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java | Util.marshallTxnEntry | public static byte[] marshallTxnEntry(TxnHeader hdr, Record txn)
throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputArchive boa = BinaryOutputArchive.getArchive(baos);
hdr.serialize(boa, "hdr");
if (txn != null) {
txn.serialize(b... | java | public static byte[] marshallTxnEntry(TxnHeader hdr, Record txn)
throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputArchive boa = BinaryOutputArchive.getArchive(baos);
hdr.serialize(boa, "hdr");
if (txn != null) {
txn.serialize(b... | [
"public",
"static",
"byte",
"[",
"]",
"marshallTxnEntry",
"(",
"TxnHeader",
"hdr",
",",
"Record",
"txn",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"OutputArchive",
"boa",
"=",
"BinaryO... | Serializes transaction header and transaction data into a byte buffer.
@param hdr transaction header
@param txn transaction data
@return serialized transaction record
@throws IOException | [
"Serializes",
"transaction",
"header",
"and",
"transaction",
"data",
"into",
"a",
"byte",
"buffer",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java#L256-L266 |
60,971 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java | Util.writeTxnBytes | public static void writeTxnBytes(OutputArchive oa, byte[] bytes)
throws IOException {
oa.writeBuffer(bytes, "txnEntry");
oa.writeByte((byte) 0x42, "EOR"); // 'B'
} | java | public static void writeTxnBytes(OutputArchive oa, byte[] bytes)
throws IOException {
oa.writeBuffer(bytes, "txnEntry");
oa.writeByte((byte) 0x42, "EOR"); // 'B'
} | [
"public",
"static",
"void",
"writeTxnBytes",
"(",
"OutputArchive",
"oa",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"oa",
".",
"writeBuffer",
"(",
"bytes",
",",
"\"txnEntry\"",
")",
";",
"oa",
".",
"writeByte",
"(",
"(",
"byte",
"... | Write the serialized transaction record to the output archive.
@param oa output archive
@param bytes serialized trasnaction record
@throws IOException | [
"Write",
"the",
"serialized",
"transaction",
"record",
"to",
"the",
"output",
"archive",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java#L275-L279 |
60,972 | VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java | Util.sortDataDir | public static List<File> sortDataDir(File[] files, String prefix, boolean ascending)
{
if(files==null)
return new ArrayList<File>(0);
List<File> filelist = Arrays.asList(files);
Collections.sort(filelist, new DataDirFileComparator(prefix, ascending));
return filelist;
... | java | public static List<File> sortDataDir(File[] files, String prefix, boolean ascending)
{
if(files==null)
return new ArrayList<File>(0);
List<File> filelist = Arrays.asList(files);
Collections.sort(filelist, new DataDirFileComparator(prefix, ascending));
return filelist;
... | [
"public",
"static",
"List",
"<",
"File",
">",
"sortDataDir",
"(",
"File",
"[",
"]",
"files",
",",
"String",
"prefix",
",",
"boolean",
"ascending",
")",
"{",
"if",
"(",
"files",
"==",
"null",
")",
"return",
"new",
"ArrayList",
"<",
"File",
">",
"(",
"... | Sort the list of files. Recency as determined by the version component
of the file name.
@param files array of files
@param prefix files not matching this prefix are assumed to have a
version = -1)
@param ascending true sorted in ascending order, false results in
descending order
@return sorted input files | [
"Sort",
"the",
"list",
"of",
"files",
".",
"Recency",
"as",
"determined",
"by",
"the",
"version",
"component",
"of",
"the",
"file",
"name",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/persistence/Util.java#L317-L324 |
60,973 | VoltDB/voltdb | src/frontend/org/voltdb/plannodes/SwapTablesPlanNode.java | SwapTablesPlanNode.diagnoseIndexMismatch | private List<String> diagnoseIndexMismatch(Index theIndex, Index otherIndex) {
List<String> mismatchedAttrs = new ArrayList<>();
// Pairs of matching indexes must agree on type (int hash, etc.).
if (theIndex.getType() != otherIndex.getType()) {
mismatchedAttrs.add("index type (hash ... | java | private List<String> diagnoseIndexMismatch(Index theIndex, Index otherIndex) {
List<String> mismatchedAttrs = new ArrayList<>();
// Pairs of matching indexes must agree on type (int hash, etc.).
if (theIndex.getType() != otherIndex.getType()) {
mismatchedAttrs.add("index type (hash ... | [
"private",
"List",
"<",
"String",
">",
"diagnoseIndexMismatch",
"(",
"Index",
"theIndex",
",",
"Index",
"otherIndex",
")",
"{",
"List",
"<",
"String",
">",
"mismatchedAttrs",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// Pairs of matching indexes must agree on... | Give two strings, return a list of attributes that do not match
@param theIndex
@param otherIndex
@return list of attributes that do not match | [
"Give",
"two",
"strings",
"return",
"a",
"list",
"of",
"attributes",
"that",
"do",
"not",
"match"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/SwapTablesPlanNode.java#L354-L415 |
60,974 | VoltDB/voltdb | src/frontend/org/voltdb/plannodes/SwapTablesPlanNode.java | SwapTablesPlanNode.validateTableCompatibility | private void validateTableCompatibility(String theName, String otherName,
Table theTable, Table otherTable, FailureMessage failureMessage) {
if (theTable.getIsdred() != otherTable.getIsdred()) {
failureMessage.addReason("To swap table " + theName + " with table " + otherName +
... | java | private void validateTableCompatibility(String theName, String otherName,
Table theTable, Table otherTable, FailureMessage failureMessage) {
if (theTable.getIsdred() != otherTable.getIsdred()) {
failureMessage.addReason("To swap table " + theName + " with table " + otherName +
... | [
"private",
"void",
"validateTableCompatibility",
"(",
"String",
"theName",
",",
"String",
"otherName",
",",
"Table",
"theTable",
",",
"Table",
"otherTable",
",",
"FailureMessage",
"failureMessage",
")",
"{",
"if",
"(",
"theTable",
".",
"getIsdred",
"(",
")",
"!=... | Flag any issues of incompatibility between the two table operands
of a swap by appending error details to a feedback buffer. These
details and possibly others should get attached to a
PlannerErrorException's message by the caller.
@param theName the first argument to the table swap
@param otherName the second argument ... | [
"Flag",
"any",
"issues",
"of",
"incompatibility",
"between",
"the",
"two",
"table",
"operands",
"of",
"a",
"swap",
"by",
"appending",
"error",
"details",
"to",
"a",
"feedback",
"buffer",
".",
"These",
"details",
"and",
"possibly",
"others",
"should",
"get",
... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/SwapTablesPlanNode.java#L496-L528 |
60,975 | VoltDB/voltdb | src/frontend/org/voltdb/plannodes/SwapTablesPlanNode.java | SwapTablesPlanNode.validateColumnCompatibility | private void validateColumnCompatibility(String theName, String otherName,
Table theTable, Table otherTable,
FailureMessage failureMessage) {
CatalogMap<Column> theColumns = theTable.getColumns();
int theColCount = theColumns.size();
CatalogMap<Column> otherColumn... | java | private void validateColumnCompatibility(String theName, String otherName,
Table theTable, Table otherTable,
FailureMessage failureMessage) {
CatalogMap<Column> theColumns = theTable.getColumns();
int theColCount = theColumns.size();
CatalogMap<Column> otherColumn... | [
"private",
"void",
"validateColumnCompatibility",
"(",
"String",
"theName",
",",
"String",
"otherName",
",",
"Table",
"theTable",
",",
"Table",
"otherTable",
",",
"FailureMessage",
"failureMessage",
")",
"{",
"CatalogMap",
"<",
"Column",
">",
"theColumns",
"=",
"t... | Flag any issues of incompatibility between the columns of the two table
operands of a swap by appending error details to a feedback buffer.
These details and possibly others should get attached to a
PlannerErrorException's message by the caller.
@param theName the first argument to the table swap
@param otherName the s... | [
"Flag",
"any",
"issues",
"of",
"incompatibility",
"between",
"the",
"columns",
"of",
"the",
"two",
"table",
"operands",
"of",
"a",
"swap",
"by",
"appending",
"error",
"details",
"to",
"a",
"feedback",
"buffer",
".",
"These",
"details",
"and",
"possibly",
"ot... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/SwapTablesPlanNode.java#L568-L615 |
60,976 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.growIfNeeded | private final void growIfNeeded(int minimumDesired) {
if (buffer.b().remaining() < minimumDesired) {
// Compute the size of the new buffer
int newCapacity = buffer.b().capacity();
int newRemaining = newCapacity - buffer.b().position();
while (newRemaining < minimu... | java | private final void growIfNeeded(int minimumDesired) {
if (buffer.b().remaining() < minimumDesired) {
// Compute the size of the new buffer
int newCapacity = buffer.b().capacity();
int newRemaining = newCapacity - buffer.b().position();
while (newRemaining < minimu... | [
"private",
"final",
"void",
"growIfNeeded",
"(",
"int",
"minimumDesired",
")",
"{",
"if",
"(",
"buffer",
".",
"b",
"(",
")",
".",
"remaining",
"(",
")",
"<",
"minimumDesired",
")",
"{",
"// Compute the size of the new buffer",
"int",
"newCapacity",
"=",
"buffe... | Resizes the internal byte buffer with a simple doubling policy, if needed. | [
"Resizes",
"the",
"internal",
"byte",
"buffer",
"with",
"a",
"simple",
"doubling",
"policy",
"if",
"needed",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L116-L141 |
60,977 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.serialize | public static byte[] serialize(FastSerializable object) throws IOException {
FastSerializer out = new FastSerializer();
object.writeExternal(out);
return out.getBBContainer().b().array();
} | java | public static byte[] serialize(FastSerializable object) throws IOException {
FastSerializer out = new FastSerializer();
object.writeExternal(out);
return out.getBBContainer().b().array();
} | [
"public",
"static",
"byte",
"[",
"]",
"serialize",
"(",
"FastSerializable",
"object",
")",
"throws",
"IOException",
"{",
"FastSerializer",
"out",
"=",
"new",
"FastSerializer",
"(",
")",
";",
"object",
".",
"writeExternal",
"(",
"out",
")",
";",
"return",
"ou... | Get the byte version of object. This is a shortcut utility method when
you only need to serialize a single object.
@return The byte array representation for <code>object</code>. | [
"Get",
"the",
"byte",
"version",
"of",
"object",
".",
"This",
"is",
"a",
"shortcut",
"utility",
"method",
"when",
"you",
"only",
"need",
"to",
"serialize",
"a",
"single",
"object",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L149-L153 |
60,978 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.getBytes | public byte[] getBytes() {
byte[] retval = new byte[buffer.b().position()];
int position = buffer.b().position();
buffer.b().rewind();
buffer.b().get(retval);
assert position == buffer.b().position();
return retval;
} | java | public byte[] getBytes() {
byte[] retval = new byte[buffer.b().position()];
int position = buffer.b().position();
buffer.b().rewind();
buffer.b().get(retval);
assert position == buffer.b().position();
return retval;
} | [
"public",
"byte",
"[",
"]",
"getBytes",
"(",
")",
"{",
"byte",
"[",
"]",
"retval",
"=",
"new",
"byte",
"[",
"buffer",
".",
"b",
"(",
")",
".",
"position",
"(",
")",
"]",
";",
"int",
"position",
"=",
"buffer",
".",
"b",
"(",
")",
".",
"position"... | This method is slow and horrible. It entails an extra copy. Don't use it! Ever! Not even for test!
Just say no to test only code. It will also leak the BBContainer if this FS is being used with a pool. | [
"This",
"method",
"is",
"slow",
"and",
"horrible",
".",
"It",
"entails",
"an",
"extra",
"copy",
".",
"Don",
"t",
"use",
"it!",
"Ever!",
"Not",
"even",
"for",
"test!",
"Just",
"say",
"no",
"to",
"test",
"only",
"code",
".",
"It",
"will",
"also",
"leak... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L165-L172 |
60,979 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.getBuffer | public ByteBuffer getBuffer() {
assert(isDirect == false);
assert(buffer.b().hasArray());
assert(!buffer.b().isDirect());
buffer.b().flip();
return buffer.b().asReadOnlyBuffer();
} | java | public ByteBuffer getBuffer() {
assert(isDirect == false);
assert(buffer.b().hasArray());
assert(!buffer.b().isDirect());
buffer.b().flip();
return buffer.b().asReadOnlyBuffer();
} | [
"public",
"ByteBuffer",
"getBuffer",
"(",
")",
"{",
"assert",
"(",
"isDirect",
"==",
"false",
")",
";",
"assert",
"(",
"buffer",
".",
"b",
"(",
")",
".",
"hasArray",
"(",
")",
")",
";",
"assert",
"(",
"!",
"buffer",
".",
"b",
"(",
")",
".",
"isDi... | Return a readOnly slice of this buffer. Flips the internal buffer.
May not be, usefully, invoked multiple times on the same internal
state.
Only use this if using a non-direct ByteBuffer! | [
"Return",
"a",
"readOnly",
"slice",
"of",
"this",
"buffer",
".",
"Flips",
"the",
"internal",
"buffer",
".",
"May",
"not",
"be",
"usefully",
"invoked",
"multiple",
"times",
"on",
"the",
"same",
"internal",
"state",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L181-L187 |
60,980 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.getHexEncodedBytes | public String getHexEncodedBytes() {
buffer.b().flip();
byte bytes[] = new byte[buffer.b().remaining()];
buffer.b().get(bytes);
String hex = Encoder.hexEncode(bytes);
buffer.discard();
return hex;
} | java | public String getHexEncodedBytes() {
buffer.b().flip();
byte bytes[] = new byte[buffer.b().remaining()];
buffer.b().get(bytes);
String hex = Encoder.hexEncode(bytes);
buffer.discard();
return hex;
} | [
"public",
"String",
"getHexEncodedBytes",
"(",
")",
"{",
"buffer",
".",
"b",
"(",
")",
".",
"flip",
"(",
")",
";",
"byte",
"bytes",
"[",
"]",
"=",
"new",
"byte",
"[",
"buffer",
".",
"b",
"(",
")",
".",
"remaining",
"(",
")",
"]",
";",
"buffer",
... | Get a ascii-string-safe version of the binary value using a
hex encoding.
@return A hex-encoded string value representing the serialized
objects. | [
"Get",
"a",
"ascii",
"-",
"string",
"-",
"safe",
"version",
"of",
"the",
"binary",
"value",
"using",
"a",
"hex",
"encoding",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L206-L213 |
60,981 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.writeString | public static void writeString(String string, ByteBuffer buffer) throws IOException {
if (string == null) {
buffer.putInt(VoltType.NULL_STRING_LENGTH);
return;
}
byte[] strbytes = string.getBytes(Constants.UTF8ENCODING);
int len = strbytes.length;
buffer... | java | public static void writeString(String string, ByteBuffer buffer) throws IOException {
if (string == null) {
buffer.putInt(VoltType.NULL_STRING_LENGTH);
return;
}
byte[] strbytes = string.getBytes(Constants.UTF8ENCODING);
int len = strbytes.length;
buffer... | [
"public",
"static",
"void",
"writeString",
"(",
"String",
"string",
",",
"ByteBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"buffer",
".",
"putInt",
"(",
"VoltType",
".",
"NULL_STRING_LENGTH",
")",
";",
... | Write a string in the standard VoltDB way without
wrapping the byte buffer. | [
"Write",
"a",
"string",
"in",
"the",
"standard",
"VoltDB",
"way",
"without",
"wrapping",
"the",
"byte",
"buffer",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L230-L241 |
60,982 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.writeString | public void writeString(String string) throws IOException {
if (string == null) {
writeInt(VoltType.NULL_STRING_LENGTH);
return;
}
byte[] strbytes = string.getBytes(Constants.UTF8ENCODING);
int len = strbytes.length;
writeInt(len);
write(strbyte... | java | public void writeString(String string) throws IOException {
if (string == null) {
writeInt(VoltType.NULL_STRING_LENGTH);
return;
}
byte[] strbytes = string.getBytes(Constants.UTF8ENCODING);
int len = strbytes.length;
writeInt(len);
write(strbyte... | [
"public",
"void",
"writeString",
"(",
"String",
"string",
")",
"throws",
"IOException",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"writeInt",
"(",
"VoltType",
".",
"NULL_STRING_LENGTH",
")",
";",
"return",
";",
"}",
"byte",
"[",
"]",
"strbytes",
... | Write a string in the standard VoltDB way. That is, two
bytes of length info followed by the bytes of characters
encoded in UTF-8.
@param string The string value to be serialized.
@throws IOException Rethrows any IOExceptions thrown. | [
"Write",
"a",
"string",
"in",
"the",
"standard",
"VoltDB",
"way",
".",
"That",
"is",
"two",
"bytes",
"of",
"length",
"info",
"followed",
"by",
"the",
"bytes",
"of",
"characters",
"encoded",
"in",
"UTF",
"-",
"8",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L251-L262 |
60,983 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.writeVarbinary | public void writeVarbinary(byte[] bin) throws IOException {
if (bin == null) {
writeInt(VoltType.NULL_STRING_LENGTH);
return;
}
if (bin.length > VoltType.MAX_VALUE_LENGTH) {
throw new IOException("Varbinary exceeds maximum length of "
... | java | public void writeVarbinary(byte[] bin) throws IOException {
if (bin == null) {
writeInt(VoltType.NULL_STRING_LENGTH);
return;
}
if (bin.length > VoltType.MAX_VALUE_LENGTH) {
throw new IOException("Varbinary exceeds maximum length of "
... | [
"public",
"void",
"writeVarbinary",
"(",
"byte",
"[",
"]",
"bin",
")",
"throws",
"IOException",
"{",
"if",
"(",
"bin",
"==",
"null",
")",
"{",
"writeInt",
"(",
"VoltType",
".",
"NULL_STRING_LENGTH",
")",
";",
"return",
";",
"}",
"if",
"(",
"bin",
".",
... | Write a varbinary in the standard VoltDB way. That is, four
bytes of length info followed by the bytes.
@param bin The byte array value to be serialized.
@throws IOException Rethrows any IOExceptions thrown. | [
"Write",
"a",
"varbinary",
"in",
"the",
"standard",
"VoltDB",
"way",
".",
"That",
"is",
"four",
"bytes",
"of",
"length",
"info",
"followed",
"by",
"the",
"bytes",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L271-L283 |
60,984 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.writeTable | public void writeTable(VoltTable table) throws IOException {
int len = table.getSerializedSize();
growIfNeeded(len);
table.flattenToBuffer(buffer.b());
} | java | public void writeTable(VoltTable table) throws IOException {
int len = table.getSerializedSize();
growIfNeeded(len);
table.flattenToBuffer(buffer.b());
} | [
"public",
"void",
"writeTable",
"(",
"VoltTable",
"table",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"table",
".",
"getSerializedSize",
"(",
")",
";",
"growIfNeeded",
"(",
"len",
")",
";",
"table",
".",
"flattenToBuffer",
"(",
"buffer",
".",
"b... | Write a table using it's ByteBuffer serialization code. | [
"Write",
"a",
"table",
"using",
"it",
"s",
"ByteBuffer",
"serialization",
"code",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L288-L292 |
60,985 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.writeInvocation | public void writeInvocation(StoredProcedureInvocation invocation) throws IOException {
int len = invocation.getSerializedSize();
growIfNeeded(len);
invocation.flattenToBuffer(buffer.b());
} | java | public void writeInvocation(StoredProcedureInvocation invocation) throws IOException {
int len = invocation.getSerializedSize();
growIfNeeded(len);
invocation.flattenToBuffer(buffer.b());
} | [
"public",
"void",
"writeInvocation",
"(",
"StoredProcedureInvocation",
"invocation",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"invocation",
".",
"getSerializedSize",
"(",
")",
";",
"growIfNeeded",
"(",
"len",
")",
";",
"invocation",
".",
"flattenToBuf... | Write an SPI using it's ByteBuffer serialization code. | [
"Write",
"an",
"SPI",
"using",
"it",
"s",
"ByteBuffer",
"serialization",
"code",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L297-L301 |
60,986 | VoltDB/voltdb | src/frontend/org/voltdb/messaging/FastSerializer.java | FastSerializer.writeParameterSet | public void writeParameterSet(ParameterSet params) throws IOException {
int len = params.getSerializedSize();
growIfNeeded(len);
params.flattenToBuffer(buffer.b());
} | java | public void writeParameterSet(ParameterSet params) throws IOException {
int len = params.getSerializedSize();
growIfNeeded(len);
params.flattenToBuffer(buffer.b());
} | [
"public",
"void",
"writeParameterSet",
"(",
"ParameterSet",
"params",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"params",
".",
"getSerializedSize",
"(",
")",
";",
"growIfNeeded",
"(",
"len",
")",
";",
"params",
".",
"flattenToBuffer",
"(",
"buffer"... | Write a ParameterSet using it's ByteBuffer serialization code. | [
"Write",
"a",
"ParameterSet",
"using",
"it",
"s",
"ByteBuffer",
"serialization",
"code",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FastSerializer.java#L306-L310 |
60,987 | VoltDB/voltdb | src/frontend/org/voltcore/network/PicoNetwork.java | PicoNetwork.start | public void start(InputHandler ih, Set<Long> verbotenThreads) {
m_ih = ih;
m_verbotenThreads = verbotenThreads;
startSetup();
m_thread.start();
} | java | public void start(InputHandler ih, Set<Long> verbotenThreads) {
m_ih = ih;
m_verbotenThreads = verbotenThreads;
startSetup();
m_thread.start();
} | [
"public",
"void",
"start",
"(",
"InputHandler",
"ih",
",",
"Set",
"<",
"Long",
">",
"verbotenThreads",
")",
"{",
"m_ih",
"=",
"ih",
";",
"m_verbotenThreads",
"=",
"verbotenThreads",
";",
"startSetup",
"(",
")",
";",
"m_thread",
".",
"start",
"(",
")",
";... | Start this VoltNetwork's thread. populate the verbotenThreads set
with the id of the thread that is created | [
"Start",
"this",
"VoltNetwork",
"s",
"thread",
".",
"populate",
"the",
"verbotenThreads",
"set",
"with",
"the",
"id",
"of",
"the",
"thread",
"that",
"is",
"created"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/network/PicoNetwork.java#L124-L129 |
60,988 | VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Statement.java | JDBC4Statement.execute | @Override
public boolean execute(String sql) throws SQLException
{
checkClosed();
VoltSQL query = VoltSQL.parseSQL(sql);
return this.execute(query);
} | java | @Override
public boolean execute(String sql) throws SQLException
{
checkClosed();
VoltSQL query = VoltSQL.parseSQL(sql);
return this.execute(query);
} | [
"@",
"Override",
"public",
"boolean",
"execute",
"(",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"VoltSQL",
"query",
"=",
"VoltSQL",
".",
"parseSQL",
"(",
"sql",
")",
";",
"return",
"this",
".",
"execute",
"(",
"qu... | Executes the given SQL statement, which may return multiple results. | [
"Executes",
"the",
"given",
"SQL",
"statement",
"which",
"may",
"return",
"multiple",
"results",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Statement.java#L382-L388 |
60,989 | VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Statement.java | JDBC4Statement.execute | @Override
public boolean execute(String sql, String[] columnNames) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public boolean execute(String sql, String[] columnNames) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"boolean",
"execute",
"(",
"String",
"sql",
",",
"String",
"[",
"]",
"columnNames",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. | [
"Executes",
"the",
"given",
"SQL",
"statement",
"which",
"may",
"return",
"multiple",
"results",
"and",
"signals",
"the",
"driver",
"that",
"the",
"auto",
"-",
"generated",
"keys",
"indicated",
"in",
"the",
"given",
"array",
"should",
"be",
"made",
"available"... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Statement.java#L407-L412 |
60,990 | VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Statement.java | JDBC4Statement.executeBatch | @Override
public int[] executeBatch() throws SQLException
{
checkClosed();
closeCurrentResult();
if (batch == null || batch.size() == 0) {
return new int[0];
}
int[] updateCounts = new int[batch.size()];
// keep a running total of update counts
... | java | @Override
public int[] executeBatch() throws SQLException
{
checkClosed();
closeCurrentResult();
if (batch == null || batch.size() == 0) {
return new int[0];
}
int[] updateCounts = new int[batch.size()];
// keep a running total of update counts
... | [
"@",
"Override",
"public",
"int",
"[",
"]",
"executeBatch",
"(",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"closeCurrentResult",
"(",
")",
";",
"if",
"(",
"batch",
"==",
"null",
"||",
"batch",
".",
"size",
"(",
")",
"==",
"0",
... | Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. | [
"Submits",
"a",
"batch",
"of",
"commands",
"to",
"the",
"database",
"for",
"execution",
"and",
"if",
"all",
"commands",
"execute",
"successfully",
"returns",
"an",
"array",
"of",
"update",
"counts",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Statement.java#L415-L454 |
60,991 | VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Statement.java | JDBC4Statement.executeQuery | @Override
public ResultSet executeQuery(String sql) throws SQLException
{
checkClosed();
VoltSQL query = VoltSQL.parseSQL(sql);
if (!query.isOfType(VoltSQL.TYPE_SELECT)) {
throw SQLError.get(SQLError.ILLEGAL_STATEMENT, sql);
}
return this.executeQuery(query);
... | java | @Override
public ResultSet executeQuery(String sql) throws SQLException
{
checkClosed();
VoltSQL query = VoltSQL.parseSQL(sql);
if (!query.isOfType(VoltSQL.TYPE_SELECT)) {
throw SQLError.get(SQLError.ILLEGAL_STATEMENT, sql);
}
return this.executeQuery(query);
... | [
"@",
"Override",
"public",
"ResultSet",
"executeQuery",
"(",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"VoltSQL",
"query",
"=",
"VoltSQL",
".",
"parseSQL",
"(",
"sql",
")",
";",
"if",
"(",
"!",
"query",
".",
"isOf... | Executes the given SQL statement, which returns a single ResultSet object. | [
"Executes",
"the",
"given",
"SQL",
"statement",
"which",
"returns",
"a",
"single",
"ResultSet",
"object",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Statement.java#L463-L472 |
60,992 | VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Statement.java | JDBC4Statement.setFetchDirection | @Override
public void setFetchDirection(int direction) throws SQLException
{
checkClosed();
if ((direction != ResultSet.FETCH_FORWARD) && (direction != ResultSet.FETCH_REVERSE) && (direction != ResultSet.FETCH_UNKNOWN)) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, direction);
... | java | @Override
public void setFetchDirection(int direction) throws SQLException
{
checkClosed();
if ((direction != ResultSet.FETCH_FORWARD) && (direction != ResultSet.FETCH_REVERSE) && (direction != ResultSet.FETCH_UNKNOWN)) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, direction);
... | [
"@",
"Override",
"public",
"void",
"setFetchDirection",
"(",
"int",
"direction",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"if",
"(",
"(",
"direction",
"!=",
"ResultSet",
".",
"FETCH_FORWARD",
")",
"&&",
"(",
"direction",
"!=",
"Resul... | Gives the driver a hint as to the direction in which rows will be processed in ResultSet objects created using this Statement object. | [
"Gives",
"the",
"driver",
"a",
"hint",
"as",
"to",
"the",
"direction",
"in",
"which",
"rows",
"will",
"be",
"processed",
"in",
"ResultSet",
"objects",
"created",
"using",
"this",
"Statement",
"object",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Statement.java#L700-L708 |
60,993 | VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Statement.java | JDBC4Statement.setFetchSize | @Override
public void setFetchSize(int rows) throws SQLException
{
checkClosed();
if (rows < 0) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, rows);
}
this.fetchSize = rows;
} | java | @Override
public void setFetchSize(int rows) throws SQLException
{
checkClosed();
if (rows < 0) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, rows);
}
this.fetchSize = rows;
} | [
"@",
"Override",
"public",
"void",
"setFetchSize",
"(",
"int",
"rows",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"if",
"(",
"rows",
"<",
"0",
")",
"{",
"throw",
"SQLError",
".",
"get",
"(",
"SQLError",
".",
"ILLEGAL_ARGUMENT",
","... | Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for ResultSet objects genrated by this Statement. | [
"Gives",
"the",
"JDBC",
"driver",
"a",
"hint",
"as",
"to",
"the",
"number",
"of",
"rows",
"that",
"should",
"be",
"fetched",
"from",
"the",
"database",
"when",
"more",
"rows",
"are",
"needed",
"for",
"ResultSet",
"objects",
"genrated",
"by",
"this",
"State... | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Statement.java#L711-L719 |
60,994 | VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Statement.java | JDBC4Statement.setMaxFieldSize | @Override
public void setMaxFieldSize(int max) throws SQLException
{
checkClosed();
if (max < 0) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, max);
}
throw SQLError.noSupport(); // Not supported by provider - no point trashing data we received from the server just ... | java | @Override
public void setMaxFieldSize(int max) throws SQLException
{
checkClosed();
if (max < 0) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, max);
}
throw SQLError.noSupport(); // Not supported by provider - no point trashing data we received from the server just ... | [
"@",
"Override",
"public",
"void",
"setMaxFieldSize",
"(",
"int",
"max",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"if",
"(",
"max",
"<",
"0",
")",
"{",
"throw",
"SQLError",
".",
"get",
"(",
"SQLError",
".",
"ILLEGAL_ARGUMENT",
",... | Sets the limit for the maximum number of bytes that can be returned for character and binary column values in a ResultSet object produced by this Statement object. | [
"Sets",
"the",
"limit",
"for",
"the",
"maximum",
"number",
"of",
"bytes",
"that",
"can",
"be",
"returned",
"for",
"character",
"and",
"binary",
"column",
"values",
"in",
"a",
"ResultSet",
"object",
"produced",
"by",
"this",
"Statement",
"object",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Statement.java#L722-L730 |
60,995 | VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Statement.java | JDBC4Statement.setMaxRows | @Override
public void setMaxRows(int max) throws SQLException
{
checkClosed();
if (max < 0) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, max);
}
this.maxRows = max;
} | java | @Override
public void setMaxRows(int max) throws SQLException
{
checkClosed();
if (max < 0) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, max);
}
this.maxRows = max;
} | [
"@",
"Override",
"public",
"void",
"setMaxRows",
"(",
"int",
"max",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"if",
"(",
"max",
"<",
"0",
")",
"{",
"throw",
"SQLError",
".",
"get",
"(",
"SQLError",
".",
"ILLEGAL_ARGUMENT",
",",
... | Sets the limit for the maximum number of rows that any ResultSet object generated by this Statement object can contain to the given number. | [
"Sets",
"the",
"limit",
"for",
"the",
"maximum",
"number",
"of",
"rows",
"that",
"any",
"ResultSet",
"object",
"generated",
"by",
"this",
"Statement",
"object",
"can",
"contain",
"to",
"the",
"given",
"number",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Statement.java#L733-L741 |
60,996 | VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Statement.java | JDBC4Statement.setQueryTimeout | @Override
public void setQueryTimeout(int seconds) throws SQLException
{
checkClosed();
if (seconds < 0) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, seconds);
}
if (seconds == 0) {
this.m_timeout = Integer.MAX_VALUE;
} else {
this.m... | java | @Override
public void setQueryTimeout(int seconds) throws SQLException
{
checkClosed();
if (seconds < 0) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, seconds);
}
if (seconds == 0) {
this.m_timeout = Integer.MAX_VALUE;
} else {
this.m... | [
"@",
"Override",
"public",
"void",
"setQueryTimeout",
"(",
"int",
"seconds",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"if",
"(",
"seconds",
"<",
"0",
")",
"{",
"throw",
"SQLError",
".",
"get",
"(",
"SQLError",
".",
"ILLEGAL_ARGUMEN... | 0 is infinite in our case its Integer.MAX_VALUE | [
"0",
"is",
"infinite",
"in",
"our",
"case",
"its",
"Integer",
".",
"MAX_VALUE"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Statement.java#L753-L765 |
60,997 | VoltDB/voltdb | src/frontend/org/voltdb/iv2/SpInitiator.java | SpInitiator.updateReplicasForJoin | public void updateReplicasForJoin(TransactionState snapshotTransactionState) {
long[] replicasAdded = new long[0];
if (m_term != null) {
replicasAdded = ((SpTerm) m_term).updateReplicas(snapshotTransactionState);
}
m_scheduler.forwardPendingTaskToRejoinNode(replicasAdded, sna... | java | public void updateReplicasForJoin(TransactionState snapshotTransactionState) {
long[] replicasAdded = new long[0];
if (m_term != null) {
replicasAdded = ((SpTerm) m_term).updateReplicas(snapshotTransactionState);
}
m_scheduler.forwardPendingTaskToRejoinNode(replicasAdded, sna... | [
"public",
"void",
"updateReplicasForJoin",
"(",
"TransactionState",
"snapshotTransactionState",
")",
"{",
"long",
"[",
"]",
"replicasAdded",
"=",
"new",
"long",
"[",
"0",
"]",
";",
"if",
"(",
"m_term",
"!=",
"null",
")",
"{",
"replicasAdded",
"=",
"(",
"(",
... | This will be called from Snapshot in elastic joining or rejoining cases. | [
"This",
"will",
"be",
"called",
"from",
"Snapshot",
"in",
"elastic",
"joining",
"or",
"rejoining",
"cases",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/SpInitiator.java#L348-L354 |
60,998 | VoltDB/voltdb | examples/bank-offers/client/bankoffers/PersonGenerator.java | PersonGenerator.newPerson | public Person newPerson() {
Person p = new Person();
p.firstname = firstnames[rand.nextInt(firstnames.length)];
p.lastname = lastnames[rand.nextInt(lastnames.length)];
p.sex = sexes[rand.nextInt(2)];
p.dob = randomDOB();
// state and area code match
int i = rand.... | java | public Person newPerson() {
Person p = new Person();
p.firstname = firstnames[rand.nextInt(firstnames.length)];
p.lastname = lastnames[rand.nextInt(lastnames.length)];
p.sex = sexes[rand.nextInt(2)];
p.dob = randomDOB();
// state and area code match
int i = rand.... | [
"public",
"Person",
"newPerson",
"(",
")",
"{",
"Person",
"p",
"=",
"new",
"Person",
"(",
")",
";",
"p",
".",
"firstname",
"=",
"firstnames",
"[",
"rand",
".",
"nextInt",
"(",
"firstnames",
".",
"length",
")",
"]",
";",
"p",
".",
"lastname",
"=",
"... | generate a random person | [
"generate",
"a",
"random",
"person"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/bank-offers/client/bankoffers/PersonGenerator.java#L116-L129 |
60,999 | VoltDB/voltdb | src/frontend/org/voltdb/plannodes/PlanNodeTree.java | PlanNodeTree.loadFromJSONPlan | public void loadFromJSONPlan(JSONObject jobj, Database db) throws JSONException {
if (jobj.has(Members.PLAN_NODES_LISTS)) {
JSONArray jplanNodesArray = jobj.getJSONArray(Members.PLAN_NODES_LISTS);
for (int i = 0; i < jplanNodesArray.length(); ++i) {
JSONObject jplanNodes... | java | public void loadFromJSONPlan(JSONObject jobj, Database db) throws JSONException {
if (jobj.has(Members.PLAN_NODES_LISTS)) {
JSONArray jplanNodesArray = jobj.getJSONArray(Members.PLAN_NODES_LISTS);
for (int i = 0; i < jplanNodesArray.length(); ++i) {
JSONObject jplanNodes... | [
"public",
"void",
"loadFromJSONPlan",
"(",
"JSONObject",
"jobj",
",",
"Database",
"db",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"jobj",
".",
"has",
"(",
"Members",
".",
"PLAN_NODES_LISTS",
")",
")",
"{",
"JSONArray",
"jplanNodesArray",
"=",
"jobj",
"... | Load json plan. The plan must have either "PLAN_NODE" array in case of a statement without
subqueries or "PLAN_NODES_LISTS" array of "PLAN_NODE" arrays for each sub statement.
@param jobj
@param db
@throws JSONException | [
"Load",
"json",
"plan",
".",
"The",
"plan",
"must",
"have",
"either",
"PLAN_NODE",
"array",
"in",
"case",
"of",
"a",
"statement",
"without",
"subqueries",
"or",
"PLAN_NODES_LISTS",
"array",
"of",
"PLAN_NODE",
"arrays",
"for",
"each",
"sub",
"statement",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/PlanNodeTree.java#L133-L156 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.