public class GoogleHadoopFileSystem extends GoogleHadoopFileSystemBase
This implementation sacrifices a small amount of cross-bucket interoperability in favor of more straightforward FileSystem semantics and compatibility with existing Hadoop applications. In particular, it is not subject to bucket-naming constraints, and files are allowed to be placed in root.
GoogleHadoopFileSystemBase.Counter, GoogleHadoopFileSystemBase.GcsFileChecksumType, GoogleHadoopFileSystemBase.OutputStreamType
counters, DEFAULT_FILTER, defaultBlockSize, delegationTokens, GHFS_ID, initUri, PROPERTIES_FILE, REPLICATION_FACTOR_DEFAULT, UNKNOWN_VERSION, VERSION, VERSION_PROPERTY
Constructor and Description |
---|
GoogleHadoopFileSystem()
Constructs an instance of GoogleHadoopFileSystem; the internal
GoogleCloudStorageFileSystem will be set up with config settings when initialize() is called.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkPath(org.apache.hadoop.fs.Path path) |
protected void |
configureBuckets(GoogleCloudStorageFileSystem gcsFs)
Sets and validates the root bucket.
|
org.apache.hadoop.fs.Path |
getDefaultWorkingDirectory()
Gets the default value of working directory.
|
org.apache.hadoop.fs.Path |
getFileSystemRoot()
Returns the Hadoop path representing the root of the FileSystem associated with this
FileSystemDescriptor.
|
URI |
getGcsPath(org.apache.hadoop.fs.Path hadoopPath)
Translates a "gs:/" style hadoopPath (or relative path which is not fully-qualified) into
the appropriate GCS path which is compatible with the underlying GcsFs or gsutil.
|
org.apache.hadoop.fs.Path |
getHadoopPath(URI gcsPath)
Validates GCS Path belongs to this file system.
|
protected String |
getHomeDirectorySubpath()
Override to allow a homedir subpath which sits directly on our FileSystem root.
|
String |
getScheme()
As the global-rooted FileSystem, our hadoop-path "scheme" is exactly equal to the general
GCS scheme.
|
append, close, completeLocalOutput, concat, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, create, createCounterMap, createNonRecursive, delete, deleteOnExit, getCanonicalServiceName, getContentSummary, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDelegationToken, getFileChecksum, getFileStatus, getGcsFs, getHomeDirectory, getUri, getUsed, getWorkingDirectory, getXAttr, getXAttrs, getXAttrs, globStatus, globStatus, initialize, initialize, listStatus, listXAttrs, makeQualified, mkdirs, open, processDeleteOnExit, removeXAttr, rename, setOwner, setPermission, setTimes, setVerifyChecksum, setWorkingDirectory, setXAttr, startLocalOutput
access, addDelegationTokens, append, append, appendFile, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, clearStatistics, closeAll, closeAllForUGI, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, create, createFile, createNewFile, createNonRecursive, createNonRecursive, createSnapshot, createSnapshot, createSymlink, delete, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAclStatus, getAllStatistics, getAllStoragePolicies, getBlockSize, getCanonicalUri, getChildFileSystems, getDefaultBlockSize, getDefaultReplication, getDefaultUri, getFileBlockLocations, getFileBlockLocations, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getQuotaUsage, getReplication, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getStoragePolicy, getStorageStatistics, getTrashRoot, getTrashRoots, getUsed, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, listStatusBatch, listStatusIterator, mkdirs, mkdirs, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, removeAcl, removeAclEntries, removeDefaultAcl, rename, renameSnapshot, resolveLink, resolvePath, setAcl, setDefaultUri, setDefaultUri, setReplication, setStoragePolicy, setWriteChecksum, setXAttr, supportsSymlinks, truncate, unsetStoragePolicy
public GoogleHadoopFileSystem()
protected void configureBuckets(GoogleCloudStorageFileSystem gcsFs) throws IOException
configureBuckets
in class GoogleHadoopFileSystemBase
gcsFs
- GoogleCloudStorageFileSystem
to configure bucketsIOException
- if bucket name is invalid or cannot be found.protected void checkPath(org.apache.hadoop.fs.Path path)
checkPath
in class GoogleHadoopFileSystemBase
protected String getHomeDirectorySubpath()
getHomeDirectorySubpath
in class GoogleHadoopFileSystemBase
public org.apache.hadoop.fs.Path getHadoopPath(URI gcsPath)
getHadoopPath
in class GoogleHadoopFileSystemBase
gcsPath
- Fully-qualified GCS path, of the form gs://bucket/object-path.public URI getGcsPath(org.apache.hadoop.fs.Path hadoopPath)
getGcsPath
in class GoogleHadoopFileSystemBase
hadoopPath
- Hadoop path.public String getScheme()
getScheme
in interface FileSystemDescriptor
getScheme
in class GoogleHadoopFileSystemBase
public org.apache.hadoop.fs.Path getFileSystemRoot()
FileSystemDescriptor
getFileSystemRoot
in interface FileSystemDescriptor
getFileSystemRoot
in class GoogleHadoopFileSystemBase
public org.apache.hadoop.fs.Path getDefaultWorkingDirectory()
getDefaultWorkingDirectory
in class GoogleHadoopFileSystemBase
Copyright © 2020. All rights reserved.