use of com.navercorp.pinpoint.hbase.schema.reader.InvalidHbaseSchemaException in project pinpoint by naver.
the class TableChangeMapper method mapColumnFamilies.
private List<ColumnFamilyChange> mapColumnFamilies(List<Table.CreateColumnFamily> createColumnFamilies) {
if (CollectionUtils.isEmpty(createColumnFamilies)) {
return Collections.emptyList();
}
Map<String, ColumnFamilyChange> createColumnFamilyChanges = new LinkedHashMap<>();
for (Table.CreateColumnFamily createColumnFamily : createColumnFamilies) {
String columnFamilyName = createColumnFamily.getName();
ColumnFamilyChange columnFamilyChange = columnFamilyChangeMapper.mapCreate(createColumnFamily);
if (createColumnFamilyChanges.put(columnFamilyName, columnFamilyChange) != null) {
throw new InvalidHbaseSchemaException("Duplicate ColumnFamily name : " + columnFamilyName);
}
}
return new ArrayList<>(createColumnFamilyChanges.values());
}
use of com.navercorp.pinpoint.hbase.schema.reader.InvalidHbaseSchemaException in project pinpoint by naver.
the class TableChangeMapper method map.
public TableChange map(ChangeSet.CreateTable createTable) {
String tableName = createTable.getName();
if (StringUtils.isEmpty(tableName)) {
throw new InvalidHbaseSchemaException("Table name must not be empty");
}
TableConfiguration tableConfiguration = tableConfigurationMapper.mapConfiguration(createTable.getConfiguration());
List<ColumnFamilyChange> columnFamilyChanges = mapColumnFamilies(createTable.getCreateColumnFamily());
CreateTableChange.SplitOption splitOption = splitOptionMapper.mapSplitOption(createTable.getSplit());
return new CreateTableChange(tableName, tableConfiguration, columnFamilyChanges, splitOption);
}
Aggregations