org.apache.accumulo.examples.simple.filedata
Class ChunkInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.accumulo.examples.simple.filedata.ChunkInputStream
All Implemented Interfaces:
Closeable

public class ChunkInputStream
extends InputStream

An input stream that reads file data stored in one or more Accumulo values. Used by ChunkInputFormat to present input streams to a mapper.


Field Summary
protected  byte[] buf
           
protected  int count
           
protected  int currentChunk
           
protected  int currentChunkSize
           
protected  Key currentKey
           
protected  Set<org.apache.hadoop.io.Text> currentVis
           
protected  boolean gotEndMarker
           
protected  int pos
           
protected  PeekingIterator<Map.Entry<Key,Value>> source
           
 
Constructor Summary
ChunkInputStream()
           
ChunkInputStream(PeekingIterator<Map.Entry<Key,Value>> in)
           
 
Method Summary
 void clear()
           
 void close()
           
 Set<org.apache.hadoop.io.Text> getVisibilities()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 void setSource(PeekingIterator<Map.Entry<Key,Value>> in)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected PeekingIterator<Map.Entry<Key,Value>> source

currentKey

protected Key currentKey

currentVis

protected Set<org.apache.hadoop.io.Text> currentVis

currentChunk

protected int currentChunk

currentChunkSize

protected int currentChunkSize

gotEndMarker

protected boolean gotEndMarker

buf

protected byte[] buf

count

protected int count

pos

protected int pos
Constructor Detail

ChunkInputStream

public ChunkInputStream()

ChunkInputStream

public ChunkInputStream(PeekingIterator<Map.Entry<Key,Value>> in)
                 throws IOException
Throws:
IOException
Method Detail

setSource

public void setSource(PeekingIterator<Map.Entry<Key,Value>> in)
               throws IOException
Throws:
IOException

getVisibilities

public Set<org.apache.hadoop.io.Text> getVisibilities()

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

clear

public void clear()

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException


Copyright © 2013 Apache Accumulo Project. All Rights Reserved.