private Router createRouter(String[] conf) {
if (HASH.equalsIgnoreCase(conf[0])) {
RouterFactory factory = new RouterFactory(HASH) {
@Override
public Router onCreateRouter(String column, String pattern, int partitions) {
return new HashRouter(column, pattern, partitions);
}
};
return factory.setColumn(conf[2]).setPattern(conf[3]).setPartition(conf[4]).createRouter();
} else if (RANGE.equalsIgnoreCase(conf[0])) {
RouterFactory factory = new RouterFactory(RANGE) {