From 823b8fd667f618d029bcf0d282230bb716745314 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Fri, 17 Dec 2021 18:34:09 -0800 Subject: [PATCH] Revert "HBASE-26490 Add builder for class ReplicationLoadSink (#3883)" This reverts commit 02fa0903a206bbcc42b7daaadb66e428e0a4184e. --- .../replication/ReplicationLoadSink.java | 44 ++----------------- .../hbase/shaded/protobuf/ProtobufUtil.java | 10 ++--- 2 files changed, 7 insertions(+), 47 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationLoadSink.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationLoadSink.java index 75515602ecb..f9afddd3d9b 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationLoadSink.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationLoadSink.java @@ -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); - } - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java index 94858097d99..c2544f6d008 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java @@ -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(