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 protected
HdfsInputStream()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static HdfsInputStream
createInputStream(String hdfsPath, org.apache.camel.component.hdfs.HdfsInfoFactory hdfsInfoFactory)
String
getActualPath()
int
getChunkSize()
Closeable
getIn()
long
getNumOfReadBytes()
long
getNumOfReadMessages()
boolean
hasNext()
boolean
isOpened()
boolean
isStreamDownload()
long
next(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:
close
in interfaceAutoCloseable
- Specified by:
close
in 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()
-
-