Search in sources :

Example 11 with MutableList

use of org.eclipse.collections.api.list.MutableList in project neo4j by neo4j.

the class TxStateIndexChanges method indexUpdatesWithValuesForSeek.

static AddedWithValuesAndRemoved indexUpdatesWithValuesForSeek(ReadableTransactionState txState, IndexDescriptor descriptor, ValueTuple values) {
    UnmodifiableMap<ValueTuple, ? extends LongDiffSets> updates = txState.getIndexUpdates(descriptor.schema());
    if (updates != null) {
        LongDiffSets indexUpdatesForSeek = updates.get(values);
        if (indexUpdatesForSeek == null) {
            return EMPTY_ADDED_AND_REMOVED_WITH_VALUES;
        }
        Value[] valueArray = values.getValues();
        MutableList<EntityWithPropertyValues> added = Lists.mutable.empty();
        indexUpdatesForSeek.getAdded().forEach((LongProcedure) l -> added.add(new EntityWithPropertyValues(l, valueArray)));
        return new AddedWithValuesAndRemoved(added, indexUpdatesForSeek.getRemoved());
    }
    return EMPTY_ADDED_AND_REMOVED_WITH_VALUES;
}
Also used : IndexOrder(org.neo4j.internal.schema.IndexOrder) NO_VALUE(org.neo4j.values.storable.Values.NO_VALUE) LongDiffSets(org.neo4j.storageengine.api.txstate.LongDiffSets) ReadableTransactionState(org.neo4j.storageengine.api.txstate.ReadableTransactionState) ValueTuple(org.neo4j.values.storable.ValueTuple) LongLists(org.eclipse.collections.impl.factory.primitive.LongLists) Value(org.neo4j.values.storable.Value) TextValue(org.neo4j.values.storable.TextValue) MutableLongList(org.eclipse.collections.api.list.primitive.MutableLongList) NavigableMap(java.util.NavigableMap) MutableList(org.eclipse.collections.api.list.MutableList) Values(org.neo4j.values.storable.Values) MutableLongSet(org.eclipse.collections.api.set.primitive.MutableLongSet) LongProcedure(org.eclipse.collections.api.block.procedure.primitive.LongProcedure) Lists(org.eclipse.collections.impl.factory.Lists) Map(java.util.Map) LongIterable(org.eclipse.collections.api.LongIterable) LongSets(org.eclipse.collections.impl.factory.primitive.LongSets) PropertyIndexQuery(org.neo4j.internal.kernel.api.PropertyIndexQuery) IndexDescriptor(org.neo4j.internal.schema.IndexDescriptor) ValueGroup(org.neo4j.values.storable.ValueGroup) LongSet(org.eclipse.collections.api.set.primitive.LongSet) Collections(java.util.Collections) UnmodifiableMap(org.eclipse.collections.impl.UnmodifiableMap) ValueTuple(org.neo4j.values.storable.ValueTuple) Value(org.neo4j.values.storable.Value) TextValue(org.neo4j.values.storable.TextValue) LongDiffSets(org.neo4j.storageengine.api.txstate.LongDiffSets)

Aggregations

MutableList (org.eclipse.collections.api.list.MutableList)11 Predicates (org.eclipse.collections.impl.block.factory.Predicates)8 Lists (org.eclipse.collections.impl.factory.Lists)8 Interval (org.eclipse.collections.impl.list.Interval)8 Verify (org.eclipse.collections.impl.test.Verify)8 Assert (org.junit.Assert)8 Test (org.junit.Test)8 Function (org.eclipse.collections.api.block.function.Function)7 Collections (java.util.Collections)6 RichIterable (org.eclipse.collections.api.RichIterable)6 Procedures (org.eclipse.collections.impl.block.factory.Procedures)6 Arrays (java.util.Arrays)5 List (java.util.List)5 NoSuchElementException (java.util.NoSuchElementException)5 ExecutorService (java.util.concurrent.ExecutorService)5 LazyIterable (org.eclipse.collections.api.LazyIterable)5 Predicates2 (org.eclipse.collections.impl.block.factory.Predicates2)5 CollectionAddProcedure (org.eclipse.collections.impl.block.procedure.CollectionAddProcedure)5 ArrayList (java.util.ArrayList)4 Executors (java.util.concurrent.Executors)4