Search in sources :

Example 36 with Service

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));
}
Also used : ClientFactoryImpl(io.pravega.client.stream.impl.ClientFactoryImpl) ControllerImpl(io.pravega.client.control.impl.ControllerImpl) Service(io.pravega.test.system.framework.services.Service) StreamManagerImpl(io.pravega.client.admin.impl.StreamManagerImpl) SocketConnectionFactoryImpl(io.pravega.client.connection.impl.SocketConnectionFactoryImpl) URI(java.net.URI) Before(org.junit.Before)

Example 37 with Service

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));
}
Also used : Service(io.pravega.test.system.framework.services.Service) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) URI(java.net.URI) Before(org.junit.Before)

Example 38 with Service

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));
}
Also used : Service(io.pravega.test.system.framework.services.Service) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) URI(java.net.URI) Before(org.junit.Before)

Example 39 with Service

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");
}
Also used : Service(io.pravega.test.system.framework.services.Service) URI(java.net.URI) Test(org.junit.Test)

Example 40 with Service

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));
}
Also used : Service(io.pravega.test.system.framework.services.Service) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) URI(java.net.URI) Before(org.junit.Before)

Aggregations

Service (io.pravega.test.system.framework.services.Service)48 URI (java.net.URI)41 Before (org.junit.Before)18 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)16 ControllerImpl (io.pravega.client.control.impl.ControllerImpl)12 Environment (io.pravega.test.system.framework.Environment)12 ClientConfig (io.pravega.client.ClientConfig)10 StreamManagerImpl (io.pravega.client.admin.impl.StreamManagerImpl)8 ClientFactoryImpl (io.pravega.client.stream.impl.ClientFactoryImpl)8 Test (org.junit.Test)8 ExecutionException (java.util.concurrent.ExecutionException)7 SocketConnectionFactoryImpl (io.pravega.client.connection.impl.SocketConnectionFactoryImpl)6 Cleanup (lombok.Cleanup)5 ReaderGroupManager (io.pravega.client.admin.ReaderGroupManager)3 PravegaControllerService (io.pravega.test.system.framework.services.marathon.PravegaControllerService)3 EventStreamClientFactory (io.pravega.client.EventStreamClientFactory)2 StreamManager (io.pravega.client.admin.StreamManager)2 ConnectionFactory (io.pravega.client.connection.impl.ConnectionFactory)2 ControllerImpl (io.pravega.client.stream.impl.ControllerImpl)2 Invocation (javax.ws.rs.client.Invocation)2