Beispiel #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void doWorkOnMember(org.neo4j.causalclustering.discovery.ClusterMember oldMember) throws Exception
        public override void DoWorkOnMember(ClusterMember oldMember)
        {
            bool replaceFromBackup = ThreadLocalRandom.current().nextBoolean();

            File backup = null;

            if (replaceFromBackup)
            {
                backup = CreateBackupWithRetries(oldMember);
            }

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

            ClusterMember newMember = (oldMember is CoreClusterMember) ? _cluster.newCoreMember() : _cluster.newReadReplica();

            if (replaceFromBackup)
            {
                _log.info("Restoring backup: " + backup.Name + " to: " + newMember);
                restoreFromBackup(backup, _fs, newMember);
                _fs.deleteRecursively(backup);
            }

            _log.info("Starting: " + newMember);
            newMember.start();

            _successfulReplacements++;
        }
Beispiel #2
0
		 private static void VerifyWarmupHappensAfterStoreCopy( ClusterMember member, long pagesInMemory )
		 {
			  AtomicLong pagesLoadedInWarmup = new AtomicLong();
			  BinaryLatch warmupLatch = InjectWarmupLatch( member, pagesLoadedInWarmup );
			  member.start();
			  warmupLatch.Await();
			  // Check that we warmup up all right:
			  assertThat( pagesLoadedInWarmup.get(), greaterThanOrEqualTo(pagesInMemory) );
		 }
Beispiel #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();
        }