public class GridGgfsHadoopFileSystem
extends org.apache.hadoop.fs.FileSystem
GGFS Hadoop 1.x file system driver over file system API. To use
GGFS as Hadoop file system, you should configure this class
in Hadoop's core-site.xml as follows:
<property>
<name>fs.default.name</name>
<value>ggfs://ipc</value>
</property>
<property>
<name>fs.ggfs.impl</name>
<value>org.gridgain.grid.ggfs.hadoop.GridGgfsHadoopFileSystem</value>
</property>
You should also add GridGain JAR and all libraries to Hadoop classpath. To
do this, add following lines to conf/hadoop-env.sh script in Hadoop
distribution:
export GRIDGAIN_HOME=/path/to/GridGain/distribution export HADOOP_CLASSPATH=$GRIDGAIN_HOME/gridgain*.jar for f in $GRIDGAIN_HOME/libs/*.jar; do export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$f; done
job-submitter or job-scheduler processes, while data nodes are usually
started together with Hadoop task-tracker processes.
For sample client and data node configuration refer to config/hadoop/default-config-client.xml
and config/hadoop/default-config.xml configuration files in GridGain installation.
| Modifier and Type | Field and Description |
|---|---|
static org.apache.hadoop.fs.FileStatus[] |
EMPTY_FILE_STATUS
Empty array of file statuses.
|
static String |
GGFS_MANAGEMENT
Internal property to indicate management connection.
|
| Constructor and Description |
|---|
GridGgfsHadoopFileSystem() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.fs.FSDataOutputStream |
append(org.apache.hadoop.fs.Path f,
int bufSize,
org.apache.hadoop.util.Progressable progress) |
protected void |
checkPath(org.apache.hadoop.fs.Path path) |
void |
close() |
void |
colocateFileWrites(boolean colocateFileWrites)
Public setter that can be used by direct users of FS or Visor.
|
org.apache.hadoop.fs.FSDataOutputStream |
create(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission perm,
boolean overwrite,
int bufSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress) |
boolean |
delete(org.apache.hadoop.fs.Path f) |
boolean |
delete(org.apache.hadoop.fs.Path f,
boolean recursive) |
protected void |
finalize() |
org.apache.hadoop.fs.ContentSummary |
getContentSummary(org.apache.hadoop.fs.Path f) |
long |
getDefaultBlockSize() |
short |
getDefaultReplication() |
org.apache.hadoop.fs.BlockLocation[] |
getFileBlockLocations(org.apache.hadoop.fs.FileStatus status,
long start,
long len) |
org.apache.hadoop.fs.FileStatus |
getFileStatus(org.apache.hadoop.fs.Path f) |
URI |
getUri() |
org.apache.hadoop.fs.Path |
getWorkingDirectory() |
void |
initialize(URI name,
org.apache.hadoop.conf.Configuration cfg) |
org.apache.hadoop.fs.FileStatus[] |
listStatus(org.apache.hadoop.fs.Path f) |
boolean |
mkdirs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission perm) |
org.gridgain.grid.ggfs.GridGgfsMode |
mode(org.gridgain.grid.ggfs.GridGgfsPath path)
Resolve path mode.
|
org.gridgain.grid.ggfs.GridGgfsMode |
mode(org.apache.hadoop.fs.Path path)
Resolve path mode.
|
org.apache.hadoop.fs.FSDataInputStream |
open(org.apache.hadoop.fs.Path f,
int bufSize) |
boolean |
rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst) |
void |
setOwner(org.apache.hadoop.fs.Path p,
String username,
String grpName) |
void |
setPermission(org.apache.hadoop.fs.Path p,
org.apache.hadoop.fs.permission.FsPermission perm) |
void |
setTimes(org.apache.hadoop.fs.Path p,
long mtime,
long atime) |
void |
setWorkingDirectory(org.apache.hadoop.fs.Path newPath) |
String |
toString() |
addDelegationTokens, append, append, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, clearStatistics, 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, getBlockSize, getCanonicalServiceName, getCanonicalUri, getChildFileSystems, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultUri, getDelegationToken, getFileBlockLocations, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getHomeDirectory, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getReplication, getScheme, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getUsed, globStatus, globStatus, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, makeQualified, mkdirs, mkdirs, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeAcl, removeAclEntries, removeDefaultAcl, rename, renameSnapshot, resolveLink, resolvePath, setAcl, setDefaultUri, setDefaultUri, setReplication, setVerifyChecksum, setWriteChecksum, startLocalOutput, supportsSymlinkspublic static final String GGFS_MANAGEMENT
public static final org.apache.hadoop.fs.FileStatus[] EMPTY_FILE_STATUS
public URI getUri()
getUri in class org.apache.hadoop.fs.FileSystempublic void colocateFileWrites(boolean colocateFileWrites)
colocateFileWrites - Whether all ongoing file writes should be colocated.public void initialize(URI name, org.apache.hadoop.conf.Configuration cfg) throws IOException
initialize in class org.apache.hadoop.fs.FileSystemIOExceptionprotected void checkPath(org.apache.hadoop.fs.Path path)
checkPath in class org.apache.hadoop.fs.FileSystempublic short getDefaultReplication()
getDefaultReplication in class org.apache.hadoop.fs.FileSystempublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class org.apache.hadoop.fs.FileSystemIOExceptionprotected void finalize()
throws Throwable
public void setTimes(org.apache.hadoop.fs.Path p,
long mtime,
long atime)
throws IOException
setTimes in class org.apache.hadoop.fs.FileSystemIOExceptionpublic void setPermission(org.apache.hadoop.fs.Path p,
org.apache.hadoop.fs.permission.FsPermission perm)
throws IOException
setPermission in class org.apache.hadoop.fs.FileSystemIOExceptionpublic void setOwner(org.apache.hadoop.fs.Path p,
String username,
String grpName)
throws IOException
setOwner in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.FSDataInputStream open(org.apache.hadoop.fs.Path f,
int bufSize)
throws IOException
open in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.FSDataOutputStream create(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission perm,
boolean overwrite,
int bufSize,
short replication,
long blockSize,
org.apache.hadoop.util.Progressable progress)
throws IOException
create in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.FSDataOutputStream append(org.apache.hadoop.fs.Path f,
int bufSize,
org.apache.hadoop.util.Progressable progress)
throws IOException
append in class org.apache.hadoop.fs.FileSystemIOExceptionpublic boolean rename(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
throws IOException
rename in class org.apache.hadoop.fs.FileSystemIOExceptionpublic boolean delete(org.apache.hadoop.fs.Path f)
throws IOException
delete in class org.apache.hadoop.fs.FileSystemIOExceptionpublic boolean delete(org.apache.hadoop.fs.Path f,
boolean recursive)
throws IOException
delete in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.FileStatus[] listStatus(org.apache.hadoop.fs.Path f)
throws IOException
listStatus in class org.apache.hadoop.fs.FileSystemIOExceptionpublic void setWorkingDirectory(org.apache.hadoop.fs.Path newPath)
setWorkingDirectory in class org.apache.hadoop.fs.FileSystempublic org.apache.hadoop.fs.Path getWorkingDirectory()
getWorkingDirectory in class org.apache.hadoop.fs.FileSystempublic boolean mkdirs(org.apache.hadoop.fs.Path f,
org.apache.hadoop.fs.permission.FsPermission perm)
throws IOException
mkdirs in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.FileStatus getFileStatus(org.apache.hadoop.fs.Path f)
throws IOException
getFileStatus in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.ContentSummary getContentSummary(org.apache.hadoop.fs.Path f)
throws IOException
getContentSummary in class org.apache.hadoop.fs.FileSystemIOExceptionpublic org.apache.hadoop.fs.BlockLocation[] getFileBlockLocations(org.apache.hadoop.fs.FileStatus status,
long start,
long len)
throws IOException
getFileBlockLocations in class org.apache.hadoop.fs.FileSystemIOExceptionpublic long getDefaultBlockSize()
getDefaultBlockSize in class org.apache.hadoop.fs.FileSystempublic org.gridgain.grid.ggfs.GridGgfsMode mode(org.apache.hadoop.fs.Path path)
path - HDFS path.public org.gridgain.grid.ggfs.GridGgfsMode mode(org.gridgain.grid.ggfs.GridGgfsPath path)
path - GGFS path.Copyright © 2014. All rights reserved.