public StorageClientImpl(String namespaceName, StorageClientSettings settings, ClientResources resources, StorageServerClientManager serverManager, boolean ownServerManager) { this.defaultNamespace = namespaceName; this.settings = settings; this.resources = resources; this.serverManager = serverManager; this.ownServerManager = ownServerManager; this.scheduler = SharedResourceManager.shared().get(resources.scheduler()); }
public static SharedResourceManager create(Supplier<ScheduledExecutorService> destroyerFactory) { return new SharedResourceManager(destroyerFactory); }
public static SharedResourceManager create() { return create(() -> Executors.newSingleThreadScheduledExecutor( ExecutorUtils.getThreadFactory("bookkeeper-shared-destroyer-%d", true))); }
protected SimpleClientBase(StorageClientSettings settings, Resource<OrderedScheduler> schedulerResource, ManagedChannel managedChannel, boolean ownChannel) { this.settings = settings; this.managedChannel = managedChannel; this.ownChannel = ownChannel; this.channel = ClientInterceptors.intercept( managedChannel, new StorageContainerClientInterceptor(0L)); this.schedulerResource = schedulerResource; this.scheduler = SharedResourceManager.shared().get(schedulerResource); this.retryUtils = RetryUtils.create(settings.backoffPolicy(), scheduler); }
public StorageServerClientManagerImpl(StorageClientSettings settings, Resource<OrderedScheduler> schedulerResource, Function<Endpoint, StorageServerChannel> channelFactory) { this.schedulerResource = schedulerResource; this.scheduler = SharedResourceManager.shared().get(schedulerResource); this.locationClient = new LocationClientImpl(settings, scheduler); this.channelManager = new StorageServerChannelManager(channelFactory); this.scChannelManager = new StorageContainerChannelManager( this.channelManager, this.locationClient, scheduler); this.rootRangeClient = new RootRangeClientImplWithRetries( new RootRangeClientImpl( scheduler, scChannelManager), settings.backoffPolicy(), scheduler ); this.streamMetadataCache = new StreamMetadataCache(rootRangeClient); this.metaRangeClients = Maps.newConcurrentMap(); }