Exemplo n.º 1
0
        public override void EndOfEntity()
        {
            // Make sure we have an ID
            if (_nodeRecord.Id == NULL_REFERENCE.longValue())
            {
                _nodeRecord.Id = _nodeIds.next();
            }

            // Compose the labels
            if (!_hasLabelField)
            {
                long[] labelIds = _labelTokenRepository.getOrCreateIds(_labels, _labelsCursor);
                InlineNodeLabels.putSorted(_nodeRecord, labelIds, null, _nodeStore.DynamicLabelStore);
            }
            _labelsCursor = 0;

            // Write data to stores
            _nodeRecord.NextProp = CreateAndWritePropertyChain();
            _nodeRecord.InUse    = true;
            _nodeStore.updateRecord(_nodeRecord);
            _nodeCount++;
            _nodeRecord.clear();
            _nodeRecord.Id = NULL_REFERENCE.longValue();
            _hasLabelField = false;
            base.EndOfEntity();
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldDeleteIdGeneratorsWhenOpeningExistingStore() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldDeleteIdGeneratorsWhenOpeningExistingStore()
        {
            // given
            long expectedHighId;

            using (BatchingNeoStores stores = BatchingNeoStores.BatchingNeoStoresWithExternalPageCache(Storage.fileSystem(), Storage.pageCache(), PageCacheTracer.NULL, Storage.directory().absolutePath(), LATEST_RECORD_FORMATS, DEFAULT, NullLogService.Instance, EMPTY, Config.defaults()))
            {
                stores.CreateNew();
                RelationshipStore  relationshipStore = stores.RelationshipStore;
                RelationshipRecord record            = relationshipStore.NewRecord();
                long no = NULL_REFERENCE.longValue();
                record.Initialize(true, no, 1, 2, 0, no, no, no, no, true, true);
                record.Id      = relationshipStore.NextId();
                expectedHighId = relationshipStore.HighId;
                relationshipStore.UpdateRecord(record);
                // fiddle with the highId
                relationshipStore.HighId = record.Id + 999;
            }

            // when
            using (BatchingNeoStores stores = BatchingNeoStores.BatchingNeoStoresWithExternalPageCache(Storage.fileSystem(), Storage.pageCache(), PageCacheTracer.NULL, Storage.directory().absolutePath(), LATEST_RECORD_FORMATS, DEFAULT, NullLogService.Instance, EMPTY, Config.defaults()))
            {
                stores.PruneAndOpenExistingStore(Predicates.alwaysTrue(), Predicates.alwaysTrue());

                // then
                assertEquals(expectedHighId, stores.RelationshipStore.HighId);
            }
        }
Exemplo n.º 3
0
        protected internal static IList <RelationshipGroupRecord> Groups(params Group[] groups)
        {
            IList <RelationshipGroupRecord> records = new List <RelationshipGroupRecord>();

            foreach (Group group in groups)
            {
                for (int i = 0; i < group.Count; i++)
                {
                    RelationshipGroupRecord record = new RelationshipGroupRecord(NULL_REFERENCE.longValue());
                    record.OwningNode = group.OwningNode;
                    record.Next       = group.Count - i - 1;                        // count: how many come after it (importer does this)
                    records.Add(record);
                }
            }
            return(records);
        }
Exemplo n.º 4
0
 private static RelationshipRecord Relationship(long id, long startNodeId, long endNodeId)
 {
     return((new RelationshipRecord(id)).initialize(true, Record.NO_NEXT_PROPERTY.longValue(), startNodeId, endNodeId, 0, NULL_REFERENCE.longValue(), NULL_REFERENCE.longValue(), NULL_REFERENCE.longValue(), NULL_REFERENCE.longValue(), false, false));
 }