use of org.neo4j.storageengine.api.schema.SimpleEntityTokenClient in project neo4j by neo4j.
the class DefaultTokenIndexReaderTest method shouldFindMultipleWithProgressorAscending.
@Test
void shouldFindMultipleWithProgressorAscending() {
// WHEN
var reader = new DefaultTokenIndexReader(index);
SimpleEntityTokenClient tokenClient = new SimpleEntityTokenClient();
reader.query(tokenClient, IndexQueryConstraints.constrained(IndexOrder.ASCENDING, false), new TokenPredicate(LABEL_ID), NULL);
// THEN
assertArrayEquals(expected, asArray(tokenClient));
}
use of org.neo4j.storageengine.api.schema.SimpleEntityTokenClient in project neo4j by neo4j.
the class RelationshipTypeIndexIT method assertContainIds.
private void assertContainIds(List<Long> expectedIds) throws IndexNotFoundKernelException {
int relationshipTypeId = getRelationshipTypeId();
IndexProxy indexProxy = getIndexProxy();
List<Long> actualIds = new ArrayList<>();
try (TokenIndexReader reader = indexProxy.newTokenReader()) {
SimpleEntityTokenClient tokenClient = new SimpleEntityTokenClient();
reader.query(tokenClient, unconstrained(), new TokenPredicate(relationshipTypeId), CursorContext.NULL);
while (tokenClient.next()) {
actualIds.add(tokenClient.reference);
}
}
expectedIds.sort(Long::compareTo);
actualIds.sort(Long::compareTo);
assertThat(actualIds).as("contains expected relationships").isEqualTo(expectedIds);
}
use of org.neo4j.storageengine.api.schema.SimpleEntityTokenClient in project neo4j by neo4j.
the class BatchInsertTokenIndexesTest method assertTokenIndexContains.
private void assertTokenIndexContains(TokenIndexReader reader, int tokenId, Long... intityIds) {
SimpleEntityTokenClient tokenClient = new SimpleEntityTokenClient();
reader.query(tokenClient, unconstrained(), new TokenPredicate(tokenId), CursorContext.NULL);
var found = new ArrayList<Long>();
while (tokenClient.next()) {
found.add(tokenClient.reference);
}
assertThat(found).containsExactlyInAnyOrder(intityIds);
}
use of org.neo4j.storageengine.api.schema.SimpleEntityTokenClient in project neo4j by neo4j.
the class DefaultTokenIndexReaderTest method shouldFindMultipleEntitiesInEachRange.
@Test
void shouldFindMultipleEntitiesInEachRange() {
// WHEN
var reader = new DefaultTokenIndexReader(index);
SimpleEntityTokenClient tokenClient = new SimpleEntityTokenClient();
reader.query(tokenClient, unconstrained(), new TokenPredicate(LABEL_ID), NULL);
// THEN
assertArrayEquals(expected, asArray(tokenClient));
}
use of org.neo4j.storageengine.api.schema.SimpleEntityTokenClient in project neo4j by neo4j.
the class DefaultTokenIndexReaderTest method shouldFindMultipleWithProgressorDescending.
@Test
void shouldFindMultipleWithProgressorDescending() {
// WHEN
var reader = new DefaultTokenIndexReader(index);
SimpleEntityTokenClient tokenClient = new SimpleEntityTokenClient();
reader.query(tokenClient, IndexQueryConstraints.constrained(IndexOrder.DESCENDING, false), new TokenPredicate(LABEL_ID), NULL);
// THEN
ArrayUtils.reverse(expected);
assertArrayEquals(expected, asArray(tokenClient));
}
Aggregations