private ReplicationSource newRemoteReplicationSource ( DataCenter dataCenter ) { MultiThreadedServiceFactory < ReplicationSource > clientFactory = new ReplicationClientFactory ( _jerseyClient ) . usingApiKey ( _replicationApiKey ) ; ServiceEndPoint endPoint = new ServiceEndPointBuilder ( ) . withServiceName ( clientFactory . getServiceName ( ) ) . withId ( dataCenter . getName ( ) ) . withPayload ( new PayloadBuilder ( ) . withUrl ( dataCenter . getServiceUri ( ) . resolve ( ReplicationClient . SERVICE_PATH ) ) . withAdminUrl ( dataCenter . getAdminUri ( ) ) . toString ( ) ) . build ( ) ; return ServicePoolBuilder . create ( ReplicationSource . class ) . withHostDiscovery ( new FixedHostDiscovery ( endPoint ) ) . withServiceFactory ( clientFactory ) . withCachingPolicy ( ServiceCachingPolicyBuilder . getMultiThreadedClientPolicy ( ) ) . withHealthCheckExecutor ( _healthCheckExecutor ) . withMetricRegistry ( _metrics ) . buildProxy ( new ExponentialBackoffRetry ( 30 , 1 , 10 , TimeUnit . SECONDS ) ) ; }
Creates a ReplicationSource proxy to the remote data center .