protected void openCurrentStream() throws IOException { Preconditions.checkState(currentStream == null); FSDataInputStream stream = currentStateHandle.openInputStream(); closableRegistry.registerCloseable(stream); currentStream = stream; }
backendCloseableRegistry.registerCloseable(backendInstance);
streamTaskCloseableRegistry.registerCloseable(rawKeyedStateInputs); streamTaskCloseableRegistry.registerCloseable(rawOperatorStateInputs);
/** * Restore one key groups state handle. */ private void restoreKeyGroupsInStateHandle() throws IOException, StateMigrationException, RocksDBException { try { currentStateHandleInStream = currentKeyGroupsStateHandle.openInputStream(); rocksDBKeyedStateBackend.cancelStreamRegistry.registerCloseable(currentStateHandleInStream); currentStateHandleInView = new DataInputViewStreamWrapper(currentStateHandleInStream); restoreKVStateMetaData(); restoreKVStateData(); } finally { if (rocksDBKeyedStateBackend.cancelStreamRegistry.unregisterCloseable(currentStateHandleInStream)) { IOUtils.closeQuietly(currentStateHandleInStream); } } }
FileSystem restoreFileSystem = restoreFilePath.getFileSystem(); inputStream = remoteFileHandle.openInputStream(); closeableRegistry.registerCloseable(inputStream); closeableRegistry.registerCloseable(outputStream);
closeableRegistry.registerCloseable(inputStream); closeableRegistry.registerCloseable(outputStream);
@Override protected void run() throws Exception { final OneShotLatch latch = new OneShotLatch(); final Object lock = new Object(); LockHolder holder = new LockHolder(lock, latch); holder.start(); try { // cancellation should try and cancel this getCancelables().registerCloseable(holder); // wait till the lock holder has the lock latch.await(); // we are at the point where cancelling can happen syncLatch.trigger(); // try to acquire the lock - this is not possible as long as the lock holder // thread lives //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (lock) { // nothing } } finally { holder.close(); } }
stateBackend.cancelStreamRegistry.registerCloseable(inputStream);
eq(CheckpointOptions.forCheckpointWithDefaultLocation()))).thenThrow(failingException); closeableRegistry.registerCloseable(operatorStateBackend); closeableRegistry.registerCloseable(keyedStateBackend);
/** * Registers the {@link Closeable} with the snapshot's {@link CloseableRegistry}, so that it will be closed on * {@link #cancel()} and becomes unblocked. If the registry is already closed, the arguments is closed and an * {@link IOException} is emitted. */ protected void registerCloseableForCancellation(@Nullable Closeable toRegister) throws IOException { snapshotCloseableRegistry.registerCloseable(toRegister); }
/** * Registers the {@link Closeable} with the snapshot's {@link CloseableRegistry}, so that it will be closed on * {@link #cancel()} and becomes unblocked. If the registry is already closed, the arguments is closed and an * {@link IOException} is emitted. */ protected void registerCloseableForCancellation(@Nullable Closeable toRegister) throws IOException { snapshotCloseableRegistry.registerCloseable(toRegister); }
@Override protected void acquireResources() throws Exception { streamAndResultExtractor = checkpointStreamSupplier.get(); cancelStreamRegistry.registerCloseable(streamAndResultExtractor); }
private CheckpointStreamFactory.CheckpointStateOutputStream openAndRegisterNewStream() throws Exception { CheckpointStreamFactory.CheckpointStateOutputStream cout = streamFactory.createCheckpointStateOutputStream(CheckpointedStateScope.EXCLUSIVE); closableRegistry.registerCloseable(cout); return cout; }
private CheckpointStreamFactory.CheckpointStateOutputStream openAndRegisterNewStream() throws Exception { CheckpointStreamFactory.CheckpointStateOutputStream cout = streamFactory.createCheckpointStateOutputStream(checkpointId, CheckpointedStateScope.EXCLUSIVE); closableRegistry.registerCloseable(cout); return cout; }
private CheckpointStreamFactory.CheckpointStateOutputStream openAndRegisterNewStream() throws Exception { CheckpointStreamFactory.CheckpointStateOutputStream cout = streamFactory.createCheckpointStateOutputStream(CheckpointedStateScope.EXCLUSIVE); closableRegistry.registerCloseable(cout); return cout; }
private void openOutStream() throws Exception { out = streamFactory.createCheckpointStateOutputStream(checkpointId, CheckpointedStateScope.EXCLUSIVE); closeStreamOnCancelRegistry.registerCloseable(out); }
protected void openCurrentStream() throws IOException { Preconditions.checkState(currentStream == null); FSDataInputStream stream = currentStateHandle.openInputStream(); closableRegistry.registerCloseable(stream); currentStream = stream; }
protected void openCurrentStream() throws IOException { Preconditions.checkState(currentStream == null); FSDataInputStream stream = currentStateHandle.openInputStream(); closableRegistry.registerCloseable(stream); currentStream = stream; }
/** * Restore one key groups state handle. */ private void restoreKeyGroupsInStateHandle() throws IOException, StateMigrationException, RocksDBException { try { currentStateHandleInStream = currentKeyGroupsStateHandle.openInputStream(); rocksDBKeyedStateBackend.cancelStreamRegistry.registerCloseable(currentStateHandleInStream); currentStateHandleInView = new DataInputViewStreamWrapper(currentStateHandleInStream); restoreKVStateMetaData(); restoreKVStateData(); } finally { if (rocksDBKeyedStateBackend.cancelStreamRegistry.unregisterCloseable(currentStateHandleInStream)) { IOUtils.closeQuietly(currentStateHandleInStream); } } }
/** * Restore one key groups state handle. */ private void restoreKeyGroupsInStateHandle() throws IOException, StateMigrationException, RocksDBException { try { currentStateHandleInStream = currentKeyGroupsStateHandle.openInputStream(); rocksDBKeyedStateBackend.cancelStreamRegistry.registerCloseable(currentStateHandleInStream); currentStateHandleInView = new DataInputViewStreamWrapper(currentStateHandleInStream); restoreKVStateMetaData(); restoreKVStateData(); } finally { if (rocksDBKeyedStateBackend.cancelStreamRegistry.unregisterCloseable(currentStateHandleInStream)) { IOUtils.closeQuietly(currentStateHandleInStream); } } }