public static String[] getRecoveryDirs(ServerContext context) { return VolumeConfiguration.prefix(getBaseUris(context), RECOVERY_DIR); }
public static String[] getTablesDirs(ServerContext context) { return VolumeConfiguration.prefix(getBaseUris(context), TABLE_DIR); }
public static String[] getBaseUris(ServerContext context) { return getBaseUris(context.getConfiguration(), context.getHadoopConf()); }
for (String baseDir : getBaseUris(conf, hadoopConf)) {
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; fs.mkdirs(new Path(newPath));
Path newDir = new Path(vm.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Path.SEPARATOR + ServerConstants.TABLE_DIR + Path.SEPARATOR + dir.getParent().getName() + Path.SEPARATOR + dir.getName());
String volume = fs.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR;
@Override public void execute(final String[] args) throws Exception { Opts opts = new Opts(); opts.parseArgs(ZooKeeperMain.class.getName(), args); try (ServerContext context = new ServerContext(new SiteConfiguration())) { FileSystem fs = context.getVolumeManager().getDefaultVolume().getFileSystem(); String baseDir = ServerConstants.getBaseUris(context)[0]; System.out.println("Using " + fs.makeQualified(new Path(baseDir + "/instance_id")) + " to lookup accumulo instance"); if (opts.servers == null) { opts.servers = context.getZooKeepers(); } System.out.println("The accumulo instance id is " + context.getInstanceID()); if (!opts.servers.contains("/")) opts.servers += "/accumulo/" + context.getInstanceID(); org.apache.zookeeper.ZooKeeperMain .main(new String[] {"-server", opts.servers, "-timeout", "" + (opts.timeout * 1000)}); } } }
logPath = fs.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Path.SEPARATOR + ServerConstants.WAL_DIR + Path.SEPARATOR + logger + Path.SEPARATOR + filename;
final String newLocation = vm.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Path.SEPARATOR + ServerConstants.TABLE_DIR + Path.SEPARATOR + tableId + Path.SEPARATOR + directory;
/** * 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); }
ServerConstants.getBaseUris(siteConfig, hadoopConf)) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + MetadataTable.ID + TABLE_TABLETS_TABLET_DIR; String replicationTableDefaultTabletDir = fs.choose(chooserEnv, ServerConstants.getBaseUris(siteConfig, hadoopConf)) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + ReplicationTable.ID + Constants.DEFAULT_TABLET_LOCATION; String defaultMetadataTabletDir = fs.choose(chooserEnv, ServerConstants.getBaseUris(siteConfig, hadoopConf)) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + MetadataTable.ID + Constants.DEFAULT_TABLET_LOCATION;
@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); }
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( FastFormat.toZeroPaddedString(dirCount++, 8, 16, Constants.CLONE_PREFIX_BYTES));
master.getContext()); String tdir = master.getFileSystem().choose(chooserEnv, ServerConstants.getBaseUris(master.getContext())) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + extent.getTableId() + Constants.DEFAULT_TABLET_LOCATION; MetadataTableUtil.addTablet(
public static String[] getTablesDirs() { return VolumeConfiguration.prefix(getBaseUris(), TABLE_DIR); }
public static String[] getWalogArchives() { return VolumeConfiguration.prefix(getBaseUris(), WALOG_ARCHIVE_DIR); }
public static String[] getRecoveryDirs() { return VolumeConfiguration.prefix(getBaseUris(), RECOVERY_DIR); }
public static String[] getWalDirs() { return VolumeConfiguration.prefix(getBaseUris(), WAL_DIR); }
@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 tableInfo.dir = master.getFileSystem().choose(Optional.of(tableInfo.tableId), ServerConstants.getBaseUris()) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + tableInfo.tableId + Constants.DEFAULT_TABLET_LOCATION; return new CreateDir(tableInfo); }