public class GridGgfsHadoopInProc extends Object implements GridGgfsHadoopEx
| Constructor and Description |
|---|
GridGgfsHadoopInProc(GridGgfsEx ggfs,
org.apache.commons.logging.Log log)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(GridGgfsHadoopStreamDelegate delegate,
GridGgfsHadoopStreamEventListener lsnr)
Adds event listener that will be invoked when connection with server is lost or remote error has occurred.
|
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.
|
void |
closeStream(GridGgfsHadoopStreamDelegate desc)
Close server stream.
|
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.
|
void |
flush(GridGgfsHadoopStreamDelegate delegate)
Flush output stream.
|
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.
|
org.gridgain.grid.util.lang.GridPlainFuture<byte[]> |
readData(GridGgfsHadoopStreamDelegate delegate,
long pos,
int len,
byte[] outBuf,
int outOff,
int outLen)
Asynchronously reads specified amount of bytes from opened input stream.
|
void |
removeEventListener(GridGgfsHadoopStreamDelegate delegate)
Removes event listener that will be invoked when connection with server is lost or remote error has occurred.
|
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.
|
void |
writeData(GridGgfsHadoopStreamDelegate delegate,
byte[] data,
int off,
int len)
Writes data to the stream with given streamId.
|
public GridGgfsHadoopInProc(GridGgfsEx ggfs, org.apache.commons.logging.Log log)
ggfs - Target GGFS.public GridGgfsHandshakeResponse handshake(String logDir)
handshake in interface GridGgfsHadooplogDir - Log directory.public void close(boolean force)
close in interface GridGgfsHadoopforce - Force flag.public org.gridgain.grid.ggfs.GridGgfsFile info(org.gridgain.grid.ggfs.GridGgfsPath path)
throws org.gridgain.grid.GridException
info in interface GridGgfsHadooppath - Path to get file info for.org.gridgain.grid.GridException - If failed.public org.gridgain.grid.ggfs.GridGgfsFile update(org.gridgain.grid.ggfs.GridGgfsPath path,
Map<String,String> props)
throws org.gridgain.grid.GridException
update in interface GridGgfsHadooppath - GGFS path to update properties.props - Properties to update.org.gridgain.grid.GridException - If failed.public Boolean setTimes(org.gridgain.grid.ggfs.GridGgfsPath path, long accessTime, long modificationTime) throws org.gridgain.grid.GridException
setTimes in interface GridGgfsHadooppath - Path to update times.accessTime - Last access time to set.modificationTime - Last modification time to set.org.gridgain.grid.GridException - If failed.public Boolean rename(org.gridgain.grid.ggfs.GridGgfsPath src, org.gridgain.grid.ggfs.GridGgfsPath dest) throws org.gridgain.grid.GridException
rename in interface GridGgfsHadoopsrc - Source path.dest - Destination path.org.gridgain.grid.GridException - If failed.public Boolean delete(org.gridgain.grid.ggfs.GridGgfsPath path, boolean recursive) throws org.gridgain.grid.GridException
delete in interface GridGgfsHadooppath - Path to delete.recursive - True if deletion is recursive.org.gridgain.grid.GridException - If failed.public GridGgfsStatus fsStatus() throws org.gridgain.grid.GridException
fsStatus in interface GridGgfsHadooporg.gridgain.grid.GridException - If failed.public Collection<org.gridgain.grid.ggfs.GridGgfsPath> listPaths(org.gridgain.grid.ggfs.GridGgfsPath path) throws org.gridgain.grid.GridException
listPaths in interface GridGgfsHadooppath - Path to list.org.gridgain.grid.GridException - If failed.public Collection<org.gridgain.grid.ggfs.GridGgfsFile> listFiles(org.gridgain.grid.ggfs.GridGgfsPath path) throws org.gridgain.grid.GridException
listFiles in interface GridGgfsHadooppath - Path to list.org.gridgain.grid.GridException - If failed.public Boolean mkdirs(org.gridgain.grid.ggfs.GridGgfsPath path, Map<String,String> props) throws org.gridgain.grid.GridException
mkdirs in interface GridGgfsHadooppath - Path to create.org.gridgain.grid.GridException - If failed.public org.gridgain.grid.ggfs.GridGgfsPathSummary contentSummary(org.gridgain.grid.ggfs.GridGgfsPath path)
throws org.gridgain.grid.GridException
contentSummary in interface GridGgfsHadooppath - Path to get summary for.org.gridgain.grid.GridException - If failed.public Collection<org.gridgain.grid.ggfs.GridGgfsBlockLocation> affinity(org.gridgain.grid.ggfs.GridGgfsPath path, long start, long len) throws org.gridgain.grid.GridException
affinity in interface GridGgfsHadooppath - Path to get affinity for.start - Start position (offset).len - Data length.org.gridgain.grid.GridException - If failed.public GridGgfsHadoopStreamDelegate open(org.gridgain.grid.ggfs.GridGgfsPath path) throws org.gridgain.grid.GridException
open in interface GridGgfsHadooppath - File path to open.org.gridgain.grid.GridException - If failed.public GridGgfsHadoopStreamDelegate open(org.gridgain.grid.ggfs.GridGgfsPath path, int seqReadsBeforePrefetch) throws org.gridgain.grid.GridException
open in interface GridGgfsHadooppath - File path to open.org.gridgain.grid.GridException - If failed.public GridGgfsHadoopStreamDelegate create(org.gridgain.grid.ggfs.GridGgfsPath path, boolean overwrite, boolean colocate, int replication, long blockSize, @Nullable Map<String,String> props) throws org.gridgain.grid.GridException
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.org.gridgain.grid.GridException - If failed.public GridGgfsHadoopStreamDelegate append(org.gridgain.grid.ggfs.GridGgfsPath path, boolean create, @Nullable Map<String,String> props) throws org.gridgain.grid.GridException
append in interface GridGgfsHadooppath - Path to file.create - If true, file will be created if does not exist.props - File properties.org.gridgain.grid.GridException - If failed.public org.gridgain.grid.util.lang.GridPlainFuture<byte[]> readData(GridGgfsHadoopStreamDelegate delegate, long pos, int len, @Nullable byte[] outBuf, int outOff, int outLen)
readData in interface GridGgfsHadoopExdelegate - Stream delegate.pos - Position to read from.len - Data length to read.outBuf - Optional output buffer. If buffer length is less then len, all remaining
bytes will be read into new allocated buffer of length {len - outBuf.length} and this buffer will
be the result of read future.outOff - Output offset.outLen - Output length.public void writeData(GridGgfsHadoopStreamDelegate delegate, byte[] data, int off, int len) throws IOException
writeData in interface GridGgfsHadoopExdelegate - Stream delegate.data - Data to write.off - Offset.len - Length.IOException - If failed.public void flush(GridGgfsHadoopStreamDelegate delegate) throws IOException
flush in interface GridGgfsHadoopExdelegate - Stream delegate.IOException - If failed.public void closeStream(GridGgfsHadoopStreamDelegate desc) throws IOException
closeStream in interface GridGgfsHadoopExdesc - Stream delegate.IOException - If failed.public void addEventListener(GridGgfsHadoopStreamDelegate delegate, GridGgfsHadoopStreamEventListener lsnr)
addEventListener in interface GridGgfsHadoopExdelegate - Stream delegate.lsnr - Event listener.public void removeEventListener(GridGgfsHadoopStreamDelegate delegate)
removeEventListener in interface GridGgfsHadoopExdelegate - Stream delegate.Copyright © 2014. All rights reserved.