Search in sources :

Example 1 with TableDumpStatus

use of com.qlangtech.tis.fullbuild.phasestatus.impl.DumpPhaseStatus.TableDumpStatus in project tis by qlangtech.

the class IncrStatusUmbilicalProtocolImpl method reportDumpTableStatus.

@Override
public void reportDumpTableStatus(com.qlangtech.tis.rpc.grpc.log.common.TableDumpStatus tableDumpStatus, StreamObserver<Empty> responseObserver) {
    Integer taskid = tableDumpStatus.getTaskid();
    if (taskid == null || taskid < 1) {
        throw new IllegalArgumentException("taskid illegal:" + taskid);
    }
    PhaseStatusCollection phaseStatusSet = TrackableExecuteInterceptor.getTaskPhaseReference(taskid);
    if (phaseStatusSet == null) {
        returnEmpty(responseObserver);
        return;
    }
    log.info("taskid:" + taskid + ",tablename:" + tableDumpStatus.getTableName() + ",read:" + tableDumpStatus.getReadRows() + ",all:" + tableDumpStatus.getAllRows());
    DumpPhaseStatus dumpPhase = phaseStatusSet.getDumpPhase();
    TableDumpStatus dumpStatus = phaseStatusSet.getDumpPhase().getTable(tableDumpStatus.getTableName());
    // }
    if (tableDumpStatus.getComplete()) {
        // 成功
        dumpStatus.setComplete(true);
    }
    if (tableDumpStatus.getFaild()) {
        // 失败了
        dumpStatus.setFaild(true);
    }
    dumpStatus.setReadRows(tableDumpStatus.getReadRows());
    dumpStatus.setAllRows(tableDumpStatus.getAllRows());
    if (!tableDumpStatus.getWaiting()) {
        dumpStatus.setWaiting(tableDumpStatus.getWaiting());
    }
    dumpPhase.isComplete();
    returnEmpty(responseObserver);
}
Also used : PhaseStatusCollection(com.qlangtech.tis.fullbuild.phasestatus.PhaseStatusCollection) TableDumpStatus(com.qlangtech.tis.fullbuild.phasestatus.impl.DumpPhaseStatus.TableDumpStatus) DumpPhaseStatus(com.qlangtech.tis.fullbuild.phasestatus.impl.DumpPhaseStatus)

Example 2 with TableDumpStatus

use of com.qlangtech.tis.fullbuild.phasestatus.impl.DumpPhaseStatus.TableDumpStatus in project tis by qlangtech.

the class DumpPhaseStatus method getTable.

/**
 * 取得表執行狀態
 *
 * @param tableName
 * @return
 */
public TableDumpStatus getTable(String tableName) {
    TableDumpStatus tabDumpStatus = this.tablesDump.get(tableName);
    if (tabDumpStatus == null) {
        tabDumpStatus = new TableDumpStatus(tableName, this.getTaskId());
        this.tablesDump.put(tableName, tabDumpStatus);
    }
    return tabDumpStatus;
}
Also used : TableDumpStatus(com.qlangtech.tis.fullbuild.phasestatus.impl.DumpPhaseStatus.TableDumpStatus)

Aggregations

TableDumpStatus (com.qlangtech.tis.fullbuild.phasestatus.impl.DumpPhaseStatus.TableDumpStatus)2 PhaseStatusCollection (com.qlangtech.tis.fullbuild.phasestatus.PhaseStatusCollection)1 DumpPhaseStatus (com.qlangtech.tis.fullbuild.phasestatus.impl.DumpPhaseStatus)1