|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avro.file.DataFileStream<D>
public class DataFileStream<D>
Streaming access to files written by DataFileWriter
. Use DataFileReader
for file-based input.
DataFileWriter
Nested Class Summary | |
---|---|
static class |
DataFileStream.Header
A handle that can be used to reopen a DataFile without re-reading the header of the stream. |
Constructor Summary | |
---|---|
protected |
DataFileStream(DatumReader<D> reader)
create an unitialized DataFileStream |
|
DataFileStream(InputStream in,
DatumReader<D> reader)
Construct a reader for an input stream. |
Method Summary | |
---|---|
protected void |
blockFinished()
|
void |
close()
Close this reader. |
long |
getBlockCount()
Expert: Return the count of items in the current block. |
DataFileStream.Header |
getHeader()
A handle that can be used to reopen this stream without rereading the head. |
byte[] |
getMeta(String key)
Return the value of a metadata property. |
List<String> |
getMetaKeys()
Return the list of keys in the metadata |
long |
getMetaLong(String key)
Return the value of a metadata property. |
String |
getMetaString(String key)
Return the value of a metadata property. |
Schema |
getSchema()
Return the schema used in this file. |
boolean |
hasNext()
True if more entries remain in this file. |
Iterator<D> |
iterator()
Returns an iterator over entries in this file. |
D |
next()
Read the next datum in the file. |
D |
next(D reuse)
Read the next datum from the file. |
ByteBuffer |
nextBlock()
Expert: Return the next block in the file, as binary-encoded data. |
void |
remove()
Not supported. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataFileStream(InputStream in, DatumReader<D> reader) throws IOException
DataFileReader
. This will buffer, wrapping with a
BufferedInputStream
is not necessary.
IOException
protected DataFileStream(DatumReader<D> reader) throws IOException
IOException
Method Detail |
---|
public DataFileStream.Header getHeader()
public Schema getSchema()
public List<String> getMetaKeys()
public byte[] getMeta(String key)
public String getMetaString(String key)
public long getMetaLong(String key)
public Iterator<D> iterator()
iterator
in interface Iterable<D>
public boolean hasNext()
hasNext
in interface Iterator<D>
public D next()
next
in interface Iterator<D>
NoSuchElementException
- if no more remain in the file.public D next(D reuse) throws IOException
reuse
- an instance to reuse.
NoSuchElementException
- if no more remain in the file.
IOException
public ByteBuffer nextBlock() throws IOException
IOException
public long getBlockCount()
protected void blockFinished() throws IOException
IOException
public void remove()
remove
in interface Iterator<D>
public void close() throws IOException
close
in interface Closeable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |