code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
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[] 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 void writeTxnBytes(OutputArchive oa, byte[] bytes)
throws IOException {
oa.writeBuffer(bytes, "txnEntry");
oa.writeByte((byte) 0x42, "EOR"); // 'B'
} | 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;
... | 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 ... | 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 +
... | 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... | 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... | java |
public static byte[] serialize(FastSerializable object) throws IOException {
FastSerializer out = new FastSerializer();
object.writeExternal(out);
return out.getBBContainer().b().array();
} | 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;
} | java |
public ByteBuffer getBuffer() {
assert(isDirect == false);
assert(buffer.b().hasArray());
assert(!buffer.b().isDirect());
buffer.b().flip();
return buffer.b().asReadOnlyBuffer();
} | 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;
} | 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... | 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... | 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 "
... | java |
public void writeTable(VoltTable table) throws IOException {
int len = table.getSerializedSize();
growIfNeeded(len);
table.flattenToBuffer(buffer.b());
} | java |
public void writeInvocation(StoredProcedureInvocation invocation) throws IOException {
int len = invocation.getSerializedSize();
growIfNeeded(len);
invocation.flattenToBuffer(buffer.b());
} | java |
public void writeParameterSet(ParameterSet params) throws IOException {
int len = params.getSerializedSize();
growIfNeeded(len);
params.flattenToBuffer(buffer.b());
} | java |
public void start(InputHandler ih, Set<Long> verbotenThreads) {
m_ih = ih;
m_verbotenThreads = verbotenThreads;
startSetup();
m_thread.start();
} | java |
@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, String[] columnNames) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | 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
... | 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);
... | 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);
... | java |
@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 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 setMaxRows(int max) throws SQLException
{
checkClosed();
if (max < 0) {
throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, max);
}
this.maxRows = max;
} | 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... | 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... | 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.... | 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... | java |
private void loadPlanNodesFromJSONArrays(int stmtId, JSONArray jArray, Database db) {
List<AbstractPlanNode> planNodes = new ArrayList<>();
int size = jArray.length();
try {
for (int i = 0; i < size; i++) {
JSONObject jobj = jArray.getJSONObject(i);
S... | java |
public final void configure(Properties props, FormatterBuilder formatterBuilder)
{
Map<URI, ImporterConfig> configs = m_factory.createImporterConfigurations(props, formatterBuilder);
m_configs = new ImmutableMap.Builder<URI, ImporterConfig>()
.putAll(configs)
.putAll(... | java |
public final void stop()
{
m_stopping = true;
ImmutableMap<URI, AbstractImporter> oldReference;
boolean success = false;
do { // onChange also could set m_importers. Use while loop to pick up latest ref
oldReference = m_importers.get();
success = m_importers.... | java |
public int[] get() {
int includedHashes = Math.min(m_hashCount, MAX_HASHES_COUNT);
int[] retval = new int[includedHashes + HEADER_OFFSET];
System.arraycopy(m_hashes, 0, retval, HEADER_OFFSET, includedHashes);
m_inputCRC.update(m_hashCount);
m_inputCRC.update(m_catalogVersion);
... | java |
public void offerStatement(int stmtHash, int offset, ByteBuffer psetBuffer) {
m_inputCRC.update(stmtHash);
m_inputCRC.updateFromPosition(offset, psetBuffer);
if (m_hashCount < MAX_HASHES_COUNT) {
m_hashes[m_hashCount] = stmtHash;
m_hashes[m_hashCount + 1] = (int) m_input... | java |
public static int compareHashes(int[] leftHashes, int[] rightHashes) {
assert(leftHashes != null);
assert(rightHashes != null);
assert(leftHashes.length >= 3);
assert(rightHashes.length >= 3);
// Compare total checksum first
if (leftHashes[0] == rightHashes[0]) {
... | java |
public static String description(int[] hashes, int m_hashMismatchPos) {
assert(hashes != null);
assert(hashes.length >= 3);
StringBuilder sb = new StringBuilder();
sb.append("Full Hash ").append(hashes[0]);
sb.append(", Catalog Version ").append(hashes[1]);
sb.append(", ... | java |
private boolean renameOverwrite(String oldname, String newname) {
boolean deleted = delete(newname);
if (exists(oldname)) {
File file = new File(oldname);
return file.renameTo(new File(newname));
}
return deleted;
} | java |
public String canonicalOrAbsolutePath(String path) {
try {
return canonicalPath(path);
} catch (Exception e) {
return absolutePath(path);
}
} | java |
private boolean isCoordinatorStatsUsable(boolean incremental) {
if (m_coordinatorTask == null) {
return false;
}
if (incremental) {
return m_coordinatorTask.m_timedInvocations - m_coordinatorTask.m_lastTimedInvocations > 0;
}
return m_coordinatorTask.m_tim... | java |
public int getIncrementalMinResultSizeAndReset() {
int retval = m_workerTask.m_incrMinResultSize;
m_workerTask.m_incrMinResultSize = Integer.MAX_VALUE;
if (isCoordinatorStatsUsable(true)) {
m_coordinatorTask.m_incrMinResultSize = Integer.MAX_VALUE;
}
return retval;
... | java |
private Statement compileAlterTableDropTTL(Table t) {
if (t.getTTL() == null) {
throw Error.error(ErrorCode.X_42501);
}
if (!StringUtil.isEmpty(t.getTTL().migrationTarget)) {
throw unexpectedToken("May not drop migration target");
}
Object[] args = new Obj... | java |
StatementDMQL compileTriggerSetStatement(Table table,
RangeVariable[] rangeVars) {
read();
Expression[] updateExpressions;
int[] columnMap;
OrderedHashSet colNames = new OrderedHashSet();
HsqlArrayList exprList = new HsqlArrayList();
RangeVariabl... | java |
ColumnSchema readColumnDefinitionOrNull(Table table, HsqlName hsqlName,
HsqlArrayList constraintList) {
boolean isIdentity = false;
boolean isPKIdentity = false;
boolean identityAlways = false;
Expression generateExpr = null;
boolean ... | java |
void readCheckConstraintCondition(Constraint c) {
readThis(Tokens.OPENBRACKET);
startRecording();
isCheckOrTriggerCondition = true;
Expression condition = XreadBooleanValueExpression();
isCheckOrTriggerCondition = false;
Token[] tokens = getRecordedStatement();
... | java |
private int[] readColumnList(Table table, boolean ascOrDesc) {
OrderedHashSet set = readColumnNames(ascOrDesc);
return table.getColumnIndexes(set);
} | java |
void processAlterTableRename(Table table) {
HsqlName name = readNewSchemaObjectName(SchemaObject.TABLE);
name.setSchemaIfNull(table.getSchemaName());
if (table.getSchemaName() != name.schema) {
throw Error.error(ErrorCode.X_42505);
}
database.schemaManager.renameS... | java |
void processAlterTableDropColumn(Table table, String colName,
boolean cascade) {
int colindex = table.getColumnIndex(colName);
if (table.getColumnCount() == 1) {
throw Error.error(ErrorCode.X_42591);
}
session.commit(false);
Ta... | java |
void processAlterTableDropConstraint(Table table, String name,
boolean cascade) {
session.commit(false);
TableWorks tableWorks = new TableWorks(session, table);
tableWorks.dropConstraint(name, cascade);
return;
} | java |
private void processAlterColumnType(Table table, ColumnSchema oldCol,
boolean fullDefinition) {
ColumnSchema newCol;
if (oldCol.isGenerated()) {
throw Error.error(ErrorCode.X_42561);
}
if (fullDefinition) {
HsqlArrayList ... | java |
private void processAlterColumnRename(Table table, ColumnSchema column) {
checkIsSimpleName();
if (table.findColumn(token.tokenString) > -1) {
throw Error.error(ErrorCode.X_42504, token.tokenString);
}
database.schemaManager.checkColumnIsReferenced(table.getName(),
... | java |
void readLimitConstraintCondition(Constraint c) {
readThis(Tokens.PARTITION);
readThis(Tokens.ROWS);
int rowsLimit = readInteger();
c.rowsLimit = rowsLimit;
// The optional EXECUTE (DELETE ...) clause
if (readIfThis(Tokens.EXECUTE)) {
// Capture the statemen... | java |
private java.util.List<Expression> XreadExpressions(java.util.List<Boolean> ascDesc) {
return XreadExpressions(ascDesc, false);
} | java |
static boolean isValid(int type) {
// make sure this is always synchronized with Zoodefs!!
switch (type) {
case OpCode.notification:
return false;
case OpCode.create:
case OpCode.delete:
case OpCode.createSession:
case OpCode.exists:
case OpCod... | java |
public void startSeekingFor(
final Set<Long> hsids, final Map<Long,Boolean> inTrouble) {
// if the mesh hsids change we need to reset
if (!m_hsids.equals(hsids)) {
if (!m_hsids.isEmpty()) clear();
m_hsids = ImmutableSortedSet.copyOf(hsids);
}
// deter... | java |
static protected void removeValues(TreeMultimap<Long, Long> mm, Set<Long> values) {
Iterator<Map.Entry<Long, Long>> itr = mm.entries().iterator();
while (itr.hasNext()) {
Map.Entry<Long, Long> e = itr.next();
if (values.contains(e.getValue())) {
itr.remove();
... | java |
public static Predicate<Map.Entry<Long, Boolean>> amongDeadHsids(final Set<Long> hsids) {
return new Predicate<Map.Entry<Long,Boolean>>() {
@Override
public boolean apply(Entry<Long, Boolean> e) {
return hsids.contains(e.getKey()) && e.getValue();
}
};... | java |
private void removeValue(TreeMultimap<Long, Long> mm, long value) {
Iterator<Map.Entry<Long, Long>> itr = mm.entries().iterator();
while (itr.hasNext()) {
Map.Entry<Long,Long> e = itr.next();
if (e.getValue().equals(value)) {
itr.remove();
}
}
... | java |
void add(long reportingHsid, final Map<Long,Boolean> failed) {
// skip if the reporting site did not belong to the pre
// failure mesh
if (!m_hsids.contains(reportingHsid)) return;
// ship if the reporting site is reporting itself dead
Boolean harakiri = failed.get(reportingHsid... | java |
public void add(long reportingHsid, SiteFailureMessage sfm) {
// skip if the reporting site did not belong to the pre
// failure mesh, or the reporting site is reporting itself
// dead, or none of the sites in the safe transaction map
// are among the known hsids
if ( !m_hsids.... | java |
protected boolean seenByInterconnectedPeers( Set<Long> destinations, Set<Long> origins) {
Set<Long> seers = Multimaps.filterValues(m_alive, in(origins)).keySet();
int before = origins.size();
origins.addAll(seers);
if (origins.containsAll(destinations)) {
return true;
... | java |
public Set<Long> forWhomSiteIsDead(long hsid) {
ImmutableSet.Builder<Long> isb = ImmutableSet.builder();
Set<Long> deadBy = m_dead.get(hsid);
if ( !deadBy.isEmpty()
&& m_survivors.contains(hsid)
&& m_strategy == ArbitrationStrategy.MATCHING_CARDINALITY) {
is... | java |
protected static InMemoryJarfile addDDLToCatalog(Catalog oldCatalog, InMemoryJarfile jarfile, String[] adhocDDLStmts, boolean isXDCR)
throws IOException, VoltCompilerException
{
StringBuilder sb = new StringBuilder();
compilerLog.info("Applying the following DDL to cluster:");
for (Strin... | java |
static protected CompletableFuture<ClientResponse> makeQuickResponse(byte statusCode, String msg) {
ClientResponseImpl cri = new ClientResponseImpl(statusCode, new VoltTable[0], msg);
CompletableFuture<ClientResponse> f = new CompletableFuture<>();
f.complete(cri);
return f;
} | java |
protected String verifyAndWriteCatalogJar(CatalogChangeResult ccr)
{
String procedureName = "@VerifyCatalogAndWriteJar";
CompletableFuture<Map<Integer,ClientResponse>> cf =
callNTProcedureOnAllHosts(procedureName, ccr.catalogBytes, ccr.encodedDiffCommands,
cc... | java |
public static long getNextGenerationId() {
// ENG-14511- these calls may hit assertion failures in testing environments
try {
return UniqueIdGenerator.makeIdFromComponents(System.currentTimeMillis(),
m_generationId.incrementAndGet(),
MpInitiator.MP_INI... | java |
public User getUser(String name, String password) {
if (name == null) {
name = "";
}
if (password == null) {
password = "";
}
User user = get(name);
user.checkPassword(password);
return user;
} | java |
public User get(String name) {
User user = (User) userList.get(name);
if (user == null) {
throw Error.error(ErrorCode.X_28501, name);
}
return user;
} | java |
void reset(int hashTableSize, int capacity) {
// A VoltDB extension to diagnose ArrayOutOfBounds.
if (linkTable != null) {
voltDBresetCapacity = linkTable.length;
}
++voltDBresetCount;
voltDBlastResetEvent = voltDBhistoryDepth;
voltDBhistoryCapacity = Math.min... | java |
void clear() {
// A VoltDB extension to diagnose ArrayOutOfBounds.
if (linkTable != null) {
voltDBclearCapacity = linkTable.length;
}
++voltDBclearCount;
voltDBlastClearEvent = voltDBhistoryDepth;
// End of VoltDB extension
int to = linkTable.... | java |
void unlinkNode(int index, int lastLookup, int lookup) {
// A VoltDB extension to diagnose ArrayOutOfBounds.
voltDBhistory[voltDBhistoryDepth++ % voltDBhistoryCapacity] = -index-1;
// End of VoltDB extension
// unlink the node
if (lastLookup == -1) {
hashTable[index]... | java |
boolean removeEmptyNode(int lookup) {
// A VoltDB extension to diagnose ArrayOutOfBounds.
voltDBhistory[voltDBhistoryDepth++ % voltDBhistoryCapacity] = 1000000 + lookup;
// End of VoltDB extension
boolean found = false;
int lastLookup = -1;
for (int i = reclaim... | java |
private static String translateSep(String sep, boolean isProperty) {
if (sep == null) {
return null;
}
int next = sep.indexOf(BACKSLASH_CHAR);
if (next != -1) {
int start = 0;
char[] sepArray = sep.toCharArray();
char ... | java |
public void open(boolean readonly) {
fileFreePosition = 0;
try {
dataFile = ScaledRAFile.newScaledRAFile(database, fileName,
readonly, ScaledRAFile.DATA_FILE_RAF, null, null);
fileFreePosition = dataFile.length();
if (fileFreePosition > Integer.... | java |
public synchronized void close(boolean write) {
if (dataFile == null) {
return;
}
try {
cache.saveAll();
boolean empty = (dataFile.length() <= NL.length());
dataFile.close();
dataFile = null;
if (empty && !cacheReadonl... | java |
void purge() {
uncommittedCache.clear();
try {
if (cacheReadonly) {
close(false);
} else {
if (dataFile != null) {
dataFile.close();
dataFile = null;
}
FileUtil.getDefaultI... | java |
int findNextUsedLinePos(int pos) {
try {
int firstPos = pos;
int currentPos = pos;
boolean wasCR = false;
dataFile.seek(pos);
while (true) {
int c = dataFile.read();
currentPos++;
swit... | java |
protected synchronized void saveRows(CachedObject[] rows, int offset,
int count) {
if (count == 0) {
return;
}
for (int i = offset; i < offset + count; i++) {
CachedObject r = rows[i];
uncommittedCache.put(r.getPos()... | java |
public DoubleHistogram copy() {
final DoubleHistogram targetHistogram =
new DoubleHistogram(configuredHighestToLowestValueRatio, getNumberOfSignificantValueDigits());
targetHistogram.setTrackableValueRange(currentLowestValueInAutoRange, currentHighestValueLimitInAutoRange);
integ... | java |
public void add(final DoubleHistogram fromHistogram) throws ArrayIndexOutOfBoundsException {
int arrayLength = fromHistogram.integerValuesHistogram.countsArrayLength;
AbstractHistogram fromIntegerHistogram = fromHistogram.integerValuesHistogram;
for (int i = 0; i < arrayLength; i++) {
... | java |
public void subtract(final DoubleHistogram otherHistogram) {
int arrayLength = otherHistogram.integerValuesHistogram.countsArrayLength;
AbstractHistogram otherIntegerHistogram = otherHistogram.integerValuesHistogram;
for (int i = 0; i < arrayLength; i++) {
long otherCount = otherInte... | java |
public double highestEquivalentValue(final double value) {
double nextNonEquivalentValue = nextNonEquivalentValue(value);
// Theoretically, nextNonEquivalentValue - ulp(nextNonEquivalentValue) == nextNonEquivalentValue
// is possible (if the ulp size switches right at nextNonEquivalentValue), so... | java |
public static DoubleHistogram decodeFromCompressedByteBuffer(
final ByteBuffer buffer,
final long minBarForHighestToLowestValueRatio) throws DataFormatException {
return decodeFromCompressedByteBuffer(buffer, Histogram.class, minBarForHighestToLowestValueRatio);
} | java |
public Object getValueAt(int row, int col) {
if (row >= rows.size()) {
return null;
}
Object[] colArray = (Object[]) rows.elementAt(row);
if (col >= colArray.length) {
return null;
}
return colArray[col];
} | java |
public void setHead(Object[] h) {
headers = new Object[h.length];
// System.arraycopy(h, 0, headers, 0, h.length);
for (int i = 0; i < h.length; i++) {
headers[i] = h[i];
}
} | java |
public void addRow(Object[] r) {
Object[] row = new Object[r.length];
// System.arraycopy(r, 0, row, 0, r.length);
for (int i = 0; i < r.length; i++) {
row[i] = r[i];
if (row[i] == null) {
// row[i] = "(null)";
}
}
rows.addE... | java |
public Object[] getCurrent() {
if (currentPos < 0 || currentPos >= size) {
return null;
}
if (currentPos == currentOffset + table.length) {
getBlock(currentOffset + table.length);
}
return table[currentPos - currentOffset];
} | java |
void getBlock(int offset) {
try {
RowSetNavigatorClient source = session.getRows(id, offset,
baseBlockSize);
table = source.table;
currentOffset = source.currentOffset;
} catch (HsqlException e) {}
} | java |
@Override
public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | java |
@Override
public ResultSet getCatalogs() throws SQLException
{
checkClosed();
VoltTable result = new VoltTable(new VoltTable.ColumnInfo("TABLE_CAT",VoltType.STRING));
result.addRow(new Object[] { catalogString });
return new JDBC4ResultSet(null, result);
} | java |
@Override
public int getDatabaseMajorVersion() throws SQLException
{
checkClosed();
System.out.println("\n\n\nVERSION: " + versionString);
return Integer.valueOf(versionString.split("\\.")[0]);
} | java |
@Override
public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | java |
@Override
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException
{
assert(table != null && !table.isEmpty());
checkClosed();
this.sysCatalog.setString(1, "PRIMARYKEYS");
JDBC4ResultSet res = (JDBC4ResultSet) this.sysCatalog.executeQuery()... | java |
@Override
public ResultSet getSchemas() throws SQLException
{
checkClosed();
VoltTable vtable = new VoltTable(
new ColumnInfo("TABLE_SCHEM", VoltType.STRING),
new ColumnInfo("TABLE_CATALOG", VoltType.STRING));
JDBC4ResultSet res = new JDBC4ResultSet(this.s... | java |
@Override
public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException
{
checkClosed();
VoltTable vtable = new VoltTable(
new ColumnInfo("TABLE_CAT", VoltType.STRING),
new ColumnInfo("TABLE_SCHEM", VoltType... | java |
public static Pattern computeJavaPattern(String sqlPattern)
{
StringBuffer pattern_buff = new StringBuffer();
// Replace "_" with "." (match exactly 1 character)
// Replace "%" with ".*" (match 0 or more characters)
for (int i=0; i<sqlPattern.length(); i++)
{
char... | java |
@Override
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException
{
checkClosed();
this.sysCatalog.setString(1, "TABLES");
JDBC4ResultSet res = (JDBC4ResultSet) this.sysCatalog.executeQuery();
VoltTable vtable ... | java |
@Override
public ResultSet getTableTypes() throws SQLException
{
checkClosed();
VoltTable vtable = new VoltTable(new ColumnInfo("TABLE_TYPE", VoltType.STRING));
for (String type : tableTypes) {
vtable.addRow(type);
}
JDBC4ResultSet res = new JDBC4ResultSet(thi... | java |
@Override
public ResultSet getTypeInfo() throws SQLException
{
checkClosed();
this.sysCatalog.setString(1, "TYPEINFO");
ResultSet res = this.sysCatalog.executeQuery();
return res;
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.