public static VSizeColumnarInts fromArray(int[] array) { return fromArray(array, Ints.max(array)); }
public void testMax_noArgs() { try { Ints.max(); fail(); } catch (IllegalArgumentException expected) { } }
public Table rows(int... rowNumbers) { Preconditions.checkArgument(Ints.max(rowNumbers) <= rowCount()); return where(Selection.with(rowNumbers)); }
public StageLinkage(PlanFragmentId fragmentId, ExchangeLocationsConsumer parent, Set<SqlStageExecution> children) { this.currentStageFragmentId = fragmentId; this.parent = parent; this.childOutputBufferManagers = children.stream() .map(childStage -> { PartitioningHandle partitioningHandle = childStage.getFragment().getPartitioningScheme().getPartitioning().getHandle(); if (partitioningHandle.equals(FIXED_BROADCAST_DISTRIBUTION)) { return new BroadcastOutputBufferManager(childStage::setOutputBuffers); } else if (partitioningHandle.equals(SCALED_WRITER_DISTRIBUTION)) { return new ScaledOutputBufferManager(childStage::setOutputBuffers); } else { int partitionCount = Ints.max(childStage.getFragment().getPartitioningScheme().getBucketToPartition().get()) + 1; return new PartitionedOutputBufferManager(partitioningHandle, partitionCount, childStage::setOutputBuffers); } }) .collect(toImmutableSet()); this.childStageIds = children.stream() .map(SqlStageExecution::getStageId) .collect(toImmutableSet()); }
public Table dropRows(int... rowNumbers) { Preconditions.checkArgument(Ints.max(rowNumbers) <= rowCount()); Selection selection = Selection.withRange(0, rowCount()) .andNot(Selection.with(rowNumbers)); return where(selection); }
private void makeWithSerde(final int chunkSize) throws IOException { CloseQuietly.close(columnarInts); ByteArrayOutputStream baos = new ByteArrayOutputStream(); final CompressedVSizeColumnarIntsSupplier theSupplier = CompressedVSizeColumnarIntsSupplier.fromList( IntArrayList.wrap(vals), Ints.max(vals), chunkSize, byteOrder, compressionStrategy, closer ); theSupplier.writeTo(Channels.newChannel(baos), null); final byte[] bytes = baos.toByteArray(); Assert.assertEquals(theSupplier.getSerializedSize(), bytes.length); supplier = CompressedVSizeColumnarIntsSupplier.fromByteBuffer(ByteBuffer.wrap(bytes), byteOrder); columnarInts = supplier.get(); }
private void setupSimple(final int chunkSize) { CloseQuietly.close(columnarInts); vals = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16}; supplier = CompressedVSizeColumnarIntsSupplier.fromList( IntArrayList.wrap(vals), Ints.max(vals), chunkSize, ByteOrder.nativeOrder(), compressionStrategy, closer ); columnarInts = supplier.get(); }
if (assumption == RaptorWorkerTimetable.BoardingAssumption.WORST_CASE) aggregateHeadway = Ints.max(headway); else {
private void checkSerializedSizeAndData() throws Exception { int maxValue = vals.length == 0 ? 0 : Ints.max(vals); VSizeColumnarIntsSerializer writer = new VSizeColumnarIntsSerializer(segmentWriteOutMedium, maxValue); VSizeColumnarInts intsFromList = VSizeColumnarInts.fromIndexedInts(new ArrayBasedIndexedInts(vals), maxValue); writer.open(); for (int val : vals) { writer.addValue(val); } long writtenLength = writer.getSerializedSize(); WriteOutBytes writeOutBytes = segmentWriteOutMedium.makeWriteOutBytes(); writer.writeTo(writeOutBytes, null); assertEquals(writtenLength, intsFromList.getSerializedSize()); // read from ByteBuffer and check values VSizeColumnarInts intsFromByteBuffer = VSizeColumnarInts.readFromByteBuffer( ByteBuffer.wrap(IOUtils.toByteArray(writeOutBytes.asInputStream())) ); assertEquals(vals.length, intsFromByteBuffer.size()); for (int i = 0; i < vals.length; ++i) { assertEquals(vals[i], intsFromByteBuffer.get(i)); } }
blockSize != -1 ? blockSize : Ints.max( fromPath.getFileSystem().config().blockSize(), toPath.getFileSystem().config().blockSize());
CompressedVSizeColumnarIntsSerializer writer = new CompressedVSizeColumnarIntsSerializer( segmentWriteOutMedium, vals.length > 0 ? Ints.max(vals) : 0, chunkSize, byteOrder,
/** * Construct an exception instance to happen at a time in the future * * @param message * message * @param seconds * retry after delta. Negative values are converted to zero */ public RetryAfterException(String message, int seconds) { super(message); this.seconds = Ints.max(seconds, 0); }
/** * Construct an exception instance to happen at a time in the future * * @param message * message * @param seconds * retry after delta. Negative values are converted to zero */ public RetryAfterException(String message, int seconds) { super(message); this.seconds = Ints.max(seconds, 0); }
/** * Construct an exception instance to happen at a time in the future * * @param cause * cause * @param seconds * retry after delta. Negative values are converted to zero */ public RetryAfterException(Throwable cause, int seconds) { super(defaultMessage(seconds = Ints.max(seconds, 0)), cause); this.seconds = seconds; }
/** * Construct an exception instance to happen at a time in the future * * @param cause * cause * @param seconds * retry after delta. Negative values are converted to zero */ public RetryAfterException(Throwable cause, int seconds) { super(defaultMessage(seconds = Ints.max(seconds, 0)), cause); this.seconds = seconds; }