@ThreadSafe public class HdfsUnderFileSystem extends ConsistentUnderFileSystem implements AtomicFileOutputStreamCallback
UnderFileSystem implementation.UnderFileSystem.Factory, UnderFileSystem.SpaceType| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
CHECKSUM_COMBINE_MODE |
protected static java.lang.String |
HADOOP_AUTH_METHOD |
protected static java.lang.String |
HDFS_ACL_PROVIDER_CLASS
Name of the class for the HDFS Acl provider.
|
protected static java.lang.String |
HDFS_EC_CODEC_REGISTRY_CLASS
Name of the class for the HDFS EC Codec Registry.
|
protected static java.lang.String |
HDFS_EC_MIN_VERSION
The minimum HDFS production version required for EC.
|
protected static java.lang.String |
HDFS_USER |
protected static java.lang.String |
JAVAX_WS_RS_CORE_MEDIA_TYPE |
protected static java.lang.String |
KRB_KEYTAB_LOGIN_AUTO_RENEW |
protected static java.lang.String |
KRB5_CONF_FILE |
protected static int |
MAX_TRY |
protected HdfsAclProvider |
mHdfsAclProvider |
protected static java.lang.String |
USER_NAMESPACE_PREFIX |
EMPTY_ACL, mUfsConf, mUri| Modifier | Constructor and Description |
|---|---|
|
HdfsUnderFileSystem(AlluxioURI ufsUri,
UnderFileSystemConfiguration conf,
org.apache.hadoop.conf.Configuration hdfsConf)
Constructs a new HDFS
UnderFileSystem. |
protected |
HdfsUnderFileSystem(AlluxioURI ufsUri,
UnderFileSystemConfiguration conf,
org.apache.hadoop.conf.Configuration hdfsConf,
boolean useLoadingCache) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup() |
void |
close() |
void |
connectFromMaster(java.lang.String host) |
void |
connectFromWorker(java.lang.String host) |
java.io.OutputStream |
create(java.lang.String path,
CreateOptions options) |
static org.apache.hadoop.conf.Configuration |
createConfiguration(UnderFileSystemConfiguration conf)
Prepares the Hadoop configuration necessary to successfully obtain a
FileSystem
instance that can access the provided path. |
java.io.OutputStream |
createDirect(java.lang.String path,
CreateOptions options) |
static HdfsUnderFileSystem |
createInstance(AlluxioURI ufsUri,
UnderFileSystemConfiguration conf)
Factory method to constructs a new HDFS
UnderFileSystem instance. |
boolean |
deleteDirectory(java.lang.String path,
DeleteOptions options) |
boolean |
deleteFile(java.lang.String path) |
boolean |
exists(java.lang.String path) |
Pair<AccessControlList,DefaultAccessControlList> |
getAclPair(java.lang.String path) |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes(java.lang.String path) |
long |
getBlockSizeByte(java.lang.String path) |
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,
FileLocationOptions options) |
UfsFileStatus |
getFileStatus(java.lang.String path,
GetStatusOptions options) |
org.apache.hadoop.fs.FileSystem |
getFs() |
long |
getSpace(java.lang.String path,
UnderFileSystem.SpaceType type) |
UfsStatus |
getStatus(java.lang.String path,
GetStatusOptions options) |
java.lang.String |
getUnderFSType() |
boolean |
isDirectory(java.lang.String path) |
boolean |
isFile(java.lang.String path) |
boolean |
isSeekable() |
UfsStatus[] |
listStatus(java.lang.String path) |
java.util.Iterator<UfsStatus> |
listStatusIterable(java.lang.String path,
ListOptions options,
java.lang.String startAfter,
int batchSize) |
boolean |
mkdirs(java.lang.String path,
MkdirsOptions options) |
java.io.InputStream |
open(java.lang.String path,
OpenOptions options) |
HdfsPositionedUnderFileInputStream |
openPositionRead(java.lang.String path,
long fileLength) |
boolean |
renameDirectory(java.lang.String src,
java.lang.String dst) |
boolean |
renameFile(java.lang.String src,
java.lang.String dst) |
void |
setAclEntries(java.lang.String path,
java.util.List<AclEntry> aclEntries) |
void |
setAttribute(java.lang.String path,
java.lang.String name,
byte[] value) |
void |
setMode(java.lang.String path,
short mode) |
void |
setOwner(java.lang.String path,
java.lang.String user,
java.lang.String group) |
boolean |
supportsFlush() |
createNonexistingFile, createNonexistingFile, deleteExistingDirectory, deleteExistingDirectory, deleteExistingFile, getExistingDirectoryStatus, getExistingFileStatus, getExistingStatus, isExistingDirectory, openExistingFile, openExistingFile, renameRenamableDirectory, renameRenamableFilecreate, deleteDirectory, getConfiguration, getFingerprint, getOperationMode, getParsedFingerprint, getParsedFingerprint, getPhysicalStores, isObjectStorage, listStatus, mkdirs, open, performListingAsync, resolveUri, validatePathclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, createNonexistingFile, createNonexistingFile, deleteDirectory, deleteExistingDirectory, deleteExistingDirectory, deleteExistingFile, getConfiguration, getExistingDirectoryStatus, getExistingFileStatus, getExistingStatus, getFileStatus, getFingerprint, getOperationMode, getParsedFingerprint, getParsedFingerprint, getPhysicalStores, getStatus, getTemporaryToken, isExistingDirectory, isObjectStorage, isTemporaryConnectionToken, listStatus, listStatuses, mkdirs, open, openExistingFile, openExistingFile, refreshTemporaryToken, renameRenamableDirectory, renameRenamableFile, resolveUri, setTemporaryTokenRefreshContextperformListingAsyncprotected static final int MAX_TRY
protected static final java.lang.String HDFS_USER
protected static final java.lang.String HDFS_ACL_PROVIDER_CLASS
protected static final java.lang.String HDFS_EC_MIN_VERSION
protected static final java.lang.String HDFS_EC_CODEC_REGISTRY_CLASS
protected static final java.lang.String JAVAX_WS_RS_CORE_MEDIA_TYPE
protected static final java.lang.String HADOOP_AUTH_METHOD
protected static final java.lang.String KRB5_CONF_FILE
protected static final java.lang.String KRB_KEYTAB_LOGIN_AUTO_RENEW
protected static final java.lang.String CHECKSUM_COMBINE_MODE
protected static final java.lang.String USER_NAMESPACE_PREFIX
protected final HdfsAclProvider mHdfsAclProvider
public HdfsUnderFileSystem(AlluxioURI ufsUri, UnderFileSystemConfiguration conf, org.apache.hadoop.conf.Configuration hdfsConf)
UnderFileSystem.ufsUri - the AlluxioURI for this UFSconf - the configuration for this UFShdfsConf - the configuration for HDFSprotected HdfsUnderFileSystem(AlluxioURI ufsUri, UnderFileSystemConfiguration conf, org.apache.hadoop.conf.Configuration hdfsConf, boolean useLoadingCache)
public static HdfsUnderFileSystem createInstance(AlluxioURI ufsUri, UnderFileSystemConfiguration conf)
UnderFileSystem instance.ufsUri - the AlluxioURI for this UFSconf - the configuration for HadoopUnderFileSystem instancepublic java.lang.String getUnderFSType()
getUnderFSType in interface UnderFileSystempublic static org.apache.hadoop.conf.Configuration createConfiguration(UnderFileSystemConfiguration conf)
FileSystem
instance that can access the provided path.
Derived implementations that work with specialised Hadoop FileSystem API compatible implementations can override this method to add implementation specific configuration necessary for obtaining a usable FileSystem instance.
conf - the configuration for this UFSpublic void cleanup()
cleanup in interface UnderFileSystempublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class BaseUnderFileSystempublic java.io.OutputStream create(java.lang.String path,
CreateOptions options)
throws java.io.IOException
create in interface UnderFileSystemjava.io.IOExceptionpublic java.io.OutputStream createDirect(java.lang.String path,
CreateOptions options)
throws java.io.IOException
createDirect in interface AtomicFileOutputStreamCallbackjava.io.IOExceptionpublic boolean deleteDirectory(java.lang.String path,
DeleteOptions options)
throws java.io.IOException
deleteDirectory in interface UnderFileSystemjava.io.IOExceptionpublic boolean deleteFile(java.lang.String path)
throws java.io.IOException
deleteFile in interface UnderFileSystemjava.io.IOExceptionpublic boolean exists(java.lang.String path)
throws java.io.IOException
exists in interface UnderFileSystemexists in class BaseUnderFileSystemjava.io.IOExceptionpublic Pair<AccessControlList,DefaultAccessControlList> getAclPair(java.lang.String path) throws java.io.IOException
getAclPair in interface UnderFileSystemgetAclPair in class BaseUnderFileSystemjava.io.IOExceptionpublic void setAclEntries(java.lang.String path,
java.util.List<AclEntry> aclEntries)
throws java.io.IOException
setAclEntries in interface UnderFileSystemsetAclEntries in class BaseUnderFileSystemjava.io.IOExceptionpublic long getBlockSizeByte(java.lang.String path)
throws java.io.IOException
getBlockSizeByte in interface UnderFileSystemjava.io.IOExceptionpublic UfsDirectoryStatus getDirectoryStatus(java.lang.String path) throws java.io.IOException
getDirectoryStatus in interface UnderFileSystemjava.io.IOExceptionpublic java.util.List<java.lang.String> getFileLocations(java.lang.String path)
throws java.io.IOException
getFileLocations in interface UnderFileSystemjava.io.IOException@Nullable
public java.util.List<java.lang.String> getFileLocations(java.lang.String path,
FileLocationOptions options)
throws java.io.IOException
getFileLocations in interface UnderFileSystemjava.io.IOExceptionpublic UfsFileStatus getFileStatus(java.lang.String path, GetStatusOptions options) throws java.io.IOException
getFileStatus in interface UnderFileSystemjava.io.IOExceptionpublic long getSpace(java.lang.String path,
UnderFileSystem.SpaceType type)
throws java.io.IOException
getSpace in interface UnderFileSystemjava.io.IOExceptionpublic UfsStatus getStatus(java.lang.String path, GetStatusOptions options) throws java.io.IOException
getStatus in interface UnderFileSystemjava.io.IOExceptionpublic boolean isDirectory(java.lang.String path)
throws java.io.IOException
isDirectory in interface UnderFileSystemjava.io.IOExceptionpublic boolean isFile(java.lang.String path)
throws java.io.IOException
isFile in interface UnderFileSystemjava.io.IOException@Nullable public java.util.Iterator<UfsStatus> listStatusIterable(java.lang.String path, ListOptions options, java.lang.String startAfter, int batchSize) throws java.io.IOException
listStatusIterable in interface UnderFileSystemlistStatusIterable in class BaseUnderFileSystemjava.io.IOException@Nullable public UfsStatus[] listStatus(java.lang.String path) throws java.io.IOException
listStatus in interface UnderFileSystemjava.io.IOExceptionpublic void connectFromMaster(java.lang.String host)
throws java.io.IOException
connectFromMaster in interface UnderFileSystemjava.io.IOExceptionpublic void connectFromWorker(java.lang.String host)
throws java.io.IOException
connectFromWorker in interface UnderFileSystemjava.io.IOExceptionpublic boolean mkdirs(java.lang.String path,
MkdirsOptions options)
throws java.io.IOException
mkdirs in interface UnderFileSystemjava.io.IOExceptionpublic java.io.InputStream open(java.lang.String path,
OpenOptions options)
throws java.io.IOException
open in interface UnderFileSystemjava.io.IOExceptionpublic HdfsPositionedUnderFileInputStream openPositionRead(java.lang.String path, long fileLength)
openPositionRead in interface UnderFileSystempublic boolean renameDirectory(java.lang.String src,
java.lang.String dst)
throws java.io.IOException
renameDirectory in interface UnderFileSystemjava.io.IOExceptionpublic boolean renameFile(java.lang.String src,
java.lang.String dst)
throws java.io.IOException
renameFile in interface UnderFileSystemjava.io.IOExceptionpublic void setOwner(java.lang.String path,
java.lang.String user,
java.lang.String group)
throws java.io.IOException
setOwner in interface UnderFileSystemjava.io.IOExceptionpublic void setAttribute(java.lang.String path,
java.lang.String name,
byte[] value)
throws java.io.IOException
setAttribute in interface UnderFileSystemjava.io.IOExceptionpublic java.util.Map<java.lang.String,java.lang.String> getAttributes(java.lang.String path)
throws java.io.IOException
getAttributes in interface UnderFileSystemjava.io.IOExceptionpublic void setMode(java.lang.String path,
short mode)
throws java.io.IOException
setMode in interface UnderFileSystemjava.io.IOExceptionpublic boolean supportsFlush()
supportsFlush in interface UnderFileSystempublic boolean isSeekable()
isSeekable in interface UnderFileSystemisSeekable in class BaseUnderFileSystempublic org.apache.hadoop.fs.FileSystem getFs()
throws java.io.IOException
FileSystem objectjava.io.IOExceptionCopyright © 2023. All Rights Reserved.