Ejemplo n.º 1
0
        private void AwaitIndexOnline(ClusterMember member)
        {
            GraphDatabaseAPI db = member.database();

            using (Transaction tx = Db.beginTx())
            {
                Db.schema().awaitIndexesOnline(1, TimeUnit.MINUTES);
                tx.Success();
            }
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnUnavailableStatusWhenDoingLongOperation()
        public virtual void ShouldReturnUnavailableStatusWhenDoingLongOperation()
        {
            // given
            ClusterMember member = _cluster.getCoreMemberById(1);

            // when
            member.database().DependencyResolver.resolveDependency(typeof(DatabaseAvailabilityGuard)).require(() => "Not doing long operation");

            // then
            try
            {
                using (Transaction tx = member.database().BeginTx())
                {
                    tx.Success();
                    fail();
                }
            }
            catch (Exception e)
            {
                assertEquals(Org.Neo4j.Kernel.Api.Exceptions.Status_General.DatabaseUnavailable, statusCodeOf(e));
            }
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void doWorkOnMember(org.neo4j.causalclustering.discovery.ClusterMember member) throws Exception
        public override void DoWorkOnMember(ClusterMember member)
        {
            File databaseDirectory = member.database().DatabaseLayout().databaseDirectory();

            _log.info("Stopping: " + member);
            member.shutdown();

            assertStoreConsistent(_fileSystem, databaseDirectory);

            Thread.Sleep(5000);
            _log.info("Starting: " + member);
            member.start();
        }
Ejemplo n.º 4
0
 private long?TxId(ClusterMember member)
 {
     try
     {
         GraphDatabaseAPI   database  = member.database();
         TransactionIdStore txIdStore = database.DependencyResolver.resolveDependency(typeof(TransactionIdStore), ONLY);
         return(long?.of(txIdStore.LastClosedTransactionId));
     }
     catch (Exception)
     {
         return(long?.empty());
     }
 }
Ejemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnUnavailableStatusWhenShutdown()
        public virtual void ShouldReturnUnavailableStatusWhenShutdown()
        {
            // given
            ClusterMember member = _cluster.getCoreMemberById(1);

            // when
            GraphDatabaseAPI db = member.database();

            member.shutdown();

            // then
            try
            {
                using (Transaction tx = Db.beginTx())
                {
                    tx.Success();
                    fail();
                }
            }
            catch (Exception e)
            {
                assertEquals(Org.Neo4j.Kernel.Api.Exceptions.Status_General.DatabaseUnavailable, statusCodeOf(e));
            }
        }
Ejemplo n.º 6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static <T extends ClusterMember> void dataMatchesEventually(ClusterMember source, java.util.Collection<T> targets) throws java.util.concurrent.TimeoutException
        public static void DataMatchesEventually <T>(ClusterMember source, ICollection <T> targets) where T : ClusterMember
        {
            DataMatchesEventually(DbRepresentation.of(source.database()), targets);
        }
Ejemplo n.º 7
0
 private static LogFiles PhysicalLogFiles(ClusterMember clusterMember)
 {
     return(clusterMember.database().DependencyResolver.resolveDependency(typeof(LogFiles)));
 }