public class SwiftNativeFileSystem extends FileSystem
FileSystem.Statistics| Modifier and Type | Field and Description |
|---|---|
static String |
SWIFT
filesystem prefix: "swift"
|
DEFAULT_FS, FS_DEFAULT_NAME_KEY, SHUTDOWN_HOOK_PRIORITY, statistics| Constructor and Description |
|---|
SwiftNativeFileSystem()
Default constructor for Hadoop
|
SwiftNativeFileSystem(SwiftNativeFileSystemStore store)
This constructor used for testing purposes
|
| Modifier and Type | Method and Description |
|---|---|
FSDataOutputStream |
append(Path f,
int bufferSize,
Progressable progress)
This optional operation is not supported
|
FSDataOutputStream |
create(Path file,
FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
Progressable progress) |
protected org.apache.hadoop.fs.swift.snative.SwiftNativeOutputStream |
createSwiftOutputStream(Path path)
Create the swift output stream
|
boolean |
delete(Path f)
Delete a file.
|
boolean |
delete(Path path,
boolean recursive)
Delete a file or directory
|
long |
getBlockSize(Path path) |
static long |
getBytesUploaded(FSDataOutputStream outputStream)
Get the the number of bytes uploaded by an output stream
to the swift cluster.
|
static long |
getBytesWritten(FSDataOutputStream outputStream)
Get the the number of bytes written to an output stream
This is for testing
|
long |
getDefaultBlockSize()
The blocksize of this filesystem is set by the property
SwiftProtocolConstants.SWIFT_BLOCKSIZE;the default is the value of
SwiftProtocolConstants.DEFAULT_SWIFT_BLOCKSIZE;
|
long |
getDefaultBlockSize(Path f)
The blocksize for this filesystem.
|
BlockLocation[] |
getFileBlockLocations(FileStatus file,
long start,
long len)
Return an array containing hostnames, offset and size of
portions of the given file.
|
FileStatus |
getFileStatus(Path path)
Return a file status object that represents the path.
|
List<DurationStats> |
getOperationStatistics()
Get the current operation statistics
|
static long |
getPartitionSize(FSDataOutputStream outputStream)
Get the size of partitions written by an output stream
This is for testing
|
static int |
getPartitionsWritten(FSDataOutputStream outputStream)
Get the number of partitions written by an output stream
This is for testing
|
String |
getScheme() |
SwiftNativeFileSystemStore |
getStore()
This is for testing
|
URI |
getUri() |
Path |
getWorkingDirectory()
Path to user working directory
|
void |
initialize(URI fsuri,
Configuration conf)
default class initialization
|
boolean |
isDirectory(Path f) |
boolean |
isFile(Path f) |
FileStatus[] |
listRawFileStatus(Path path,
boolean newest)
Low level method to do a deep listing of all entries, not stopping
at the next directory entry.
|
FileStatus[] |
listStatus(Path path)
List the statuses of the files/directories in the given path if the path is
a directory.
|
protected Path |
makeAbsolute(Path path)
Makes path absolute
|
boolean |
mkdirs(Path path,
FsPermission permission)
Create the parent directories.
|
FSDataInputStream |
open(Path path,
int bufferSize)
Opens an FSDataInputStream at the indicated Path.
|
FSDataInputStream |
open(Path path,
int bufferSize,
long readBlockSize)
Low-level operation to also set the block size for this operation
|
boolean |
rename(Path src,
Path dst)
Renames Path src to Path dst.
|
void |
setWorkingDirectory(Path dir) |
String |
toString() |
access, addDelegationTokens, append, append, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, checkPath, clearStatistics, close, closeAll, closeAllForUGI, completeLocalOutput, concat, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, create, createNewFile, createNonRecursive, createNonRecursive, createNonRecursive, createSnapshot, createSnapshot, createSymlink, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAclStatus, getAllStatistics, getCanonicalServiceName, getCanonicalUri, getChildFileSystems, getContentSummary, getDefaultPort, getDefaultReplication, getDefaultReplication, getDefaultUri, getDelegationToken, getFileBlockLocations, getFileChecksum, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getHomeDirectory, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getReplication, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getUsed, getXAttr, getXAttrs, getXAttrs, globStatus, globStatus, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, listStatusIterator, listXAttrs, makeQualified, mkdirs, mkdirs, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, setAcl, setDefaultUri, setDefaultUri, setOwner, setPermission, setReplication, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, setXAttr, startLocalOutput, supportsSymlinks, truncategetConf, setConfpublic static final String SWIFT
public SwiftNativeFileSystem()
public SwiftNativeFileSystem(SwiftNativeFileSystemStore store)
public SwiftNativeFileSystemStore getStore()
public String getScheme()
getScheme in class FileSystempublic void initialize(URI fsuri, Configuration conf) throws IOException
initialize in class FileSystemfsuri - path to Swiftconf - Hadoop configurationIOExceptionpublic URI getUri()
getUri in class FileSystempublic Path getWorkingDirectory()
getWorkingDirectory in class FileSystempublic void setWorkingDirectory(Path dir)
setWorkingDirectory in class FileSystemdir - user working directorypublic FileStatus getFileStatus(Path path) throws IOException
getFileStatus in class FileSystempath - The path we want information fromIOExceptionpublic long getDefaultBlockSize()
getDefaultBlockSize in class FileSystempublic long getDefaultBlockSize(Path f)
getDefaultBlockSize in class FileSystemf - path of filegetDefaultBlockSize()public long getBlockSize(Path path) throws IOException
getBlockSize in class FileSystemIOExceptionpublic boolean isFile(Path f) throws IOException
isFile in class FileSystemIOExceptionpublic boolean isDirectory(Path f) throws IOException
isDirectory in class FileSystemIOExceptionpublic BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len) throws IOException
This call is most helpful with DFS, where it returns hostnames of machines that contain the given file.
The FileSystem will simply return an elt containing 'localhost'.
getFileBlockLocations in class FileSystemIOExceptionpublic boolean mkdirs(Path path, FsPermission permission) throws IOException
mkdirs in class FileSystempath - path to create.permission - to apply to filesIOException - on a problempublic FileStatus[] listStatus(Path path) throws IOException
listStatus in class FileSystempath - given pathIOExceptionpublic FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException
append in class FileSystemIOExceptionpublic FSDataOutputStream create(Path file, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
create in class FileSystempermission - Currently ignored.IOExceptionprotected org.apache.hadoop.fs.swift.snative.SwiftNativeOutputStream createSwiftOutputStream(Path path) throws IOException
path - path to write toIOExceptionpublic FSDataInputStream open(Path path, int bufferSize) throws IOException
open in class FileSystempath - the file name to openbufferSize - the size of the buffer to be used.FileNotFoundException - if the file is not foundIOException - any IO problempublic FSDataInputStream open(Path path, int bufferSize, long readBlockSize) throws IOException
path - the file name to openbufferSize - the size of the buffer to be used.readBlockSize - how big should the read blockk/buffer size be?FileNotFoundException - if the file is not foundIOException - any IO problempublic boolean rename(Path src, Path dst) throws IOException
rename in class FileSystemsrc - pathdst - pathIOException - on problemspublic boolean delete(Path path, boolean recursive) throws IOException
delete in class FileSystempath - the path to delete.recursive - if path is a directory and set to
true, the directory is deleted else throws an exception if the
directory is not empty
case of a file the recursive can be set to either true or false.IOException - IO problemspublic boolean delete(Path f) throws IOException
delete in class FileSystemIOExceptionprotected Path makeAbsolute(Path path)
path - path to filepublic List<DurationStats> getOperationStatistics()
@InterfaceAudience.Private public FileStatus[] listRawFileStatus(Path path, boolean newest) throws IOException
path - path to recurse downnewest - ask for the newest data, potentially slower than not.IOException - any problem@InterfaceAudience.Private public static int getPartitionsWritten(FSDataOutputStream outputStream)
outputStream - output stream@InterfaceAudience.Private public static long getPartitionSize(FSDataOutputStream outputStream)
outputStream - output stream@InterfaceAudience.Private public static long getBytesWritten(FSDataOutputStream outputStream)
outputStream - output stream@InterfaceAudience.Private public static long getBytesUploaded(FSDataOutputStream outputStream)
outputStream - output streamCopyright © 2018 CERN. All Rights Reserved.