Exemplo n.º 1
0
 public override void Run(StoreAccess store, PrintStream @out)
 {
     foreach (NamedToken token in (( RelationshipTypeTokenStore )store.RelationshipTypeTokenStore).Tokens)
     {
         @out.println(token);
     }
 }
        private StoreAccess CreateStoreWithOneHighDegreeNodeAndSeveralDegreeTwoNodes(int nDegreeTwoNodes)
        {
            File storeDirectory           = _testDirectory.databaseDir();
            GraphDatabaseService database = (new TestGraphDatabaseFactory()).newEmbeddedDatabaseBuilder(storeDirectory).setConfig(GraphDatabaseSettings.record_format, RecordFormatName).setConfig("dbms.backup.enabled", "false").newGraphDatabase();

            using (Transaction transaction = database.BeginTx())
            {
                Node denseNode = database.CreateNode();
                for (int i = 0; i < nDegreeTwoNodes; i++)
                {
                    Node degreeTwoNode = database.CreateNode();
                    Node leafNode      = database.CreateNode();
                    if (i % 2 == 0)
                    {
                        denseNode.CreateRelationshipTo(degreeTwoNode, TestRelationshipType.Connected);
                    }
                    else
                    {
                        degreeTwoNode.CreateRelationshipTo(denseNode, TestRelationshipType.Connected);
                    }
                    degreeTwoNode.CreateRelationshipTo(leafNode, TestRelationshipType.Connected);
                }
                transaction.Success();
            }
            database.Shutdown();
            PageCache   pageCache   = PageCacheRule.getPageCache(_fileSystemRule.get());
            StoreAccess storeAccess = new StoreAccess(_fileSystemRule.get(), pageCache, _testDirectory.databaseLayout(), Config.defaults());

            return(storeAccess.Initialize());
        }
Exemplo n.º 3
0
 public override void Run(StoreAccess store, PrintStream @out)
 {
     foreach (NamedToken token in (( PropertyKeyTokenStore )store.PropertyKeyTokenStore).Tokens)
     {
         @out.println(token);
     }
 }
Exemplo n.º 4
0
            public override void Run(StoreAccess store, PrintStream @out)
            {
                RecordStore <NodeRecord> nodeStore = store.NodeStore;
                NodeRecord node = nodeStore.GetRecord(Id, nodeStore.NewRecord(), NORMAL);

                if (node.Dense)
                {
                    RecordStore <RelationshipGroupRecord> relationshipGroupStore = store.RelationshipGroupStore;
                    RelationshipGroupRecord group = relationshipGroupStore.NewRecord();
                    relationshipGroupStore.GetRecord(node.NextRel, group, NORMAL);
                    do
                    {
                        @out.println("group " + group);
                        @out.println("out:");
                        PrintRelChain(store, @out, group.FirstOut);
                        @out.println("in:");
                        PrintRelChain(store, @out, group.FirstIn);
                        @out.println("loop:");
                        PrintRelChain(store, @out, group.FirstLoop);
                        group = group.Next != -1 ? relationshipGroupStore.GetRecord(group.Next, group, NORMAL) : null;
                    } while (group != null);
                }
                else
                {
                    PrintRelChain(store, @out, node.NextRel);
                }
            }
Exemplo n.º 5
0
            public override void Run(StoreAccess store, PrintStream @out)
            {
                long propId = FirstPropId(store);
                RecordStore <PropertyRecord> propertyStore = store.PropertyStore;
                PropertyRecord record = propertyStore.NewRecord();

                while (propId != Record.NO_NEXT_PROPERTY.intValue())
                {
                    propertyStore.GetRecord(propId, record, NORMAL);
                    // We rely on this method having the side-effect of loading the property blocks:
                    record.NumberOfProperties();
                    @out.println(record);
                    propId = record.NextProp;
                }
            }
Exemplo n.º 6
0
 internal virtual void PrintRelChain(StoreAccess access, PrintStream @out, long firstRelId)
 {
     for (long rel = firstRelId; rel != Record.NO_NEXT_RELATIONSHIP.intValue();)
     {
         RecordStore <RelationshipRecord> relationshipStore = access.RelationshipStore;
         RelationshipRecord record = relationshipStore.GetRecord(rel, relationshipStore.NewRecord(), NORMAL);
         @out.println(rel + "\t" + record);
         if (record.FirstNode == Id)
         {
             rel = record.FirstNextRel;
         }
         else
         {
             rel = record.SecondNextRel;
         }
     }
 }
Exemplo n.º 7
0
 public CheckNextRel(Stage stage, CacheAccess cacheAccess, StoreAccess storeAccess, StoreProcessor storeProcessor) : base(stage, cacheAccess)
 {
     this.StoreAccess    = storeAccess;
     this.StoreProcessor = storeProcessor;
 }
Exemplo n.º 8
0
 internal abstract Org.Neo4j.Kernel.impl.store.RecordStore <JavaToDotNetGenericWildcard> getRecordStore(Org.Neo4j.Kernel.impl.store.StoreAccess storeAccess);
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setupStoreAccess()
        public virtual void SetupStoreAccess()
        {
            _store = CreateStoreWithOneHighDegreeNodeAndSeveralDegreeTwoNodes(DEGREE_TWO_NODES);
        }
Exemplo n.º 10
0
 protected internal abstract long FirstPropId(StoreAccess access);
Exemplo n.º 11
0
 public override void Run(StoreAccess store, PrintStream @out)
 {
     run();
 }
Exemplo n.º 12
0
            protected internal override long FirstPropId(StoreAccess access)
            {
                RecordStore <RelationshipRecord> relationshipStore = access.RelationshipStore;

                return(relationshipStore.GetRecord(Id, relationshipStore.NewRecord(), NORMAL).NextProp);
            }
Exemplo n.º 13
0
            protected internal override long FirstPropId(StoreAccess access)
            {
                RecordStore <NodeRecord> nodeStore = access.NodeStore;

                return(nodeStore.GetRecord(Id, nodeStore.NewRecord(), NORMAL).NextProp);
            }
Exemplo n.º 14
0
 public SchemaStoreProcessorTask(string name, Statistics statistics, int threads, RecordStore <R> store, StoreAccess storeAccess, string builderPrefix, SchemaRecordCheck schemaRecordCheck, ProgressMonitorFactory.MultiPartBuilder builder, CacheAccess cacheAccess, StoreProcessor processor, QueueDistribution distribution) : base(name, statistics, threads, store, storeAccess, builderPrefix, builder, cacheAccess, processor, distribution)
 {
     this._schemaRecordCheck = schemaRecordCheck;
 }