Skip to content

Commit

Permalink
modify log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
terence-yoo committed Aug 30, 2019
1 parent 2ca357c commit bf8f534
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,29 @@ public void setTest(boolean test) {
@Override
public void run() throws Exception {
long timestampPrev;
int i = 1;
// todo refactoring
if (actionParam.toLowerCase().equals("empty-fast")) {
for (String tableName : tableNameSet) {
timestampPrev = System.currentTimeMillis();
TableInfo tableInfo = new TableInfo(admin, tableName, args);
Util.printMessage(i + "/" + tableNameSet.size() + " - Table - " + tableName + " - empty-fast - Start");
timestampPrev = Util.printVerboseMessage(args, "Merge.run.new TableInfo", timestampPrev);
emptyFast(tableInfo);
Util.printVerboseMessage(args, "Merge.run.emptyFast", timestampPrev);
Util.printMessage(i++ + "/" + tableNameSet.size() + " - Table - " + tableName + " - empty-fast - End\n");
}
} else if (actionParam.toLowerCase().equals("empty")) {
for (String tableName : tableNameSet) {
TableInfo tableInfo = new TableInfo(admin, tableName, args);

Util.printMessage("Table - " + tableName + " - empty-fast - Start");
Util.printMessage(i + "/" + tableNameSet.size() + " - Table - " + tableName + " - empty-fast - Start");
emptyFast(tableInfo);
Util.printMessage("Table - " + tableName + " - empty-fast - End\n");
Util.printMessage(i + "/" + tableNameSet.size() + " - Table - " + tableName + " - empty-fast - End\n");

Util.printMessage("Table - " + tableName + " - empty - Start");
Util.printMessage(i + "/" + tableNameSet.size() + " - Table - " + tableName + " - empty - Start");
empty(tableInfo);
Util.printMessage("Table - " + tableName + " - empty - End");
Util.printMessage(i++ + "/" + tableNameSet.size() + " - Table - " + tableName + " - empty - End");
}
} else if (actionParam.toLowerCase().equals("size")) {
throw new IllegalStateException("Not implemented yet"); //todo
Expand Down Expand Up @@ -311,7 +314,7 @@ private void emptyFast(TableInfo tableInfo) throws Exception {
private void printMergeInfo(HRegionInfo regionA, HRegionInfo regionB) {
Util.printMessage("Merge regions");
System.out.println(" - " + Util.getRegionInfoString(regionA));
System.out.println(" L " + Util.getRegionInfoString(regionB));
System.out.println(" " + Util.getRegionInfoString(regionB));
}

private List<HRegionInfo> findEmptyRegions(TableInfo tableInfo) throws Exception {
Expand Down

0 comments on commit bf8f534

Please sign in to comment.