Skip to content

Commit

Permalink
Added storage destroy to release HD resources.
Browse files Browse the repository at this point in the history
To release key+value pairs storage#clear should be called,
storage#destroy only releases internal resources of backing
data structure
  • Loading branch information
ahmetmircik committed Aug 29, 2018
1 parent 8550196 commit 88abbb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -316,7 +316,7 @@ public void clearMapsHavingLesserBackupCountThan(int partitionId, int backupCoun
RecordStore recordStore = iter.next();
final MapContainer mapContainer = recordStore.getMapContainer();
if (backupCount > mapContainer.getTotalBackupCount()) {
recordStore.clearPartition(false, false);
recordStore.clearPartition(false, true);
iter.remove();
}
}
Expand All @@ -328,7 +328,7 @@ public void clearPartitionData(int partitionId) {
final PartitionContainer container = partitionContainers[partitionId];
if (container != null) {
for (RecordStore mapPartition : container.getMaps().values()) {
mapPartition.clearPartition(false, false);
mapPartition.clearPartition(false, true);
}
container.getMaps().clear();
}
Expand Down
Expand Up @@ -231,6 +231,10 @@ public void clearPartition(boolean onShutdown, boolean onRecordStoreDestroy) {
}
clearMapStore();
clearStorage(onShutdown);

if (!onShutdown && onRecordStoreDestroy) {
storage.destroy(false);
}
}

protected void clearLockStore() {
Expand Down

0 comments on commit 88abbb7

Please sign in to comment.