Package org.apache.camel.component.hdfs
Class HdfsInputStream
- java.lang.Object
-
- org.apache.camel.component.hdfs.HdfsInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class HdfsInputStream extends Object implements Closeable
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHdfsInputStream()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static HdfsInputStreamcreateInputStream(String hdfsPath, org.apache.camel.component.hdfs.HdfsInfoFactory hdfsInfoFactory)StringgetActualPath()intgetChunkSize()CloseablegetIn()longgetNumOfReadBytes()longgetNumOfReadMessages()booleanhasNext()booleanisOpened()booleanisStreamDownload()longnext(Holder<Object> key, Holder<Object> value)Reads next record/chunk specific to give file type.
-
-
-
Method Detail
-
createInputStream
public static HdfsInputStream createInputStream(String hdfsPath, org.apache.camel.component.hdfs.HdfsInfoFactory hdfsInfoFactory)
- Parameters:
hdfsPath-hdfsInfoFactory-- Returns:
-
close
public final void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
next
public final long next(Holder<Object> key, Holder<Object> value)
Reads next record/chunk specific to give file type.- Parameters:
key-value-- Returns:
- number of bytes read. 0 is correct number of bytes (empty file), -1 indicates no record was read
-
hasNext
public final boolean hasNext()
-
getNumOfReadBytes
public final long getNumOfReadBytes()
-
getNumOfReadMessages
public final long getNumOfReadMessages()
-
getActualPath
public final String getActualPath()
-
getChunkSize
public final int getChunkSize()
-
getIn
public final Closeable getIn()
-
isOpened
public boolean isOpened()
-
isStreamDownload
public boolean isStreamDownload()
-
-