@Test public void testFindShard() { ModuleShardStrategy moduleShardStrategy = new ModuleShardStrategy("cars", configuration); String shard = moduleShardStrategy.findShard(CarsModel.BASE_PATH); assertEquals("cars-1", shard); }
@Override public String findShard(YangInstanceIdentifier path) { String shardName = configuration.getShardNameForModule(moduleName); return shardName != null ? shardName : DefaultShardStrategy.DEFAULT_SHARD; }
ModuleShardStrategy implements ShardStrategy { @Override public String findShard(YangInstanceIdentifier path) { String shardName = configuration.getShardNameForModule(moduleName); return shardName != null ? shardName : DefaultShardStrategy.DEFAULT_SHARD; } }
ModuleShardStrategy implements ShardStrategy { @Override public String findShard(YangInstanceIdentifier path) { String shardName = configuration.getShardNameForModule(moduleName); return shardName != null ? shardName : DefaultShardStrategy.DEFAULT_SHARD; } ModuleShardStrategy(String moduleName, Configuration configuration); }
ModuleShardStrategy implements ShardStrategy { @Override public String findShard(YangInstanceIdentifier path) { String shardName = configuration.getShardNameForModule(moduleName); return shardName != null ? shardName : DefaultShardStrategy.DEFAULT_SHARD; } ModuleShardStrategy(String moduleName, Configuration configuration); @Override String findShard(YangInstanceIdentifier path); @Override YangInstanceIdentifier getPrefixForPath(YangInstanceIdentifier path); }
ModuleShardStrategy implements ShardStrategy { @Override public String findShard(YangInstanceIdentifier path) { String shardName = configuration.getShardNameForModule(moduleName); return shardName != null ? shardName : DefaultShardStrategy.DEFAULT_SHARD; } ModuleShardStrategy(String moduleName, Configuration configuration); @Override String findShard(YangInstanceIdentifier path); @Override YangInstanceIdentifier getPrefixForPath(YangInstanceIdentifier path); static final String NAME; }