Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void makeSureUpdatePullerGetsGoingAfterMasterSwitch() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MakeSureUpdatePullerGetsGoingAfterMasterSwitch()
        {
            ClusterManager.ManagedCluster cluster = ClusterRule.withSharedSetting(HaSettings.pull_interval, PULL_INTERVAL + "ms").startCluster();

            cluster.Info("### Creating initial dataset");
            long commonNodeId = CreateNodeOnMaster(cluster);

            HighlyAvailableGraphDatabase master = cluster.Master;

            SetProperty(master, commonNodeId, 1);
            cluster.Info("### Initial dataset created");
            AwaitPropagation(1, commonNodeId, cluster);

            cluster.Info("### Shutting down master");
            ClusterManager.RepairKit masterShutdownRK = cluster.Shutdown(master);

            cluster.Info("### Awaiting new master");
            cluster.Await(masterAvailable(master));
            cluster.Await(masterSeesSlavesAsAvailable(1));

            cluster.Info("### Doing a write to master");
            SetProperty(cluster.Master, commonNodeId, 2);
            AwaitPropagation(2, commonNodeId, cluster, master);

            cluster.Info("### Repairing cluster");
            masterShutdownRK.Repair();
            cluster.Await(masterAvailable());
            cluster.Await(masterSeesSlavesAsAvailable(2));
            cluster.Await(allSeesAllAsAvailable());

            cluster.Info("### Awaiting change propagation");
            AwaitPropagation(2, commonNodeId, cluster);
        }
Beispiel #2
0
        private ClusterManager.ManagedCluster StartCluster()
        {
            _clusterRule.withSharedSetting(GraphDatabaseSettings.lock_manager, LockManagerName);

            ClusterManager.ManagedCluster cluster = _clusterRule.startCluster();
            cluster.Await(ClusterManager.allSeesAllAsAvailable());
            return(cluster);
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void slavesTerminateOrReadConsistentDataWhenApplyingBatchLargerThanSafeZone() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void SlavesTerminateOrReadConsistentDataWhenApplyingBatchLargerThanSafeZone()
        {
            long safeZone = TimeUnit.MILLISECONDS.toSeconds(0);

            ClusterRule.withSharedSetting(HaSettings.id_reuse_safe_zone_time, safeZone.ToString());
            // given
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.kernel.impl.ha.ClusterManager.ManagedCluster cluster = clusterRule.startCluster();
            ClusterManager.ManagedCluster cluster = ClusterRule.startCluster();
            HighlyAvailableGraphDatabase  master  = cluster.Master;

            // when
            // ... slaves and master has node with long string property
            long entityId = Action.createInitialEntity(master);

            cluster.Sync();
            // ... and property is removed on master
            Action.removeProperties(master, entityId);
            Thread.Sleep(100);
            // ... and maintenance is called to make sure "safe" ids are freed to be reused
            ForceMaintenance(master);
            // ... and a new property is created on master that
            Action.setNewProperties(master, entityId);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.kernel.ha.HighlyAvailableGraphDatabase slave = cluster.getAnySlave();
            HighlyAvailableGraphDatabase slave = cluster.AnySlave;
            Race race = new Race();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.concurrent.atomic.AtomicBoolean end = new java.util.concurrent.atomic.AtomicBoolean(false);
            AtomicBoolean end = new AtomicBoolean(false);

            for (int i = 0; i < READER_CONTESTANTS; i++)
            {
                race.AddContestant(ReadContestant(Action, entityId, slave, end));
            }

            race.AddContestant(PullUpdatesContestant(slave, end));

            race.Go();
        }
Beispiel #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void Setup()
        {
            Cluster = ClusterRule.withSharedSetting(HaSettings.PullInterval, "0").startCluster();
            ClearData();
        }
Beispiel #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUp()
        public virtual void SetUp()
        {
            _cluster = ClusterRule.withSharedSetting(HaSettings.tx_push_factor, "2").withInstanceSetting(GraphDatabaseSettings.lock_manager, i => "community").startCluster();
        }
Beispiel #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void Setup()
        {
            _cluster = ClusterRule.withSharedSetting(HaSettings.ReadTimeout, "1s").withSharedSetting(HaSettings.StateSwitchTimeout, "2s").withSharedSetting(HaSettings.ComChunkSize, "1024").startCluster();
        }