public static ServiceName<AbstractRaftState> candidateServiceName(String raftName, int term) { return ServiceName.newServiceName( String.format("raft.candidate.%s.%d", raftName, term), AbstractRaftState.class); } }
@Override public String getName() { return name.getName(); }
public <S> S getService(final ServiceName<S> serviceName) { final ServiceContainer serviceContainer = broker.getBrokerContext().getServiceContainer(); final Injector<S> injector = new Injector<>(); final ServiceName<TestService> accessorServiceName = ServiceName.newServiceName("serviceAccess" + serviceName.getName(), TestService.class); try { serviceContainer .createService(accessorServiceName, new TestService()) .dependency(serviceName, injector) .install() .get(); } catch (final InterruptedException | ExecutionException e) { throw new RuntimeException(e); } serviceContainer.removeService(accessorServiceName); return injector.getValue(); }
public <S> S getService(final ServiceName<S> serviceName) { final ServiceContainer serviceContainer = broker.getBrokerContext().getServiceContainer(); final Injector<S> injector = new Injector<>(); final ServiceName<TestService> accessorServiceName = ServiceName.newServiceName("serviceAccess" + serviceName.getName(), TestService.class); try { serviceContainer .createService(accessorServiceName, new TestService()) .dependency(serviceName, injector) .install() .get(); } catch (final InterruptedException | ExecutionException e) { throw new RuntimeException(e); } serviceContainer.removeService(accessorServiceName); return injector.getValue(); }
public static final ServiceName<LogStorageAppender> logStorageAppenderServiceName( String logName) { return ServiceName.newServiceName( String.format("logstream.%s.storage.appender", logName), LogStorageAppender.class); }
public <S> S getService(final ServiceName<S> serviceName) { final ServiceContainer serviceContainer = broker.getBrokerContext().getServiceContainer(); final Injector<S> injector = new Injector<>(); final ServiceName<TestService> accessorServiceName = ServiceName.newServiceName("serviceAccess" + serviceName.getName(), TestService.class); try { serviceContainer .createService(accessorServiceName, new TestService()) .dependency(serviceName, injector) .install() .get(); } catch (final InterruptedException | ExecutionException e) { throw new RuntimeException(e); } serviceContainer.removeService(accessorServiceName); return injector.getValue(); }
@Override public String getName() { return name.getName(); }
public static ServiceName<Void> replicateLogConrollerServiceName( String raftName, int term, int followerNodeId) { return ServiceName.newServiceName( String.format("raft.leader.%s.%d.replicate.%d", raftName, term, followerNodeId), Void.class); }
public <S> S getService(final ServiceName<S> serviceName) { final ServiceContainer serviceContainer = broker.getBrokerContext().getServiceContainer(); final Injector<S> injector = new Injector<>(); final ServiceName<TestService> accessorServiceName = ServiceName.newServiceName("serviceAccess" + serviceName.getName(), TestService.class); try { serviceContainer .createService(accessorServiceName, new TestService()) .dependency(serviceName, injector) .install() .get(); } catch (final InterruptedException | ExecutionException e) { throw new RuntimeException(e); } serviceContainer.removeService(accessorServiceName); return injector.getValue(); }
public <T> void removeService(final ServiceName<T> name) { try { broker.getBrokerContext().getServiceContainer().removeService(name).get(10, TimeUnit.SECONDS); } catch (final InterruptedException | ExecutionException | TimeoutException e) { throw new RuntimeException("Could not remove service " + name.getName() + " in 10 seconds."); } }
public static final ServiceName<Subscription> logWriteBufferSubscriptionServiceName( String logName, String subscriptionName) { return ServiceName.newServiceName( String.format("logstream.%s.writeBuffer.subscription.%s", logName, subscriptionName), Subscription.class); }
public <T> void removeService(final ServiceName<T> name) { try { broker.getBrokerContext().getServiceContainer().removeService(name).get(10, TimeUnit.SECONDS); } catch (final InterruptedException | ExecutionException | TimeoutException e) { throw new RuntimeException("Could not remove service " + name.getName() + " in 10 seconds."); } }
public static final ServiceName<StateStorageFactory> stateStorageFactoryServiceName( String partitionName) { return ServiceName.newServiceName( String.format("%s.rocksdb.storage", partitionName), StateStorageFactory.class); }
final String errorMessage = "Could not complete installation of " + compositeServiceName.getName() + ": Failed to install " + futures.getKey();
public static ServiceName<Void> replicateLogConrollerServiceName( String raftName, int term, int followerNodeId) { return ServiceName.newServiceName( String.format("raft.leader.%s.%d.replicate.%d", raftName, term, followerNodeId), Void.class); }
final String errorMessage = "Could not complete installation of " + compositeServiceName.getName() + ": Failed to install " + futures.getKey();
public static final ServiceName<StreamProcessorService> streamProcessorService( String logName, String processorName) { return ServiceName.newServiceName( String.format("logstream.%s.processor.%s", logName, processorName), StreamProcessorService.class); } }
LOG.debug( String.format( "Service %s interrupted while building", serviceName.getName())); } else { LOG.error("Failed to build service", t);
public static ServiceName<ClientTransport> clientTransport(String identifier) { return ServiceName.newServiceName( String.format("transport.%s.client", identifier), ClientTransport.class); } }
LOG.debug( String.format( "Service %s interrupted while building", serviceName.getName())); } else { LOG.error("Failed to build service", t);