Search in sources :

Example 21 with Service

use of io.pravega.test.system.framework.services.Service in project pravega by pravega.

the class AbstractSystemTest method startPravegaControllerInstances.

static URI startPravegaControllerInstances(final URI zkUri, final int instanceCount) throws ExecutionException {
    Service controllerService = Utils.createPravegaControllerService(zkUri);
    if (!controllerService.isRunning()) {
        controllerService.start(true);
    }
    Futures.getAndHandleExceptions(controllerService.scaleService(instanceCount), ExecutionException::new);
    List<URI> conUris = controllerService.getServiceDetails();
    log.info("Pravega Controller service  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());
    URI controllerURI = URI.create((Utils.TLS_AND_AUTH_ENABLED ? TLS : TCP) + String.join(",", uris));
    log.info("Controller Service direct URI: {}", controllerURI);
    return controllerURI;
}
Also used : Service(io.pravega.test.system.framework.services.Service) ExecutionException(java.util.concurrent.ExecutionException) URI(java.net.URI)

Example 22 with Service

use of io.pravega.test.system.framework.services.Service in project pravega by pravega.

the class AbstractSystemTest method startBookkeeperInstances.

static void startBookkeeperInstances(final URI zkUri) {
    Service bkService = Utils.createBookkeeperService(zkUri);
    startBkService(bkService);
}
Also used : Service(io.pravega.test.system.framework.services.Service)

Example 23 with Service

use of io.pravega.test.system.framework.services.Service in project pravega by pravega.

the class BookkeeperTest method initialize.

/**
 * This is used to setup the various services required by the system test framework.
 *
 * @throws MarathonException if error in setup
 */
@Environment
public static void initialize() throws MarathonException {
    Service zk = Utils.createZookeeperService();
    if (!zk.isRunning()) {
        zk.start(true);
    }
    Service bk = Utils.createBookkeeperService(zk.getServiceDetails().get(0));
    if (!bk.isRunning()) {
        bk.start(true);
    }
}
Also used : Service(io.pravega.test.system.framework.services.Service) Environment(io.pravega.test.system.framework.Environment)

Example 24 with Service

use of io.pravega.test.system.framework.services.Service in project pravega by pravega.

the class Utils method createPravegaSegmentStoreService.

public static Service createPravegaSegmentStoreService(final URI zkUri, final URI contUri) {
    URI hdfsUri = null;
    if (DOCKER_BASED) {
        Service hdfsService = new HDFSDockerService("hdfs");
        if (!hdfsService.isRunning()) {
            hdfsService.start(true);
        }
        hdfsUri = hdfsService.getServiceDetails().get(0);
    }
    String serviceId = "segmentstore";
    switch(EXECUTOR_TYPE) {
        case REMOTE_SEQUENTIAL:
            return new PravegaSegmentStoreService(serviceId, zkUri, contUri);
        case DOCKER:
            return new PravegaSegmentStoreDockerService(serviceId, zkUri, hdfsUri, contUri);
        case KUBERNETES:
        default:
            return new PravegaSegmentStoreK8sService(serviceId, zkUri, getPravegaProperties());
    }
}
Also used : PravegaSegmentStoreK8sService(io.pravega.test.system.framework.services.kubernetes.PravegaSegmentStoreK8sService) PravegaSegmentStoreService(io.pravega.test.system.framework.services.marathon.PravegaSegmentStoreService) PravegaSegmentStoreDockerService(io.pravega.test.system.framework.services.docker.PravegaSegmentStoreDockerService) ZookeeperDockerService(io.pravega.test.system.framework.services.docker.ZookeeperDockerService) BookkeeperDockerService(io.pravega.test.system.framework.services.docker.BookkeeperDockerService) HDFSDockerService(io.pravega.test.system.framework.services.docker.HDFSDockerService) ZookeeperService(io.pravega.test.system.framework.services.marathon.ZookeeperService) PravegaSegmentStoreK8sService(io.pravega.test.system.framework.services.kubernetes.PravegaSegmentStoreK8sService) PravegaControllerService(io.pravega.test.system.framework.services.marathon.PravegaControllerService) Service(io.pravega.test.system.framework.services.Service) PravegaControllerK8sService(io.pravega.test.system.framework.services.kubernetes.PravegaControllerK8sService) ZookeeperK8sService(io.pravega.test.system.framework.services.kubernetes.ZookeeperK8sService) PravegaControllerDockerService(io.pravega.test.system.framework.services.docker.PravegaControllerDockerService) BookkeeperService(io.pravega.test.system.framework.services.marathon.BookkeeperService) PravegaSegmentStoreService(io.pravega.test.system.framework.services.marathon.PravegaSegmentStoreService) BookkeeperK8sService(io.pravega.test.system.framework.services.kubernetes.BookkeeperK8sService) HDFSDockerService(io.pravega.test.system.framework.services.docker.HDFSDockerService) URI(java.net.URI) PravegaSegmentStoreDockerService(io.pravega.test.system.framework.services.docker.PravegaSegmentStoreDockerService)

Example 25 with Service

use of io.pravega.test.system.framework.services.Service in project pravega by pravega.

the class AbstractFailoverTests method startBookkeeperInstances.

static void startBookkeeperInstances(final URI zkUri) throws ExecutionException {
    Service bkService = Utils.createBookkeeperService(zkUri);
    if (!bkService.isRunning()) {
        bkService.start(true);
    }
    List<URI> bkUris = bkService.getServiceDetails();
    log.debug("Bookkeeper service details: {}", bkUris);
}
Also used : Service(io.pravega.test.system.framework.services.Service) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) URI(java.net.URI)

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