Search in sources :

Example 1 with NonConfiguredVolume

use of org.apache.accumulo.core.volume.NonConfiguredVolume in project accumulo by apache.

the class VolumeManagerImpl method getVolumeByPath.

@Override
public Volume getVolumeByPath(Path path) {
    if (path.toString().contains(":")) {
        try {
            FileSystem desiredFs = path.getFileSystem(CachedConfiguration.getInstance());
            URI desiredFsUri = desiredFs.getUri();
            Collection<Volume> candidateVolumes = volumesByFileSystemUri.get(desiredFsUri);
            if (null != candidateVolumes) {
                for (Volume candidateVolume : candidateVolumes) {
                    if (candidateVolume.isValidPath(path)) {
                        return candidateVolume;
                    }
                }
            } else {
                log.debug("Could not determine volume for Path: {}", path);
            }
            return new NonConfiguredVolume(desiredFs);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
    return defaultVolume;
}
Also used : Volume(org.apache.accumulo.core.volume.Volume) NonConfiguredVolume(org.apache.accumulo.core.volume.NonConfiguredVolume) FileSystem(org.apache.hadoop.fs.FileSystem) DistributedFileSystem(org.apache.hadoop.hdfs.DistributedFileSystem) IOException(java.io.IOException) URI(java.net.URI) NonConfiguredVolume(org.apache.accumulo.core.volume.NonConfiguredVolume)

Aggregations

IOException (java.io.IOException)1 URI (java.net.URI)1 NonConfiguredVolume (org.apache.accumulo.core.volume.NonConfiguredVolume)1 Volume (org.apache.accumulo.core.volume.Volume)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 DistributedFileSystem (org.apache.hadoop.hdfs.DistributedFileSystem)1