accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ctubbsii commented on a change in pull request #506: fixes #472 Enabled bulk imports into offline table
Date Thu, 07 Jun 2018 23:03:35 GMT
ctubbsii commented on a change in pull request #506: fixes #472 Enabled bulk imports into offline
table
URL: https://github.com/apache/accumulo/pull/506#discussion_r193909246
 
 

 ##########
 File path: server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer2/LoadFiles.java
 ##########
 @@ -84,74 +93,58 @@ public long isReady(long tid, Master master) throws Exception {
 
   @Override
   public Repo<Master> call(final long tid, final Master master) throws Exception {
-    return new CompleteBulkImport(bulkInfo.tableId, bulkInfo.sourceDir, bulkInfo.bulkDir);
-  }
-
-  static boolean equals(Text t1, Text t2) {
-    if (t1 == null || t2 == null)
-      return t1 == t2;
-
-    return t1.equals(t2);
+    if (bulkInfo.tableState == TableState.ONLINE) {
+      return new CompleteBulkImport(bulkInfo);
+    } else {
+      return new CleanUpBulkImport(bulkInfo);
+    }
   }
 
-  /**
-   * Make asynchronous load calls to each overlapping Tablet in the bulk mapping. Return
a sleep
-   * time to isReady based on a factor of the TabletServer with the most Tablets. This method
will
-   * scan the metadata table getting Tablet range and location information. It will return
0 when
-   * all files have been loaded.
-   */
-  private long loadFiles(Table.ID tableId, Path bulkDir, LoadMappingIterator lmi, Master
master,
-      long tid) throws AccumuloSecurityException, TableNotFoundException, AccumuloException
{
-
-    Map.Entry<KeyExtent,Bulk.Files> loadMapEntry = lmi.next();
-
-    Text startRow = loadMapEntry.getKey().getPrevEndRow();
-
-    long timeInMillis = master.getConfiguration().getTimeInMillis(Property.MASTER_BULK_TIMEOUT);
-    Iterator<TabletMetadata> tabletIter = MetadataScanner.builder().from(master).scanMetadataTable()
-        .overRange(tableId, startRow, null).checkConsistency().fetchPrev().fetchLocation()
-        .fetchLoaded().build().iterator();
+  private static abstract class Loader {
+    protected Path bulkDir;
+    protected Master master;
+    protected long tid;
+    protected boolean setTime;
+
+    void start(Path bulkDir, Master master, long tid, boolean setTime) throws Exception {
+      this.bulkDir = bulkDir;
+      this.master = master;
+      this.tid = tid;
+      this.setTime = setTime;
+    }
 
-    List<TabletMetadata> tablets = new ArrayList<>();
-    TabletMetadata currentTablet = tabletIter.next();
-    HostAndPort server = null;
+    abstract void load(List<TabletMetadata> tablets, Files files) throws Exception;
 
 Review comment:
   Do these signatures have to throw `Exception`, or can they be more specific?

----------------------------------------------------------------
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