@Override public TableConfig getTableConfig(byte[] tableName) { String tableNameString = Bytes.toString(tableName); for (TableConfigEntry entry : tableConfigs) { if (entry.matches(tableNameString)) { log.debug("Table configuration settings: table \"" + tableNameString + "\" matched regex \"" + entry.getTableNamePattern().pattern() + "\""); return entry.getTableConfig(); } } log.debug("Table configuration settings: table \"" + tableNameString + "\" has no matching settings."); return new TableConfig(); }
byte[][] parsedSplitKeys = TableConfig.parseSplitKeys(null, splitKeys, splitKeyPrefix); createDescriptor = new TableCreateDescriptor(tableName, parsedSplitKeys); } else if (regionCount != -1) { byte[][] parsedSplitKeys = TableConfig.parseSplitKeys(regionCount, null, splitKeyPrefix); createDescriptor = new TableCreateDescriptor(tableName, parsedSplitKeys); } else {
@Override public byte[][] getSplitKeys(byte[] tableName) { return getTableConfig(tableName).getSplitKeys(); } }
public static List<TableConfigEntry> buildTableConfigs(Conf conf) { List<TableConfigEntry> result = new ArrayList<TableConfigEntry>(); for (Conf table : conf.getChildren("table")) { String tableName = table.getAttribute("name"); Pattern tableNamePattern; try { tableNamePattern = Pattern.compile(tableName); } catch (PatternSyntaxException e) { throw new RuntimeException("The table name should be a valid regular expression, " + "which the following is not: " + tableName + " at " + conf.getLocation()); } Integer regionCount = table.getChild("splits").getChild("regionCount").getValueAsInteger(-1); String splitKeysAsString = table.getChild("splits").getChild("splitKeys").getValue(null); String splitKeyPrefix = table.getChild("splits").getChild("splitKeyPrefix").getValue(null); byte[][] splitKeys = TableConfig.parseSplitKeys(regionCount, splitKeysAsString, splitKeyPrefix); Long maxFileSize = table.getChild("maxFileSize").getValueAsLong(null); Long memStoreFlushSize = table.getChild("memStoreFlushSize").getValueAsLong(null); TableConfig config = new TableConfig(splitKeys); config.setMaxFileSize(maxFileSize); config.setMemStoreFlushSize(memStoreFlushSize); for (Conf familyConf : table.getChild("families").getChildren("family")) { ColumnFamilyConfig family = buildCfConfig(familyConf); String familyName = familyConf.getAttribute("name"); config.getColumnFamilies().put(familyName, family); } result.add(new TableConfigEntry(tableNamePattern, config)); } return result; }
Long maxFileSize = tableConfig.getMaxFileSize(); if (maxFileSize != null) { tableDescriptor.setMaxFileSize(maxFileSize); Long memStoreFlushSize = tableConfig.getMemStoreFlushSize(); if (memStoreFlushSize != null) { tableDescriptor.setMemStoreFlushSize(memStoreFlushSize); ColumnFamilyConfig cfConf = tableConfig.getColumnFamilyConfig(column.getNameAsString());