Search in sources :

Example 6 with EntityTokenRange

use of org.neo4j.kernel.impl.index.schema.EntityTokenRange 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));
    }
}
Also used : EntityTokenRange(org.neo4j.kernel.impl.index.schema.EntityTokenRange) EntityTokenRangeImpl(org.neo4j.kernel.impl.index.schema.EntityTokenRangeImpl) Test(org.junit.jupiter.api.Test)

Aggregations

EntityTokenRange (org.neo4j.kernel.impl.index.schema.EntityTokenRange)6 Test (org.junit.jupiter.api.Test)4 EntityTokenRangeImpl (org.neo4j.kernel.impl.index.schema.EntityTokenRangeImpl)4 IntObjectHashMap (org.eclipse.collections.impl.map.mutable.primitive.IntObjectHashMap)2 CacheAccess (org.neo4j.consistency.checking.cache.CacheAccess)2 ProgressListener (org.neo4j.internal.helpers.progress.ProgressListener)2 CursorContext (org.neo4j.io.pagecache.context.CursorContext)2 RelationshipRecord (org.neo4j.kernel.impl.store.record.RelationshipRecord)2 Value (org.neo4j.values.storable.Value)2 RelationshipCounter (org.neo4j.internal.recordstorage.RelationshipCounter)1 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)1 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)1