Skip to content

Commit a727b4d

Browse files
committed
Fixed a couple of bugs in the RocksDBClient close method
1 parent 3de4d76 commit a727b4d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • extensions/datastores/rocksdb/src/main/java/org/locationtech/geowave/datastore/rocksdb/util

extensions/datastores/rocksdb/src/main/java/org/locationtech/geowave/datastore/rocksdb/util/RocksDBClient.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,15 @@ public void close(final String indexName, final String typeName) {
295295
final String prefix = RocksDBUtils.getTablePrefix(typeName, indexName);
296296
for (final Entry<String, CacheKey> e : keyCache.asMap().entrySet()) {
297297
final String key = e.getKey();
298-
// BUGFIX: This string compare was failing due to a separator in the file path
299-
// It seems like 'contains' is a better choice, but alternately could fix like this:
300-
// if (key.substring(subDirectory.length()+1).startsWith(prefix)) {
301-
if (key.contains(prefix)) {
298+
if (key.substring(subDirectory.length() + 1).startsWith(prefix)) {
302299
keyCache.invalidate(key);
303300
AbstractRocksDBTable indexTable = indexTableCache.getIfPresent(e.getValue());
304301
if (indexTable == null) {
305302
indexTable = dataIndexTableCache.getIfPresent(e.getValue());
306303
}
307304
if (indexTable != null) {
308305
indexTableCache.invalidate(e.getValue());
306+
dataIndexTableCache.invalidate(e.getValue());
309307
indexTable.close();
310308
}
311309
}

0 commit comments

Comments
 (0)