Search in sources :

Example 6 with NIOLooper

use of org.apache.heron.common.basics.NIOLooper in project heron by twitter.

the class MetricsManagerServerTest method before.

@Before
public void before() throws IOException {
    metricsManagerServer = new MetricsManagerServer(new NIOLooper(), HeronServerTester.SERVER_HOST, SysUtils.getFreePort(), HeronServerTester.TEST_SOCKET_OPTIONS, new MultiCountMetric());
    serverTester = new HeronServerTester(metricsManagerServer, new MetricsManagerClientRequestHandler(), new HeronServerTester.SuccessResponseHandler(Metrics.MetricPublisherRegisterResponse.class, new MetricsManagerClientResponseHandler(MESSAGE_SIZE)), RESPONSE_RECEIVED_TIMEOUT);
}
Also used : Metrics(org.apache.heron.proto.system.Metrics) NIOLooper(org.apache.heron.common.basics.NIOLooper) MultiCountMetric(org.apache.heron.api.metric.MultiCountMetric) HeronServerTester(org.apache.heron.common.testhelpers.HeronServerTester) Before(org.junit.Before)

Example 7 with NIOLooper

use of org.apache.heron.common.basics.NIOLooper in project heron by twitter.

the class CheckpointManager method init.

public void init(String topologyName, String topologyId, String checkpointMgrId, String serverHost, int serverPort, SystemConfig systemConfig, CheckpointManagerConfig checkpointManagerConfig) throws IOException, CheckpointManagerException {
    LOG.info("Initializing CheckpointManager");
    checkpointManagerServerLoop = new NIOLooper();
    HeronSocketOptions serverSocketOptions = new HeronSocketOptions(checkpointManagerConfig.getWriteBatchSize(), checkpointManagerConfig.getWriteBatchTime(), checkpointManagerConfig.getReadBatchSize(), checkpointManagerConfig.getReadBatchTime(), checkpointManagerConfig.getSocketSendSize(), checkpointManagerConfig.getSocketReceiveSize(), checkpointManagerConfig.getMaximumPacketSize());
    // Setup the IStatefulStorage
    IStatefulStorage statefulStorage = setupStatefulStorage(topologyName, checkpointManagerConfig);
    // Start the server
    this.checkpointManagerServer = new CheckpointManagerServer(topologyName, topologyId, checkpointMgrId, statefulStorage, checkpointManagerServerLoop, serverHost, serverPort, serverSocketOptions);
}
Also used : NIOLooper(org.apache.heron.common.basics.NIOLooper) HeronSocketOptions(org.apache.heron.common.network.HeronSocketOptions) IStatefulStorage(org.apache.heron.spi.statefulstorage.IStatefulStorage)

Aggregations

NIOLooper (org.apache.heron.common.basics.NIOLooper)7 HeronServerTester (org.apache.heron.common.testhelpers.HeronServerTester)4 Before (org.junit.Before)4 CountDownLatch (java.util.concurrent.CountDownLatch)2 SystemConfig (org.apache.heron.common.config.SystemConfig)2 HeronSocketOptions (org.apache.heron.common.network.HeronSocketOptions)2 Metrics (org.apache.heron.proto.system.Metrics)2 MultiCountMetric (org.apache.heron.api.metric.MultiCountMetric)1 MetricsSinksConfig (org.apache.heron.metricsmgr.MetricsSinksConfig)1 TopologyManager (org.apache.heron.proto.tmanager.TopologyManager)1 IStatefulStorage (org.apache.heron.spi.statefulstorage.IStatefulStorage)1 Test (org.junit.Test)1