@Override public void configure(Binder binder) { driftClientBinder(binder) .bindDriftClient(PrestoThriftService.class) .withExceptionClassifier(t -> { if (t instanceof PrestoThriftServiceException) { boolean retryable = ((PrestoThriftServiceException) t).isRetryable(); return new ExceptionClassification(Optional.of(retryable), HostStatus.NORMAL); } return NORMAL_EXCEPTION; }); binder.bind(ThriftConnector.class).in(Scopes.SINGLETON); binder.bind(ThriftMetadata.class).in(Scopes.SINGLETON); binder.bind(ThriftSplitManager.class).in(Scopes.SINGLETON); binder.bind(ThriftPageSourceProvider.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(ThriftConnectorConfig.class); binder.bind(ThriftSessionProperties.class).in(Scopes.SINGLETON); binder.bind(ThriftIndexProvider.class).in(Scopes.SINGLETON); binder.bind(ThriftConnectorStats.class).in(Scopes.SINGLETON); newExporter(binder).export(ThriftConnectorStats.class) .as(generatedNameOf(ThriftConnectorStats.class, connectorId)); }
@Override public void configure(Binder binder) { driftClientBinder(binder) .bindDriftClient(PrestoThriftService.class) .withExceptionClassifier(t -> { if (t instanceof PrestoThriftServiceException) { boolean retryable = ((PrestoThriftServiceException) t).isRetryable(); return new ExceptionClassification(Optional.of(retryable), HostStatus.NORMAL); } return NORMAL_EXCEPTION; }); binder.bind(ThriftConnector.class).in(Scopes.SINGLETON); binder.bind(ThriftMetadata.class).in(Scopes.SINGLETON); binder.bind(ThriftSplitManager.class).in(Scopes.SINGLETON); binder.bind(ThriftPageSourceProvider.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(ThriftConnectorConfig.class); binder.bind(ThriftSessionProperties.class).in(Scopes.SINGLETON); binder.bind(ThriftIndexProvider.class).in(Scopes.SINGLETON); binder.bind(ThriftConnectorStats.class).in(Scopes.SINGLETON); newExporter(binder).export(ThriftConnectorStats.class).withGeneratedName(); }
.bindDriftClient(Client.class) .withAddressSelector(new MockAddressSelector()) .withExceptionClassifier(clientClassifier), binder -> driftClientBinder(binder) .bindDriftClient(Client.class, CustomClient.class) .withAddressSelector(new MockAddressSelector()) .withExceptionClassifier(customClientClassifier));
.withAddressSelector(new MockAddressSelector()) .withMethodInvocationFilter(staticFilterBinder(passThroughFilter, shortCircuitFilter)) .withExceptionClassifier(clientClassifier), binder -> driftClientBinder(binder) .bindDriftClient(Client.class, CustomClient.class) .withAddressSelector(new MockAddressSelector()) .withMethodInvocationFilter(staticFilterBinder(passThroughFilter, shortCircuitFilter)) .withExceptionClassifier(customClientClassifier));
driftClientBinder(binder).bindDriftClient(MismatchService.class).withAddressSelector(simpleAddressSelector()); driftClientBinder(binder).bindDriftClient(ThrowingService.class).withAddressSelector(simpleAddressSelector()) .withExceptionClassifier(t -> { if (t instanceof ExampleException) { boolean retryable = ((ExampleException) t).isRetryable();