[improve](show alter) add more infos to 'show alter' result for schema change job (#16843)
This commit is contained in:
@ -992,6 +992,7 @@ public class SchemaChangeJobV2 extends AlterJobV2 {
|
||||
info.add(errMsg);
|
||||
info.add(progress);
|
||||
info.add(timeoutMs / 1000);
|
||||
info.add(getOtherInfo());
|
||||
infos.add(info);
|
||||
}
|
||||
}
|
||||
@ -1012,6 +1013,21 @@ public class SchemaChangeJobV2 extends AlterJobV2 {
|
||||
return taskInfos;
|
||||
}
|
||||
|
||||
public String getOtherInfo() {
|
||||
String info = null;
|
||||
// can add info as needed
|
||||
List<String> infoList = Lists.newArrayList();
|
||||
if (invertedIndexChange) {
|
||||
String invertedIndexChangeInfo = "";
|
||||
for (Index invertedIndex : alterInvertedIndexes) {
|
||||
invertedIndexChangeInfo += "[" + (isDropOp ? "DROP " : "ADD ") + invertedIndex.toString() + "], ";
|
||||
}
|
||||
infoList.add(invertedIndexChangeInfo);
|
||||
}
|
||||
info = Joiner.on(", ").join(infoList.subList(0, infoList.size()));
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutput out) throws IOException {
|
||||
String json = GsonUtils.GSON.toJson(this, AlterJobV2.class);
|
||||
|
||||
@ -48,6 +48,7 @@ public class SchemaChangeProcDir implements ProcDirInterface {
|
||||
.add("JobId").add("TableName").add("CreateTime").add("FinishTime")
|
||||
.add("IndexName").add("IndexId").add("OriginIndexId").add("SchemaVersion")
|
||||
.add("TransactionId").add("State").add("Msg").add("Progress").add("Timeout")
|
||||
.add("OtherInfos")
|
||||
.build();
|
||||
|
||||
private static final Logger LOG = LogManager.getLogger(SchemaChangeProcDir.class);
|
||||
|
||||
Reference in New Issue
Block a user