Package org.apache.accumulo.server.fs
Interface VolumeManager
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
VolumeManagerImpl
public interface VolumeManager extends AutoCloseable
A wrapper around multiple hadoop FileSystem objects, which are assumed to be different volumes. This also concentrates a bunch of meta-operations like waiting for SAFE_MODE, and closing WALs. N.B. implementations must be thread safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classVolumeManager.FileType
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Loggerlog
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default 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 dest)org.apache.hadoop.fs.FSDataOutputStreamcreate(org.apache.hadoop.fs.Path path, boolean b, int int1, short int2, long long1)booleancreateNewFile(org.apache.hadoop.fs.Path writable)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)booleanexists(org.apache.hadoop.fs.Path path)shortgetDefaultReplication(org.apache.hadoop.fs.Path logPath)org.apache.hadoop.fs.FileStatusgetFileStatus(org.apache.hadoop.fs.Path path)org.apache.hadoop.fs.FileSystemgetFileSystemByPath(org.apache.hadoop.fs.Path path)default VolumegetFirst()Fetch the first configured instance Volumestatic InstanceIdgetInstanceIDFromHdfs(org.apache.hadoop.fs.Path instanceDirectory, org.apache.hadoop.conf.Configuration hadoopConf)Collection<Volume>getVolumes()Fetch the configured instance Volumesorg.apache.hadoop.fs.FileStatus[]globStatus(org.apache.hadoop.fs.Path path)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 directory)booleanmkdirs(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.permission.FsPermission permission)booleanmoveToTrash(org.apache.hadoop.fs.Path sourcePath)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)
-
-
-
Method Detail
-
close
void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
create
org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path dest) throws IOException- Throws:
IOException
-
overwrite
org.apache.hadoop.fs.FSDataOutputStream overwrite(org.apache.hadoop.fs.Path path) throws IOException- Throws:
IOException
-
create
org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path path, boolean b, int int1, short int2, long long1) throws IOException- Throws:
IOException
-
createNewFile
boolean createNewFile(org.apache.hadoop.fs.Path writable) throws IOException- Throws:
IOException
-
createSyncable
org.apache.hadoop.fs.FSDataOutputStream createSyncable(org.apache.hadoop.fs.Path logPath, int buffersize, short replication, long blockSize) throws IOException- Throws:
IOException
-
delete
boolean delete(org.apache.hadoop.fs.Path path) throws IOException- Throws:
IOException
-
deleteRecursively
boolean deleteRecursively(org.apache.hadoop.fs.Path path) throws IOException- Throws:
IOException
-
exists
boolean exists(org.apache.hadoop.fs.Path path) throws IOException- Throws:
IOException
-
getFileStatus
org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path path) throws IOException- Throws:
IOException
-
getFileSystemByPath
org.apache.hadoop.fs.FileSystem getFileSystemByPath(org.apache.hadoop.fs.Path path)
-
matchingFileSystem
org.apache.hadoop.fs.Path matchingFileSystem(org.apache.hadoop.fs.Path source, Set<String> options)
-
listFiles
org.apache.hadoop.fs.RemoteIterator<org.apache.hadoop.fs.LocatedFileStatus> listFiles(org.apache.hadoop.fs.Path path, boolean recursive) throws IOException- Throws:
IOException
-
listStatus
org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path path) throws IOException- Throws:
IOException
-
mkdirs
boolean mkdirs(org.apache.hadoop.fs.Path directory) throws IOException- Throws:
IOException
-
mkdirs
boolean mkdirs(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.permission.FsPermission permission) throws IOException- Throws:
IOException
-
open
org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path path) throws IOException- Throws:
IOException
-
rename
boolean rename(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.Path newPath) throws IOException- Throws:
IOException
-
bulkRename
void bulkRename(Map<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.Path> oldToNewPathMap, int poolSize, String poolName, String transactionId) throws IOException
Rename 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.- Throws:
IOException
-
moveToTrash
boolean moveToTrash(org.apache.hadoop.fs.Path sourcePath) throws IOException- Throws:
IOException
-
getDefaultReplication
short getDefaultReplication(org.apache.hadoop.fs.Path logPath)
-
isReady
boolean isReady() throws IOException- Throws:
IOException
-
globStatus
org.apache.hadoop.fs.FileStatus[] globStatus(org.apache.hadoop.fs.Path path) throws IOException- Throws:
IOException
-
choose
String choose(VolumeChooserEnvironment env, Set<String> options)
-
choosable
Set<String> choosable(VolumeChooserEnvironment env, Set<String> options)
-
canSyncAndFlush
boolean canSyncAndFlush(org.apache.hadoop.fs.Path path)
-
getFirst
default Volume getFirst()
Fetch the first configured instance Volume
-
getVolumes
Collection<Volume> getVolumes()
Fetch the configured instance Volumes
-
getInstanceIDFromHdfs
static InstanceId getInstanceIDFromHdfs(org.apache.hadoop.fs.Path instanceDirectory, org.apache.hadoop.conf.Configuration hadoopConf)
-
-