Beispiel #1
0
        public static ICollection <DynamicRecord> AllocateRecordsForDynamicLabels(long nodeId, long[] labels, DynamicRecordAllocator allocator)
        {
            long[] storedLongs = LabelIdArray.PrependNodeId(nodeId, labels);
            ICollection <DynamicRecord> records = new List <DynamicRecord>();

            // since we can't store points in long array we passing false as possibility to store points
            DynamicArrayStore.AllocateRecords(records, storedLongs, allocator, false);
            return(records);
        }
Beispiel #2
0
        public override ICollection <DynamicRecord> Add(long labelId, NodeStore nodeStore, DynamicRecordAllocator allocator)
        {
            nodeStore.EnsureHeavy(_node, firstDynamicLabelRecordId(_node.LabelField));
            long[] existingLabelIds = GetDynamicLabelsArray(_node.UsedDynamicLabelRecords, nodeStore.DynamicLabelStore);
            long[] newLabelIds      = LabelIdArray.ConcatAndSort(existingLabelIds, labelId);
            ICollection <DynamicRecord> existingRecords       = _node.DynamicLabelRecords;
            ICollection <DynamicRecord> changedDynamicRecords = AllocateRecordsForDynamicLabels(_node.Id, newLabelIds, new ReusableRecordsCompositeAllocator(existingRecords, allocator));

            _node.setLabelField(DynamicPointer(changedDynamicRecords), changedDynamicRecords);
            return(changedDynamicRecords);
        }
Beispiel #3
0
 public static Pair <long, long[]> GetDynamicLabelsArrayAndOwner(IEnumerable <DynamicRecord> records, AbstractDynamicStore dynamicLabelStore)
 {
     long[] storedLongs = ( long[] )DynamicArrayStore.GetRightArray(dynamicLabelStore.ReadFullByteArray(records, PropertyType.Array)).asObject();
     return(Pair.of(storedLongs[0], LabelIdArray.StripNodeId(storedLongs)));
 }
Beispiel #4
0
 public static long[] GetDynamicLabelsArrayFromHeavyRecords(IEnumerable <DynamicRecord> records)
 {
     long[] storedLongs = ( long[] )DynamicArrayStore.GetRightArray(readFullByteArrayFromHeavyRecords(records, PropertyType.Array)).asObject();
     return(LabelIdArray.StripNodeId(storedLongs));
 }