use of com.twitter.distributedlog.service.DistributedLogCluster.DLServer in project distributedlog by twitter.
the class DistributedLogServerTestCase method setupNoAdHocCluster.
public void setupNoAdHocCluster() throws Exception {
noAdHocCluster = createCluster(noAdHocConf);
noAdHocCluster.start();
noAdHocServer = new DLServer(noAdHocConf, noAdHocCluster.getUri(), 7002);
noAdHocClient = createDistributedLogClient("no-ad-hoc-client");
}
use of com.twitter.distributedlog.service.DistributedLogCluster.DLServer in project distributedlog by twitter.
the class TestRegionUnavailable method setup.
@Before
@Override
public void setup() throws Exception {
DistributedLogConfiguration localConf = new DistributedLogConfiguration();
localConf.addConfiguration(conf);
localConf.setFeatureProviderClass(TestFeatureProvider.class);
DistributedLogConfiguration remoteConf = new DistributedLogConfiguration();
remoteConf.addConfiguration(conf);
super.setup();
int localPort = 9010;
int remotePort = 9020;
for (int i = 0; i < numServersPerDC; i++) {
localCluster.add(createDistributedLogServer(localConf, localPort + i));
remoteCluster.add(createDistributedLogServer(remoteConf, remotePort + i));
}
Map<SocketAddress, String> regionMap = new HashMap<SocketAddress, String>();
for (DLServer server : localCluster) {
regionMap.put(server.getAddress(), "local");
}
for (DLServer server : remoteCluster) {
regionMap.put(server.getAddress(), "remote");
}
client = createTwoRegionDLClient("two_regions_client", regionMap);
}
use of com.twitter.distributedlog.service.DistributedLogCluster.DLServer in project distributedlog by twitter.
the class TestRegionUnavailable method testRegionUnavailable.
@Test(timeout = 60000)
public void testRegionUnavailable() throws Exception {
String name = "dlserver-region-unavailable";
registerStream(name);
for (long i = 1; i <= 10; i++) {
client.dlClient.write(name, ByteBuffer.wrap(("" + i).getBytes())).get();
}
// check local region
for (DLServer server : localCluster) {
checkStreams(0, server);
}
}
Aggregations