keith-turner commented on code in PR #3604:
URL: https://github.com/apache/accumulo/pull/3604#discussion_r1264205827


##########
server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java:
##########
@@ -531,50 +133,4 @@ public static <T extends TabletFile> Map<T,FileInfo> 
tryToGetFirstAndLastRows(
 
     return dataFilesInfo;
   }
-
-  public static <T extends TabletFile> WritableComparable<Key> 
findLastKey(ServerContext context,
-      TableConfiguration tableConf, Collection<T> dataFiles) throws 
IOException {
-
-    Key lastKey = null;
-
-    for (T file : dataFiles) {
-      FileSystem ns = 
context.getVolumeManager().getFileSystemByPath(file.getPath());
-      FileSKVIterator reader = FileOperations.getInstance().newReaderBuilder()
-          .forFile(file, ns, ns.getConf(), tableConf.getCryptoService())
-          .withTableConfiguration(tableConf).seekToBeginning().build();
-
-      try {
-        if (!reader.hasTop()) {
-          // file is empty, so there is no last key
-          continue;
-        }
-
-        Key key = reader.getLastKey();
-
-        if (lastKey == null || key.compareTo(lastKey) > 0) {
-          lastKey = key;
-        }
-      } finally {
-        try {
-          if (reader != null) {
-            reader.close();
-          }
-        } catch (IOException e) {
-          log.error("{}", e.getMessage(), e);
-        }
-      }
-    }
-
-    return lastKey;
-
-  }
-
-  /**
-   * Convert TabletFiles to Strings in case we need to reduce number of files. 
The temporary files
-   * used will have irregular paths that don't conform to TabletFile 
verification.
-   */
-  public static Collection<String> 
toPathStrings(Collection<ReferencedTabletFile> files) {
-    return files.stream().map(ReferencedTabletFile::getNormalizedPathStr)
-        .collect(Collectors.toList());
-  }

Review Comment:
   This code was related to splitting in the tserver.  The tserver could only 
split 1 tablet into 2.  The split code in the manager can split 1 tablet into 2 
or more in one Fate op, so the code is different and needed to be rewritten.  
The new code is cleaner in addition to being different, does not have all the 
cruft that has built up.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to