public static String switchRootTableVolume(ServerContext context, String location) throws IOException { String newLocation = switchVolume(location, FileType.TABLE, ServerConstants.getVolumeReplacements(context.getConfiguration(), context.getHadoopConf())); if (newLocation != null) { MetadataTableUtil.setRootTabletDir(context, newLocation); log.info("Volume replaced: {} -> {}", location, newLocation); return new Path(newLocation).toString(); } return location; }
private static void addVolumes(VolumeManager fs, SiteConfiguration siteConfig, Configuration hadoopConf) throws IOException { String[] volumeURIs = VolumeConfiguration.getVolumeUris(siteConfig, hadoopConf); HashSet<String> initializedDirs = new HashSet<>(); initializedDirs.addAll( Arrays.asList(ServerConstants.checkBaseUris(siteConfig, hadoopConf, volumeURIs, true))); HashSet<String> uinitializedDirs = new HashSet<>(); uinitializedDirs.addAll(Arrays.asList(volumeURIs)); uinitializedDirs.removeAll(initializedDirs); Path aBasePath = new Path(initializedDirs.iterator().next()); Path iidPath = new Path(aBasePath, ServerConstants.INSTANCE_ID_DIR); Path versionPath = new Path(aBasePath, ServerConstants.VERSION_DIR); UUID uuid = UUID.fromString(ZooUtil.getInstanceIDFromHdfs(iidPath, siteConfig, hadoopConf)); for (Pair<Path,Path> replacementVolume : ServerConstants.getVolumeReplacements(siteConfig, hadoopConf)) { if (aBasePath.equals(replacementVolume.getFirst())) log.error( "{} is set to be replaced in {} and should not appear in {}." + " It is highly recommended that this property be removed as data" + " could still be written to this volume.", aBasePath, Property.INSTANCE_VOLUMES_REPLACEMENTS, Property.INSTANCE_VOLUMES); } if (ServerUtil.getAccumuloPersistentVersion(versionPath.getFileSystem(hadoopConf), versionPath) != ServerConstants.DATA_VERSION) { throw new IOException("Accumulo " + Constants.VERSION + " cannot initialize data version " + ServerUtil.getAccumuloPersistentVersion(fs)); } initDirs(fs, uuid, uinitializedDirs.toArray(new String[uinitializedDirs.size()]), true); }
.getVolumeReplacements(getConfiguration(), getContext().getHadoopConf());
throws IOException { List<Pair<Path,Path>> replacements = ServerConstants .getVolumeReplacements(context.getConfiguration(), context.getHadoopConf()); log.trace("Using volume replacements: {}", replacements);
.getVolumeReplacements(master.getConfiguration(), master.getContext().getHadoopConf())); if (switchedWalog != null) {
public static String switchRootTableVolume(String location) throws IOException { String newLocation = switchVolume(location, FileType.TABLE, ServerConstants.getVolumeReplacements()); if (newLocation != null) { MetadataTableUtil.setRootTabletDir(newLocation); log.info("Volume replaced: " + location + " -> " + newLocation); return new Path(newLocation).toString(); } return location; }
private static void addVolumes(VolumeManager fs) throws IOException { String[] volumeURIs = VolumeConfiguration.getVolumeUris(SiteConfiguration.getInstance()); HashSet<String> initializedDirs = new HashSet<>(); initializedDirs.addAll(Arrays.asList(ServerConstants.checkBaseUris(volumeURIs, true))); HashSet<String> uinitializedDirs = new HashSet<>(); uinitializedDirs.addAll(Arrays.asList(volumeURIs)); uinitializedDirs.removeAll(initializedDirs); Path aBasePath = new Path(initializedDirs.iterator().next()); Path iidPath = new Path(aBasePath, ServerConstants.INSTANCE_ID_DIR); Path versionPath = new Path(aBasePath, ServerConstants.VERSION_DIR); UUID uuid = UUID .fromString(ZooUtil.getInstanceIDFromHdfs(iidPath, SiteConfiguration.getInstance())); for (Pair<Path,Path> replacementVolume : ServerConstants.getVolumeReplacements()) { if (aBasePath.equals(replacementVolume.getFirst())) log.error(aBasePath + " is set to be replaced in " + Property.INSTANCE_VOLUMES_REPLACEMENTS + " and should not appear in " + Property.INSTANCE_VOLUMES + ". It is highly recommended that this property be removed as data" + " could still be written to this volume."); } if (ServerConstants.DATA_VERSION != Accumulo.getAccumuloPersistentVersion( versionPath.getFileSystem(CachedConfiguration.getInstance()), versionPath)) { throw new IOException("Accumulo " + Constants.VERSION + " cannot initialize data version " + Accumulo.getAccumuloPersistentVersion(fs)); } initDirs(fs, uuid, uinitializedDirs.toArray(new String[uinitializedDirs.size()]), true); }
VolumeManager vm, KeyExtent extent, TabletFiles tabletFiles, boolean replicate) throws IOException { List<Pair<Path,Path>> replacements = ServerConstants.getVolumeReplacements(); log.trace("Using volume replacements: " + replacements);
new NamingThreadFactory("deleting")); final List<Pair<Path,Path>> replacements = ServerConstants.getVolumeReplacements();
ServerConstants.getVolumeReplacements()); if (switchedWalog != null) {