class NodeLabelsCache implements MemoryStatsVisitor.Visitable, AutoCloseable {

    public void put( long nodeId, long[] labelIds )
    {
        putClient.labelBits.clear( true );
        putClient.labelBits.put( labelIds.length, bitsPerLabel );
        for ( long labelId : labelIds )
        {
            putClient.labelBits.put( (int) labelId, bitsPerLabel );
        }

        int longsInUse = putClient.labelBits.longsInUse();
        assert longsInUse > 0 : "Uhm";
        if ( longsInUse == 1 )
        {   // We only require one long, so put it right in there
            cache.set( nodeId, putClient.labelScratch[0] );
        }
        else
        {   // Now it gets tricky, we have to spill over into another array
            // So create the reference
            putClient.fieldBits.clear( true );
            putClient.fieldBits.put( labelIds.length, bitsPerLabel );
            putClient.fieldBits.put( spillOverIndex, Long.SIZE - bitsPerLabel );
            cache.set( nodeId, putClient.fieldBits.getLongs()[0] );

            // And set the longs in the spill over array. For simplicity we put the encoded bits as they
            // are right into the spill over array, where the first slot will have the length "again".
            for ( int i = 0; i < longsInUse; i++ )
            {
                spillOver.set( spillOverIndex++, putClient.labelScratch[i] );
            }
        }
    }

    public  NodeLabelsCache( NumberArrayFactory cacheFactory, int highLabelId );
    public  NodeLabelsCache( NumberArrayFactory cacheFactory, int highLabelId, int chunkSize );

}