Skip to content

Commit 3efb645

Browse files
committed
Removed some synchronized
Signed-off-by: Prabhu Subramanian <[email protected]>
1 parent b6ce831 commit 3efb645

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "overflowdb2"
22
ThisBuild / organization := "io.appthreat"
3-
ThisBuild / version := "1.0.2"
3+
ThisBuild / version := "2.0.0"
44
ThisBuild / scalaVersion := "3.6.4"
55
publish / skip := true
66

core/src/main/java/overflowdb/NodeDb.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public Map<String, Object> propertiesMapForStorage() {
111111

112112
for (String propertyKey : propertyKeys()) {
113113
final Object value = property(propertyKey);
114-
/** note: not differentiating `null` and `default value` is a bug - we won't fix it for now, but want to state that as a fact here... */
114+
/* note: not differentiating `null` and `default value` is a bug - we won't fix it for now, but want to state that as a fact here... */
115115
if (value != null && !value.equals(propertyDefaultValue(propertyKey))) results.put(propertyKey, value);
116116
}
117117

@@ -595,7 +595,7 @@ public final <A extends Node> Iterator<A> createAdjacentNodeIteratorByOffSet(int
595595

596596
/* Simplify hoisting of string lookups.
597597
* n.b. `final` so that the JIT compiler can inline it */
598-
public final <A extends Node> scala.collection.Iterator<? extends Object> createAdjacentNodeScalaIteratorByOffSet(int offsetPos) {
598+
public final <A extends Node> scala.collection.Iterator<?> createAdjacentNodeScalaIteratorByOffSet(int offsetPos) {
599599
AdjacentNodes adjacentNodesTmp = this.adjacentNodes;
600600
if (offsetPos != -1) {
601601
int start = startIndex(adjacentNodesTmp, offsetPos);

core/src/main/java/overflowdb/NodeRef.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public final N get() {
9393
}
9494

9595
/** deserialize node from disk, synchronized to ensure this only happens once in a multi-threaded setup */
96-
private final synchronized N getSynchronized() throws IOException {
96+
private synchronized N getSynchronized() throws IOException {
9797
final N ref = node;
9898
/* checking again, in case another thread came here first and deserialized the node from disk */
9999
if (ref != null) {

core/src/main/java/overflowdb/storage/OdbStorage.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,21 @@ public Set<Map.Entry<Long, byte[]>> allNodes() {
135135
return getNodesMVMap().entrySet();
136136
}
137137

138-
public synchronized MVMap<Long, byte[]> getNodesMVMap() {
138+
public MVMap<Long, byte[]> getNodesMVMap() {
139139
ensureMVStoreAvailable();
140140
if (nodesMVMap == null)
141141
nodesMVMap = mvstore.openMap("nodes");
142142
return nodesMVMap;
143143
}
144144

145-
public synchronized MVMap<String, String> getMetaDataMVMap() {
145+
public MVMap<String, String> getMetaDataMVMap() {
146146
ensureMVStoreAvailable();
147147
if (metadataMVMap == null)
148148
metadataMVMap = mvstore.openMap("metadata");
149149
return metadataMVMap;
150150
}
151151

152-
public synchronized MVMap<String, Integer> getStringToIntMappings() {
152+
public MVMap<String, Integer> getStringToIntMappings() {
153153
ensureMVStoreAvailable();
154154
if (stringToIntMappings == null)
155155
stringToIntMappings = mvstore.openMap("stringToIntMappings");
@@ -209,7 +209,7 @@ private void ensureMVStoreAvailable() {
209209

210210
private MVStore initializeMVStore() {
211211
MVStore.Builder builder = new MVStore.Builder()
212-
.autoCommitBufferSize(1024 * 8)
212+
.autoCommitBufferSize(1024 * 64)
213213
.compress()
214214
.autoCommitDisabled();
215215

core/src/main/java/overflowdb/util/NodesList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public int cardinality(String label) {
223223
return 0;
224224
}
225225

226-
public synchronized void persistAll(NodesWriter nodesWriter) {
226+
public void persistAll(NodesWriter nodesWriter) {
227227
nodesWriter.writeAndClearBatched(Arrays.spliterator(nodes), nodes.length);
228228
}
229229

traversal/src/main/scala/overflowdb/algorithm/DependencySequencer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ object DependencySequencer:
2626
accumulator: Seq[Set[A]],
2727
visited: Set[A]
2828
): Seq[Set[A]] =
29-
if nodes.size == 0 then
29+
if nodes.isEmpty then
3030
accumulator
3131
else
3232
val getParents = implicitly[GetParents[A]]

0 commit comments

Comments
 (0)