Package org.apache.accumulo.server.fs
Class VolumeManagerImpl
- java.lang.Object
-
- org.apache.accumulo.server.fs.VolumeManagerImpl
-
- All Implemented Interfaces:
AutoCloseable,VolumeManager
public class VolumeManagerImpl extends Object implements VolumeManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.accumulo.server.fs.VolumeManager
VolumeManager.FileType
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedVolumeManagerImpl(Map<String,Volume> volumes, AccumuloConfiguration conf, org.apache.hadoop.conf.Configuration hadoopConf)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbulkRename(Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.Path> oldToNewPathMap, int poolSize, String poolName, String transactionId)Rename lots of files at once in a thread pool and return once all the threads have completed.booleancanSyncAndFlush(org.apache.hadoop.fs.Path path)Set<String>choosable(VolumeChooserEnvironment env, Set<String> options)Stringchoose(VolumeChooserEnvironment env, Set<String> options)voidclose()org.apache.hadoop.fs.FSDataOutputStreamcreate(org.apache.hadoop.fs.Path path)org.apache.hadoop.fs.FSDataOutputStreamcreate(org.apache.hadoop.fs.Path path, boolean overwrite, int bufferSize, short replication, long blockSize)booleancreateNewFile(org.apache.hadoop.fs.Path path)org.apache.hadoop.fs.FSDataOutputStreamcreateSyncable(org.apache.hadoop.fs.Path logPath, int bufferSize, short replication, long blockSize)booleandelete(org.apache.hadoop.fs.Path path)booleandeleteRecursively(org.apache.hadoop.fs.Path path)protected voidensureSyncIsEnabled()booleanexists(org.apache.hadoop.fs.Path path)protected static Stream<Map.Entry<String,String>>findVolumeOverridesMissingVolume(AccumuloConfiguration conf, Set<String> definedVolumes)static VolumeManagerget(AccumuloConfiguration conf, org.apache.hadoop.conf.Configuration hadoopConf)shortgetDefaultReplication(org.apache.hadoop.fs.Path path)org.apache.hadoop.fs.FileStatusgetFileStatus(org.apache.hadoop.fs.Path path)org.apache.hadoop.fs.FileSystemgetFileSystemByPath(org.apache.hadoop.fs.Path path)static VolumeManagergetLocalForTesting(String localBasePath)Collection<Volume>getVolumes()Fetch the configured instance Volumesorg.apache.hadoop.fs.FileStatus[]globStatus(org.apache.hadoop.fs.Path pathPattern)booleanisReady()org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus>listFiles(org.apache.hadoop.fs.Path path, boolean recursive)org.apache.hadoop.fs.FileStatus[]listStatus(org.apache.hadoop.fs.Path path)org.apache.hadoop.fs.PathmatchingFileSystem(org.apache.hadoop.fs.Path source, Set<String> options)booleanmkdirs(org.apache.hadoop.fs.Path path)booleanmkdirs(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.permission.FsPermission permission)booleanmoveToTrash(org.apache.hadoop.fs.Path path)org.apache.hadoop.fs.FSDataInputStreamopen(org.apache.hadoop.fs.Path path)org.apache.hadoop.fs.FSDataOutputStreamoverwrite(org.apache.hadoop.fs.Path path)booleanrename(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.Path newPath)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.accumulo.server.fs.VolumeManager
getFirst
-
-
-
-
Constructor Detail
-
VolumeManagerImpl
protected VolumeManagerImpl(Map<String,Volume> volumes, AccumuloConfiguration conf, org.apache.hadoop.conf.Configuration hadoopConf)
-
-
Method Detail
-
getLocalForTesting
public static VolumeManager getLocalForTesting(String localBasePath) throws IOException
- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceVolumeManager- Throws:
IOException
-
create
public org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
createin interfaceVolumeManager- Throws:
IOException
-
overwrite
public org.apache.hadoop.fs.FSDataOutputStream overwrite(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
overwritein interfaceVolumeManager- Throws:
IOException
-
create
public org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path path, boolean overwrite, int bufferSize, short replication, long blockSize) throws IOException- Specified by:
createin interfaceVolumeManager- Throws:
IOException
-
createNewFile
public boolean createNewFile(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
createNewFilein interfaceVolumeManager- Throws:
IOException
-
createSyncable
public org.apache.hadoop.fs.FSDataOutputStream createSyncable(org.apache.hadoop.fs.Path logPath, int bufferSize, short replication, long blockSize) throws IOException- Specified by:
createSyncablein interfaceVolumeManager- Throws:
IOException
-
delete
public boolean delete(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
deletein interfaceVolumeManager- Throws:
IOException
-
deleteRecursively
public boolean deleteRecursively(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
deleteRecursivelyin interfaceVolumeManager- Throws:
IOException
-
ensureSyncIsEnabled
protected void ensureSyncIsEnabled()
-
exists
public boolean exists(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
existsin interfaceVolumeManager- Throws:
IOException
-
getFileStatus
public org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
getFileStatusin interfaceVolumeManager- Throws:
IOException
-
getFileSystemByPath
public org.apache.hadoop.fs.FileSystem getFileSystemByPath(org.apache.hadoop.fs.Path path)
- Specified by:
getFileSystemByPathin interfaceVolumeManager
-
listFiles
public org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> listFiles(org.apache.hadoop.fs.Path path, boolean recursive) throws IOException- Specified by:
listFilesin interfaceVolumeManager- Throws:
IOException
-
listStatus
public org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
listStatusin interfaceVolumeManager- Throws:
IOException
-
mkdirs
public boolean mkdirs(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
mkdirsin interfaceVolumeManager- Throws:
IOException
-
mkdirs
public boolean mkdirs(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.permission.FsPermission permission) throws IOException- Specified by:
mkdirsin interfaceVolumeManager- Throws:
IOException
-
open
public org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
openin interfaceVolumeManager- Throws:
IOException
-
rename
public boolean rename(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.Path newPath) throws IOException- Specified by:
renamein interfaceVolumeManager- Throws:
IOException
-
bulkRename
public void bulkRename(Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.Path> oldToNewPathMap, int poolSize, String poolName, String transactionId) throws IOException
Description copied from interface:VolumeManagerRename lots of files at once in a thread pool and return once all the threads have completed. This operation should be idempotent to allow calling multiple times in the case of a partial completion.- Specified by:
bulkRenamein interfaceVolumeManager- Throws:
IOException
-
moveToTrash
public boolean moveToTrash(org.apache.hadoop.fs.Path path) throws IOException- Specified by:
moveToTrashin interfaceVolumeManager- Throws:
IOException
-
getDefaultReplication
public short getDefaultReplication(org.apache.hadoop.fs.Path path)
- Specified by:
getDefaultReplicationin interfaceVolumeManager
-
findVolumeOverridesMissingVolume
protected static Stream<Map.Entry<String,String>> findVolumeOverridesMissingVolume(AccumuloConfiguration conf, Set<String> definedVolumes)
-
get
public static VolumeManager get(AccumuloConfiguration conf, org.apache.hadoop.conf.Configuration hadoopConf) throws IOException
- Throws:
IOException
-
isReady
public boolean isReady() throws IOException- Specified by:
isReadyin interfaceVolumeManager- Throws:
IOException
-
globStatus
public org.apache.hadoop.fs.FileStatus[] globStatus(org.apache.hadoop.fs.Path pathPattern) throws IOException- Specified by:
globStatusin interfaceVolumeManager- Throws:
IOException
-
matchingFileSystem
public org.apache.hadoop.fs.Path matchingFileSystem(org.apache.hadoop.fs.Path source, Set<String> options)- Specified by:
matchingFileSystemin interfaceVolumeManager
-
choose
public String choose(VolumeChooserEnvironment env, Set<String> options)
- Specified by:
choosein interfaceVolumeManager
-
choosable
public Set<String> choosable(VolumeChooserEnvironment env, Set<String> options)
- Specified by:
choosablein interfaceVolumeManager
-
canSyncAndFlush
public boolean canSyncAndFlush(org.apache.hadoop.fs.Path path)
- Specified by:
canSyncAndFlushin interfaceVolumeManager
-
getVolumes
public Collection<Volume> getVolumes()
Description copied from interface:VolumeManagerFetch the configured instance Volumes- Specified by:
getVolumesin interfaceVolumeManager
-
-