use of io.pravega.test.system.framework.services.Service in project pravega by pravega.
the class BookieFailoverTest 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 bookie is running
bookkeeperService = Utils.createBookkeeperService(zkUri);
List<URI> bkUris = bookkeeperService.getServiceDetails();
log.debug("Bookkeeper service details: {}", bkUris);
// 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());
executorService = ExecutorServiceHelpers.newScheduledThreadPool(NUM_READERS + NUM_WRITERS + 1, "BookieFailoverTest-main");
controllerExecutorService = ExecutorServiceHelpers.newScheduledThreadPool(2, "BookieFailoverTest-controller");
// get Controller Uri
controller = new ControllerImpl(ControllerImplConfig.builder().clientConfig(Utils.buildClientConfig(controllerURIDirect)).maxBackoffMillis(5000).build(), controllerExecutorService);
testState = new TestState(false);
// read and write count variables
testState.writersListComplete.add(0, testState.writersComplete);
streamManager = new StreamManagerImpl(Utils.buildClientConfig(controllerURIDirect));
createScopeAndStream(SCOPE, STREAM, config, streamManager);
log.info("Scope passed to client factory {}", SCOPE);
clientFactory = new ClientFactoryImpl(SCOPE, controller, new SocketConnectionFactoryImpl(Utils.buildClientConfig(controllerURIDirect)));
readerGroupManager = ReaderGroupManager.withScope(SCOPE, Utils.buildClientConfig(controllerURIDirect));
}
use of io.pravega.test.system.framework.services.Service in project pravega by pravega.
the class ByteClientTest method setup.
@Before
public void setup() {
Service conService = Utils.createPravegaControllerService(null);
List<URI> ctlURIs = conService.getServiceDetails();
controllerURI = ctlURIs.get(0);
streamManager = StreamManager.create(Utils.buildClientConfig(controllerURI));
assertTrue("Creating scope", streamManager.createScope(SCOPE));
assertTrue("Creating stream", streamManager.createStream(SCOPE, STREAM, config));
}
use of io.pravega.test.system.framework.services.Service in project pravega by pravega.
the class BatchClientSimpleTest method setup.
@Before
public void setup() {
Service conService = Utils.createPravegaControllerService(null);
List<URI> ctlURIs = conService.getServiceDetails();
controllerURI = ctlURIs.get(0);
streamManager = StreamManager.create(Utils.buildClientConfig(controllerURI));
assertTrue("Creating scope", streamManager.createScope(SCOPE));
assertTrue("Creating stream", streamManager.createStream(SCOPE, STREAM, config));
}
use of io.pravega.test.system.framework.services.Service in project pravega by pravega.
the class BookkeeperTest method bkTest.
/**
* Invoke the bookkeeper test.
* The test fails in case bookkeeper is not running on given port.
*/
@Test
public void bkTest() {
log.debug("Start execution of bkTest");
Service bk = Utils.createBookkeeperService(null);
List<URI> bkUri = bk.getServiceDetails();
log.debug("Bk Service URI details: {} ", bkUri);
for (int i = 0; i < bkUri.size(); i++) {
assertEquals(3181, bkUri.get(i).getPort());
}
log.debug("BkTest execution completed");
}
use of io.pravega.test.system.framework.services.Service in project pravega by pravega.
the class ControllerFailoverTest method getControllerInfo.
@Before
public void getControllerInfo() {
Service zkService = Utils.createZookeeperService();
Assert.assertTrue(zkService.isRunning());
List<URI> zkUris = zkService.getServiceDetails();
log.info("zookeeper service details: {}", zkUris);
controllerService = Utils.createPravegaControllerService(zkUris.get(0));
if (!controllerService.isRunning()) {
controllerService.start(true);
}
List<URI> controllerUris = controllerService.getServiceDetails();
log.info("Controller uris: {} {}", controllerUris.get(0), controllerUris.get(1));
log.debug("Pravega Controller service details: {}", controllerUris);
// Fetch all the RPC endpoints and construct the client URIs.
final List<String> uris = controllerUris.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);
segmentStoreService = Utils.createPravegaSegmentStoreService(zkUris.get(0), controllerUris.get(0));
}
Aggregations