|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.piggybank.storage.IndexedStorage.IndexManager
public static class IndexedStorage.IndexManager
IndexManager
manages the index file (both writing and reading)
It keeps track of the last index read during reading.
Constructor Summary | |
---|---|
IndexedStorage.IndexManager(org.apache.hadoop.fs.FileStatus ifile)
Constructor (called during reading) |
|
IndexedStorage.IndexManager(int[] offsetsToIndexKeys)
Constructor (called during writing) |
Method Summary | |
---|---|
void |
Close()
Close the index file |
void |
createIndexFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file)
Open the index file for writing for given data file |
Tuple |
getIndexKeyTuple(Tuple indexTuple)
Extracts the index key from the index tuple |
long |
getIndexKeyTupleCount(Tuple indexTuple)
Extracts the number of records that share the current key from the index tuple. |
long |
getOffset(Tuple indexTuple)
Extracts the offset into the data file from the index tuple. |
void |
openIndexFile(org.apache.hadoop.fs.FileSystem fs)
Opens the index file. |
Tuple |
ReadIndex()
Reads the next index from the index file (or null if EOF) and extracts the index fields. |
void |
ReadIndexFooter()
Reads the index footer |
void |
ReadIndexHeader()
Read index header |
Tuple |
ScanIndex(Tuple keys)
Scans the index looking for a given key. |
void |
SeekToIndexFooter()
Seeks to the index footer |
void |
WriteIndex()
Writes the current index. |
void |
WriteIndexHeader()
Write index header |
void |
WriterIndexFooter()
Writes the index footer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexedStorage.IndexManager(org.apache.hadoop.fs.FileStatus ifile)
ifile
- index file to readpublic IndexedStorage.IndexManager(int[] offsetsToIndexKeys)
offsetsToIndexKeys
- Method Detail |
---|
public void createIndexFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file) throws IOException
fs
- file
-
IOException
public void openIndexFile(org.apache.hadoop.fs.FileSystem fs) throws IOException
IOException
public void Close() throws IOException
IOException
public void WriteIndexHeader() throws IOException
indexOut
- - Stream to write toih
- - Index header to write
IOException
public void ReadIndexHeader() throws IOException
indexIn
- - Stream to read from
IOException
public void WriterIndexFooter() throws IOException
IOException
public void ReadIndexFooter() throws IOException
IOException
public void SeekToIndexFooter() throws IOException
IOException
public void WriteIndex() throws IOException
IOException
public Tuple getIndexKeyTuple(Tuple indexTuple) throws IOException
IOException
public long getIndexKeyTupleCount(Tuple indexTuple) throws IOException
IOException
public long getOffset(Tuple indexTuple) throws IOException
IOException
public Tuple ReadIndex() throws IOException
IOException
public Tuple ScanIndex(Tuple keys) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |