@Override public UploadPartResult uploadPart(String key, String uploadId, int partNumber, File inputFile, long length) throws IOException { final UploadPartRequest uploadRequest = s3accessHelper.newUploadPartRequest( key, uploadId, partNumber, MathUtils.checkedDownCast(length), null, inputFile, 0L); return s3accessHelper.uploadPart(uploadRequest); }
@Override public IntValue translate(LongValue value, IntValue reuse) throws Exception { if (reuse == null) { reuse = new IntValue(); } reuse.setValue(MathUtils.checkedDownCast(value.getValue())); return reuse; } }
checkedDownCast( MemorySize.parse(config.getString(TaskManagerOptions.MEMORY_SEGMENT_SIZE)) .getBytes());
protected SlidingWindowAssigner(long size, long slide, long offset, boolean isEventTime) { if (offset < 0 || offset >= slide || size <= 0) { throw new IllegalArgumentException( "SlidingWindowAssigner parameters must satisfy 0 <= offset < slide and size > 0"); } this.size = size; this.slide = slide; this.offset = offset; this.isEventTime = isEventTime; this.paneSize = ArithmeticUtils.gcd(size, slide); this.numPanesPerWindow = MathUtils.checkedDownCast(size / paneSize); }
this.windowSlide = windowSlide; this.paneSize = paneSlide; this.numPanesPerWindow = MathUtils.checkedDownCast(windowLength / paneSlide);
@Override public IntValue translate(LongValue value, IntValue reuse) throws Exception { if (reuse == null) { reuse = new IntValue(); } reuse.setValue(MathUtils.checkedDownCast(value.getValue())); return reuse; } }
@Override public IntValue translate(LongValue value, IntValue reuse) throws Exception { if (reuse == null) { reuse = new IntValue(); } reuse.setValue(MathUtils.checkedDownCast(value.getValue())); return reuse; } }
@Override public IntValue translate(LongValue value, IntValue reuse) throws Exception { if (reuse == null) { reuse = new IntValue(); } reuse.setValue(MathUtils.checkedDownCast(value.getValue())); return reuse; } }
public void seek(long position) throws IOException { final int block = MathUtils.checkedDownCast(position / segmentSize); final int positionInBlock = (int) (position % segmentSize); if (position < 0 || block >= numBlocksTotal || (block == numBlocksTotal - 1 && positionInBlock > sizeOfLastBlock)) { throw new IllegalArgumentException("Position is out of range"); } clear(); if (reader != null) { reader.close(); } reader = ioManager.createBlockChannelReader(channelId); if (block > 0) { reader.seekToPosition(((long) block) * segmentSize); } this.numBlocksRemaining = this.numBlocksTotal - block; this.numRequestsRemaining = numBlocksRemaining; for (int i = 0; i < memory.size(); i++) { sendReadRequest(memory.get(i)); } numBlocksRemaining--; seekInput(reader.getNextReturnedBlock(), positionInBlock, numBlocksRemaining == 0 ? sizeOfLastBlock : segmentSize); }
public void seek(long position) throws IOException { final int block = MathUtils.checkedDownCast(position / segmentSize); final int positionInBlock = (int) (position % segmentSize); if (position < 0 || block >= numBlocksTotal || (block == numBlocksTotal - 1 && positionInBlock > sizeOfLastBlock)) { throw new IllegalArgumentException("Position is out of range"); } clear(); if (reader != null) { reader.close(); } reader = ioManager.createBlockChannelReader(channelId); if (block > 0) { reader.seekToPosition(((long) block) * segmentSize); } this.numBlocksRemaining = this.numBlocksTotal - block; this.numRequestsRemaining = numBlocksRemaining; for (int i = 0; i < memory.size(); i++) { sendReadRequest(memory.get(i)); } numBlocksRemaining--; seekInput(reader.getNextReturnedBlock(), positionInBlock, numBlocksRemaining == 0 ? sizeOfLastBlock : segmentSize); }
public void seek(long position) throws IOException { final int block = MathUtils.checkedDownCast(position / segmentSize); final int positionInBlock = (int) (position % segmentSize); if (position < 0 || block >= numBlocksTotal || (block == numBlocksTotal - 1 && positionInBlock > sizeOfLastBlock)) { throw new IllegalArgumentException("Position is out of range"); } clear(); if (reader != null) { reader.close(); } reader = ioManager.createBlockChannelReader(channelId); if (block > 0) { reader.seekToPosition(((long) block) * segmentSize); } this.numBlocksRemaining = this.numBlocksTotal - block; this.numRequestsRemaining = numBlocksRemaining; for (int i = 0; i < memory.size(); i++) { sendReadRequest(memory.get(i)); } numBlocksRemaining--; seekInput(reader.getNextReturnedBlock(), positionInBlock, numBlocksRemaining == 0 ? sizeOfLastBlock : segmentSize); }
public void seek(long position) throws IOException { final int block = MathUtils.checkedDownCast(position / segmentSize); final int positionInBlock = (int) (position % segmentSize); if (position < 0 || block >= numBlocksTotal || (block == numBlocksTotal - 1 && positionInBlock > sizeOfLastBlock)) { throw new IllegalArgumentException("Position is out of range"); } clear(); if (reader != null) { reader.close(); } reader = ioManager.createBlockChannelReader(channelId); if (block > 0) { reader.seekToPosition(((long) block) * segmentSize); } this.numBlocksRemaining = this.numBlocksTotal - block; this.numRequestsRemaining = numBlocksRemaining; for (int i = 0; i < memory.size(); i++) { sendReadRequest(memory.get(i)); } numBlocksRemaining--; seekInput(reader.getNextReturnedBlock(), positionInBlock, numBlocksRemaining == 0 ? sizeOfLastBlock : segmentSize); }
final int segmentSize = memManager.getPageSize(); this.numBlocksRemaining = MathUtils.checkedDownCast(channelLength / segmentSize); if (channelLength % segmentSize != 0) { this.numBlocksRemaining++;
final int segmentSize = memManager.getPageSize(); this.numBlocksRemaining = MathUtils.checkedDownCast(channelLength / segmentSize); if (channelLength % segmentSize != 0) { this.numBlocksRemaining++;
final int segmentSize = memManager.getPageSize(); this.numBlocksRemaining = MathUtils.checkedDownCast(channelLength / segmentSize); if (channelLength % segmentSize != 0) { this.numBlocksRemaining++;
final int segmentSize = memManager.getPageSize(); this.numBlocksRemaining = MathUtils.checkedDownCast(channelLength / segmentSize); if (channelLength % segmentSize != 0) { this.numBlocksRemaining++;
final long channelLength = reader.getSize(); final int blockCount = MathUtils.checkedDownCast(channelLength / segmentSize); this.numBlocksTotal = (channelLength % segmentSize == 0) ? blockCount : blockCount + 1;
final long channelLength = reader.getSize(); final int blockCount = MathUtils.checkedDownCast(channelLength / segmentSize); this.numBlocksTotal = (channelLength % segmentSize == 0) ? blockCount : blockCount + 1;
final long channelLength = reader.getSize(); final int blockCount = MathUtils.checkedDownCast(channelLength / segmentSize); this.numBlocksTotal = (channelLength % segmentSize == 0) ? blockCount : blockCount + 1;
final long channelLength = reader.getSize(); final int blockCount = MathUtils.checkedDownCast(channelLength / segmentSize); this.numBlocksTotal = (channelLength % segmentSize == 0) ? blockCount : blockCount + 1;