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

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

                Author: ASF GitHub Bot
            Created on: 13/Apr/18 00:58
            Start Date: 13/Apr/18 00:58
    Worklog Time Spent: 10m 
      Work Description: tweise commented on a change in pull request #5081: 
[BEAM-4019] Refactor HBaseIO splitting to produce ByteKeyRange objects
URL: https://github.com/apache/beam/pull/5081#discussion_r181261877
 
 

 ##########
 File path: 
sdks/java/io/hbase/src/main/java/org/apache/beam/sdk/io/hbase/HBaseIO.java
 ##########
 @@ -420,17 +313,38 @@ private long estimateSizeBytes() throws Exception {
       }
 
       try (Connection connection = 
ConnectionFactory.createConnection(read.getConfiguration())) {
-        List<HRegionLocation> regionLocations = getRegionLocations(connection);
-        int realNumSplits = numSplits < regionLocations.size() ? 
regionLocations.size() : numSplits;
-        LOG.debug("Suggested {} bundle(s) based on size", numSplits);
-        LOG.debug("Suggested {} bundle(s) based on number of regions", 
regionLocations.size());
-        final List<HBaseSource> sources = splitBasedOnRegions(regionLocations, 
realNumSplits);
-        LOG.debug("Split into {} bundle(s)", sources.size());
-        if (numSplits >= 1) {
+        List<HRegionLocation> regionLocations =
+            HBaseUtils.getRegionLocations(connection, read.tableId, 
read.serializableScan.get());
+        LOG.debug("Suggested {} source(s) based on size", numSplits);
+        LOG.debug("Suggested {} source(s) based on number of regions", 
regionLocations.size());
+
+        List<ByteKeyRange> ranges =
+            HBaseUtils.getRanges(
+                regionLocations, read.tableId, read.serializableScan.get());
+        final int numSources = ranges.size();
+        LOG.debug("Spliting into {} source(s)", numSources);
+        if (numSources >= 1) {
 
 Review comment:
   `if numSources > 0` ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 90659)
    Time Spent: 1h  (was: 50m)

> Refactor HBaseIO splitting to produce ByteKeyRange objects
> ----------------------------------------------------------
>
>                 Key: BEAM-4019
>                 URL: https://issues.apache.org/jira/browse/BEAM-4019
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-hbase
>            Reporter: Ismaël Mejía
>            Assignee: Ismaël Mejía
>            Priority: Minor
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> This allows to reuse the splitting logic for a future SDF-based 
> implementation by reusing it as part of the @SplitRestriction method.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to