code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public void seek(long position) throws IOException {
if (!readOnly && file.length() < position) {
long tempSize = position - file.length();
if (tempSize > 1 << 18) {
tempSize = 1 << 18;
}
byte[] temp = new byte[(int) tempSize];
try ... | java |
void getBytes(byte[] output) {
if (m_totalAvailable < output.length) {
throw new IllegalStateException("Requested " + output.length + " bytes; only have "
+ m_totalAvailable + " bytes; call tryRead() first");
}
int bytesCopied = 0;
while (bytesCopied < ou... | java |
void reindex(Session session, Index index) {
setAccessor(index, null);
RowIterator it = table.rowIterator(session);
while (it.hasNext()) {
Row row = it.getNextRow();
// may need to clear the node before insert
index.insert(session, this, row);
}
... | java |
public XAConnection getXAConnection() throws SQLException {
// Comment out before public release:
System.err.print("Executing " + getClass().getName()
+ ".getXAConnection()...");
try {
Class.forName(driver).newInstance();
} catch (ClassNotFoundExcep... | java |
public XAConnection getXAConnection(String user,
String password) throws SQLException {
validateSpecifiedUserAndPassword(user, password);
return getXAConnection();
} | java |
static String id(Object o) {
if (o == null) return "(null)";
Thread t = Thread.currentThread();
StringBuilder sb = new StringBuilder(128);
sb.append("(T[").append(t.getName()).append("]@");
sb.append(Long.toString(t.getId(), Character.MAX_RADIX));
sb.append(":O[").append(... | java |
public void registerCallback(String importer, ChannelChangeCallback callback) {
Preconditions.checkArgument(
importer != null && !importer.trim().isEmpty(),
"importer is null or empty"
);
callback = checkNotNull(callback, "callback is null");
if (... | java |
public void unregisterCallback(String importer) {
if ( importer == null
|| !m_callbacks.getReference().containsKey(importer)
|| m_unregistered.getReference().contains(importer))
{
return;
}
if (m_done.get()) return;
int [] rstamp = new int[]... | java |
public void shutdown() {
if (m_done.compareAndSet(false, true)) {
m_es.shutdown();
m_buses.shutdown();
DeleteNode deleteHost = new DeleteNode(joinZKPath(HOST_DN, m_hostId));
DeleteNode deleteCandidate = new DeleteNode(m_candidate);
try {
... | java |
@Subscribe
public void undispatched(DeadEvent e) {
if (!m_done.get() && e.getEvent() instanceof ImporterChannelAssignment) {
ImporterChannelAssignment assignment = (ImporterChannelAssignment)e.getEvent();
synchronized (m_undispatched) {
NavigableSet<String> registere... | java |
public Object next() {
// for chained iterators
if (chained) {
if (it1 == null) {
if (it2 == null) {
throw new NoSuchElementException();
}
if (it2.hasNext()) {
return it2.next();
}
... | java |
public List<Long> getSitesForPartitions(int[] partitions) {
ArrayList<Long> all_sites = new ArrayList<Long>();
for (int p : partitions) {
List<Long> sites = getSitesForPartition(p);
for (long site : sites)
{
all_sites.add(site);
}
}... | java |
public long[] getSitesForPartitionsAsArray(int[] partitions) {
ArrayList<Long> all_sites = new ArrayList<Long>();
for (int p : partitions) {
List<Long> sites = getSitesForPartition(p);
for (long site : sites)
{
all_sites.add(site);
}
... | java |
protected void readCompressedBlocks(int blocks) throws IOException {
int bytesSoFar = 0;
int requiredBytes = 512 * blocks;
// This method works with individual bytes!
int i;
while (bytesSoFar < requiredBytes) {
i = readStream.read(readBuffer, bytesSoFar,
... | java |
static <T> T[] arraysCopyOf(T[] original, int newLength) {
T[] copy = newArray(original, newLength);
System.arraycopy(original, 0, copy, 0, Math.min(original.length, newLength));
return copy;
} | java |
public static void initialize(Class<? extends TheHashinator> hashinatorImplementation, byte config[]) {
TheHashinator hashinator = constructHashinator( hashinatorImplementation, config, false);
m_pristineHashinator = hashinator;
m_cachedHashinators.put(0L, hashinator);
instance.set(Pair.... | java |
public static TheHashinator getHashinator(Class<? extends TheHashinator> hashinatorImplementation,
byte config[], boolean cooked) {
return constructHashinator(hashinatorImplementation, config, cooked);
} | java |
public static TheHashinator
constructHashinator(
Class<? extends TheHashinator> hashinatorImplementation,
byte configBytes[], boolean cooked) {
try {
Constructor<? extends TheHashinator> constructor =
hashinatorImplementation.getConstructor... | java |
static public long computeConfigurationSignature(byte [] config) {
PureJavaCrc32C crc = new PureJavaCrc32C();
crc.update(config);
return crc.getValue();
} | java |
public static int getPartitionForParameter(VoltType partitionType, Object invocationParameter) {
return instance.get().getSecond().getHashedPartitionForParameter(partitionType, invocationParameter);
} | java |
public static Pair<? extends UndoAction, TheHashinator> updateHashinator(
Class<? extends TheHashinator> hashinatorImplementation,
long version,
byte configBytes[],
boolean cooked) {
//Use a cached/canonical hashinator if possible
TheHashinator existingHas... | java |
public static Map<Integer, Integer> getRanges(int partition) {
return instance.get().getSecond().pGetRanges(partition);
} | java |
public static HashinatorSnapshotData serializeConfiguredHashinator()
throws IOException
{
Pair<Long, ? extends TheHashinator> currentInstance = instance.get();
byte[] cookedData = currentInstance.getSecond().getCookedBytes();
return new HashinatorSnapshotData(cookedData, currentI... | java |
public static Pair< ? extends UndoAction, TheHashinator> updateConfiguredHashinator(long version, byte config[]) {
return updateHashinator(getConfiguredHashinatorClass(), version, config, true);
} | java |
public static VoltTable getPartitionKeys(TheHashinator hashinator, VoltType type) {
// get partitionKeys response table so we can copy it
final VoltTable partitionKeys;
switch (type) {
case INTEGER:
partitionKeys = hashinator.m_integerPartitionKeys.get();
... | java |
public void append(long startDrId, long endDrId, long spUniqueId, long mpUniqueId) {
assert(startDrId <= endDrId && (m_map.isEmpty() || startDrId > end(m_map.span())));
addRange(startDrId, endDrId, spUniqueId, mpUniqueId);
} | java |
public void truncate(long newTruncationPoint) {
if (newTruncationPoint < getFirstDrId()) {
return;
}
final Iterator<Range<Long>> iter = m_map.asRanges().iterator();
while (iter.hasNext()) {
final Range<Long> next = iter.next();
if (end(next) < newTrunc... | java |
public void mergeTracker(DRConsumerDrIdTracker tracker) {
final long newSafePoint = Math.max(tracker.getSafePointDrId(), getSafePointDrId());
m_map.addAll(tracker.m_map);
truncate(newSafePoint);
m_lastSpUniqueId = Math.max(m_lastSpUniqueId, tracker.m_lastSpUniqueId);
m_lastMpUniq... | java |
private JSONObject readJSONObjFromWire(MessagingChannel messagingChannel) throws IOException, JSONException {
ByteBuffer messageBytes = messagingChannel.readMessage();
JSONObject jsObj = new JSONObject(new String(messageBytes.array(), StandardCharsets.UTF_8));
return jsObj;
} | java |
private JSONObject processJSONResponse(MessagingChannel messagingChannel,
Set<String> activeVersions,
boolean checkVersion) throws IOException, JSONException
{
// read the json response from socketjoiner with version inf... | java |
private SocketChannel createLeaderSocket(
SocketAddress hostAddr,
ConnectStrategy mode) throws IOException
{
SocketChannel socket;
int connectAttempts = 0;
do {
try {
socket = SocketChannel.open();
socket.socket().connect(ho... | java |
private SocketChannel connectToHost(SocketAddress hostAddr)
throws IOException
{
SocketChannel socket = null;
while (socket == null) {
try {
socket = SocketChannel.open(hostAddr);
}
catch (java.net.ConnectException e) {
... | java |
private RequestHostIdResponse requestHostId (
MessagingChannel messagingChannel,
Set<String> activeVersions) throws Exception
{
VersionChecker versionChecker = m_acceptor.getVersionChecker();
activeVersions.add(versionChecker.getVersionString());
JSONObject jsObj = n... | java |
public void addFragment(byte[] planHash, int outputDepId, ByteBuffer parameterSet) {
addFragment(planHash, null, outputDepId, parameterSet);
} | 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... | java |
public static FragmentTaskMessage createWithOneFragment(long initiatorHSId,
long coordinatorHSId,
long txnId,
long uniqueId,
... | 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) {
... | 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... | 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;
}
}
} | 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");
... | 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;
} | 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... | java |
private void writeExternalStreamStates(JSONStringer stringer) throws JSONException {
stringer.key(DISABLED_EXTERNAL_STREAMS).array();
for (int partition : m_disabledExternalStreams) {
stringer.value(partition);
}
stringer.endArray();
} | 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... | 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 <... | 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;
} | java |
public static Stream<VoltTableRow> stream(VoltTable table) {
return StreamSupport.stream(new VoltTableSpliterator(table, 0, table.getRowCount()), false);
} | 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... | 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));
}... | 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 ... | 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... | 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("/");
... | 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);
... | java |
@Override
public final int getType() {
if (userTypeModifier == null) {
throw Error.runtimeError(ErrorCode.U_S0500, "Type");
}
return userTypeModifier.getType();
} | java |
public Object castToType(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);
} | 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 ... | 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... | 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();
... | 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... | 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... | 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... | 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>();
... | 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();
... | 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... | 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 >=... | 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... | 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... | java |
private static int containingBucket(int token, long interval)
{
return (int) ((((long) token - Integer.MIN_VALUE) / interval) * interval + Integer.MIN_VALUE);
} | 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... | 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... | 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... | java |
private final CompletableFuture<ClientResponse> createAdHocTransaction(
final AdHocPlannedStmtBatch plannedStmtBatch,
final boolean isSwapTables)
throws VoltTypeException
{
ByteBuffer buf = null;
try {
buf = plannedStmtBatch.flattenPlanArrayToB... | 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... | 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;
} | 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... | 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;
... | 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;
} | java |
public void setPreparedResultUpdateProperties(Object[] parameterValues) {
if (navigator.getSize() == 1) {
((RowSetNavigatorClient) navigator).setData(0, parameterValues);
} else {
navigator.clear();
navigator.add(parameterValues);
}
} | 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();
... | 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... | 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;
... | java |
private static void reset()
{
description = null;
argName = null;
longopt = null;
type = String.class;
required = false;
numberOfArgs = Option.UNINITIALIZED;
optionalArg = false;
valuesep = (char) 0;
} | java |
public static OptionBuilder hasOptionalArgs()
{
OptionBuilder.numberOfArgs = Option.UNLIMITED_VALUES;
OptionBuilder.optionalArg = true;
return INSTANCE;
} | java |
public static OptionBuilder hasOptionalArgs(int numArgs)
{
OptionBuilder.numberOfArgs = numArgs;
OptionBuilder.optionalArg = true;
return INSTANCE;
} | java |
public static Option create() throws IllegalArgumentException
{
if (longopt == null)
{
OptionBuilder.reset();
throw new IllegalArgumentException("must specify longopt");
}
return create(null);
} | 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 ... | 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... | 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 ... | 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... | 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 ... | 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);
... | 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... | 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... | 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... | java |
public void removeClassFromJar(String classname)
{
for (String innerclass : getLoader().getInnerClassesForClass(classname)) {
remove(classToFileName(innerclass));
}
remove(classToFileName(classname));
} | 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();... | 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... | java |
public static URI makeFileLoggerURL(File dataDir, File dataLogDir){
return URI.create(makeURIString(dataDir.getPath(),dataLogDir.getPath(),null));
} | 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... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.