Search in sources :

Example 1 with MutableLongDiffSets

use of org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSets in project neo4j by neo4j.

the class TxStateTest method getOrCreateTypeStateRelationshipDiffSets_useCollectionsFactory.

@Test
void getOrCreateTypeStateRelationshipDiffSets_useCollectionsFactory() {
    final MutableLongDiffSets diffSets = state.getOrCreateTypeStateRelationshipDiffSets(1);
    diffSets.add(1);
    diffSets.remove(2);
    verify(collectionsFactory, times(2)).newLongSet(memoryTracker);
    verifyNoMoreInteractions(collectionsFactory);
}
Also used : MutableLongDiffSets(org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSets) RepeatedTest(org.junit.jupiter.api.RepeatedTest) Test(org.junit.jupiter.api.Test)

Example 2 with MutableLongDiffSets

use of org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSets in project neo4j by neo4j.

the class TxStateTest method getOrCreateLabelStateNodeDiffSets_useCollectionsFactory.

@Test
void getOrCreateLabelStateNodeDiffSets_useCollectionsFactory() {
    final MutableLongDiffSets diffSets = state.getOrCreateLabelStateNodeDiffSets(1);
    diffSets.add(1);
    diffSets.remove(2);
    verify(collectionsFactory, times(2)).newLongSet(memoryTracker);
    verifyNoMoreInteractions(collectionsFactory);
}
Also used : MutableLongDiffSets(org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSets) RepeatedTest(org.junit.jupiter.api.RepeatedTest) Test(org.junit.jupiter.api.Test)

Example 3 with MutableLongDiffSets

use of org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSets in project neo4j by neo4j.

the class TxStateTest method getOrCreateIndexUpdatesForSeek_useCollectionsFactory.

@Test
void getOrCreateIndexUpdatesForSeek_useCollectionsFactory() {
    final MutableLongDiffSets diffSets = state.getOrCreateIndexUpdatesForSeek(new HashMap<>(), ValueTuple.of(stringValue("test")));
    diffSets.add(1);
    diffSets.remove(2);
    verify(collectionsFactory, times(2)).newLongSet(memoryTracker);
    verifyNoMoreInteractions(collectionsFactory);
}
Also used : MutableLongDiffSets(org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSets) RepeatedTest(org.junit.jupiter.api.RepeatedTest) Test(org.junit.jupiter.api.Test)

Example 4 with MutableLongDiffSets

use of org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSets in project neo4j by neo4j.

the class TxState method indexDoUpdateEntry.

@Override
public void indexDoUpdateEntry(SchemaDescriptor descriptor, long entityIdId, ValueTuple propertiesBefore, ValueTuple propertiesAfter) {
    Map<ValueTuple, MutableLongDiffSets> updates = getOrCreateIndexUpdatesByDescriptor(descriptor);
    if (propertiesBefore != null) {
        MutableLongDiffSets before = getOrCreateIndexUpdatesForSeek(updates, propertiesBefore);
        before.remove(entityIdId);
    }
    if (propertiesAfter != null) {
        MutableLongDiffSets after = getOrCreateIndexUpdatesForSeek(updates, propertiesAfter);
        after.add(entityIdId);
    }
}
Also used : TrackableDiffSets.newMutableLongDiffSets(org.neo4j.kernel.impl.util.diffsets.TrackableDiffSets.newMutableLongDiffSets) MutableLongDiffSets(org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSets) ValueTuple(org.neo4j.values.storable.ValueTuple)

Aggregations

MutableLongDiffSets (org.neo4j.kernel.impl.util.diffsets.MutableLongDiffSets)4 RepeatedTest (org.junit.jupiter.api.RepeatedTest)3 Test (org.junit.jupiter.api.Test)3 TrackableDiffSets.newMutableLongDiffSets (org.neo4j.kernel.impl.util.diffsets.TrackableDiffSets.newMutableLongDiffSets)1 ValueTuple (org.neo4j.values.storable.ValueTuple)1