/** * Given options for tables (across multiple volumes), construct an absolute path using the unique * name within the chosen volume * * @return An absolute, unique path for the imported table */ protected String getClonedTabletDir(Master master, String[] tableDirs, String tabletDir) { // We can try to spread out the tablet dirs across all volumes VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(tableInfo.tableId, master.getContext()); String tableDir = master.getFileSystem().choose(chooserEnv, tableDirs); // Build up a full hdfs://localhost:8020/accumulo/tables/$id/c-XXXXXXX return tableDir + "/" + tableInfo.tableId + "/" + tabletDir; }
Path oldPath = fs.getFullPath(FileType.TABLE, "/" + MetadataTable.ID + "/root_tablet"); if (fs.exists(oldPath)) { VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(RootTable.ID, context); String newPath = fs.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + RootTable.ID;
VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(extent.getTableId(), context); Path newDir = new Path(vm.choose(chooserEnv, ServerConstants.getBaseUris(context))
VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(tableId, context); String volume = fs.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR;
VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(ChooserScope.INIT, null); final String rootTabletDir = new Path( fs.choose(chooserEnv, configuredVolumes) + Path.SEPARATOR + ServerConstants.TABLE_DIR
VolumeManager fs = conf.getFileSystem(); VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(ChooserScope.LOGGER, context); logPath = fs.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Path.SEPARATOR
Mutation m = new Mutation(key.getRow()); VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(tableId, context); final String newLocation = vm.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Path.SEPARATOR + ServerConstants.TABLE_DIR + Path.SEPARATOR + tableId + Path.SEPARATOR
/** * During an upgrade from 1.6 to 1.7, we need to add the replication table */ public static void createReplicationTable(ServerContext context) { VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(ReplicationTable.ID, context); String dir = context.getVolumeManager().choose(chooserEnv, ServerConstants.getBaseUris(context)) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + ReplicationTable.ID + Constants.DEFAULT_TABLET_LOCATION; Mutation m = new Mutation(new Text(TabletsSection.getRow(ReplicationTable.ID, null))); m.put(DIRECTORY_COLUMN.getColumnFamily(), DIRECTORY_COLUMN.getColumnQualifier(), 0, new Value(dir.getBytes(UTF_8))); m.put(TIME_COLUMN.getColumnFamily(), TIME_COLUMN.getColumnQualifier(), 0, new Value((TabletTime.LOGICAL_TIME_ID + "0").getBytes(UTF_8))); m.put(PREV_ROW_COLUMN.getColumnFamily(), PREV_ROW_COLUMN.getColumnQualifier(), 0, KeyExtent.encodePrevEndRow(null)); update(context, getMetadataTable(context), null, m); }
@Override public Repo<Master> call(long tid, Master master) throws Exception { // Constants.DEFAULT_TABLET_LOCATION has a leading slash prepended to it so we don't need to add // one here VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(tableInfo.getTableId(), master.getContext()); String baseDir = master.getFileSystem().choose(chooserEnv, ServerConstants.getBaseUris(master.getContext())) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + tableInfo.getTableId(); tableInfo.defaultTabletDir = baseDir + Constants.DEFAULT_TABLET_LOCATION; if (tableInfo.getInitialSplitSize() > 0) { createTableDirectoriesInfo(master, baseDir); } return new CreateDir(tableInfo); }
Mutation m = new Mutation(k.getRow()); m.putDelete(k.getColumnFamily(), k.getColumnQualifier()); VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(tableId, context); String dir = volumeManager.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + tableId + Path.SEPARATOR + new String(
VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(extent.getTableId(), master.getContext()); String tdir = master.getFileSystem().choose(chooserEnv,
@Override public String choose(Optional<String> tableId, String[] options) { final VolumeChooserEnvironment env = new VolumeChooserEnvironment(tableId); final String choice = chooser.choose(env, options); if (!(ArrayUtils.contains(options, choice))) { log.error("The configured volume chooser, '" + chooser.getClass() + "', or one of its delegates returned a volume not in the set of" + " options provided; will continue by relying on a RandomVolumeChooser." + " You should investigate and correct the named chooser."); return failsafeChooser.choose(env, options); } return choice; }
VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(ChooserScope.INIT, null); String tableMetadataTabletDir = fs.choose(chooserEnv, ServerConstants.getBaseUris(siteConfig, hadoopConf)) + Constants.HDFS_TABLES_DIR