Skip to content

Commit 890ef05

Browse files
committed
performance tweaks for rocksdb
1 parent 175b5e1 commit 890ef05

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

core/store/src/main/java/org/locationtech/geowave/core/store/metadata/InternalAdapterStoreImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private String internalGetTypeName(final short adapterId, final boolean warnIfNo
104104
return null;
105105
}
106106
typeName = StringUtils.stringFromBinary(it.next().getValue());
107-
cache.put(typeName, adapterId);
107+
cache.putIfAbsent(typeName, adapterId);
108108
return typeName;
109109
}
110110
}
@@ -143,7 +143,7 @@ public Short internalGetAdapterId(final String typeName, final boolean warnIfNot
143143
return null;
144144
}
145145
final short adapterId = ByteArrayUtils.byteArrayToShort(it.next().getValue());
146-
cache.put(typeName, adapterId);
146+
cache.putIfAbsent(typeName, adapterId);
147147
return adapterId;
148148
}
149149
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public synchronized void add(final byte[] dataId, final GeoWaveValue value) {
5353
put(dataId, DataIndexUtils.serializeDataIndexValue(value, visibilityEnabled));
5454
}
5555

56-
public synchronized CloseableIterator<GeoWaveRow> dataIndexIterator(final byte[][] dataIds) {
56+
public CloseableIterator<GeoWaveRow> dataIndexIterator(final byte[][] dataIds) {
5757
final RocksDB readDb = getReadDb();
5858
if (readDb == null) {
5959
return new CloseableIterator.Empty<>();
@@ -74,7 +74,7 @@ public synchronized CloseableIterator<GeoWaveRow> dataIndexIterator(final byte[]
7474
return new CloseableIterator.Empty<>();
7575
}
7676

77-
public synchronized CloseableIterator<GeoWaveRow> dataIndexIterator(
77+
public CloseableIterator<GeoWaveRow> dataIndexIterator(
7878
final byte[] startDataId,
7979
final byte[] endDataId) {
8080
final RocksDB readDb = getReadDb();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public synchronized void add(
9292
}
9393

9494

95-
public synchronized CloseableIterator<GeoWaveRow> iterator() {
95+
public CloseableIterator<GeoWaveRow> iterator() {
9696
final RocksDB readDb = getReadDb();
9797
if (readDb == null) {
9898
return new CloseableIterator.Empty<>();
@@ -109,7 +109,7 @@ public synchronized CloseableIterator<GeoWaveRow> iterator() {
109109
visibilityEnabled);
110110
}
111111

112-
public synchronized CloseableIterator<GeoWaveRow> iterator(final ByteArrayRange range) {
112+
public CloseableIterator<GeoWaveRow> iterator(final ByteArrayRange range) {
113113
final RocksDB readDb = getReadDb();
114114
if (readDb == null) {
115115
return new CloseableIterator.Empty<>();

0 commit comments

Comments
 (0)