/** * shard table datanode(2) < function count(3) and check failed */ private void checkRuleSuitTable(TableConfig tableConf) { AbstractPartitionAlgorithm function = tableConf.getRule().getRuleAlgorithm(); int suitValue = function.suitableFor(tableConf); if (suitValue < 0) { throw new ConfigException("Illegal table conf : table [ " + tableConf.getName() + " ] rule function [ " + tableConf.getRule().getFunctionName() + " ] partition size : " + tableConf.getRule().getRuleAlgorithm().getPartitionNum() + " > table datanode size : " + tableConf.getDataNodes().size() + ", please make sure table datanode size = function partition size"); } else if (suitValue > 0) { problemReporter.warn("table conf : table [ " + tableConf.getName() + " ] rule function [ " + tableConf.getRule().getFunctionName() + " ] " + "partition size : " + String.valueOf(tableConf.getRule().getRuleAlgorithm().getPartitionNum()) + " < table datanode size : " + String.valueOf(tableConf.getDataNodes().size())); } else { // table data node size == rule function partition size } }