accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] keith-turner commented on a change in pull request #890: Organize new Bulk Import code
Date Thu, 10 Jan 2019 22:59:47 GMT
keith-turner commented on a change in pull request #890: Organize new Bulk Import code
URL: https://github.com/apache/accumulo/pull/890#discussion_r246952648
 
 

 ##########
 File path: server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer2/LoadFiles.java
 ##########
 @@ -328,38 +333,45 @@ private long loadFiles(Table.ID tableId, Path bulkDir, LoadMappingIterator
lmi,
     loader.start(bulkDir, master, tid, bulkInfo.setTime);
 
     long t1 = System.currentTimeMillis();
-    while (true) {
-      if (loadMapEntry == null) {
-        if (!lmi.hasNext()) {
-          break;
-        }
-        loadMapEntry = lmi.next();
-      }
-      KeyExtent fke = loadMapEntry.getKey();
-      Files files = loadMapEntry.getValue();
-      loadMapEntry = null;
-
+    while (loadMapEntry != null) {
+      KeyExtent fileTablet = loadMapEntry.getKey();
       tablets.clear();
 
-      while (!Objects.equals(currentTablet.getPrevEndRow(), fke.getPrevEndRow())) {
-        currentTablet = tabletIter.next();
-      }
+      // get first tablet in range
+      currentTablet = getFirstTablet(tabletIter, currentTablet, fileTablet.getPrevEndRow());
       tablets.add(currentTablet);
 
-      while (!Objects.equals(currentTablet.getEndRow(), fke.getEndRow())) {
-        currentTablet = tabletIter.next();
-        tablets.add(currentTablet);
-      }
+      // get all tablets between currentTablet and EndRow given in mapping file
 
 Review comment:
   Personally I think these loops inlined are easier to understand.  The method names do not
give me any concrete idea what the method will do with the parameters.  So I still need to
go look at the method impl to understand the big picture.  
   
   I think the loops inlined with comments you put before the methods would be good.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message