public class GridGgfsHadoopWrapper extends Object implements GridGgfsHadoop
| Constructor and Description |
|---|
GridGgfsHadoopWrapper(String authority,
String logDir,
org.apache.hadoop.conf.Configuration conf,
org.apache.commons.logging.Log log)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Collection<org.gridgain.grid.ggfs.GridGgfsBlockLocation> |
affinity(org.gridgain.grid.ggfs.GridGgfsPath path,
long start,
long len)
Command to get affinity for given path, offset and length.
|
GridGgfsHadoopStreamDelegate |
append(org.gridgain.grid.ggfs.GridGgfsPath path,
boolean create,
Map<String,String> props)
Open file for output appending data to the end of a file.
|
void |
close(boolean force)
Close connection.
|
org.gridgain.grid.ggfs.GridGgfsPathSummary |
contentSummary(org.gridgain.grid.ggfs.GridGgfsPath path)
Gets path summary.
|
GridGgfsHadoopStreamDelegate |
create(org.gridgain.grid.ggfs.GridGgfsPath path,
boolean overwrite,
boolean colocate,
int replication,
long blockSize,
Map<String,String> props)
Command to create file and open it for output.
|
Boolean |
delete(org.gridgain.grid.ggfs.GridGgfsPath path,
boolean recursive)
Command to delete given path.
|
GridGgfsStatus |
fsStatus()
Performs status request.
|
GridGgfsHandshakeResponse |
handshake(String logDir)
Perform handshake.
|
org.gridgain.grid.ggfs.GridGgfsFile |
info(org.gridgain.grid.ggfs.GridGgfsPath path)
Command to retrieve file info for some GGFS path.
|
Collection<org.gridgain.grid.ggfs.GridGgfsFile> |
listFiles(org.gridgain.grid.ggfs.GridGgfsPath path)
Command to get list of files in directory.
|
Collection<org.gridgain.grid.ggfs.GridGgfsPath> |
listPaths(org.gridgain.grid.ggfs.GridGgfsPath path)
Command to get directory listing.
|
Boolean |
mkdirs(org.gridgain.grid.ggfs.GridGgfsPath path,
Map<String,String> props)
Command to create directories.
|
GridGgfsHadoopStreamDelegate |
open(org.gridgain.grid.ggfs.GridGgfsPath path)
Command to open file for reading.
|
GridGgfsHadoopStreamDelegate |
open(org.gridgain.grid.ggfs.GridGgfsPath path,
int seqReadsBeforePrefetch)
Command to open file for reading.
|
Boolean |
rename(org.gridgain.grid.ggfs.GridGgfsPath src,
org.gridgain.grid.ggfs.GridGgfsPath dest)
Command to rename given path.
|
Boolean |
setTimes(org.gridgain.grid.ggfs.GridGgfsPath path,
long accessTime,
long modificationTime)
Sets last access time and last modification time for a file.
|
org.gridgain.grid.ggfs.GridGgfsFile |
update(org.gridgain.grid.ggfs.GridGgfsPath path,
Map<String,String> props)
Command to update file properties.
|
public GridGgfsHadoopWrapper(String authority, String logDir, org.apache.hadoop.conf.Configuration conf, org.apache.commons.logging.Log log) throws IOException
authority - Authority (connection string).logDir - Log directory for server.conf - Configuration.log - Current logger.IOExceptionpublic GridGgfsHandshakeResponse handshake(String logDir) throws IOException
handshake in interface GridGgfsHadooplogDir - Log directory.IOExceptionpublic void close(boolean force)
close in interface GridGgfsHadoopforce - Force flag.public org.gridgain.grid.ggfs.GridGgfsFile info(org.gridgain.grid.ggfs.GridGgfsPath path)
throws IOException
info in interface GridGgfsHadooppath - Path to get file info for.IOExceptionpublic org.gridgain.grid.ggfs.GridGgfsFile update(org.gridgain.grid.ggfs.GridGgfsPath path,
Map<String,String> props)
throws IOException
update in interface GridGgfsHadooppath - GGFS path to update properties.props - Properties to update.IOExceptionpublic Boolean setTimes(org.gridgain.grid.ggfs.GridGgfsPath path, long accessTime, long modificationTime) throws IOException
setTimes in interface GridGgfsHadooppath - Path to update times.accessTime - Last access time to set.modificationTime - Last modification time to set.IOExceptionpublic Boolean rename(org.gridgain.grid.ggfs.GridGgfsPath src, org.gridgain.grid.ggfs.GridGgfsPath dest) throws IOException
rename in interface GridGgfsHadoopsrc - Source path.dest - Destination path.IOExceptionpublic Boolean delete(org.gridgain.grid.ggfs.GridGgfsPath path, boolean recursive) throws IOException
delete in interface GridGgfsHadooppath - Path to delete.recursive - True if deletion is recursive.IOExceptionpublic Collection<org.gridgain.grid.ggfs.GridGgfsBlockLocation> affinity(org.gridgain.grid.ggfs.GridGgfsPath path, long start, long len) throws IOException
affinity in interface GridGgfsHadooppath - Path to get affinity for.start - Start position (offset).len - Data length.IOExceptionpublic org.gridgain.grid.ggfs.GridGgfsPathSummary contentSummary(org.gridgain.grid.ggfs.GridGgfsPath path)
throws IOException
contentSummary in interface GridGgfsHadooppath - Path to get summary for.IOExceptionpublic Boolean mkdirs(org.gridgain.grid.ggfs.GridGgfsPath path, Map<String,String> props) throws IOException
mkdirs in interface GridGgfsHadooppath - Path to create.IOExceptionpublic Collection<org.gridgain.grid.ggfs.GridGgfsFile> listFiles(org.gridgain.grid.ggfs.GridGgfsPath path) throws IOException
listFiles in interface GridGgfsHadooppath - Path to list.IOExceptionpublic Collection<org.gridgain.grid.ggfs.GridGgfsPath> listPaths(org.gridgain.grid.ggfs.GridGgfsPath path) throws IOException
listPaths in interface GridGgfsHadooppath - Path to list.IOExceptionpublic GridGgfsStatus fsStatus() throws IOException
fsStatus in interface GridGgfsHadoopIOExceptionpublic GridGgfsHadoopStreamDelegate open(org.gridgain.grid.ggfs.GridGgfsPath path) throws IOException
open in interface GridGgfsHadooppath - File path to open.IOExceptionpublic GridGgfsHadoopStreamDelegate open(org.gridgain.grid.ggfs.GridGgfsPath path, int seqReadsBeforePrefetch) throws IOException
open in interface GridGgfsHadooppath - File path to open.IOExceptionpublic GridGgfsHadoopStreamDelegate create(org.gridgain.grid.ggfs.GridGgfsPath path, boolean overwrite, boolean colocate, int replication, long blockSize, @Nullable Map<String,String> props) throws IOException
create in interface GridGgfsHadooppath - Path to file.overwrite - If true then old file contents will be lost.colocate - If true and called on data node, file will be written on that node.replication - Replication factor.props - File properties for creation.IOExceptionpublic GridGgfsHadoopStreamDelegate append(org.gridgain.grid.ggfs.GridGgfsPath path, boolean create, @Nullable Map<String,String> props) throws IOException
append in interface GridGgfsHadooppath - Path to file.create - If true, file will be created if does not exist.props - File properties.IOExceptionCopyright © 2014. All rights reserved.