@Override public State startAndWait() { return delegateService.startAndWait(); }
@Override protected void startUp() throws Exception { internalService.startAndWait(); }
@Deprecated @Override public final State startAndWait() { return delegate.startAndWait(); }
@Deprecated @Override public final State startAndWait() { return delegate.startAndWait(); }
@Deprecated @Override public final State startAndWait() { return delegate.startAndWait(); }
@Deprecated @Override public final State startAndWait() { return delegate.startAndWait(); }
@Deprecated @Override public final State startAndWait() { return delegate.startAndWait(); }
@Deprecated @Override public final State startAndWait() { return delegate.startAndWait(); }
@Deprecated @Override public final State startAndWait() { return delegate.startAndWait(); }
@Deprecated @Override public final State startAndWait() { return delegate.startAndWait(); }
@Override protected void startUp() throws Exception { LOG.info("Starting scheduler."); // RetryOnStartFailureservice#startAndWait returns before its service's startAndWait completes serviceDelegate.startAndWait(); startUpLatch.await(); }
@Override protected void startUp() throws Exception { LOG.info("Starting scheduler."); // RetryOnStartFailureservice#startAndWait returns before its service's startAndWait completes serviceDelegate.startAndWait(); startUpLatch.await(); }
/** * Gets an instance of the given {@link Service} class from the given {@link Injector}, start the service and * returns it. */ private static <T extends Service> T getAndStart(Injector injector, Class<T> cls) { T service = injector.getInstance(cls); LOG.debug("Starting service in master {}", service); service.startAndWait(); LOG.info("Service {} started in master", service); return service; }
@Deprecated @Override public State startAndWait() { return delegate().startAndWait(); }
@Deprecated @Override public State startAndWait() { return delegate().startAndWait(); }
@Deprecated @Override public State startAndWait() { return delegate().startAndWait(); }
@Test public void testRetrySucceed() throws InterruptedException { CountDownLatch startLatch = new CountDownLatch(1); Service service = new RetryOnStartFailureService( createServiceSupplier(3, startLatch, new CountDownLatch(1), false), RetryStrategies.fixDelay(10, TimeUnit.MILLISECONDS)); service.startAndWait(); Assert.assertTrue(startLatch.await(1, TimeUnit.SECONDS)); }
@Test public void testStopWhileRetrying() throws InterruptedException { // This test the service can be stopped during failure retry CountDownLatch failureLatch = new CountDownLatch(1); Service service = new RetryOnStartFailureService( createServiceSupplier(1000, new CountDownLatch(1), failureLatch, false), RetryStrategies.fixDelay(10, TimeUnit.MILLISECONDS)); service.startAndWait(); Assert.assertTrue(failureLatch.await(1, TimeUnit.SECONDS)); service.stopAndWait(); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(flowletContext.getLoggingContext()); flowletContext.getProgramMetrics().increment("process.instance", 1); flowletProcessDriver = new FlowletProcessDriver(flowletContext, dataFabricFacade, txCallback, processSpecs); serviceHook.startAndWait(); initFlowlet(); flowletProcessDriver.startAndWait(); LOG.info("Started Flowlet '{}' for Flow '{}'. Flowlet details: [{}]", flowletContext.getFlowletId(), flowletContext.getFlowId(), flowletContext); }
@BeforeClass public static void init() throws Exception { cConf = CConfiguration.create(); cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath()); Injector injector = AppFabricTestHelper.getInjector(cConf, new AuditModule().getDistributedModules()); messagingService = injector.getInstance(MessagingService.class); if (messagingService instanceof Service) { ((Service) messagingService).startAndWait(); } auditTopic = NamespaceId.SYSTEM.topic(cConf.get(Constants.Audit.TOPIC)); }