@Test public void invalidChooserConfigured() throws Exception { List<String> volumes = Arrays.asList("file: ConfigurationCopy conf = new ConfigurationCopy(); conf.set(Property.INSTANCE_VOLUMES, String.join(",", volumes)); conf.set(Property.GENERAL_VOLUME_CHOOSER, "org.apache.accumulo.server.fs.ChooserThatDoesntExist"); assertThrows(RuntimeException.class, () -> VolumeManagerImpl.get(conf, hadoopConf)); }
public static VolumeManager get(AccumuloConfiguration conf, final Configuration hadoopConf) throws IOException { final Map<String,Volume> volumes = new HashMap<>(); Set<String> volumeStrings = VolumeConfiguration.getVolumeUris(conf); for (String volumeUriOrDir : volumeStrings) { if (volumeUriOrDir.isBlank()) throw new IllegalArgumentException("Empty volume specified in configuration"); if (volumeUriOrDir.startsWith("viewfs")) throw new IllegalArgumentException("Cannot use viewfs as a volume"); if (volumeUriOrDir.contains(":")) { volumes.put(volumeUriOrDir, new VolumeImpl(new Path(volumeUriOrDir), hadoopConf)); } else { throw new IllegalArgumentException("Expected fully qualified URI for " + Property.INSTANCE_VOLUMES.getKey() + " got " + volumeUriOrDir); } } String uri = volumeStrings.iterator().next(); Volume defaultVolume = new VolumeImpl(new Path(uri), hadoopConf); return new VolumeManagerImpl(volumes, defaultVolume, conf, hadoopConf); }
VolumeManagerImpl implements VolumeManager { public static VolumeManager get(AccumuloConfiguration conf, final Configuration hadoopConf) throws IOException { final Map<String,Volume> volumes = new HashMap<>(); Set<String> volumeStrings = VolumeConfiguration.getVolumeUris(conf); for (String volumeUriOrDir : volumeStrings) { if (volumeUriOrDir.isBlank()) throw new IllegalArgumentException("Empty volume specified in configuration"); if (volumeUriOrDir.startsWith("viewfs")) throw new IllegalArgumentException("Cannot use viewfs as a volume"); if (volumeUriOrDir.contains(":")) { volumes.put(volumeUriOrDir, new VolumeImpl(new Path(volumeUriOrDir), hadoopConf)); } else { throw new IllegalArgumentException("Expected fully qualified URI for " + Property.INSTANCE_VOLUMES.getKey() + " got " + volumeUriOrDir); } } String uri = volumeStrings.iterator().next(); Volume defaultVolume = new VolumeImpl(new Path(uri), hadoopConf); return new VolumeManagerImpl(volumes, defaultVolume, conf, hadoopConf); } }
VolumeManagerImpl implements VolumeManager { public static VolumeManager get(AccumuloConfiguration conf, final Configuration hadoopConf) throws IOException { final Map<String,Volume> volumes = new HashMap<>(); Set<String> volumeStrings = VolumeConfiguration.getVolumeUris(conf); for (String volumeUriOrDir : volumeStrings) { if (volumeUriOrDir.isBlank()) throw new IllegalArgumentException("Empty volume specified in configuration"); if (volumeUriOrDir.startsWith("viewfs")) throw new IllegalArgumentException("Cannot use viewfs as a volume"); if (volumeUriOrDir.contains(":")) { volumes.put(volumeUriOrDir, new VolumeImpl(new Path(volumeUriOrDir), hadoopConf)); } else { throw new IllegalArgumentException("Expected fully qualified URI for " + Property.INSTANCE_VOLUMES.getKey() + " got " + volumeUriOrDir); } } String uri = volumeStrings.iterator().next(); Volume defaultVolume = new VolumeImpl(new Path(uri), hadoopConf); return new VolumeManagerImpl(volumes, defaultVolume, conf, hadoopConf); } protected  VolumeManagerImpl(Map<String,Volume> volumes, Volume defaultVolume,
      AccumuloConfiguration conf, Configuration hadoopConf); }
VolumeManagerImpl implements VolumeManager { public static VolumeManager get(AccumuloConfiguration conf, final Configuration hadoopConf) throws IOException { final Map<String,Volume> volumes = new HashMap<>(); Set<String> volumeStrings = VolumeConfiguration.getVolumeUris(conf); for (String volumeUriOrDir : volumeStrings) { if (volumeUriOrDir.isBlank()) throw new IllegalArgumentException("Empty volume specified in configuration"); if (volumeUriOrDir.startsWith("viewfs")) throw new IllegalArgumentException("Cannot use viewfs as a volume"); if (volumeUriOrDir.contains(":")) { volumes.put(volumeUriOrDir, new VolumeImpl(new Path(volumeUriOrDir), hadoopConf)); } else { throw new IllegalArgumentException("Expected fully qualified URI for " + Property.INSTANCE_VOLUMES.getKey() + " got " + volumeUriOrDir); } } String uri = volumeStrings.iterator().next(); Volume defaultVolume = new VolumeImpl(new Path(uri), hadoopConf); return new VolumeManagerImpl(volumes, defaultVolume, conf, hadoopConf); } protected  VolumeManagerImpl(Map<String,Volume> volumes, Volume defaultVolume,
      AccumuloConfiguration conf, Configuration hadoopConf); static VolumeManager getLocalForTesting(String localBasePath); @Override void close(); @Override FSDataOutputStream create(Path path); @Override FSDataOutputStream overwrite(Path path); @Override FSDataOutputStream create(Path path, boolean overwrite, int bufferSize, short replication,
      long blockSize); @Override boolean createNewFile(Path path); @Override FSDataOutputStream createSyncable(Path logPath, int bufferSize, short replication,
      long blockSize); @Override boolean delete(Path path); @Override boolean deleteRecursively(Path path); @Override boolean exists(Path path); @Override FileStatus getFileStatus(Path path); @Override FileSystem getFileSystemByPath(Path path); @Override FileStatus[] listStatus(Path path); @Override boolean mkdirs(Path path); @Override boolean mkdirs(Path path, FsPermission permission); @Override FSDataInputStream open(Path path); @Override boolean rename(Path path, Path newPath); @Override void bulkRename(Map<Path,Path> oldToNewPathMap, int poolSize, String poolName,
      String transactionId); @Override boolean moveToTrash(Path path); @Override short getDefaultReplication(Path path); static VolumeManager get(AccumuloConfiguration conf, final Configuration hadoopConf); @Override boolean isReady(); @Override FileStatus[] globStatus(Path pathPattern); @Override Path matchingFileSystem(Path source, Set<String> options); @Override String choose(VolumeChooserEnvironment env, Set<String> options); @Override Set<String> choosable(VolumeChooserEnvironment env, Set<String> options); @Override boolean canSyncAndFlush(Path path); @Override Volume getDefaultVolume(); @Override Collection<Volume> getVolumes(); }
VolumeManagerImpl implements VolumeManager { public static VolumeManager get(AccumuloConfiguration conf, final Configuration hadoopConf) throws IOException { final Map<String,Volume> volumes = new HashMap<>(); Set<String> volumeStrings = VolumeConfiguration.getVolumeUris(conf); for (String volumeUriOrDir : volumeStrings) { if (volumeUriOrDir.isBlank()) throw new IllegalArgumentException("Empty volume specified in configuration"); if (volumeUriOrDir.startsWith("viewfs")) throw new IllegalArgumentException("Cannot use viewfs as a volume"); if (volumeUriOrDir.contains(":")) { volumes.put(volumeUriOrDir, new VolumeImpl(new Path(volumeUriOrDir), hadoopConf)); } else { throw new IllegalArgumentException("Expected fully qualified URI for " + Property.INSTANCE_VOLUMES.getKey() + " got " + volumeUriOrDir); } } String uri = volumeStrings.iterator().next(); Volume defaultVolume = new VolumeImpl(new Path(uri), hadoopConf); return new VolumeManagerImpl(volumes, defaultVolume, conf, hadoopConf); } protected  VolumeManagerImpl(Map<String,Volume> volumes, Volume defaultVolume,
      AccumuloConfiguration conf, Configuration hadoopConf); static VolumeManager getLocalForTesting(String localBasePath); @Override void close(); @Override FSDataOutputStream create(Path path); @Override FSDataOutputStream overwrite(Path path); @Override FSDataOutputStream create(Path path, boolean overwrite, int bufferSize, short replication,
      long blockSize); @Override boolean createNewFile(Path path); @Override FSDataOutputStream createSyncable(Path logPath, int bufferSize, short replication,
      long blockSize); @Override boolean delete(Path path); @Override boolean deleteRecursively(Path path); @Override boolean exists(Path path); @Override FileStatus getFileStatus(Path path); @Override FileSystem getFileSystemByPath(Path path); @Override FileStatus[] listStatus(Path path); @Override boolean mkdirs(Path path); @Override boolean mkdirs(Path path, FsPermission permission); @Override FSDataInputStream open(Path path); @Override boolean rename(Path path, Path newPath); @Override void bulkRename(Map<Path,Path> oldToNewPathMap, int poolSize, String poolName,
      String transactionId); @Override boolean moveToTrash(Path path); @Override short getDefaultReplication(Path path); static VolumeManager get(AccumuloConfiguration conf, final Configuration hadoopConf); @Override boolean isReady(); @Override FileStatus[] globStatus(Path pathPattern); @Override Path matchingFileSystem(Path source, Set<String> options); @Override String choose(VolumeChooserEnvironment env, Set<String> options); @Override Set<String> choosable(VolumeChooserEnvironment env, Set<String> options); @Override boolean canSyncAndFlush(Path path); @Override Volume getDefaultVolume(); @Override Collection<Volume> getVolumes();  }