use of com.ctrip.xpipe.redis.console.controller.api.RetMessage in project x-pipe by ctripcorp.
the class MetaUpdateTest3 method createShard6.
@Test
public void createShard6() throws Exception {
int taskNum = 3;
ThreadPoolExecutor executorService = new ThreadPoolExecutor(taskNum, taskNum, 1L, TimeUnit.SECONDS, new SynchronousQueue<>());
executorService.prestartAllCoreThreads();
executorService.allowsCoreThreadTimeOut();
for (int i = 0; i < taskNum; i++) {
executorService.execute(new Runnable() {
@Override
public void run() {
ShardCreateInfo shardCreateInfo = new ShardCreateInfo();
shardCreateInfo.setShardMonitorName(shardName);
shardCreateInfo.setShardName(shardName);
RetMessage result = metaUpdate.createShards(clusterName, Lists.newArrayList(shardCreateInfo));
logger.info("{}", result);
}
});
}
waitConditionUntilTimeOut(() -> executorService.getCompletedTaskCount() == taskNum, 2000);
System.out.println("=========================");
List<ShardTbl> shards = shardService.findAllByClusterName(clusterName);
logger.info("{}", shards);
Assert.assertEquals(1, shards.size());
}
use of com.ctrip.xpipe.redis.console.controller.api.RetMessage in project x-pipe by ctripcorp.
the class SentinelUpdateControllerTest method reBalanceSentinels1.
@Test
public void reBalanceSentinels1() throws Exception {
RetMessage message = RetMessage.createSuccessMessage("clusters: " + JSON.toJSONString(Collections.emptyList()));
Assert.assertEquals(message.getMessage(), controller.reBalanceSentinels(null).getMessage());
}
use of com.ctrip.xpipe.redis.console.controller.api.RetMessage in project x-pipe by ctripcorp.
the class SentinelUpdateControllerTest method testReBalanceSentinels.
@Test
public void testReBalanceSentinels() throws Exception {
RetMessage message = RetMessage.createSuccessMessage("clusters: " + JSON.toJSONString(Arrays.asList(clusters)));
Assert.assertEquals(message.getMessage(), controller.reBalanceSentinels(3).getMessage());
}
Aggregations