use of io.pravega.test.system.framework.services.Service in project pravega by pravega.
the class ReadTxnWriteScaleWithFailoverTest method setup.
@Before
public void setup() {
// Get zk details to verify if controller, segmentstore are running
Service zkService = Utils.createZookeeperService();
List<URI> zkUris = zkService.getServiceDetails();
log.debug("Zookeeper service details: {}", zkUris);
// get the zk ip details and pass it to host, controller
URI zkUri = zkUris.get(0);
// Verify controller is running.
controllerInstance = Utils.createPravegaControllerService(zkUri);
assertTrue(controllerInstance.isRunning());
List<URI> conURIs = controllerInstance.getServiceDetails();
log.info("Pravega Controller service instance details: {}", conURIs);
// Fetch all the RPC endpoints and construct the client URIs.
final List<String> uris = conURIs.stream().filter(ISGRPC).map(URI::getAuthority).collect(Collectors.toList());
controllerURIDirect = URI.create((Utils.TLS_AND_AUTH_ENABLED ? TLS : TCP) + String.join(",", uris));
log.info("Controller Service direct URI: {}", controllerURIDirect);
// Verify segment store is running.
segmentStoreInstance = Utils.createPravegaSegmentStoreService(zkUri, controllerURIDirect);
assertTrue(segmentStoreInstance.isRunning());
log.info("Pravega Segmentstore service instance details: {}", segmentStoreInstance.getServiceDetails());
// num. of readers + num. of writers + 1 to run checkScale operation
executorService = ExecutorServiceHelpers.newScheduledThreadPool(NUM_READERS + NUM_WRITERS + 1, "ReadTxnWriteScaleWithFailoverTest-main");
controllerExecutorService = ExecutorServiceHelpers.newScheduledThreadPool(2, "ReadTxnWriteScaleWithFailoverTest-controller");
ClientConfig clientConfig = Utils.buildClientConfig(controllerURIDirect);
// get Controller Uri
controller = new ControllerImpl(ControllerImplConfig.builder().clientConfig(clientConfig).maxBackoffMillis(5000).build(), controllerExecutorService);
testState = new TestState(true);
streamManager = new StreamManagerImpl(clientConfig);
createScopeAndStream(scope, stream, config, streamManager);
log.info("Scope passed to client factory {}", scope);
clientFactory = new ClientFactoryImpl(scope, controller, clientConfig);
readerGroupManager = ReaderGroupManager.withScope(scope, clientConfig);
}
use of io.pravega.test.system.framework.services.Service in project pravega by pravega.
the class ReadWriteAndAutoScaleWithFailoverTest method setup.
@Before
public void setup() {
// Get zk details to verify if controller, SSS are running
Service zkService = Utils.createZookeeperService();
List<URI> zkUris = zkService.getServiceDetails();
log.debug("Zookeeper service details: {}", zkUris);
// get the zk ip details and pass it to host, controller
URI zkUri = zkUris.get(0);
// Verify controller is running.
controllerInstance = Utils.createPravegaControllerService(zkUri);
assertTrue(controllerInstance.isRunning());
List<URI> conURIs = controllerInstance.getServiceDetails();
log.info("Pravega Controller service instance details: {}", conURIs);
// Fetch all the RPC endpoints and construct the client URIs.
final List<String> uris = conURIs.stream().filter(ISGRPC).map(URI::getAuthority).collect(Collectors.toList());
controllerURIDirect = URI.create("tcp://" + String.join(",", uris));
log.info("Controller Service direct URI: {}", controllerURIDirect);
// Verify segment store is running.
segmentStoreInstance = Utils.createPravegaSegmentStoreService(zkUri, controllerURIDirect);
assertTrue(segmentStoreInstance.isRunning());
log.info("Pravega Segmentstore service instance details: {}", segmentStoreInstance.getServiceDetails());
// executor service
executorService = ExecutorServiceHelpers.newScheduledThreadPool(NUM_READERS + TOTAL_NUM_WRITERS + 1, "ReadWriteAndAutoScaleWithFailoverTest-main");
controllerExecutorService = ExecutorServiceHelpers.newScheduledThreadPool(2, "ReadWriteAndAutoScaleWithFailoverTest-controller");
// get Controller Uri
ClientConfig clientConfig = Utils.buildClientConfig(controllerURIDirect);
controller = new ControllerImpl(ControllerImplConfig.builder().clientConfig(clientConfig).maxBackoffMillis(5000).build(), controllerExecutorService);
testState = new TestState(false);
streamManager = new StreamManagerImpl(clientConfig);
createScopeAndStream(scope, AUTO_SCALE_STREAM, config, streamManager);
log.info("Scope passed to client factory {}", scope);
clientFactory = new ClientFactoryImpl(scope, controller, clientConfig);
readerGroupManager = ReaderGroupManager.withScope(scope, clientConfig);
}
use of io.pravega.test.system.framework.services.Service in project pravega by pravega.
the class ReaderCheckpointTest method fetchControllerURI.
private URI fetchControllerURI() {
Service conService = Utils.createPravegaControllerService(null);
List<URI> ctlURIs = conService.getServiceDetails();
return ctlURIs.get(0);
}
use of io.pravega.test.system.framework.services.Service in project pravega by pravega.
the class AbstractSystemTest method startPravegaSegmentStoreInstances.
static void startPravegaSegmentStoreInstances(final URI zkUri, final URI controllerURI, final int instanceCount) throws ExecutionException {
Service segService = Utils.createPravegaSegmentStoreService(zkUri, controllerURI);
if (!segService.isRunning()) {
segService.start(true);
}
Futures.getAndHandleExceptions(segService.scaleService(instanceCount), ExecutionException::new);
List<URI> segUris = segService.getServiceDetails();
log.info("Pravega Segmentstore service details: {}", segUris);
}
use of io.pravega.test.system.framework.services.Service in project pravega by pravega.
the class AbstractSystemTest method startZookeeperInstance.
static URI startZookeeperInstance() {
Service zkService = Utils.createZookeeperService();
if (!zkService.isRunning()) {
zkService.start(true);
}
List<URI> zkUris = zkService.getServiceDetails();
log.debug("Zookeeper service details: {}", zkUris);
return zkUris.get(0);
}
Aggregations