Package org.apache.accumulo.server.fs
Class VolumeManagerImpl
- java.lang.Object
-
- org.apache.accumulo.server.fs.VolumeManagerImpl
-
- All Implemented Interfaces:
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 protected
VolumeManagerImpl(Map<String,Volume> volumes, Volume defaultVolume, AccumuloConfiguration conf, org.apache.hadoop.conf.Configuration hadoopConf)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
choose(VolumeChooserEnvironment env, String[] options)
void
close()
org.apache.hadoop.fs.FSDataOutputStream
create(org.apache.hadoop.fs.Path path)
org.apache.hadoop.fs.FSDataOutputStream
create(org.apache.hadoop.fs.Path path, boolean overwrite)
org.apache.hadoop.fs.FSDataOutputStream
create(org.apache.hadoop.fs.Path path, boolean overwrite, int bufferSize, short replication, long blockSize)
boolean
createNewFile(org.apache.hadoop.fs.Path path)
org.apache.hadoop.fs.FSDataOutputStream
createSyncable(org.apache.hadoop.fs.Path logPath, int bufferSize, short replication, long blockSize)
boolean
delete(org.apache.hadoop.fs.Path path)
boolean
deleteRecursively(org.apache.hadoop.fs.Path path)
protected void
ensureSyncIsEnabled()
boolean
exists(org.apache.hadoop.fs.Path path)
static VolumeManager
get(AccumuloConfiguration conf, org.apache.hadoop.conf.Configuration hadoopConf)
org.apache.hadoop.fs.ContentSummary
getContentSummary(org.apache.hadoop.fs.Path dir)
short
getDefaultReplication(org.apache.hadoop.fs.Path path)
Volume
getDefaultVolume()
Fetch the default Volumeorg.apache.hadoop.fs.FileStatus
getFileStatus(org.apache.hadoop.fs.Path path)
org.apache.hadoop.fs.Path
getFullPath(Key key)
org.apache.hadoop.fs.Path
getFullPath(TableId tableId, String path)
org.apache.hadoop.fs.Path
getFullPath(VolumeManager.FileType fileType, String path)
static VolumeManager
getLocal(String localBasePath)
Volume
getVolumeByPath(org.apache.hadoop.fs.Path path)
Collection<Volume>
getVolumes()
Fetch the configured Volumes, excluding the default Volumeorg.apache.hadoop.fs.FileStatus[]
globStatus(org.apache.hadoop.fs.Path pathPattern)
boolean
isReady()
org.apache.hadoop.fs.FileStatus[]
listStatus(org.apache.hadoop.fs.Path path)
org.apache.hadoop.fs.Path
matchingFileSystem(org.apache.hadoop.fs.Path source, String[] options)
boolean
mkdirs(org.apache.hadoop.fs.Path path)
boolean
mkdirs(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.permission.FsPermission permission)
boolean
moveToTrash(org.apache.hadoop.fs.Path path)
org.apache.hadoop.fs.FSDataInputStream
open(org.apache.hadoop.fs.Path path)
boolean
rename(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.Path newPath)
-
-
-
Constructor Detail
-
VolumeManagerImpl
protected VolumeManagerImpl(Map<String,Volume> volumes, Volume defaultVolume, AccumuloConfiguration conf, org.apache.hadoop.conf.Configuration hadoopConf)
-
-
Method Detail
-
getLocal
public static VolumeManager getLocal(String localBasePath) throws IOException
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceVolumeManager
- Throws:
IOException
-
create
public org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
create
in interfaceVolumeManager
- Throws:
IOException
-
create
public org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path path, boolean overwrite) throws IOException
- Specified by:
create
in 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:
create
in interfaceVolumeManager
- Throws:
IOException
-
createNewFile
public boolean createNewFile(org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
createNewFile
in 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:
createSyncable
in interfaceVolumeManager
- Throws:
IOException
-
delete
public boolean delete(org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
delete
in interfaceVolumeManager
- Throws:
IOException
-
deleteRecursively
public boolean deleteRecursively(org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
deleteRecursively
in interfaceVolumeManager
- Throws:
IOException
-
ensureSyncIsEnabled
protected void ensureSyncIsEnabled()
-
exists
public boolean exists(org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
exists
in interfaceVolumeManager
- Throws:
IOException
-
getFileStatus
public org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
getFileStatus
in interfaceVolumeManager
- Throws:
IOException
-
getVolumeByPath
public Volume getVolumeByPath(org.apache.hadoop.fs.Path path)
- Specified by:
getVolumeByPath
in interfaceVolumeManager
-
listStatus
public org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
listStatus
in interfaceVolumeManager
- Throws:
IOException
-
mkdirs
public boolean mkdirs(org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
mkdirs
in interfaceVolumeManager
- Throws:
IOException
-
mkdirs
public boolean mkdirs(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.permission.FsPermission permission) throws IOException
- Specified by:
mkdirs
in interfaceVolumeManager
- Throws:
IOException
-
open
public org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
open
in interfaceVolumeManager
- Throws:
IOException
-
rename
public boolean rename(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.Path newPath) throws IOException
- Specified by:
rename
in interfaceVolumeManager
- Throws:
IOException
-
moveToTrash
public boolean moveToTrash(org.apache.hadoop.fs.Path path) throws IOException
- Specified by:
moveToTrash
in interfaceVolumeManager
- Throws:
IOException
-
getDefaultReplication
public short getDefaultReplication(org.apache.hadoop.fs.Path path)
- Specified by:
getDefaultReplication
in interfaceVolumeManager
-
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:
isReady
in interfaceVolumeManager
- Throws:
IOException
-
globStatus
public org.apache.hadoop.fs.FileStatus[] globStatus(org.apache.hadoop.fs.Path pathPattern) throws IOException
- Specified by:
globStatus
in interfaceVolumeManager
- Throws:
IOException
-
getFullPath
public org.apache.hadoop.fs.Path getFullPath(Key key)
- Specified by:
getFullPath
in interfaceVolumeManager
-
matchingFileSystem
public org.apache.hadoop.fs.Path matchingFileSystem(org.apache.hadoop.fs.Path source, String[] options)
- Specified by:
matchingFileSystem
in interfaceVolumeManager
-
getFullPath
public org.apache.hadoop.fs.Path getFullPath(TableId tableId, String path)
- Specified by:
getFullPath
in interfaceVolumeManager
-
getFullPath
public org.apache.hadoop.fs.Path getFullPath(VolumeManager.FileType fileType, String path)
- Specified by:
getFullPath
in interfaceVolumeManager
-
getContentSummary
public org.apache.hadoop.fs.ContentSummary getContentSummary(org.apache.hadoop.fs.Path dir) throws IOException
- Specified by:
getContentSummary
in interfaceVolumeManager
- Throws:
IOException
-
choose
public String choose(VolumeChooserEnvironment env, String[] options)
- Specified by:
choose
in interfaceVolumeManager
-
getDefaultVolume
public Volume getDefaultVolume()
Description copied from interface:VolumeManager
Fetch the default Volume- Specified by:
getDefaultVolume
in interfaceVolumeManager
-
getVolumes
public Collection<Volume> getVolumes()
Description copied from interface:VolumeManager
Fetch the configured Volumes, excluding the default Volume- Specified by:
getVolumes
in interfaceVolumeManager
-
-