private Boolean maybeComputeNext() { state = State.FAILED; next = makeNext(); if (state == State.DONE) { return false; } else { state = State.READY; return true; } }
@Override public synchronized KeyValue<Bytes, byte[]> next() { return super.next(); }
public double nextDouble() { return nextDouble(Double.MIN_VALUE, Double.MAX_VALUE); }
@Override public void onNext(Proxy.Metadata metadata) { LOGGER.info("[PUSH][CLIENTOBSERVER][ONNEXT]SendClientResponseStreamObserver.onNext. metadata: {}", toStringUtils.toOneLineString(metadata)); this.metadata = metadata; // this.delayedResult.setResult(metadata); }
@Override public void handleCheckedException(Exception e) { LOGGER.error(errorUtils.getStackTrace(e)); } }
public int nextNonNegativeInt() { return nextInt(0, Integer.MAX_VALUE); }
public T peek() { if (!hasNext()) throw new NoSuchElementException(); return next; }
public long nextNonNegativeLong() { return nextLong(0L, Long.MAX_VALUE); }
public float nextNonNegativeFloat() { return nextFloat(0F, Float.MAX_VALUE); }
@Override public boolean hasNext() { switch (state) { case FAILED: throw new IllegalStateException("Iterator is in failed state"); case DONE: return false; case READY: return true; default: return maybeComputeNext(); } }
@Override public KeyValue<Bytes, byte[]> allDone() { KeyValue<Bytes, byte[]> rtn = super.allDone(); close(); return rtn; }
protected <T> T doCrudRequest(Object model, CrudRequestProcessor crudRequestProcessor, Class<T> targetClass) { Object callResult = doCrudRequest(model, crudRequestProcessor); return reflectionUtils.castIfNotNull(callResult, targetClass); }
@Override public void onNext(Kv.CreateTableInfo createTableInfo) { LOGGER.info("Kv.CreateTableInfo result: {}", toStringUtils.toOneLineString(createTableInfo)); }
@Override public void onFailure(Throwable throwable) { LOGGER.fatal("[FEDERATION][MAIN][FATAL] job scheduler failed: {}", errorUtils.getStackTrace(throwable)); }
public int nextInt() { return nextInt(Integer.MIN_VALUE, Integer.MAX_VALUE); }
public double nextNonNegativeDuoble() { return nextDouble(0D, Double.MAX_VALUE); }
@Override public synchronized KeyValue<Bytes, byte[]> next() { return super.next(); }
public long nextLong() { return nextLong(Long.MIN_VALUE, Long.MAX_VALUE); }
public float nextFloat() { return nextFloat(Float.MAX_VALUE, Float.MAX_VALUE); }
public long nextLong(long lowerBoundInclusive, long higherBoundInclusive) { Preconditions.checkArgument(lowerBoundInclusive < higherBoundInclusive, "lower bound must be less than or equal to higher bound"); return (long) nextDouble((double) lowerBoundInclusive, (double) higherBoundInclusive); }