use of com.navercorp.pinpoint.hbase.schema.core.command.TableCommand in project pinpoint by naver.
the class HbaseSchemaServiceImpl method applyChangeSets.
private boolean applyChangeSets(HbaseSchemaCommandManager commandManager, List<ChangeSet> changeSets, List<SchemaChangeLog> executedLogs) {
if (CollectionUtils.isEmpty(changeSets)) {
return false;
}
String namespace = commandManager.getNamespace();
List<String> changeSetIds = changeSets.stream().map(ChangeSet::getId).collect(Collectors.toList());
logger.info("[{}] Applying change sets : {}", namespace, changeSetIds);
for (ChangeSet changeSet : changeSets) {
commandManager.applyChangeSet(changeSet);
}
List<TableCommand> commands = commandManager.getCommands();
boolean changesMade = commands.stream().map(command -> command.execute(hbaseAdminOperation)).reduce(Boolean::logicalOr).orElse(Boolean.FALSE);
schemaChangeLogService.recordChangeSets(namespace, executedLogs.size() + 1, changeSets);
return changesMade;
}
Aggregations