You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/10/17 23:02:18 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1389: Always choose volume for new tablet files.

ctubbsii commented on a change in pull request #1389: Always choose volume for new tablet files.
URL: https://github.com/apache/accumulo/pull/1389#discussion_r336260362
 
 

 ##########
 File path: server/base/src/main/java/org/apache/accumulo/server/util/RandomizeVolumes.java
 ##########
 @@ -16,144 +16,21 @@
  */
 package org.apache.accumulo.server.util;
 
-import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN;
-
-import java.io.IOException;
-import java.util.Map.Entry;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Mutation;
-import org.apache.accumulo.core.data.TableId;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.dataImpl.KeyExtent;
-import org.apache.accumulo.core.master.state.tables.TableState;
-import org.apache.accumulo.core.metadata.MetadataTable;
-import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
-import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.SimpleThreadPool;
-import org.apache.accumulo.server.ServerConstants;
-import org.apache.accumulo.server.ServerContext;
 import org.apache.accumulo.server.cli.ServerUtilOpts;
-import org.apache.accumulo.server.fs.VolumeChooserEnvironment;
-import org.apache.accumulo.server.fs.VolumeChooserEnvironmentImpl;
-import org.apache.accumulo.server.fs.VolumeManager;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.io.Text;
-import org.apache.htrace.TraceScope;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import com.beust.jcommander.Parameter;
 
 public class RandomizeVolumes {
-  private static final Logger log = LoggerFactory.getLogger(RandomizeVolumes.class);
+
+  public static final String DEPRECATION_MSG =
+      "Randomizing tablet directories is deprecated and now does nothing. Accumulo now always calls the volume chooser for each file created by a tablet, so its no longer necessary.";
 
   static class RandomizeOpts extends ServerUtilOpts {
     @Parameter(names = {"-t", "--table"}, required = true, description = "table to use")
     String tableName;
   }
 
   public static void main(String[] args) {
-    RandomizeOpts opts = new RandomizeOpts();
-    try (TraceScope clientSpan = opts.parseArgsAndTrace(RandomizeVolumes.class.getName(), args)) {
-      ServerContext context = opts.getServerContext();
-      try {
-        int status = randomize(context, opts.tableName);
-        System.exit(status);
-      } catch (Exception ex) {
-        log.error("{}", ex.getMessage(), ex);
-        System.exit(4);
-      }
-    }
+    System.out.println(DEPRECATION_MSG);
 
 Review comment:
   I think we should just delete this class entirely. It's internal only, and unlikely anybody used it's main method directly, instead of via the Admin utility (which incidentally is also not public API, but more likely to be used by an Admin, since it is a KeywordExecutable and has help documentation in the CLI).

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


With regards,
Apache Git Services