public class HadoopIgfsInProc extends Object implements HadoopIgfsEx
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(HadoopIgfsStreamDelegate delegate,
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.
|
static HadoopIgfsInProc |
create(String igfsName,
org.apache.commons.logging.Log log,
String userName)
Creates instance of the HadoopIgfsInProcWithIgniteRefsCount by IGFS name.
|
static HadoopIgfsInProc |
create(String igniteCfgPath,
String igfsName,
org.apache.commons.logging.Log log,
String userName)
Creates instance of the HadoopIgfsInProcWithIgniteRefsCount by IGFS name, ignite client node is created
if necessary.
|
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() |
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 delegate,
long pos,
int len,
byte[] outBuf,
int outOff,
int outLen)
Asynchronously reads specified amount of bytes from opened input stream.
|
void |
removeEventListener(HadoopIgfsStreamDelegate delegate)
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 delegate,
byte[] data,
int off,
int len)
Writes data to the stream with given streamId.
|
public static HadoopIgfsInProc create(String igfsName, org.apache.commons.logging.Log log, String userName)
igfsName - Target IGFS name.log - Log.userName - User name.null if the IGFS not fount in the current VM.public static HadoopIgfsInProc create(String igniteCfgPath, String igfsName, org.apache.commons.logging.Log log, String userName) throws IgniteCheckedException
igniteCfgPath - Path to ignite configuration.igfsName - Target IGFS name.log - Log.userName - User name.null if the IGFS not fount in the current VM.IgniteCheckedException - On error.public IgfsHandshakeResponse handshake(String logDir)
handshake in interface HadoopIgfslogDir - Log directory.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 IgfsStatus fsStatus() throws IgniteCheckedException
fsStatus in interface HadoopIgfsIgniteCheckedException - If failed.public Collection<IgfsPath> listPaths(IgfsPath path) throws IgniteCheckedException
listPaths in interface HadoopIgfspath - Path to list.IgniteCheckedException - If failed.public Collection<IgfsFile> listFiles(IgfsPath path) throws IgniteCheckedException
listFiles in interface HadoopIgfspath - Path to list.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 IgfsPathSummary contentSummary(IgfsPath path) throws IgniteCheckedException
contentSummary in interface HadoopIgfspath - Path to get summary for.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 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 delegate, long pos, int len, @Nullable byte[] outBuf, int outOff, int outLen)
readData in interface HadoopIgfsExdelegate - 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 delegate, byte[] data, int off, int len) throws IOException
writeData in interface HadoopIgfsExdelegate - 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 delegate, HadoopIgfsStreamEventListener lsnr)
addEventListener in interface HadoopIgfsExdelegate - Stream delegate.lsnr - Event listener.public void removeEventListener(HadoopIgfsStreamDelegate delegate)
removeEventListener in interface HadoopIgfsExdelegate - Stream delegate.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