Skip to content

Commit

Permalink
[hotfix] Replace OptimizingProcess#Status with ProcessStatus. (apache…
Browse files Browse the repository at this point in the history
…#3326)

(hotfix) Replace OptimizingProcess#Status with ProcessStatus.

Co-authored-by: 张文领 <zhangwl9@chinatelecom.cn>
  • Loading branch information
zhangwl9 and 张文领 authored Nov 11, 2024
1 parent b6a3549 commit b95329a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,4 @@ public interface OptimizingProcess {
void commit();

MetricsSummary getSummary();

enum Status {
RUNNING,
CLOSED,
SUCCESS,
FAILED
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

package org.apache.amoro.server.optimizing;

import org.apache.amoro.process.ProcessStatus;

import java.util.Map;

/** Meta of optimizing process. */
Expand All @@ -30,7 +32,7 @@ public class OptimizingProcessMeta {
private String tableName;
private Long targetSnapshotId;
private Long targetChangeSnapshotId;
private OptimizingProcess.Status status;
private ProcessStatus processStatus;
private OptimizingType optimizingType;
private long planTime;
private long endTime;
Expand Down Expand Up @@ -89,12 +91,12 @@ public void setTargetSnapshotId(Long targetSnapshotId) {
this.targetSnapshotId = targetSnapshotId;
}

public OptimizingProcess.Status getStatus() {
return status;
public ProcessStatus getStatus() {
return processStatus;
}

public void setStatus(OptimizingProcess.Status status) {
this.status = status;
public void setStatus(ProcessStatus processStatus) {
this.processStatus = processStatus;
}

public OptimizingType getOptimizingType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.apache.amoro.TableFormat;
import org.apache.amoro.config.TableConfiguration;
import org.apache.amoro.server.optimizing.OptimizingProcess;
import org.apache.amoro.process.ProcessStatus;
import org.apache.amoro.server.optimizing.OptimizingStatus;
import org.apache.amoro.server.optimizing.OptimizingType;
import org.apache.amoro.server.optimizing.plan.OptimizingEvaluator;
Expand Down Expand Up @@ -48,7 +48,7 @@ public class TableRuntimeMeta {
private OptimizingEvaluator.PendingInput pendingInput;
private OptimizingEvaluator.PendingInput tableSummary;
private long optimizingProcessId = 0;
private OptimizingProcess.Status processStatus;
private ProcessStatus processStatus;
private OptimizingType optimizingType;
private long targetSnapshotId;
private long targetChangeSnapshotId;
Expand Down Expand Up @@ -141,7 +141,7 @@ public long getOptimizingProcessId() {
return optimizingProcessId;
}

public OptimizingProcess.Status getProcessStatus() {
public ProcessStatus getProcessStatus() {
return processStatus;
}

Expand Down Expand Up @@ -257,7 +257,7 @@ public void setOptimizingProcessId(long optimizingProcessId) {
this.optimizingProcessId = optimizingProcessId;
}

public void setProcessStatus(OptimizingProcess.Status processStatus) {
public void setProcessStatus(ProcessStatus processStatus) {
this.processStatus = processStatus;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.amoro.server.optimizing;

import org.apache.amoro.process.ProcessStatus;
import org.apache.amoro.server.persistence.PersistentBase;
import org.apache.amoro.server.persistence.mapper.OptimizingMapper;
import org.apache.amoro.shade.guava32.com.google.common.collect.Sets;
Expand Down Expand Up @@ -128,7 +129,7 @@ protected OptimizingProcessMeta waitOptimizeResult() {
Optional<OptimizingProcessMeta> any =
tableOptimizingProcesses.stream()
.filter(p -> p.getProcessId() > lastProcessId)
.filter(p -> p.getStatus().equals(OptimizingProcess.Status.SUCCESS))
.filter(p -> p.getStatus().equals(ProcessStatus.SUCCESS))
.findAny();

if (any.isPresent()) {
Expand Down Expand Up @@ -164,7 +165,7 @@ protected OptimizingProcessMeta waitOptimizeResult() {
Integer.MAX_VALUE))
.stream()
.filter(p -> p.getProcessId() > lastProcessId)
.filter(p -> p.getStatus().equals(OptimizingProcess.Status.SUCCESS))
.filter(p -> p.getStatus().equals(ProcessStatus.SUCCESS))
.collect(Collectors.toList());
if (result.size() == 1) {
this.lastProcessId = result.get(0).getProcessId();
Expand Down

0 comments on commit b95329a

Please sign in to comment.