Beispiel #1
0
        private ReadReplica AddReadReplica(int memberId, string recordFormat, Monitors monitors)
        {
            IList <AdvertisedSocketAddress> initialHosts = ExtractInitialHosts(_coreMembers);
            ReadReplica member = CreateReadReplica(memberId, initialHosts, _readReplicaParams, _instanceReadReplicaParams, recordFormat, monitors);

            _readReplicas[memberId] = member;
            return(member);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: private void createReadReplicas(int noOfReadReplicas, final java.util.List<org.neo4j.helpers.AdvertisedSocketAddress> initialHosts, java.util.Map<String,String> extraParams, java.util.Map<String,System.Func<int, String>> instanceExtraParams, String recordFormat)
        private void CreateReadReplicas(int noOfReadReplicas, IList <AdvertisedSocketAddress> initialHosts, IDictionary <string, string> extraParams, IDictionary <string, System.Func <int, string> > instanceExtraParams, string recordFormat)
        {
            for (int i = 0; i < noOfReadReplicas; i++)
            {
                ReadReplica readReplica = createReadReplica(i, initialHosts, extraParams, instanceExtraParams, recordFormat, new Monitors()
                                                            );

                _readReplicas[i] = readReplica;
            }
            _highestReplicaServerId = noOfReadReplicas - 1;
        }
Beispiel #3
0
        public virtual void RemoveReadReplicaWithMemberId(int memberId)
        {
            ReadReplica memberToRemove = GetReadReplicaById(memberId);

            if (memberToRemove != null)
            {
                RemoveReadReplica(memberToRemove);
            }
            else
            {
                throw new Exception("Could not remove core member with member id " + memberId);
            }
        }
Beispiel #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void readReplicaShouldStartAfterPartialTransactionWriteCrash() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ReadReplicaShouldStartAfterPartialTransactionWriteCrash()
        {
            // given: a fully synced cluster with some data
            dataMatchesEventually(createEmptyNodes(_cluster, 10), _cluster.readReplicas());

            // when: shutting down a read replica
            ReadReplica readReplica = _cluster.getReadReplicaById(0);

            readReplica.Shutdown();

            // and making sure there will be something new to pull
            CoreClusterMember lastWrites = createEmptyNodes(_cluster, 10);

            dataMatchesEventually(lastWrites, _cluster.coreMembers());

            // and writing a partial tx
            WritePartialTx(readReplica.DatabaseDirectory());

            // then: we should still be able to start
            readReplica.Start();

            // and become fully synced again
            dataMatchesEventually(lastWrites, singletonList(readReplica));
        }
Beispiel #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void cacheProfilesMustBeIncludedInStoreCopyToReadReplica() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
		 public virtual void CacheProfilesMustBeIncludedInStoreCopyToReadReplica()
		 {
			  long pagesInMemory = WarmUpCluster();
			  ReadReplica member = _cluster.newReadReplica();
			  VerifyWarmupHappensAfterStoreCopy( member, pagesInMemory );
		 }
Beispiel #6
0
 private void RemoveReadReplica(ReadReplica memberToRemove)
 {
     memberToRemove.Shutdown();
     _readReplicas.Values.remove(memberToRemove);
 }