use of org.neo4j.kernel.impl.newapi.TxStateIndexChanges.AddedAndRemoved in project neo4j by neo4j.
the class TxStateIndexChangesTest method assertScanWithOrder.
private void assertScanWithOrder(IndexOrder indexOrder) {
// GIVEN
final ReadableTransactionState state = new TxStateBuilder().withAdded(40L, "Aaron").withAdded(41L, "Agatha").withAdded(42L, "Andreas").withAdded(43L, "Barbarella").withAdded(44L, "Andrea").withAdded(45L, "Aristotle").withAdded(46L, "Barbara").withAdded(47L, "Cinderella").build();
// WHEN
AddedAndRemoved changes = indexUpdatesForScan(state, index, indexOrder);
AddedWithValuesAndRemoved changesWithValues = indexUpdatesWithValuesForScan(state, index, indexOrder);
EntityWithPropertyValues[] expectedEntitiesWithValues = { entityWithPropertyValues(40L, "Aaron"), entityWithPropertyValues(41L, "Agatha"), entityWithPropertyValues(44L, "Andrea"), entityWithPropertyValues(42L, "Andreas"), entityWithPropertyValues(45L, "Aristotle"), entityWithPropertyValues(46L, "Barbara"), entityWithPropertyValues(43L, "Barbarella"), entityWithPropertyValues(47L, "Cinderella") };
// THEN
assertContains(indexOrder, changes, changesWithValues, expectedEntitiesWithValues);
}
use of org.neo4j.kernel.impl.newapi.TxStateIndexChanges.AddedAndRemoved in project neo4j by neo4j.
the class DefaultEntityValueIndexCursor method seekQuery.
private void seekQuery(IndexDescriptor descriptor, Value[] values) {
TransactionState txState = read.txState();
if (needsValues) {
AddedWithValuesAndRemoved changes = indexUpdatesWithValuesForSeek(txState, descriptor, ValueTuple.of(values));
addedWithValues = changes.getAdded().iterator();
removed = removed(txState, changes.getRemoved());
} else {
AddedAndRemoved changes = indexUpdatesForSeek(txState, descriptor, ValueTuple.of(values));
added = changes.getAdded().longIterator();
removed = removed(txState, changes.getRemoved());
}
}
use of org.neo4j.kernel.impl.newapi.TxStateIndexChanges.AddedAndRemoved in project neo4j by neo4j.
the class DefaultEntityValueIndexCursor method suffixOrContainsQuery.
private void suffixOrContainsQuery(IndexDescriptor descriptor, PropertyIndexQuery query) {
TransactionState txState = read.txState();
if (needsValues) {
AddedWithValuesAndRemoved changes = indexUpdatesWithValuesForSuffixOrContains(txState, descriptor, query, indexOrder);
addedWithValues = changes.getAdded().iterator();
removed = removed(txState, changes.getRemoved());
} else {
AddedAndRemoved changes = indexUpdatesForSuffixOrContains(txState, descriptor, query, indexOrder);
added = changes.getAdded().longIterator();
removed = removed(txState, changes.getRemoved());
}
}
use of org.neo4j.kernel.impl.newapi.TxStateIndexChanges.AddedAndRemoved in project neo4j by neo4j.
the class DefaultEntityValueIndexCursor method rangeQuery.
private void rangeQuery(IndexDescriptor descriptor, Value[] equalityPrefix, PropertyIndexQuery.RangePredicate<?> predicate) {
TransactionState txState = read.txState();
if (needsValues) {
AddedWithValuesAndRemoved changes = indexUpdatesWithValuesForRangeSeek(txState, descriptor, equalityPrefix, predicate, indexOrder);
addedWithValues = changes.getAdded().iterator();
removed = removed(txState, changes.getRemoved());
} else {
AddedAndRemoved changes = indexUpdatesForRangeSeek(txState, descriptor, equalityPrefix, predicate, indexOrder);
added = changes.getAdded().longIterator();
removed = removed(txState, changes.getRemoved());
}
}
use of org.neo4j.kernel.impl.newapi.TxStateIndexChanges.AddedAndRemoved in project neo4j by neo4j.
the class DefaultEntityValueIndexCursor method scanQuery.
private void scanQuery(IndexDescriptor descriptor) {
TransactionState txState = read.txState();
if (needsValues) {
AddedWithValuesAndRemoved changes = indexUpdatesWithValuesForScan(txState, descriptor, indexOrder);
addedWithValues = changes.getAdded().iterator();
removed = removed(txState, changes.getRemoved());
} else {
AddedAndRemoved changes = indexUpdatesForScan(txState, descriptor, indexOrder);
added = changes.getAdded().longIterator();
removed = removed(txState, changes.getRemoved());
}
}
Aggregations