iemejia commented on a change in pull request #10815: [BEAM-9279] Make HBase.ReadAll based on Reads instead of HBaseQuery URL: https://github.com/apache/beam/pull/10815#discussion_r394860657
########## File path: sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseIO.java ########## @@ -240,63 +245,109 @@ private Read( @Override public void populateDisplayData(DisplayData.Builder builder) { super.populateDisplayData(builder); - builder.add(DisplayData.item("configuration", serializableConfiguration.get().toString())); + builder.add(DisplayData.item("configuration", configuration.toString())); builder.add(DisplayData.item("tableId", tableId)); - builder.addIfNotNull(DisplayData.item("scan", serializableScan.get().toString())); + builder.addIfNotNull(DisplayData.item("scan", scan.toString())); } public Configuration getConfiguration() { - return serializableConfiguration.get(); + return configuration; } public String getTableId() { return tableId; } public Scan getScan() { - return serializableScan.get(); + return scan; } /** Returns the range of keys that will be read from the table. */ public ByteKeyRange getKeyRange() { - byte[] startRow = serializableScan.get().getStartRow(); - byte[] stopRow = serializableScan.get().getStopRow(); + byte[] startRow = scan.getStartRow(); + byte[] stopRow = scan.getStopRow(); return ByteKeyRange.of(ByteKey.copyFrom(startRow), ByteKey.copyFrom(stopRow)); } - private final SerializableConfiguration serializableConfiguration; + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Read read = (Read) o; + return configuration.toString().equals(read.configuration.toString()) + && Objects.equals(tableId, read.tableId) + && scan.toString().equals(read.scan.toString()); + } + + @Override + public int hashCode() { + return Objects.hash(configuration, tableId, scan); + } + + private Object writeReplace() { Review comment: good idea, doing it. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services