[ 
https://issues.apache.org/jira/browse/BEAM-9279?focusedWorklogId=384262&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-384262
 ]

ASF GitHub Bot logged work on BEAM-9279:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Feb/20 08:52
            Start Date: 10/Feb/20 08:52
    Worklog Time Spent: 10m 
      Work Description: iemejia commented on pull request #10815: [BEAM-9279] 
Make HBase.ReadAll based on Reads instead of HBaseQuery
URL: https://github.com/apache/beam/pull/10815#discussion_r376929018
 
 

 ##########
 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:
   This was required to keep the Read class immutable. This is some kind of 
magic I did not know before in case you did not too 
https://lingpipe-blog.com/2009/08/10/serializing-immutable-singletons-serialization-proxy/
 
----------------------------------------------------------------
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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 384262)
    Time Spent: 20m  (was: 10m)

> Make HBase.ReadAll based on Reads instead of HBaseQuery
> -------------------------------------------------------
>
>                 Key: BEAM-9279
>                 URL: https://issues.apache.org/jira/browse/BEAM-9279
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-hbase
>            Reporter: Ismaël Mejía
>            Assignee: Ismaël Mejía
>            Priority: Minor
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> HBaseIO support for SplittableDoFn introduced a new request type HBaseQuery, 
> however the attributes defined in that class are covered by common 
> HBase.Read, and additionally if we rely on Read we allow users to create 
> pipelines who can read from multiple clusters because the Configuration now 
> is part of the request.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to