@Override public int waitFor() throws InterruptedException { RetryStrategy retry = RetryStrategies.fixDelay(100, TimeUnit.MILLISECONDS); return Retries.supplyWithRetries(this::exitValue, retry, IllegalThreadStateException.class::isInstance); }
@Override public boolean datasetExists(final String name) throws DatasetManagementException { return Retries.callWithRetries(new Retries.Callable<Boolean, DatasetManagementException>() { @Override public Boolean call() throws DatasetManagementException { return datasetFramework.getDatasetSpec(createInstanceId(name)) != null; } }, retryStrategy); }
@Override protected boolean shouldRetry(Exception ex) { failed = true; return super.shouldRetry(ex); }
private String updateKafkaBrokerList(CConfiguration cConf, BrokerService brokerService) { String brokerList = Retries.callWithRetries( brokerService::getBrokerList, RetryStrategies.timeLimit(10, TimeUnit.SECONDS, RetryStrategies.exponentialDelay(100, 2000, TimeUnit.MILLISECONDS)) ); for (String param : kafkaBrokerListParams) { cConf.set(param, brokerList); } return brokerList; }
/** * @return the retry strategy to use when executing this bootstrap step */ protected RetryStrategy getRetryStrategy() { // exponential retries with a time limit of 5 minutes. return RetryStrategies.timeLimit(5, TimeUnit.MINUTES, RetryStrategies.exponentialDelay(200, 10000, TimeUnit.MILLISECONDS)); } }
@Override protected RetryStrategy getRetryStrategy() { // retry with no time limit return RetryStrategies.exponentialDelay(200, 10000, TimeUnit.MILLISECONDS); } }
/** * See {@link Services#startAndWait(Service, long, TimeUnit, String)} */ public static void startAndWait(Service service, long timeout, TimeUnit timeoutUnit) throws TimeoutException, InterruptedException, ExecutionException { startAndWait(service, timeout, timeoutUnit, null); } }
/** * Creates an instance without messaging admin support. */ public DefaultAdmin(DatasetFramework dsFramework, NamespaceId namespace, SecureStoreManager secureStoreManager) { this(dsFramework, namespace, secureStoreManager, null, RetryStrategies.noRetry(), null); }
/** * Returns a {@link Builder} to build instance of this class. * @param serviceName Name of the service name to build * @return A {@link Builder}. */ public static Builder builder(String serviceName) { return new Builder(serviceName); }
@Override public Boolean call() throws Exception { return service.getStartedService() != null; } }, 5, TimeUnit.SECONDS, 100, TimeUnit.MILLISECONDS);
/** * @return the retry strategy to use when executing this bootstrap step */ protected RetryStrategy getRetryStrategy() { // exponential retries with a time limit of 5 minutes. return RetryStrategies.timeLimit(5, TimeUnit.MINUTES, RetryStrategies.exponentialDelay(200, 10000, TimeUnit.MILLISECONDS)); } }
@Override protected RetryStrategy getRetryStrategy() { // retry with no time limit return RetryStrategies.exponentialDelay(200, 10000, TimeUnit.MILLISECONDS); } }
@Override public int waitFor() throws InterruptedException { RetryStrategy retry = RetryStrategies.fixDelay(100, TimeUnit.MILLISECONDS); return Retries.supplyWithRetries(this::exitValue, retry, IllegalThreadStateException.class::isInstance); }
@Override public boolean datasetExists(final String name) throws DatasetManagementException { return Retries.callWithRetries(new Retries.Callable<Boolean, DatasetManagementException>() { @Override public Boolean call() throws DatasetManagementException { return datasetFramework.getDatasetSpec(createInstanceId(name)) != null; } }, retryStrategy); }
/** * Creates an instance without messaging admin support. */ public DefaultAdmin(DatasetFramework dsFramework, NamespaceId namespace, SecureStoreManager secureStoreManager, NamespaceQueryAdmin namespaceQueryAdmin) { this(dsFramework, namespace, secureStoreManager, null, RetryStrategies.noRetry(), null, namespaceQueryAdmin); }
/** * Returns a {@link Builder} to build instance of this class. * @param serviceName Name of the service name to build * @return A {@link Builder}. */ public static Builder builder(String serviceName) { return new Builder(serviceName); }
@Override protected RetryStrategy getRetryStrategy() { // retry with no time limit return RetryStrategies.exponentialDelay(200, 10000, TimeUnit.MILLISECONDS); } }
ConstraintCheckerThread(int partition) { // TODO: [CDAP-11370] Need to be configured in cdap-default.xml. Retry with delay ranging from 0.1s to 30s scheduleStrategy = co.cask.cdap.common.service.RetryStrategies.exponentialDelay(100, 30000, TimeUnit.MILLISECONDS); this.partition = partition; }
ConstraintCheckerThread(int partition) { // TODO: [CDAP-11370] Need to be configured in cdap-default.xml. Retry with delay ranging from 0.1s to 30s scheduleStrategy = co.cask.cdap.common.service.RetryStrategies.exponentialDelay(100, 30000, TimeUnit.MILLISECONDS); this.partition = partition; }
@Override protected RetryStrategy getRetryStrategy() { // retry with no time limit return RetryStrategies.exponentialDelay(200, 10000, TimeUnit.MILLISECONDS); } }