use of org.neo4j.kernel.impl.index.schema.EntityTokenRangeImpl in project neo4j by neo4j.
the class TokenScanDocumentTest method shouldAdaptToStringToTypeOfRangeNode.
@Test
void shouldAdaptToStringToTypeOfRangeNode() {
TokenScanDocument labelScanDocument = new TokenScanDocument(new EntityTokenRangeImpl(0, new long[0][], NODE));
assertThat(labelScanDocument.toString()).contains("NodeLabelRange");
}
use of org.neo4j.kernel.impl.index.schema.EntityTokenRangeImpl in project neo4j by neo4j.
the class MessageConsistencyLoggerTest method shouldAdaptLogMessageToEntityTokenRangeTypeRelationship.
@Test
void shouldAdaptLogMessageToEntityTokenRangeTypeRelationship() {
// when
logger.error(RecordType.RELATIONSHIP_TYPE_SCAN_DOCUMENT, new TokenScanDocument(new EntityTokenRangeImpl(0, new long[0][], RELATIONSHIP)), "Some relationship type error", new RelationshipRecord(1));
// then
logMatcher.containsMessages("RelationshipTypeRange");
}
use of org.neo4j.kernel.impl.index.schema.EntityTokenRangeImpl in project neo4j by neo4j.
the class TokenScanDocumentTest method shouldAdaptToStringToTypeOfRangeRelationship.
@Test
void shouldAdaptToStringToTypeOfRangeRelationship() {
TokenScanDocument relationshipTypeScanDocument = new TokenScanDocument(new EntityTokenRangeImpl(0, new long[0][], RELATIONSHIP));
assertThat(relationshipTypeScanDocument.toString()).contains("RelationshipTypeRange");
}
use of org.neo4j.kernel.impl.index.schema.EntityTokenRangeImpl in project neo4j by neo4j.
the class EntityTokenRangeTest method shouldRebaseOnRangeId.
@Test
void shouldRebaseOnRangeId() {
// given
long[][] labelsPerNode = new long[][] { { 1 }, { 1, 3 }, { 3, 5, 7 }, {}, { 1, 5, 7 }, {}, {}, { 1, 2, 3, 4 } };
// when
EntityTokenRange range = new EntityTokenRangeImpl(10, labelsPerNode, NODE);
// then
long baseNodeId = range.id() * labelsPerNode.length;
long[] expectedNodeIds = new long[labelsPerNode.length];
for (int i = 0; i < expectedNodeIds.length; i++) {
expectedNodeIds[i] = baseNodeId + i;
}
assertArrayEquals(expectedNodeIds, range.entities());
}
use of org.neo4j.kernel.impl.index.schema.EntityTokenRangeImpl in project neo4j by neo4j.
the class EntityTokenRangeTest method shouldTransposeNodeIdsAndLabelIds.
@Test
void shouldTransposeNodeIdsAndLabelIds() {
// given
long[][] labelsPerNode = new long[][] { { 1 }, { 1, 3 }, { 3, 5, 7 }, {}, { 1, 5, 7 }, {}, {}, { 1, 2, 3, 4 } };
// when
EntityTokenRange range = new EntityTokenRangeImpl(0, labelsPerNode, NODE);
// then
assertArrayEquals(new long[] { 0, 1, 2, 3, 4, 5, 6, 7 }, range.entities());
for (int i = 0; i < labelsPerNode.length; i++) {
assertArrayEquals(labelsPerNode[i], range.tokens(i));
}
}
Aggregations