use of io.pravega.test.integration.demo.ControllerWrapper in project pravega by pravega.
the class ControllerFailoverTest method testSessionExpiryToleranceMinimalServices.
@Test(timeout = 120000)
public void testSessionExpiryToleranceMinimalServices() throws Exception {
final int controllerPort = TestUtils.getAvailableListenPort();
final String serviceHost = "localhost";
final int containerCount = 4;
final ControllerWrapper controllerWrapper = new ControllerWrapper(zkTestServer.getConnectString(), false, false, controllerPort, serviceHost, servicePort, containerCount, -1);
testSessionExpiryTolerance(controllerWrapper, controllerPort);
}
use of io.pravega.test.integration.demo.ControllerWrapper in project pravega by pravega.
the class ControllerStreamMetadataTest method setUp.
@Before
public void setUp() throws Exception {
final int controllerPort = TestUtils.getAvailableListenPort();
final String serviceHost = "localhost";
final int servicePort = TestUtils.getAvailableListenPort();
final int containerCount = 4;
try {
// 1. Start ZK
this.zkTestServer = new TestingServerStarter().start();
// 2. Start Pravega service.
ServiceBuilder serviceBuilder = ServiceBuilder.newInMemoryBuilder(ServiceBuilderConfig.getDefaultConfig());
serviceBuilder.initialize();
StreamSegmentStore store = serviceBuilder.createStreamSegmentService();
this.server = new PravegaConnectionListener(false, servicePort, store);
this.server.startListening();
// 3. Start controller
this.controllerWrapper = new ControllerWrapper(zkTestServer.getConnectString(), false, controllerPort, serviceHost, servicePort, containerCount);
this.controllerWrapper.awaitRunning();
this.controller = controllerWrapper.getController();
this.streamConfiguration = StreamConfiguration.builder().scope(SCOPE).streamName(STREAM).scalingPolicy(ScalingPolicy.fixed(1)).build();
} catch (Exception e) {
log.error("Error during setup", e);
throw e;
}
}
use of io.pravega.test.integration.demo.ControllerWrapper in project pravega by pravega.
the class SetupUtils method startAllServices.
/**
* Start all pravega related services required for the test deployment.
*
* @param numThreads the number of threads for the internal client threadpool.
* @throws Exception on any errors.
*/
public void startAllServices(Integer numThreads) throws Exception {
if (!this.started.compareAndSet(false, true)) {
log.warn("Services already started, not attempting to start again");
return;
}
this.connectionFactory = new ConnectionFactoryImpl(clientConfig, numThreads);
this.controller = new ControllerImpl(ControllerImplConfig.builder().clientConfig(clientConfig).build(), connectionFactory.getInternalExecutor());
this.clientFactory = new ClientFactoryImpl(scope, controller, connectionFactory);
// Start zookeeper.
this.zkTestServer = new TestingServerStarter().start();
this.zkTestServer.start();
// Start Pravega Service.
ServiceBuilder serviceBuilder = ServiceBuilder.newInMemoryBuilder(ServiceBuilderConfig.getDefaultConfig());
serviceBuilder.initialize();
StreamSegmentStore store = serviceBuilder.createStreamSegmentService();
this.server = new PravegaConnectionListener(false, servicePort, store);
this.server.startListening();
log.info("Started Pravega Service");
// Start Controller.
this.controllerWrapper = new ControllerWrapper(this.zkTestServer.getConnectString(), false, true, controllerRPCPort, "localhost", servicePort, Config.HOST_STORE_CONTAINER_COUNT, controllerRESTPort);
this.controllerWrapper.awaitRunning();
this.controllerWrapper.getController().createScope(scope).get();
log.info("Initialized Pravega Controller");
}
use of io.pravega.test.integration.demo.ControllerWrapper in project pravega by pravega.
the class ControllerFailoverTest method testStop.
@Test(timeout = 30000)
public void testStop() throws Exception {
final int controllerPort = TestUtils.getAvailableListenPort();
final String serviceHost = "localhost";
final int containerCount = 4;
final ControllerWrapper controllerWrapper = new ControllerWrapper(zkTestServer.getConnectString(), false, false, controllerPort, serviceHost, servicePort, containerCount, TestUtils.getAvailableListenPort());
controllerWrapper.awaitRunning();
controllerWrapper.close();
}
use of io.pravega.test.integration.demo.ControllerWrapper in project pravega by pravega.
the class ReadWriteTest method setup.
@Before
public void setup() throws Exception {
final int controllerPort = TestUtils.getAvailableListenPort();
final String serviceHost = "localhost";
final int servicePort = TestUtils.getAvailableListenPort();
final int containerCount = 4;
// 1. Start ZK
this.zkTestServer = new TestingServerStarter().start();
// 2. Start Pravega SegmentStore service.
ServiceBuilder serviceBuilder = ServiceBuilder.newInMemoryBuilder(ServiceBuilderConfig.getDefaultConfig());
serviceBuilder.initialize();
StreamSegmentStore store = serviceBuilder.createStreamSegmentService();
this.server = new PravegaConnectionListener(false, servicePort, store);
this.server.startListening();
// 3. Start Pravega Controller service
this.controllerWrapper = new ControllerWrapper(zkTestServer.getConnectString(), false, controllerPort, serviceHost, servicePort, containerCount);
this.controllerWrapper.awaitRunning();
this.controller = controllerWrapper.getController();
}
Aggregations