static void truncate(FileSystem hadoopFs, Path file, long length) throws IOException { if (truncateHandle != null) { try { truncateHandle.invoke(hadoopFs, file, length); } catch (InvocationTargetException e) { ExceptionUtils.rethrowIOException(e.getTargetException()); } catch (Throwable t) { throw new IOException( "Truncation of file failed because of access/linking problems with Hadoop's truncate call. " + "This is most likely a dependency conflict or class loading problem."); } } else { throw new IllegalStateException("Truncation handle has not been initialized"); } }
static void truncate(FileSystem hadoopFs, Path file, long length) throws IOException { if (truncateHandle != null) { try { truncateHandle.invoke(hadoopFs, file, length); } catch (InvocationTargetException e) { ExceptionUtils.rethrowIOException(e.getTargetException()); } catch (Throwable t) { throw new IOException( "Truncation of file failed because of access/linking problems with Hadoop's truncate call. " + "This is most likely a dependency conflict or class loading problem."); } } else { throw new IllegalStateException("Truncation handle has not been initialized"); } }
t.addSuppressed(inner); ExceptionUtils.rethrowIOException(t); e.addSuppressed(inner); ExceptionUtils.rethrowIOException(e);
/** * Writes the given block asynchronously. * * @param buffer * the buffer to be written (will be recycled when done) * * @throws IOException * thrown if adding the write operation fails */ @Override public void writeBlock(Buffer buffer) throws IOException { try { // if successfully added, the buffer will be recycled after the write operation addRequest(new BufferWriteRequest(this, buffer)); } catch (Throwable e) { // if not added, we need to recycle here buffer.recycleBuffer(); ExceptionUtils.rethrowIOException(e); } }
/** * Writes the given block asynchronously. * * @param buffer * the buffer to be written (will be recycled when done) * * @throws IOException * thrown if adding the write operation fails */ @Override public void writeBlock(Buffer buffer) throws IOException { try { // if successfully added, the buffer will be recycled after the write operation addRequest(new BufferWriteRequest(this, buffer)); } catch (Throwable e) { // if not added, we need to recycle here buffer.recycleBuffer(); ExceptionUtils.rethrowIOException(e); } }
e.addSuppressed(inner); ExceptionUtils.rethrowIOException(e);
e.addSuppressed(inner); ExceptionUtils.rethrowIOException(e);
/** * Writes the given block asynchronously. * * @param buffer * the buffer to be written (will be recycled when done) * * @throws IOException * thrown if adding the write operation fails */ @Override public void writeBlock(Buffer buffer) throws IOException { try { // if successfully added, the buffer will be recycled after the write operation if (withHeader) { addRequest(new BufferWriteRequest(this, buffer, bufferSize)); } else { addRequest(new StreamWriteRequest(this, buffer, bufferSize)); } } catch (Throwable e) { // if not added, we need to recycle here buffer.recycleBuffer(); ExceptionUtils.rethrowIOException(e); } }
ExceptionUtils.rethrowIOException(t); return null; // silence the compiler
ExceptionUtils.rethrowIOException(t); return null; // silence the compiler
ExceptionUtils.rethrowIOException(exception);
ExceptionUtils.rethrowIOException(exception);
ExceptionUtils.rethrowIOException(t);
ExceptionUtils.rethrowIOException(exception);
ExceptionUtils.rethrowIOException(t); return null; // silence the compiler
@VisibleForTesting public void setupInputGate(SingleInputGate gate) throws IOException { BufferPool bufferPool = null; int maxNumberOfMemorySegments; try { if (enableCreditBased) { maxNumberOfMemorySegments = gate.getConsumedPartitionType().isBounded() ? extraNetworkBuffersPerGate : Integer.MAX_VALUE; // assign exclusive buffers to input channels directly and use the rest for floating buffers gate.assignExclusiveSegments(networkBufferPool, networkBuffersPerChannel); bufferPool = networkBufferPool.createBufferPool(0, maxNumberOfMemorySegments); } else { maxNumberOfMemorySegments = gate.getConsumedPartitionType().isBounded() ? gate.getNumberOfInputChannels() * networkBuffersPerChannel + extraNetworkBuffersPerGate : Integer.MAX_VALUE; bufferPool = networkBufferPool.createBufferPool(gate.getNumberOfInputChannels(), maxNumberOfMemorySegments); } gate.setBufferPool(bufferPool); } catch (Throwable t) { if (bufferPool != null) { bufferPool.lazyDestroy(); } ExceptionUtils.rethrowIOException(t); } }
@VisibleForTesting public void setupInputGate(SingleInputGate gate) throws IOException { BufferPool bufferPool = null; int maxNumberOfMemorySegments; try { if (enableCreditBased) { maxNumberOfMemorySegments = gate.getConsumedPartitionType().isBounded() ? extraNetworkBuffersPerGate : Integer.MAX_VALUE; // assign exclusive buffers to input channels directly and use the rest for floating buffers gate.assignExclusiveSegments(networkBufferPool, networkBuffersPerChannel); bufferPool = networkBufferPool.createBufferPool(0, maxNumberOfMemorySegments); } else { maxNumberOfMemorySegments = gate.getConsumedPartitionType().isBounded() ? gate.getNumberOfInputChannels() * networkBuffersPerChannel + extraNetworkBuffersPerGate : Integer.MAX_VALUE; bufferPool = networkBufferPool.createBufferPool(gate.getNumberOfInputChannels(), maxNumberOfMemorySegments); } gate.setBufferPool(bufferPool); } catch (Throwable t) { if (bufferPool != null) { bufferPool.lazyDestroy(); } ExceptionUtils.rethrowIOException(t); } }
ExceptionUtils.rethrowIOException(t); return null; // silence the compiler
ExceptionUtils.rethrowIOException(t); return null; // silence the compiler
ExceptionUtils.rethrowIOException(t); return null; // silence the compiler