code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public static void enableCategories(Category... categories) throws IOException {
if (s_tracer == null) {
start();
}
final VoltTrace tracer = s_tracer;
assert tracer != null;
final ImmutableSet.Builder<Category> builder = ImmutableSet.builder();
builder.addAll... | java |
public static void disableCategories(Category... categories) {
final VoltTrace tracer = s_tracer;
if (tracer == null) {
return;
}
final List<Category> toDisable = Arrays.asList(categories);
final ImmutableSet.Builder<Category> builder = ImmutableSet.builder();
... | java |
public Thread newThread(Runnable r) {
return factory == this ? new Thread(r)
: factory.newThread(r);
} | java |
public synchronized ThreadFactory setImpl(ThreadFactory f) {
ThreadFactory old;
old = factory;
factory = (f == null) ? this
: f;
return old;
} | java |
final byte[] getRaw(int columnIndex) {
byte[] retval;
int pos = m_buffer.position();
int offset = getOffset(columnIndex);
VoltType type = getColumnType(columnIndex);
switch(type) {
case TINYINT:
case SMALLINT:
case INTEGER:
case BIGINT:
ca... | java |
final void validateColumnType(int columnIndex, VoltType... types) {
if (m_position < 0)
throw new RuntimeException("VoltTableRow is in an invalid state. Consider calling advanceRow().");
if ((columnIndex >= getColumnCount()) || (columnIndex < 0)) {
throw new IndexOutOfBoundsExce... | java |
final String readString(int position, Charset encoding) {
// Sanity check the string size int position. Note that the eventual
// m_buffer.get() does check for underflow, getInt() does not.
if (STRING_LEN_SIZE > m_buffer.limit() - position) {
throw new RuntimeException(String.format(... | java |
public int appendTask(long sourceHSId, TransactionInfoBaseMessage task) throws IOException {
Preconditions.checkState(compiledSize == 0, "buffer is already compiled");
final int msgSerializedSize = task.getSerializedSize();
ensureCapacity(taskHeaderSize() + msgSerializedSize);
ByteBuff... | java |
public TransactionInfoBaseMessage nextTask() throws IOException {
if (!hasMoreEntries()) {
return null;
}
ByteBuffer bb = m_container.b();
int position = bb.position();
int length = bb.getInt();
long sourceHSId = bb.getLong();
VoltDbMessageFactory fa... | java |
public void compile() {
if (compiledSize == 0) {
ByteBuffer bb = m_container.b();
compiledSize = bb.position();
bb.flip();
m_allocator.track(compiledSize);
}
if (log.isTraceEnabled()) {
StringBuilder sb = new StringBuilder("Compiling b... | java |
void updateCatalog(String diffCmds, CatalogContext context)
{
if (m_shuttingDown) {
return;
}
m_catalogContext = context;
// Wipe out all the idle sites with stale catalogs.
// Non-idle sites will get killed and replaced when they finish
// whatever they ... | java |
boolean doWork(long txnId, TransactionTask task)
{
boolean retval = canAcceptWork();
if (!retval) {
return false;
}
MpRoSiteContext site;
// Repair case
if (m_busySites.containsKey(txnId)) {
site = m_busySites.get(txnId);
}
else... | java |
void completeWork(long txnId)
{
if (m_shuttingDown) {
return;
}
MpRoSiteContext site = m_busySites.remove(txnId);
if (site == null) {
throw new RuntimeException("No busy site for txnID: " + txnId + " found, shouldn't happen.");
}
// check the ... | java |
public VoltTable[] run(SystemProcedureExecutionContext ctx) {
VoltTable[] result = null;
try {
result = createAndExecuteSysProcPlan(SysProcFragmentId.PF_quiesce_sites,
SysProcFragmentId.PF_quiesce_processed_sites);
} catch (Exception ex) {
ex.printSta... | java |
public static void writeFile(final String dir, final String filename, String content, boolean debug) {
// skip debug files when not in debug mode
if (debug && !VoltCompiler.DEBUG_MODE) {
return;
}
// cache the root of the folder for the debugoutput and the statement-plans fo... | java |
public AbstractExpression getAllFilters() {
ArrayDeque<JoinNode> joinNodes = new ArrayDeque<>();
ArrayDeque<AbstractExpression> in = new ArrayDeque<>();
ArrayDeque<AbstractExpression> out = new ArrayDeque<>();
// Iterate over the join nodes to collect their join and where expressions
... | java |
public AbstractExpression getSimpleFilterExpression()
{
if (m_whereExpr != null) {
if (m_joinExpr != null) {
return ExpressionUtil.combine(m_whereExpr, m_joinExpr);
}
return m_whereExpr;
}
return m_joinExpr;
} | java |
public List<JoinNode> generateAllNodesJoinOrder() {
ArrayList<JoinNode> nodes = new ArrayList<>();
listNodesJoinOrderRecursive(nodes, true);
return nodes;
} | java |
public List<JoinNode> extractSubTrees() {
List<JoinNode> subTrees = new ArrayList<>();
// Extract the first sub-tree starting at the root
subTrees.add(this);
List<JoinNode> leafNodes = new ArrayList<>();
extractSubTree(leafNodes);
// Continue with the leafs
for (... | java |
public static JoinNode reconstructJoinTreeFromTableNodes(List<JoinNode> tableNodes, JoinType joinType) {
JoinNode root = null;
for (JoinNode leafNode : tableNodes) {
JoinNode node = leafNode.cloneWithoutFilters();
if (root == null) {
root = node;
} els... | java |
public static JoinNode reconstructJoinTreeFromSubTrees(List<JoinNode> subTrees) {
if (subTrees == null || subTrees.isEmpty()) {
return null;
}
// Reconstruct the tree. The first element is the first sub-tree and so on
JoinNode joinNode = subTrees.get(0);
for (int i = ... | java |
protected static void applyTransitiveEquivalence(List<AbstractExpression> outerTableExprs,
List<AbstractExpression> innerTableExprs,
List<AbstractExpression> innerOuterTableExprs)
{
List<AbstractExpression> simplifiedOuterExprs = applyTransitiveEquivalence(innerTableExprs, innerOuter... | java |
protected static void classifyJoinExpressions(Collection<AbstractExpression> exprList,
Collection<String> outerTables, Collection<String> innerTables,
List<AbstractExpression> outerList, List<AbstractExpression> innerList,
List<AbstractExpression> innerOuterList, List<AbstractExpress... | java |
public static HSQLInterface.ParameterStateManager getParamStateManager() {
return new ParameterStateManager() {
@Override
public int getNextParamIndex() {
return ParameterizationInfo.getNextParamIndex();
}
@Override
public void resetCu... | java |
private static Object decodeNextColumn(ByteBuffer bb, VoltType columnType)
throws IOException {
Object retval = null;
switch (columnType) {
case TINYINT:
retval = decodeTinyInt(bb);
break;
case SMALLINT:
retval = decodeSmallInt(bb);
... | java |
static public BigDecimal decodeDecimal(final ByteBuffer bb) {
final int scale = bb.get();
final int precisionBytes = bb.get();
final byte[] bytes = new byte[precisionBytes];
bb.get(bytes);
return new BigDecimal(new BigInteger(bytes), scale);
} | java |
static public Object decodeVarbinary(final ByteBuffer bb) {
final int length = bb.getInt();
final byte[] data = new byte[length];
bb.get(data);
return data;
} | java |
static public GeographyValue decodeGeography(final ByteBuffer bb) {
final int strLength = bb.getInt();
final int startPosition = bb.position();
GeographyValue gv = GeographyValue.unflattenFromBuffer(bb);
assert(bb.position() - startPosition == strLength);
return gv;
} | java |
@Override
public final Iterable<T> children(final T root) {
checkNotNull(root);
return new FluentIterable<T>() {
@Override
public Iterator<T> iterator() {
return new AbstractIterator<T>() {
boolean doneLeft;
boolean doneRight;
@Override
protected T ... | java |
private boolean processTrueOrFalse() {
if (token.tokenType == Tokens.TRUE) {
read();
return true;
} else if (token.tokenType == Tokens.FALSE) {
read();
return false;
} else {
throw unexpectedToken();
}
} | java |
public VoltTable sortByAverage(String tableName)
{
List<ProcProfRow> sorted = new ArrayList<ProcProfRow>(m_table);
Collections.sort(sorted, new Comparator<ProcProfRow>() {
@Override
public int compare(ProcProfRow lhs, ProcProfRow rhs) {
return compareByAvg(rhs... | java |
public int compareByAvg(ProcProfRow lhs, ProcProfRow rhs)
{
if (lhs.avg * lhs.invocations > rhs.avg * rhs.invocations) {
return 1;
} else if (lhs.avg * lhs.invocations < rhs.avg * rhs.invocations) {
return -1;
} else {
return 0;
}
} | java |
void doInitiation(RejoinMessage message)
{
m_coordinatorHsId = message.m_sourceHSId;
m_hasPersistentTables = message.schemaHasPersistentTables();
if (m_hasPersistentTables) {
m_streamSnapshotMb = VoltDB.instance().getHostMessenger().createMailbox();
m_rejoinSiteProces... | java |
void updateTableIndexRoots() {
HsqlArrayList allTables = database.schemaManager.getAllTables();
for (int i = 0, size = allTables.size(); i < size; i++) {
Table t = (Table) allTables.get(i);
if (t.getTableType() == TableBase.CACHED_TABLE) {
int[] rootsArray = ro... | java |
public final void sendSentinel(long txnId, int partitionId) {
final long initiatorHSId = m_cartographer.getHSIdForSinglePartitionMaster(partitionId);
sendSentinel(txnId, initiatorHSId, -1, -1, true);
} | java |
private final ClientResponseImpl dispatchLoadSinglepartitionTable(Procedure catProc,
StoredProcedureInvocation task,
InvocationClientHandler handler,
Co... | java |
public void handleAllHostNTProcedureResponse(ClientResponseImpl clientResponseData) {
long handle = clientResponseData.getClientHandle();
ProcedureRunnerNT runner = m_NTProcedureService.m_outstanding.get(handle);
if (runner == null) {
hostLog.info("Run everywhere NTProcedure early re... | java |
private static boolean valueConstantsMatch(AbstractExpression e1, AbstractExpression e2) {
return (e1 instanceof ParameterValueExpression && e2 instanceof ConstantValueExpression ||
e1 instanceof ConstantValueExpression && e2 instanceof ParameterValueExpression) &&
equalsAsCVE(e1... | java |
private static boolean equalsAsCVE(AbstractExpression e1, AbstractExpression e2) {
final ConstantValueExpression ce1 = asCVE(e1), ce2 = asCVE(e2);
return ce1 == null || ce2 == null ? ce1 == ce2 : ce1.equals(ce2);
} | java |
private static ConstantValueExpression asCVE(AbstractExpression expr) {
return expr instanceof ConstantValueExpression ? (ConstantValueExpression) expr :
((ParameterValueExpression) expr).getOriginalValue();
} | java |
protected void addCorrelationParameterValueExpression(AbstractExpression expr, List<AbstractExpression> pves) {
int paramIdx = ParameterizationInfo.getNextParamIndex();
m_parameterIdxList.add(paramIdx);
ParameterValueExpression pve = new ParameterValueExpression(paramIdx, expr);
pves.add... | java |
public synchronized CachedObject get(int pos) {
if (accessCount == Integer.MAX_VALUE) {
resetAccessCount();
}
int lookup = getLookup(pos);
if (lookup == -1) {
return null;
}
accessTable[lookup] = accessCount++;
return (CachedObject) ob... | java |
synchronized void put(int key, CachedObject row) {
int storageSize = row.getStorageSize();
if (size() >= capacity
|| storageSize + cacheBytesLength > bytesCapacity) {
cleanUp();
}
if (accessCount == Integer.MAX_VALUE) {
super.resetAccessCount();... | java |
synchronized CachedObject release(int i) {
CachedObject r = (CachedObject) super.addOrRemove(i, null, true);
if (r == null) {
return null;
}
cacheBytesLength -= r.getStorageSize();
r.setInMemory(false);
return r;
} | java |
synchronized void saveAll() {
Iterator it = new BaseHashIterator();
int savecount = 0;
for (; it.hasNext(); ) {
CachedObject r = (CachedObject) it.next();
if (r.hasChanged()) {
rowTable[savecount++] = r;
}
}
save... | java |
public void addAggregate(ExpressionType aggType,
boolean isDistinct,
Integer aggOutputColumn,
AbstractExpression aggInputExpr)
{
m_aggregateTypes.add(aggType);
if (isDistinct)
{
m_aggregateDist... | java |
public static AggregatePlanNode convertToSerialAggregatePlanNode(HashAggregatePlanNode hashAggregateNode) {
AggregatePlanNode serialAggr = new AggregatePlanNode();
return setAggregatePlanNode(hashAggregateNode, serialAggr);
} | java |
public static AggregatePlanNode convertToPartialAggregatePlanNode(HashAggregatePlanNode hashAggregateNode,
List<Integer> aggrColumnIdxs) {
final AggregatePlanNode partialAggr = setAggregatePlanNode(hashAggregateNode, new PartialAggregatePlanNode());
partialAggr.m_partialGroupByColumns = aggr... | java |
public String getSQLState()
{
String state = null;
try {
state = new String(m_sqlState, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
return state;
} | java |
private static String[] aggregatePerHostResults(VoltTable vtable) {
String[] ret = new String[2];
vtable.advanceRow();
String kitCheckResult = vtable.getString("KIT_CHECK_RESULT");
String rootCheckResult = vtable.getString("ROOT_CHECK_RESULT");
String xdcrCheckResult = vtable.get... | java |
public static long millisFromJDBCformat(String param) {
java.sql.Timestamp sqlTS = java.sql.Timestamp.valueOf(param);
final long fractionalSecondsInNanos = sqlTS.getNanos();
// Fractional milliseconds would get truncated so flag them as an error.
if ((fractionalSecondsInNanos % 1000000) ... | java |
@Override
public int compareTo(TimestampType dateval) {
int comp = m_date.compareTo(dateval.m_date);
if (comp == 0) {
return m_usecs - dateval.m_usecs;
}
else {
return comp;
}
} | java |
public java.sql.Date asExactJavaSqlDate() {
if (m_usecs != 0) {
throw new RuntimeException("Can't convert to sql Date from TimestampType with fractional milliseconds");
}
return new java.sql.Date(m_date.getTime());
} | java |
public java.sql.Timestamp asJavaTimestamp() {
java.sql.Timestamp result = new java.sql.Timestamp(m_date.getTime());
result.setNanos(result.getNanos() + m_usecs * 1000);
return result;
} | java |
public boolean load() {
boolean exists;
if (!DatabaseURL.isFileBasedDatabaseType(database.getType())) {
return true;
}
try {
exists = super.load();
} catch (Exception e) {
throw Error.error(ErrorCode.FILE_IO_ERROR,
... | java |
public void setDatabaseVariables() {
if (isPropertyTrue(db_readonly)) {
database.setReadOnly();
}
if (isPropertyTrue(hsqldb_files_readonly)) {
database.setFilesReadOnly();
}
database.sqlEnforceStrictSize =
isPropertyTrue(sql_enforce_strict_s... | java |
public void setURLProperties(HsqlProperties p) {
if (p != null) {
for (Enumeration e = p.propertyNames(); e.hasMoreElements(); ) {
String propertyName = (String) e.nextElement();
Object[] row = (Object[]) meta.get(propertyName);
if (row !=... | java |
private void runSubmissions(boolean block) throws InterruptedException {
if (block) {
Runnable r = m_submissionQueue.take();
do {
r.run();
} while ((r = m_submissionQueue.poll()) != null);
} else {
Runnable r = null;
while ((r =... | java |
public void queueNotification(
final Collection<ClientInterfaceHandleManager> connections,
final Supplier<DeferredSerialization> notification,
final Predicate<ClientInterfaceHandleManager> wantsNotificationPredicate) {
m_submissionQueue.offer(new Runnable() {
@Ove... | java |
public PerfCounter get(String counter)
{
// Admited: could get a little race condition at the very beginning, but all that'll happen is that we'll lose a handful of tracking event, a loss far outweighed by overall reduced contention.
if (!this.Counters.containsKey(counter))
this.Counters... | java |
public void update(String counter, long executionDuration, boolean success)
{
this.get(counter).update(executionDuration, success);
} | java |
public String toRawString(char delimiter)
{
StringBuilder result = new StringBuilder();
for (Entry<String, PerfCounter> e : Counters.entrySet()) {
result.append(e.getKey())
.append(delimiter)
.append(e.getValue().toRawString(delimiter))
... | java |
private void leaderElection() {
loggingLog.info("Starting leader election for snapshot truncation daemon");
try {
while (true) {
Stat stat = m_zk.exists(VoltZK.snapshot_truncation_master, new Watcher() {
@Override
public void process(Wa... | java |
public ListenableFuture<Void> mayGoActiveOrInactive(final SnapshotSchedule schedule)
{
return m_es.submit(new Callable<Void>() {
@Override
public Void call() throws Exception {
makeActivePrivate(schedule);
return null;
}
});
} | java |
private void doPeriodicWork(final long now) {
if (m_lastKnownSchedule == null)
{
setState(State.STARTUP);
return;
}
if (m_frequencyUnit == null) {
return;
}
if (m_state == State.STARTUP) {
initiateSnapshotScan();
}... | java |
private void processWaitingPeriodicWork(long now) {
if (now - m_lastSysprocInvocation < m_minTimeBetweenSysprocs) {
return;
}
if (m_snapshots.size() > m_retain) {
//Quick hack to make sure we don't delete while the snapshot is running.
//Deletes work really b... | java |
public Future<Void> processClientResponse(final Callable<ClientResponseImpl> response) {
return m_es.submit(new Callable<Void>() {
@Override
public Void call() throws Exception {
try {
ClientResponseImpl resp = response.call();
long... | java |
private void processSnapshotResponse(ClientResponse response) {
setState(State.WAITING);
final long now = System.currentTimeMillis();
m_nextSnapshotTime += m_frequencyInMillis;
if (m_nextSnapshotTime < now) {
m_nextSnapshotTime = now - 1;
}
if (response.getSt... | java |
private void processDeleteResponse(ClientResponse response) {
//Continue snapshotting even if a delete fails.
setState(State.WAITING);
if (response.getStatus() != ClientResponse.SUCCESS){
logFailureResponse("Delete of snapshots failed", response);
return;
}
... | java |
private void processScanResponse(ClientResponse response) {
setState(State.WAITING);
if (response.getStatus() != ClientResponse.SUCCESS) {
logFailureResponse("Initial snapshot scan failed", response);
return;
}
final VoltTable results[] = response.getResults();
... | java |
private void deleteExtraSnapshots() {
if (m_snapshots.size() <= m_retain) {
setState(State.WAITING);
} else {
m_lastSysprocInvocation = System.currentTimeMillis();
setState(State.DELETING);
final int numberToDelete = m_snapshots.size() - m_retain;
... | java |
public void createAndWatchRequestNode(final long clientHandle,
final Connection c,
SnapshotInitiationInfo snapInfo,
boolean notifyChanges) throws ForwardClientException {
boolean request... | java |
private String createRequestNode(SnapshotInitiationInfo snapInfo)
{
String requestId = null;
try {
requestId = java.util.UUID.randomUUID().toString();
if (!snapInfo.isTruncationRequest()) {
final JSONObject jsObj = snapInfo.getJSONObjectForZK();
... | java |
public final static <T extends FastSerializable> T deserialize(
final byte[] data, final Class<T> expectedType) throws IOException {
final FastDeserializer in = new FastDeserializer(data);
return in.readObject(expectedType);
} | java |
public <T extends FastSerializable> T readObject(final Class<T> expectedType) throws IOException {
assert(expectedType != null);
T obj = null;
try {
obj = expectedType.newInstance();
obj.readExternal(this);
} catch (final InstantiationException e) {
e.... | java |
public FastSerializable readObject(final FastSerializable obj, final DeserializationMonitor monitor) throws IOException {
final int startPosition = buffer.position();
obj.readExternal(this);
final int endPosition = buffer.position();
if (monitor != null) {
monitor.deserialize... | java |
public static String readString(ByteBuffer buffer) throws IOException {
final int NULL_STRING_INDICATOR = -1;
final int len = buffer.getInt();
// check for null string
if (len == NULL_STRING_INDICATOR)
return null;
assert len >= 0;
if (len > VoltType.MAX_VA... | java |
public String readString() throws IOException {
final int len = readInt();
// check for null string
if (len == VoltType.NULL_STRING_LENGTH) {
return null;
}
if (len < VoltType.NULL_STRING_LENGTH) {
throw new IOException("String length is negative " + len... | java |
public ByteBuffer readBuffer(final int byteLen) {
final byte[] data = new byte[byteLen];
buffer.get(data);
return ByteBuffer.wrap(data);
} | java |
private boolean removeUDFInSchema(String functionName) {
for (int idx = 0; idx < m_schema.children.size(); idx++) {
VoltXMLElement func = m_schema.children.get(idx);
if ("ud_function".equals(func.name)) {
String fnm = func.attributes.get("name");
if (fnm !... | java |
public String toXML() {
StringBuilder sb = new StringBuilder();
sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
toXML(sb, 0);
return sb.toString();
} | java |
public List<VoltXMLElement> findChildrenRecursively(String name)
{
List<VoltXMLElement> retval = new ArrayList<>();
for (VoltXMLElement vxe : children) {
if (name.equals(vxe.name)) {
retval.add(vxe);
}
retval.addAll(vxe.findChildrenRecursively(name... | java |
public List<VoltXMLElement> findChildren(String name)
{
List<VoltXMLElement> retval = new ArrayList<>();
for (VoltXMLElement vxe : children) {
if (name.equals(vxe.name)) {
retval.add(vxe);
}
}
return retval;
} | java |
public VoltXMLElement findChild(String uniqueName)
{
for (VoltXMLElement vxe : children) {
if (uniqueName.equals(vxe.getUniqueName())) {
return vxe;
}
}
return null;
} | java |
static public VoltXMLDiff computeDiff(VoltXMLElement before, VoltXMLElement after)
{
// Top level call needs both names to match (I think this makes sense)
if (!before.getUniqueName().equals(after.getUniqueName())) {
// not sure this is best behavior, ponder as progress is made
... | java |
public List<VoltXMLElement> extractSubElements(String elementName, String attrName, String attrValue) {
assert(elementName != null);
assert((elementName != null && attrValue != null) || attrName == null);
List<VoltXMLElement> elements = new ArrayList<>();
extractSubElements(elementName, ... | java |
static int getHexValue(int c) {
if (c >= '0' && c <= '9') {
c -= '0';
} else if (c > 'z') {
c = 16;
} else if (c >= 'a') {
c -= ('a' - 10);
} else if (c > 'Z') {
c = 16;
} else if (c >= 'A') {
c -= ('A' - 10);
}... | java |
boolean scanSpecialIdentifier(String identifier) {
int length = identifier.length();
if (limit - currentPosition < length) {
return false;
}
for (int i = 0; i < length; i++) {
int character = identifier.charAt(i);
if (character == sqlString.charAt(... | java |
IntervalType scanIntervalType() {
int precision = -1;
int scale = -1;
int startToken;
int endToken;
final int errorCode = ErrorCode.X_22006;
startToken = endToken = token.tokenType;
scanNext(errorCode);
if (token.tokenType =... | java |
public synchronized Object convertToDatetimeInterval(String s,
DTIType type) {
Object value;
IntervalType intervalType = null;
int dateTimeToken = -1;
int errorCode = type.isDateTimeType() ? ErrorCode.X_22007
... | java |
public void writeData(Object[] data, Type[] types) {
writeData(types.length, types, data, null, null);
} | java |
void addWarning(SQLWarning w) {
// PRE: w is never null
synchronized (rootWarning_mutex) {
if (rootWarning == null) {
rootWarning = w;
} else {
rootWarning.setNextWarning(w);
}
}
} | java |
public void reset() throws SQLException {
try {
this.sessionProxy.resetSession();
} catch (HsqlException e) {
throw Util.sqlException(ErrorCode.X_08006, e.getMessage(), e);
}
} | java |
private int onStartEscapeSequence(String sql, StringBuffer sb,
int i) throws SQLException {
sb.setCharAt(i++, ' ');
i = StringUtil.skipSpaces(sql, i);
if (sql.regionMatches(true, i, "fn ", 0, 3)
|| sql.regionMatches(true, i, "oj ", 0, 3)
... | java |
synchronized long userUpdate(long value) {
if (value == currValue) {
currValue += increment;
return value;
}
if (increment > 0) {
if (value > currValue) {
currValue += ((value - currValue + increment) / increment)
... | java |
synchronized long systemUpdate(long value) {
if (value == currValue) {
currValue += increment;
return value;
}
if (increment > 0) {
if (value > currValue) {
currValue = value + increment;
}
} else {
if (value ... | java |
synchronized public long getValue() {
if (limitReached) {
throw Error.error(ErrorCode.X_2200H);
}
long nextValue;
if (increment > 0) {
if (currValue > maxValue - increment) {
if (isCycle) {
nextValue = minValue;
... | java |
synchronized public void reset(long value) {
if (value < minValue || value > maxValue) {
throw Error.error(ErrorCode.X_42597);
}
startValue = currValue = lastValue = value;
} | java |
@Override
public int compareTo(Sha1Wrapper arg0) {
if (arg0 == null) return 1;
for (int i = 0; i < 20; i++) {
int cmp = hashBytes[i] - arg0.hashBytes[i];
if (cmp != 0) return cmp;
}
return 0;
} | java |
private static void appendSpaces(final StringBuilder sb, final int spaces) {
for( int i = 0; i < spaces; i++ ) {
sb.append(SPACE);
}
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.