Search in sources :

Example 6 with D2ClientJmxManager

use of com.linkedin.d2.jmx.D2ClientJmxManager in project rest.li by linkedin.

the class LastSeenBalancerWithFacilitiesFactory method getServicePropertiesLastSeenZKStore.

private LastSeenZKStore<ServiceProperties> getServicePropertiesLastSeenZKStore(D2ClientConfig config, ZKPersistentConnection zkPersistentConnection, D2ClientJmxManager d2ClientJmxManager, ScheduledExecutorService executorService, int zookeeperReadWindowMs) {
    ZooKeeperPermanentStoreBuilder<ServiceProperties> zkServiceStoreBuilder = new ZooKeeperPermanentStoreBuilder<ServiceProperties>().setSerializer(new ServicePropertiesJsonSerializer(config.clientServicesConfig)).setPath(ZKFSUtil.servicePath(config.basePath, config.d2ServicePath)).setExecutorService(executorService).setZookeeperReadWindowMs(zookeeperReadWindowMs).addOnBuildListener(d2ClientJmxManager::setZkServiceRegistry);
    FileStore<ServiceProperties> fileStore = new FileStore<>(FileSystemDirectory.getServiceDirectory(config.fsBasePath, config.d2ServicePath), new ServicePropertiesJsonSerializer());
    d2ClientJmxManager.setFsServiceStore(fileStore);
    return new LastSeenZKStore<>(fileStore, zkServiceStoreBuilder, zkPersistentConnection, config._executorService, config.warmUpTimeoutSeconds, config.warmUpConcurrentRequests);
}
Also used : FileStore(com.linkedin.d2.discovery.stores.file.FileStore) ServiceProperties(com.linkedin.d2.balancer.properties.ServiceProperties) LastSeenZKStore(com.linkedin.d2.discovery.stores.zk.LastSeenZKStore) ServicePropertiesJsonSerializer(com.linkedin.d2.balancer.properties.ServicePropertiesJsonSerializer)

Aggregations

FileStore (com.linkedin.d2.discovery.stores.file.FileStore)3 LastSeenZKStore (com.linkedin.d2.discovery.stores.zk.LastSeenZKStore)3 ClusterProperties (com.linkedin.d2.balancer.properties.ClusterProperties)2 ServiceProperties (com.linkedin.d2.balancer.properties.ServiceProperties)2 UriProperties (com.linkedin.d2.balancer.properties.UriProperties)2 SimpleLoadBalancerState (com.linkedin.d2.balancer.simple.SimpleLoadBalancerState)2 D2ClientJmxManager (com.linkedin.d2.jmx.D2ClientJmxManager)2 TrackerClient (com.linkedin.d2.balancer.clients.TrackerClient)1 ClusterPropertiesJsonSerializer (com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer)1 ServicePropertiesJsonSerializer (com.linkedin.d2.balancer.properties.ServicePropertiesJsonSerializer)1 UriPropertiesJsonSerializer (com.linkedin.d2.balancer.properties.UriPropertiesJsonSerializer)1 UriPropertiesMerger (com.linkedin.d2.balancer.properties.UriPropertiesMerger)1 SimpleLoadBalancer (com.linkedin.d2.balancer.simple.SimpleLoadBalancer)1 LoadBalancerStrategy (com.linkedin.d2.balancer.strategies.LoadBalancerStrategy)1 WarmUpLoadBalancer (com.linkedin.d2.balancer.util.WarmUpLoadBalancer)1 LastSeenLoadBalancerWithFacilities (com.linkedin.d2.balancer.zkfs.LastSeenLoadBalancerWithFacilities)1 ZKFSComponentFactory (com.linkedin.d2.balancer.zkfs.ZKFSComponentFactory)1 ZKFSTogglingLoadBalancerFactoryImpl (com.linkedin.d2.balancer.zkfs.ZKFSTogglingLoadBalancerFactoryImpl)1 PropertyEventBusImpl (com.linkedin.d2.discovery.event.PropertyEventBusImpl)1 SharedZkConnectionProviderTest (com.linkedin.d2.discovery.stores.zk.SharedZkConnectionProviderTest)1