Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ public void dispose() {

cleanInstanceBasePath();
}
IOUtils.closeQuietly(checkpointSnapshotStrategy);
this.disposed = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public RocksDBKeyedStateBackend<K> build() throws BackendBuildingException {
new RocksDbTtlCompactFiltersManager(ttlTimeProvider);

ResourceGuard rocksDBResourceGuard = new ResourceGuard();
RocksDBSnapshotStrategyBase<K, ?> checkpointStrategy;
RocksDBSnapshotStrategyBase<K, ?> checkpointStrategy = null;
PriorityQueueSetFactory priorityQueueFactory;
SerializedCompositeKeyBuilder<K> sharedRocksKeyBuilder;
// Number of bytes required to prefix the key groups.
Expand Down Expand Up @@ -363,6 +363,7 @@ public RocksDBKeyedStateBackend<K> build() throws BackendBuildingException {
IOUtils.closeQuietly(optionsContainer);
ttlCompactFiltersManager.disposeAndClearRegisteredCompactionFactories();
kvStateInformation.clear();
IOUtils.closeQuietly(checkpointStrategy);
try {
FileUtils.deleteDirectory(instanceBasePath);
} catch (Exception ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @param <K> type of the backend keys.
*/
public abstract class RocksDBSnapshotStrategyBase<K, R extends SnapshotResources>
implements CheckpointListener, SnapshotStrategy<KeyedStateHandle, R> {
implements CheckpointListener, SnapshotStrategy<KeyedStateHandle, R>, AutoCloseable {

private static final Logger LOG = LoggerFactory.getLogger(RocksDBSnapshotStrategyBase.class);

Expand Down Expand Up @@ -92,4 +92,7 @@ public RocksDBSnapshotStrategyBase(
public String getDescription() {
return description;
}

@Override
public abstract void close();
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ public void notifyCheckpointAborted(long checkpointId) {
// nothing to do.
}

@Override
public void close() {
// nothing to do.
}

private SupplierWithException<CheckpointStreamWithResultProvider, Exception>
createCheckpointStreamSupplier(
long checkpointId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ public void notifyCheckpointAborted(long abortedCheckpointId) {
}
}

@Override
public void close() {
stateUploader.close();
}

@Nonnull
private SnapshotDirectory prepareLocalSnapshotDirectory(long checkpointId) throws IOException {

Expand Down