public void clear() { for (int i = 0; i < buckets.length; i++) { clearBucket(i); } }
public static String getErrorMessageAndSetCode(Resp resp, Throwable err) { ErrCodeAndMsg codeAndMsg = Msc.getErrorCodeAndMsg(err); resp.code(codeAndMsg.code()); return codeAndMsg.msg(); }
public static String errorMsg(Throwable error) { return getErrorCodeAndMsg(error).msg(); }
public SimpleBucket<T> bucket(long key) { int index = index(key); return getBucketAt(index); }
protected void clearBucket(int index) { getBucketAt(index).clear(); }
@Override public void clear() { entries.clear(); }
public static void doBenchmark(String name, int count, BenchmarkOperation operation, boolean silent) { long start = U.time(); for (int i = 0; i < count; i++) { operation.run(i); } if (!silent) { benchmarkComplete(name, count, start); } }
public static String purple(String text) { return code("0;35", text); }
/** * Clean-up of an old, previously cached value. * * @param oldValue can be null */ private void releaseOldValue(V oldValue) { if (oldValue instanceof Resetable) { ((Resetable) oldValue).reset(); } }
@Override public void cleanUp() { Msc.reset(); }
public T get() { T value = initializedValue; if (value == null) { synchronized (this) { value = initializedValue; if (value == null) { initializedValue = initialize(); value = initializedValue; } } } return value; }
public TimeSeries(int maxSize) { this.values = new SlidingWindowList<>(maxSize); }
public static String white(String text) { return code("1;37", text); }
public static String red(String text) { return code("0;31", text); }
public static String green(String text) { return code("0;32", text); }