@Test public void testFindShardWhenModuleConfigurationPresentInModulesButMissingInModuleShards() { final QName baseQName = QName.create( "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test:missing", "2014-03-13", "missing"); final YangInstanceIdentifier BASE_PATH = YangInstanceIdentifier.of(baseQName); ModuleShardStrategy moduleShardStrategy = new ModuleShardStrategy("missing", configuration); String shard = moduleShardStrategy.findShard(BASE_PATH); assertEquals(DefaultShardStrategy.DEFAULT_SHARD, 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; }