public class HadoopIgfsOutProc extends Object implements HadoopIgfsEx, HadoopIgfsIpcIoListener
| Constructor and Description |
|---|
HadoopIgfsOutProc(int port,
String igfs,
org.apache.commons.logging.Log log,
String user)
Constructor for shmem endpoint.
|
HadoopIgfsOutProc(String host,
int port,
String igfs,
org.apache.commons.logging.Log log,
String user)
Constructor for TCP endpoint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(HadoopIgfsStreamDelegate desc,
HadoopIgfsStreamEventListener lsnr)
Adds event listener that will be invoked when connection with server is lost or remote error has occurred.
|
Collection<IgfsBlockLocation> |
affinity(IgfsPath path,
long start,
long len)
Command to get affinity for given path, offset and length.
|
HadoopIgfsStreamDelegate |
append(IgfsPath 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(HadoopIgfsStreamDelegate desc)
Close server stream.
|
IgfsPathSummary |
contentSummary(IgfsPath path)
Gets path summary.
|
HadoopIgfsStreamDelegate |
create(IgfsPath path,
boolean overwrite,
boolean colocate,
int replication,
long blockSize,
Map<String,String> props)
Command to create file and open it for output.
|
Boolean |
delete(IgfsPath path,
boolean recursive)
Command to delete given path.
|
void |
flush(HadoopIgfsStreamDelegate delegate)
Flush output stream.
|
IgfsStatus |
fsStatus()
Performs status request.
|
IgfsHandshakeResponse |
handshake(String logDir)
Perform handshake.
|
IgfsFile |
info(IgfsPath path)
Command to retrieve file info for some IGFS path.
|
Collection<IgfsFile> |
listFiles(IgfsPath path)
Command to get list of files in directory.
|
Collection<IgfsPath> |
listPaths(IgfsPath path)
Command to get directory listing.
|
Boolean |
mkdirs(IgfsPath path,
Map<String,String> props)
Command to create directories.
|
IgfsModeResolver |
modeResolver() |
void |
onClose()
Callback invoked when the IO is being closed.
|
void |
onError(long streamId,
String errMsg)
Callback invoked when remote error occurs.
|
HadoopIgfsStreamDelegate |
open(IgfsPath path)
Command to open file for reading.
|
HadoopIgfsStreamDelegate |
open(IgfsPath path,
int seqReadsBeforePrefetch)
Command to open file for reading.
|
IgniteInternalFuture<byte[]> |
readData(HadoopIgfsStreamDelegate desc,
long pos,
int len,
byte[] outBuf,
int outOff,
int outLen)
Asynchronously reads specified amount of bytes from opened input stream.
|
void |
removeEventListener(HadoopIgfsStreamDelegate desc)
Removes event listener that will be invoked when connection with server is lost or remote error has occurred.
|
Boolean |
rename(IgfsPath src,
IgfsPath dest)
Command to rename given path.
|
Boolean |
setTimes(IgfsPath path,
long accessTime,
long modificationTime)
Sets last access time and last modification time for a file.
|
IgfsFile |
update(IgfsPath path,
Map<String,String> props)
Command to update file properties.
|
String |
user()
The user this Igfs instance works on behalf of.
|
void |
writeData(HadoopIgfsStreamDelegate desc,
byte[] data,
int off,
int len)
Writes data to the stream with given streamId.
|
public HadoopIgfsOutProc(String host, int port, String igfs, org.apache.commons.logging.Log log, String user) throws IOException
host - Host.port - Port.igfs - IGFS name.log - Client logger.user - User name.IOException - If failed.public HadoopIgfsOutProc(int port,
String igfs,
org.apache.commons.logging.Log log,
String user)
throws IOException
port - Port.igfs - IGFS name.log - Client logger.user - User name.IOException - If failed.public IgfsHandshakeResponse handshake(String logDir) throws IgniteCheckedException
handshake in interface HadoopIgfslogDir - Log directory.IgniteCheckedException - If failed.public void close(boolean force)
close in interface HadoopIgfsforce - Force flag.public IgfsFile info(IgfsPath path) throws IgniteCheckedException
info in interface HadoopIgfspath - Path to get file info for.IgniteCheckedException - If failed.public IgfsFile update(IgfsPath path, Map<String,String> props) throws IgniteCheckedException
update in interface HadoopIgfspath - IGFS path to update properties.props - Properties to update.IgniteCheckedException - If failed.public Boolean setTimes(IgfsPath path, long accessTime, long modificationTime) throws IgniteCheckedException
setTimes in interface HadoopIgfspath - Path to update times.accessTime - Last access time to set.modificationTime - Last modification time to set.IgniteCheckedException - If failed.public Boolean rename(IgfsPath src, IgfsPath dest) throws IgniteCheckedException
rename in interface HadoopIgfssrc - Source path.dest - Destination path.IgniteCheckedException - If failed.public Boolean delete(IgfsPath path, boolean recursive) throws IgniteCheckedException
delete in interface HadoopIgfspath - Path to delete.recursive - True if deletion is recursive.IgniteCheckedException - If failed.public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len) throws IgniteCheckedException
affinity in interface HadoopIgfspath - Path to get affinity for.start - Start position (offset).len - Data length.IgniteCheckedException - If failed.public IgfsPathSummary contentSummary(IgfsPath path) throws IgniteCheckedException
contentSummary in interface HadoopIgfspath - Path to get summary for.IgniteCheckedException - If failed.public Boolean mkdirs(IgfsPath path, Map<String,String> props) throws IgniteCheckedException
mkdirs in interface HadoopIgfspath - Path to create.IgniteCheckedException - If failed.public Collection<IgfsFile> listFiles(IgfsPath path) throws IgniteCheckedException
listFiles in interface HadoopIgfspath - Path to list.IgniteCheckedException - If failed.public Collection<IgfsPath> listPaths(IgfsPath path) throws IgniteCheckedException
listPaths in interface HadoopIgfspath - Path to list.IgniteCheckedException - If failed.public IgfsStatus fsStatus() throws IgniteCheckedException
fsStatus in interface HadoopIgfsIgniteCheckedException - If failed.public HadoopIgfsStreamDelegate open(IgfsPath path) throws IgniteCheckedException
open in interface HadoopIgfspath - File path to open.IgniteCheckedException - If failed.public HadoopIgfsStreamDelegate open(IgfsPath path, int seqReadsBeforePrefetch) throws IgniteCheckedException
open in interface HadoopIgfspath - File path to open.IgniteCheckedException - If failed.public HadoopIgfsStreamDelegate create(IgfsPath path, boolean overwrite, boolean colocate, int replication, long blockSize, @Nullable Map<String,String> props) throws IgniteCheckedException
create in interface HadoopIgfspath - 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.IgniteCheckedException - If failed.public HadoopIgfsStreamDelegate append(IgfsPath path, boolean create, @Nullable Map<String,String> props) throws IgniteCheckedException
append in interface HadoopIgfspath - Path to file.create - If true, file will be created if does not exist.props - File properties.IgniteCheckedException - If failed.public IgniteInternalFuture<byte[]> readData(HadoopIgfsStreamDelegate desc, long pos, int len, @Nullable byte[] outBuf, int outOff, int outLen)
readData in interface HadoopIgfsExdesc - 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(HadoopIgfsStreamDelegate desc, byte[] data, int off, int len) throws IOException
writeData in interface HadoopIgfsExdesc - Stream delegate.data - Data to write.off - Offset.len - Length.IOException - If failed.public void flush(HadoopIgfsStreamDelegate delegate) throws IOException
flush in interface HadoopIgfsExdelegate - Stream delegate.IOException - If failed.public void closeStream(HadoopIgfsStreamDelegate desc) throws IOException
closeStream in interface HadoopIgfsExdesc - Stream delegate.IOException - If failed.public void addEventListener(HadoopIgfsStreamDelegate desc, HadoopIgfsStreamEventListener lsnr)
addEventListener in interface HadoopIgfsExdesc - Stream delegate.lsnr - Event listener.public void removeEventListener(HadoopIgfsStreamDelegate desc)
removeEventListener in interface HadoopIgfsExdesc - Stream delegate.public void onClose()
onClose in interface HadoopIgfsIpcIoListenerpublic void onError(long streamId,
String errMsg)
onError in interface HadoopIgfsIpcIoListenerstreamId - Stream ID.errMsg - Error message.public String user()
user in interface HadoopIgfsExpublic IgfsModeResolver modeResolver() throws IgniteCheckedException
modeResolver in interface HadoopIgfsExIgniteCheckedException - On error.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.5.1-p166 Release Date : September 3 2019