public void testMin_noArgs() { try { Longs.min(); fail(); } catch (IllegalArgumentException expected) { } }
long rowsToStripeMemoryLimit = (long) ((stripeMaxBytes - currentTotalBytes) / totalBytesPerFutureRow); long rowsToStripeRowLimit = stripeMaxRowCount - stripeRowCount; long rowsToLimit = Longs.min(rowsToDictionaryMemoryLimit, rowsToStripeMemoryLimit, rowsToStripeRowLimit);
private void fillValues(IntValueLookup original) { final int BUFFER_SIZE = 8192; final int[] idBuffer = new int[BUFFER_SIZE]; final long[] valBuffer = new long[BUFFER_SIZE]; for (int start = 0; start < values.length; start += BUFFER_SIZE) { final int end = Math.min(values.length, start+BUFFER_SIZE), n = end-start; for (int i = 0; i < n; i++) { idBuffer[i] = start + i; } original.lookup(idBuffer, valBuffer, n); System.arraycopy(valBuffer, 0, values, start, n); } min = Longs.min(values); max = Longs.max(values); }
private static Pair<Long, Long> getPreviousAndCurrentTimestamps(final Collection<Long> longs) { final long[] timestamps = Longs.toArray(longs); final long timestamp = Longs.max(timestamps); final long previousTimestamp = Longs.min(timestamps) - 1L; return Pair.of(previousTimestamp, timestamp); }
public void testMin_noArgs() { try { Longs.min(); fail(); } catch (IllegalArgumentException expected) { } }
phaseName, elapsed, Longs.min(clientExecutionTimes), Longs.max(clientExecutionTimes), Ints.min(clientMixes), Ints.max(clientMixes));
/** * @return the minimum configured {read, write, range, truncate, misc} timeout */ public static long getMinRpcTimeout() { return Longs.min(getRpcTimeout(), getReadRpcTimeout(), getRangeRpcTimeout(), getWriteRpcTimeout(), getCounterWriteRpcTimeout(), getTruncateRpcTimeout()); }
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; return new Coder((int) Longs.max(frequencies.keySet().toLongArray()) + 1); } }
/** * @return the minimum configured {read, write, range, truncate, misc} timeout */ public static long getMinRpcTimeout() { return Longs.min(getRpcTimeout(), getReadRpcTimeout(), getRangeRpcTimeout(), getWriteRpcTimeout(), getCounterWriteRpcTimeout(), getTruncateRpcTimeout()); }
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; return new Coder(Fast.mostSignificantBit(Longs.max(frequencies.keySet().toLongArray()) + 1) * 2 + 1); } }
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; return new Coder(Fast.length(Longs.max(frequencies.keySet().toLongArray()))); } }
private void doInsert(ConsistencyLevel consistency_level, List<? extends IMutation> mutations, boolean mutateAtomically, long queryStartNanoTime) throws UnavailableException, TimedOutException, org.apache.cassandra.exceptions.InvalidRequestException { org.apache.cassandra.db.ConsistencyLevel consistencyLevel = ThriftConversion.fromThrift(consistency_level); consistencyLevel.validateForWrite(state().getKeyspace()); if (mutations.isEmpty()) return; long timeout = Long.MAX_VALUE; for (IMutation m : mutations) timeout = Longs.min(timeout, m.getTimeout()); schedule(timeout); try { StorageProxy.mutateWithTriggers(mutations, consistencyLevel, mutateAtomically, queryStartNanoTime); } catch (RequestExecutionException e) { ThriftConversion.rethrow(e); } finally { release(); } }
private void doInsert(ConsistencyLevel consistency_level, List<? extends IMutation> mutations, boolean mutateAtomically, long queryStartNanoTime) throws UnavailableException, TimedOutException, org.apache.cassandra.exceptions.InvalidRequestException { org.apache.cassandra.db.ConsistencyLevel consistencyLevel = ThriftConversion.fromThrift(consistency_level); consistencyLevel.validateForWrite(state().getKeyspace()); if (mutations.isEmpty()) return; long timeout = Long.MAX_VALUE; for (IMutation m : mutations) timeout = Longs.min(timeout, m.getTimeout()); schedule(timeout); try { StorageProxy.mutateWithTriggers(mutations, consistencyLevel, mutateAtomically, queryStartNanoTime); } catch (RequestExecutionException e) { ThriftConversion.rethrow(e); } finally { release(); } }
long rowsToStripeMemoryLimit = (long) ((stripeMaxBytes - currentTotalBytes) / totalBytesPerFutureRow); long rowsToStripeRowLimit = stripeMaxRowCount - stripeRowCount; long rowsToLimit = Longs.min(rowsToDictionaryMemoryLimit, rowsToStripeMemoryLimit, rowsToStripeRowLimit);
long rowsToStripeMemoryLimit = (long) ((stripeMaxBytes - currentTotalBytes) / totalBytesPerFutureRow); long rowsToStripeRowLimit = stripeMaxRowCount - stripeRowCount; long rowsToLimit = Longs.min(rowsToDictionaryMemoryLimit, rowsToStripeMemoryLimit, rowsToStripeRowLimit);
long rowsToStripeMemoryLimit = (long) ((stripeMaxBytes - currentTotalBytes) / totalBytesPerFutureRow); long rowsToStripeRowLimit = stripeMaxRowCount - stripeRowCount; long rowsToLimit = Longs.min(rowsToDictionaryMemoryLimit, rowsToStripeMemoryLimit, rowsToStripeRowLimit);
@Override public Coder getCoder(final Long2LongMap frequencies) { assert Longs.min(frequencies.values().toLongArray()) > 0; final int size = frequencies.size(); if (size == 0 || size == 1) return new Coder(new long[0], new int[0], new long[0], Long2IntMaps.EMPTY_MAP);