Package alluxio.underfs.local
Class LocalUnderFileSystem
- java.lang.Object
-
- alluxio.underfs.BaseUnderFileSystem
-
- alluxio.underfs.ConsistentUnderFileSystem
-
- alluxio.underfs.local.LocalUnderFileSystem
-
- All Implemented Interfaces:
alluxio.underfs.AtomicFileOutputStreamCallback
,alluxio.underfs.UnderFileSystem
,java.io.Closeable
,java.lang.AutoCloseable
@ThreadSafe public class LocalUnderFileSystem extends alluxio.underfs.ConsistentUnderFileSystem implements alluxio.underfs.AtomicFileOutputStreamCallback
Local FSUnderFileSystem
implementation.This is primarily intended for local unit testing and single machine mode. In principle, it can also be used on a system where a shared file system (e.g. NFS) is mounted at the same path on every node of the system. However, it is generally preferable to use a proper distributed file system for that scenario.
-
-
Constructor Summary
Constructors Constructor Description LocalUnderFileSystem(alluxio.AlluxioURI uri, alluxio.underfs.UnderFileSystemConfiguration ufsConf)
Constructs a newLocalUnderFileSystem
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup()
void
close()
void
connectFromMaster(java.lang.String hostname)
void
connectFromWorker(java.lang.String hostname)
java.io.OutputStream
create(java.lang.String path, alluxio.underfs.options.CreateOptions options)
java.io.OutputStream
createDirect(java.lang.String path, alluxio.underfs.options.CreateOptions options)
boolean
deleteDirectory(java.lang.String path, alluxio.underfs.options.DeleteOptions options)
boolean
deleteFile(java.lang.String path)
boolean
exists(java.lang.String path)
long
getBlockSizeByte(java.lang.String path)
alluxio.underfs.UfsDirectoryStatus
getDirectoryStatus(java.lang.String path)
java.util.List<java.lang.String>
getFileLocations(java.lang.String path)
java.util.List<java.lang.String>
getFileLocations(java.lang.String path, alluxio.underfs.options.FileLocationOptions options)
alluxio.underfs.UfsFileStatus
getFileStatus(java.lang.String path)
long
getSpace(java.lang.String path, alluxio.underfs.UnderFileSystem.SpaceType type)
alluxio.underfs.UfsStatus
getStatus(java.lang.String path)
java.lang.String
getUnderFSType()
boolean
isDirectory(java.lang.String path)
boolean
isFile(java.lang.String path)
alluxio.underfs.UfsStatus[]
listStatus(java.lang.String path)
boolean
mkdirs(java.lang.String path, alluxio.underfs.options.MkdirsOptions options)
java.io.InputStream
open(java.lang.String path, alluxio.underfs.options.OpenOptions options)
boolean
renameDirectory(java.lang.String src, java.lang.String dst)
boolean
renameFile(java.lang.String src, java.lang.String dst)
void
setMode(java.lang.String path, short mode)
void
setOwner(java.lang.String path, java.lang.String user, java.lang.String group)
boolean
supportsFlush()
-
Methods inherited from class alluxio.underfs.ConsistentUnderFileSystem
createNonexistingFile, createNonexistingFile, deleteExistingDirectory, deleteExistingDirectory, deleteExistingFile, getExistingDirectoryStatus, getExistingFileStatus, getExistingStatus, isExistingDirectory, openExistingFile, openExistingFile, renameRenamableDirectory, renameRenamableFile
-
Methods inherited from class alluxio.underfs.BaseUnderFileSystem
create, deleteDirectory, getAclPair, getActiveSyncInfo, getConfiguration, getFingerprint, getOperationMode, getPhysicalStores, isObjectStorage, isSeekable, listStatus, mkdirs, open, resolveUri, setAclEntries, startActiveSyncPolling, startSync, stopActiveSyncPolling, stopSync, supportsActiveSync, validatePath
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface alluxio.underfs.UnderFileSystem
create, createNonexistingFile, createNonexistingFile, deleteDirectory, deleteExistingDirectory, deleteExistingDirectory, deleteExistingFile, getAclPair, getActiveSyncInfo, getConfiguration, getExistingDirectoryStatus, getExistingFileStatus, getExistingStatus, getFingerprint, getOperationMode, getPhysicalStores, isExistingDirectory, isObjectStorage, isSeekable, listStatus, mkdirs, open, openExistingFile, openExistingFile, renameRenamableDirectory, renameRenamableFile, resolveUri, setAclEntries, startActiveSyncPolling, startSync, stopActiveSyncPolling, stopSync, supportsActiveSync
-
-
-
-
Constructor Detail
-
LocalUnderFileSystem
public LocalUnderFileSystem(alluxio.AlluxioURI uri, alluxio.underfs.UnderFileSystemConfiguration ufsConf)
Constructs a newLocalUnderFileSystem
.- Parameters:
uri
- theAlluxioURI
for this UFSufsConf
- UFS configuration
-
-
Method Detail
-
getUnderFSType
public java.lang.String getUnderFSType()
- Specified by:
getUnderFSType
in interfacealluxio.underfs.UnderFileSystem
-
cleanup
public void cleanup() throws java.io.IOException
- Specified by:
cleanup
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
create
public java.io.OutputStream create(java.lang.String path, alluxio.underfs.options.CreateOptions options) throws java.io.IOException
- Specified by:
create
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
createDirect
public java.io.OutputStream createDirect(java.lang.String path, alluxio.underfs.options.CreateOptions options) throws java.io.IOException
- Specified by:
createDirect
in interfacealluxio.underfs.AtomicFileOutputStreamCallback
- Throws:
java.io.IOException
-
deleteDirectory
public boolean deleteDirectory(java.lang.String path, alluxio.underfs.options.DeleteOptions options) throws java.io.IOException
- Specified by:
deleteDirectory
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
deleteFile
public boolean deleteFile(java.lang.String path) throws java.io.IOException
- Specified by:
deleteFile
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
exists
public boolean exists(java.lang.String path) throws java.io.IOException
- Specified by:
exists
in interfacealluxio.underfs.UnderFileSystem
- Overrides:
exists
in classalluxio.underfs.BaseUnderFileSystem
- Throws:
java.io.IOException
-
getBlockSizeByte
public long getBlockSizeByte(java.lang.String path) throws java.io.IOException
- Specified by:
getBlockSizeByte
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
getDirectoryStatus
public alluxio.underfs.UfsDirectoryStatus getDirectoryStatus(java.lang.String path) throws java.io.IOException
- Specified by:
getDirectoryStatus
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
getFileLocations
public java.util.List<java.lang.String> getFileLocations(java.lang.String path) throws java.io.IOException
- Specified by:
getFileLocations
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
getFileLocations
public java.util.List<java.lang.String> getFileLocations(java.lang.String path, alluxio.underfs.options.FileLocationOptions options) throws java.io.IOException
- Specified by:
getFileLocations
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
getFileStatus
public alluxio.underfs.UfsFileStatus getFileStatus(java.lang.String path) throws java.io.IOException
- Specified by:
getFileStatus
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
getSpace
public long getSpace(java.lang.String path, alluxio.underfs.UnderFileSystem.SpaceType type) throws java.io.IOException
- Specified by:
getSpace
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
getStatus
public alluxio.underfs.UfsStatus getStatus(java.lang.String path) throws java.io.IOException
- Specified by:
getStatus
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
isDirectory
public boolean isDirectory(java.lang.String path) throws java.io.IOException
- Specified by:
isDirectory
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
isFile
public boolean isFile(java.lang.String path) throws java.io.IOException
- Specified by:
isFile
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
listStatus
public alluxio.underfs.UfsStatus[] listStatus(java.lang.String path) throws java.io.IOException
- Specified by:
listStatus
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
mkdirs
public boolean mkdirs(java.lang.String path, alluxio.underfs.options.MkdirsOptions options) throws java.io.IOException
- Specified by:
mkdirs
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
open
public java.io.InputStream open(java.lang.String path, alluxio.underfs.options.OpenOptions options) throws java.io.IOException
- Specified by:
open
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
renameDirectory
public boolean renameDirectory(java.lang.String src, java.lang.String dst) throws java.io.IOException
- Specified by:
renameDirectory
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
renameFile
public boolean renameFile(java.lang.String src, java.lang.String dst) throws java.io.IOException
- Specified by:
renameFile
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
setOwner
public void setOwner(java.lang.String path, java.lang.String user, java.lang.String group) throws java.io.IOException
- Specified by:
setOwner
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
setMode
public void setMode(java.lang.String path, short mode) throws java.io.IOException
- Specified by:
setMode
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
connectFromMaster
public void connectFromMaster(java.lang.String hostname) throws java.io.IOException
- Specified by:
connectFromMaster
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
connectFromWorker
public void connectFromWorker(java.lang.String hostname) throws java.io.IOException
- Specified by:
connectFromWorker
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
supportsFlush
public boolean supportsFlush() throws java.io.IOException
- Specified by:
supportsFlush
in interfacealluxio.underfs.UnderFileSystem
- Throws:
java.io.IOException
-
-