Exemple #1
0
 private void CreateIndex(Label label, string propertyKey)
 {
     using (Transaction transaction = DatabaseRule.beginTx())
     {
         DatabaseRule.schema().indexFor(label).on(propertyKey).create();
         transaction.Success();
     }
     using (Transaction ignored = DatabaseRule.beginTx())
     {
         DatabaseRule.schema().awaitIndexesOnline(1, TimeUnit.MINUTES);
     }
 }
Exemple #2
0
        private void PrepareDatabase(Label label)
        {
            GenerateData(label);

            using (Transaction transaction = Database.beginTx())
            {
                for (int i = 0; i < 10; i++)
                {
                    Database.schema().indexFor(label).on(PROPERTY_PREFIX + i).create();
                }
                transaction.Success();
            }

            using (Transaction ignored = Database.beginTx())
            {
                Database.schema().awaitIndexesOnline(1, TimeUnit.MINUTES);
            }

            _checkPointer    = ResolveDependency(typeof(CheckPointer));
            _indexingService = ResolveDependency(typeof(IndexingService));
            _fileSystem      = ResolveDependency(typeof(FileSystemAbstraction));
        }
        internal virtual IList <Pair <long, Label[]> > SomeData(int numberOfModifications)
        {
            IList <Pair <long, Label[]> > existingNodes;

            existingNodes = new List <Pair <long, Label[]> >();
            using (Transaction tx = Db.beginTx())
            {
                RandomModifications(existingNodes, numberOfModifications);
                tx.Success();
            }
            using (Transaction tx = Db.beginTx())
            {
                Db.schema().indexFor(LABEL_ONE).on(PROPERTY_KEY).create();
                tx.Success();
            }
            using (Transaction tx = Db.beginTx())
            {
                Db.schema().awaitIndexesOnline(1, TimeUnit.MINUTES);
                tx.Success();
            }
            return(existingNodes);
        }