Revert "HBASE-26490 Add builder for class ReplicationLoadSink (#3883)"

This reverts commit 02fa0903a2.
This commit is contained in:
Andrew Purtell 2021-12-17 18:34:09 -08:00
parent deb570b2e9
commit 823b8fd667
2 changed files with 7 additions and 47 deletions

View File

@ -22,7 +22,9 @@ public class ReplicationLoadSink {
private final long timestampStarted;
private final long totalOpsProcessed;
private ReplicationLoadSink(long age, long timestamp, long timestampStarted,
// TODO: add the builder for this class
@InterfaceAudience.Private
public ReplicationLoadSink(long age, long timestamp, long timestampStarted,
long totalOpsProcessed) {
this.ageOfLastAppliedOp = age;
this.timestampsOfLastAppliedOp = timestamp;
@ -54,44 +56,4 @@ public class ReplicationLoadSink {
public long getTotalOpsProcessed() {
return totalOpsProcessed;
}
@InterfaceAudience.Private
public static ReplicationLoadSinkBuilder newBuilder() {
return new ReplicationLoadSinkBuilder();
}
@InterfaceAudience.Private
public static final class ReplicationLoadSinkBuilder {
private long ageOfLastAppliedOp;
private long timestampsOfLastAppliedOp;
private long timestampStarted;
private long totalOpsProcessed;
private ReplicationLoadSinkBuilder() {}
public ReplicationLoadSinkBuilder setAgeOfLastAppliedOp(long ageOfLastAppliedOp) {
this.ageOfLastAppliedOp = ageOfLastAppliedOp;
return this;
}
public ReplicationLoadSinkBuilder setTimestampsOfLastAppliedOp(long timestampsOfLastAppliedOp) {
this.timestampsOfLastAppliedOp = timestampsOfLastAppliedOp;
return this;
}
public ReplicationLoadSinkBuilder setTimestampStarted(long timestampStarted) {
this.timestampStarted = timestampStarted;
return this;
}
public ReplicationLoadSinkBuilder setTotalOpsProcessed(long totalOpsProcessed) {
this.totalOpsProcessed = totalOpsProcessed;
return this;
}
public ReplicationLoadSink build() {
return new ReplicationLoadSink(ageOfLastAppliedOp, timestampsOfLastAppliedOp,
timestampStarted, totalOpsProcessed);
}
}
}

View File

@ -2796,12 +2796,10 @@ public final class ProtobufUtil {
public static ReplicationLoadSink toReplicationLoadSink(
ClusterStatusProtos.ReplicationLoadSink rls) {
ReplicationLoadSink.ReplicationLoadSinkBuilder builder = ReplicationLoadSink.newBuilder();
builder.setAgeOfLastAppliedOp(rls.getAgeOfLastAppliedOp()).
setTimestampsOfLastAppliedOp(rls.getTimeStampsOfLastAppliedOp()).
setTimestampStarted(rls.hasTimestampStarted()? rls.getTimestampStarted(): -1L).
setTotalOpsProcessed(rls.hasTotalOpsProcessed()? rls.getTotalOpsProcessed(): -1L);
return builder.build();
return new ReplicationLoadSink(rls.getAgeOfLastAppliedOp(),
rls.getTimeStampsOfLastAppliedOp(),
rls.hasTimestampStarted()? rls.getTimestampStarted(): -1L,
rls.hasTotalOpsProcessed()? rls.getTotalOpsProcessed(): -1L);
}
public static ReplicationLoadSource toReplicationLoadSource(