Beispiel #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private java.util.List<LockOperationRecord> traceQueryLocks(String query, LockOperationListener... listeners) throws org.neo4j.kernel.impl.query.QueryExecutionKernelException
        private IList <LockOperationRecord> TraceQueryLocks(string query, params LockOperationListener[] listeners)
        {
            GraphDatabaseQueryService graph           = DatabaseRule.resolveDependency(typeof(GraphDatabaseQueryService));
            QueryExecutionEngine      executionEngine = DatabaseRule.resolveDependency(typeof(QueryExecutionEngine));

            using (InternalTransaction tx = graph.BeginTransaction(KernelTransaction.Type.@implicit, LoginContext.AUTH_DISABLED))
            {
                TransactionalContextWrapper context = new TransactionalContextWrapper(CreateTransactionContext(graph, tx, query), listeners);
                executionEngine.ExecuteQuery(query, VirtualValues.emptyMap(), context);
                return(new List <LockOperationRecord>(context.RecordingLocks.LockOperationRecords));
            }
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void reportNotCleanLabelIndex() throws java.io.IOException, org.neo4j.consistency.checking.full.ConsistencyCheckIncompleteException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ReportNotCleanLabelIndex()
        {
            DatabaseLayout databaseLayout = Db.databaseLayout();

            SomeData();
            Db.resolveDependency(typeof(CheckPointer)).forceCheckPoint(new SimpleTriggerInfo("forcedCheckpoint"));
            File labelIndexFileCopy = databaseLayout.File("label_index_copy");

            copyFile(databaseLayout.LabelScanStore(), labelIndexFileCopy);

            using (Transaction tx = Db.beginTx())
            {
                Db.createNode(LABEL_ONE);
                tx.Success();
            }

            Db.shutdownAndKeepStore();

            copyFile(labelIndexFileCopy, databaseLayout.LabelScanStore());

            ConsistencyCheckService.Result result = FullConsistencyCheck();
            assertFalse("Expected consistency check to fail", result.Successful);
            assertThat(ReadReport(result), hasItem(containsString("WARN : Label index was not properly shutdown and rebuild is required.")));
        }
Beispiel #3
0
 private T ResolveComponent <T>(Type clazz)
 {
     clazz = typeof(T);
     return(Db.resolveDependency(clazz));
 }