public HankResponse[] getResponses() throws ExecutionException, InterruptedException { this.get(); return runnable.getResponses(); } }
public DoublePopulationStatisticsAggregator(double minimum, double maximum, long numValues, double total, double[] randomSample) { this.minimum = minimum; this.maximum = maximum; this.numValues = numValues; this.total = total; this.reservoirSample.sample(randomSample, random); }
public void clear() { minimum = Double.MAX_VALUE; maximum = Double.MIN_VALUE; numValues = 0; total = 0.0; reservoirSample.clear(); }
public RuntimeStatisticsAggregator getRuntimeStatistics() { RuntimeStatisticsAggregator runtimeStatisticsAggregator = new RuntimeStatisticsAggregator(); for (PartitionAccessor partitionAccessor : partitionAccessors) { if (partitionAccessor != null) { runtimeStatisticsAggregator.add(partitionAccessor.getRuntimeStatistics()); } } runtimeStatisticsAggregator.setGetRequestsPopulationStatistics( getRequestsTimerAggregator.getAndResetPopulationStatistics()); return runtimeStatisticsAggregator; } }
public void sample(ReservoirSample other, Random random) { for (int i = 0; i < other.getSize(); ++i) { sample(other.getReservoir()[i], random); } }
public static double getSortedPopulationDecile(double[] population, int decile, int endIndex) { return getInterpolatedValueAtIndex(population, getDecileIndex(endIndex, decile)); }
public double[] computeDeciles() { double[] result = new double[9]; Arrays.fill(result, 0.0); if (reservoirSample.getSize() > 0) { // Sort valid reservoir values first Arrays.sort(reservoirSample.getReservoir(), 0, reservoirSample.getSize()); // Compute deciles for (int i = 0; i < 9; ++i) { result[i] = getSortedPopulationDecile(reservoirSample.getReservoir(), i + 1, reservoirSample.getSize()); } } return result; }
@Override public HankResponse get(int domainId, ByteBuffer key) { ReaderResult result = readerResultThreadLocal.get(); // If buffer exceeds limit, reset it if (result.getBuffer() != null && result.getBuffer().capacity() > bufferReuseMaxSize) { readerResultThreadLocal.remove(); result = readerResultThreadLocal.get(); } result.clear(); return _get(this, domainId, key, result); }
@Override public Thread newThread(Runnable runnable) { return new GetThread(runnable, "GET BULK Thread " + threadId++); } }
public void shutDown() { // Shutdown partition accessors for (PartitionAccessor partitionAccessor : partitionAccessors) { if (partitionAccessor != null) { partitionAccessor.shutDown(); } } }
public synchronized void stopSynchronized() { stop(); }
protected IUpdateManager getUpdateManager() throws IOException { return new UpdateManager(configurator, host, ringGroup); }
public DoublePopulationStatisticsAggregator() { clear(); }
protected IfaceWithShutdown getHandler() throws IOException { return new PartitionServerHandler(hostAddress, configurator, coordinator); }
public static double getSortedPopulationDecile(long[] population, int decile) { return getInterpolatedValueAtIndex(population, getDecileIndex(population.length, decile)); }
public void sample(double[] values, Random random) { for (double value : values) { sample(value, random); } }
public ReservoirSample(int reservoirMaxSize) { reservoir = new double[reservoirMaxSize]; clear(); }
public static double getSortedPopulationDecile(long[] population, int decile, int endIndex) { return getInterpolatedValueAtIndex(population, getDecileIndex(endIndex, decile)); }
public void aggregate(double minimum, double maximum, long numValues, double total, double[] values) { if (maximum > this.maximum) { this.maximum = maximum; } if (minimum < this.minimum) { this.minimum = minimum; } this.numValues += numValues; this.total += total; this.reservoirSample.sample(values, random); }
public static double getSortedPopulationDecile(double[] population, int decile) { return getInterpolatedValueAtIndex(population, getDecileIndex(population.length, decile)); }