use of com.twitter.heron.common.network.HeronSocketOptions in project heron by twitter.
the class HandleWriteTest method runStreamManagerClient.
void runStreamManagerClient() {
Runnable r = new Runnable() {
@Override
public void run() {
try {
SystemConfig systemConfig = (SystemConfig) SingletonRegistry.INSTANCE.getSingleton(SystemConfig.HERON_SYSTEM_CONFIG);
HeronSocketOptions socketOptions = new HeronSocketOptions(systemConfig.getInstanceNetworkWriteBatchSizeBytes(), systemConfig.getInstanceNetworkWriteBatchTimeMs(), systemConfig.getInstanceNetworkReadBatchSizeBytes(), systemConfig.getInstanceNetworkReadBatchTimeMs(), systemConfig.getInstanceNetworkOptionsSocketSendBufferSizeBytes(), systemConfig.getInstanceNetworkOptionsSocketReceivedBufferSizeBytes());
streamManagerClient = new StreamManagerClient(nioLooper, HOST, serverPort, "topology-name", "topologyId", UnitTestHelper.getInstance("bolt-id"), inStreamQueue, outStreamQueue, inControlQueue, socketOptions, gatewayMetrics);
streamManagerClient.start();
nioLooper.loop();
} finally {
streamManagerClient.stop();
nioLooper.exitLoop();
}
}
};
threadsPool.execute(r);
}
use of com.twitter.heron.common.network.HeronSocketOptions in project heron by twitter.
the class HandleTMasterLocationTest method before.
@Before
public void before() throws Exception {
// Get an available port
serverPort = SysUtils.getFreePort();
threadsPool = Executors.newFixedThreadPool(2);
HeronSocketOptions serverSocketOptions = new HeronSocketOptions(100 * 1024 * 1024, 100, 100 * 1024 * 1024, 100, 5 * 1024 * 1024, 5 * 1024 * 1024);
serverLooper = new NIOLooper();
// Spy it for unit test
metricsManagerServer = Mockito.spy(new MetricsManagerServer(serverLooper, SERVER_HOST, serverPort, serverSocketOptions, new MultiCountMetric()));
}
use of com.twitter.heron.common.network.HeronSocketOptions in project heron by twitter.
the class MetricsManagerServerTest method before.
@Before
public void before() throws Exception {
// Get an available port
serverPort = SysUtils.getFreePort();
threadsPool = Executors.newFixedThreadPool(2);
HeronSocketOptions serverSocketOptions = new HeronSocketOptions(100 * 1024 * 1024, 100, 100 * 1024 * 1024, 100, 5 * 1024 * 1024, 5 * 1024 * 1024);
serverLooper = new NIOLooper();
metricsManagerServer = new MetricsManagerServer(serverLooper, SERVER_HOST, serverPort, serverSocketOptions, new MultiCountMetric());
}
use of com.twitter.heron.common.network.HeronSocketOptions in project heron by twitter.
the class HandleReadTest method runStreamManagerClient.
void runStreamManagerClient() {
Runnable r = new Runnable() {
@Override
public void run() {
try {
SystemConfig systemConfig = (SystemConfig) SingletonRegistry.INSTANCE.getSingleton(SystemConfig.HERON_SYSTEM_CONFIG);
HeronSocketOptions socketOptions = new HeronSocketOptions(systemConfig.getInstanceNetworkWriteBatchSizeBytes(), systemConfig.getInstanceNetworkWriteBatchTimeMs(), systemConfig.getInstanceNetworkReadBatchSizeBytes(), systemConfig.getInstanceNetworkReadBatchTimeMs(), systemConfig.getInstanceNetworkOptionsSocketSendBufferSizeBytes(), systemConfig.getInstanceNetworkOptionsSocketReceivedBufferSizeBytes());
streamManagerClient = new StreamManagerClient(nioLooper, HOST, serverPort, "topology-name", "topologyId", UnitTestHelper.getInstance("bolt-id"), inStreamQueue, outStreamQueue, inControlQueue, socketOptions, gatewayMetrics);
streamManagerClient.start();
nioLooper.loop();
} finally {
streamManagerClient.stop();
nioLooper.exitLoop();
}
}
};
threadsPool.execute(r);
}
use of com.twitter.heron.common.network.HeronSocketOptions in project heron by twitter.
the class ConnectTest method runStreamManagerClient.
void runStreamManagerClient() {
Runnable r = new Runnable() {
@Override
public void run() {
try {
SystemConfig systemConfig = (SystemConfig) SingletonRegistry.INSTANCE.getSingleton(SystemConfig.HERON_SYSTEM_CONFIG);
HeronSocketOptions socketOptions = new HeronSocketOptions(systemConfig.getInstanceNetworkWriteBatchSizeBytes(), systemConfig.getInstanceNetworkWriteBatchTimeMs(), systemConfig.getInstanceNetworkReadBatchSizeBytes(), systemConfig.getInstanceNetworkReadBatchTimeMs(), systemConfig.getInstanceNetworkOptionsSocketSendBufferSizeBytes(), systemConfig.getInstanceNetworkOptionsSocketReceivedBufferSizeBytes());
streamManagerClient = new StreamManagerClient(nioLooper, HOST, serverPort, "topology-name", "topologyId", UnitTestHelper.getInstance("bolt-id"), inStreamQueue, outStreamQueue, inControlQueue, socketOptions, gatewayMetrics);
streamManagerClient.start();
nioLooper.loop();
} finally {
streamManagerClient.stop();
nioLooper.exitLoop();
}
}
};
threadsPool.execute(r);
}
Aggregations