Skip to content

Commit

Permalink
Use primitive long diff sets
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Koval committed May 16, 2018
1 parent 783eebb commit b34b9dc
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -25,7 +25,8 @@


import org.neo4j.kernel.api.index.IndexEntryUpdate; import org.neo4j.kernel.api.index.IndexEntryUpdate;
import org.neo4j.kernel.api.index.IndexUpdater; import org.neo4j.kernel.api.index.IndexUpdater;
import org.neo4j.kernel.impl.util.diffsets.DiffSets; import org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSets;
import org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSetsImpl;


/** /**
* This IndexUpdater ensures that updated properties abide by uniqueness constraints. Updates are grouped up in * This IndexUpdater ensures that updated properties abide by uniqueness constraints. Updates are grouped up in
Expand All @@ -34,7 +35,7 @@
*/ */
public abstract class UniquePropertyIndexUpdater implements IndexUpdater public abstract class UniquePropertyIndexUpdater implements IndexUpdater
{ {
private final Map<Object, DiffSets<Long>> referenceCount = new HashMap<>(); private final Map<Object, MutableLongDiffSets> referenceCount = new HashMap<>();
private final ArrayList<IndexEntryUpdate<?>> updates = new ArrayList<>(); private final ArrayList<IndexEntryUpdate<?>> updates = new ArrayList<>();


@Override @Override
Expand Down Expand Up @@ -70,8 +71,8 @@ public void close()


protected abstract void flushUpdates( Iterable<IndexEntryUpdate<?>> updates ); protected abstract void flushUpdates( Iterable<IndexEntryUpdate<?>> updates );


private DiffSets<Long> propertyValueDiffSet( Object value ) private MutableLongDiffSets propertyValueDiffSet( Object value )
{ {
return referenceCount.computeIfAbsent( value, k -> new DiffSets<>() ); return referenceCount.computeIfAbsent( value, k -> new MutableLongDiffSetsImpl() );
} }
} }

0 comments on commit b34b9dc

Please sign in to comment.