com.waveset.util
Class FlatFileDiffIterator

java.lang.Object
  extended bycom.waveset.util.FlatFileDiffIterator
All Implemented Interfaces:
FlatFileIterator

public class FlatFileDiffIterator
extends java.lang.Object
implements FlatFileIterator


Nested Class Summary
protected static class FlatFileDiffIterator.IndexEntry
           
protected static class FlatFileDiffIterator.KeyComparator
           
 
Field Summary
protected static Trace _trace
           
static java.lang.String code_id
           
 
Constructor Summary
FlatFileDiffIterator(FlatFileIterator lhs, FlatFileIterator rhs, java.lang.String uniqueKey, java.lang.String tempDir)
           
 
Method Summary
protected  void calculateNextRecord()
           
 void close()
          Intended for clean up of any open streams or readers.
 boolean hasNext()
          Indicates whether more records exist to read from the flat file.
 java.util.Map nextRecord()
          Converts a record in the flat file to a map of attribute name/value pairs.
protected  java.util.Map readRecord(long offset, java.io.RandomAccessFile db)
           
protected  void sortFlatFile(java.util.ArrayList index, java.io.RandomAccessFile db)
           
protected  void writeFlatFile(FlatFileIterator itr, java.util.ArrayList index, java.io.DataOutputStream dos)
           
protected  void writeRecord(java.util.Map record, java.io.DataOutputStream dos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

_trace

protected static Trace _trace
Constructor Detail

FlatFileDiffIterator

public FlatFileDiffIterator(FlatFileIterator lhs,
                            FlatFileIterator rhs,
                            java.lang.String uniqueKey,
                            java.lang.String tempDir)
                     throws java.io.IOException,
                            WavesetException
Method Detail

sortFlatFile

protected void sortFlatFile(java.util.ArrayList index,
                            java.io.RandomAccessFile db)

writeFlatFile

protected void writeFlatFile(FlatFileIterator itr,
                             java.util.ArrayList index,
                             java.io.DataOutputStream dos)
                      throws java.io.IOException,
                             WavesetException
Throws:
java.io.IOException
WavesetException

hasNext

public boolean hasNext()
Description copied from interface: FlatFileIterator
Indicates whether more records exist to read from the flat file.

Specified by:
hasNext in interface FlatFileIterator
Returns:
true if another record is available for processing from the flat file, false if not.

nextRecord

public java.util.Map nextRecord()
                         throws java.io.IOException
Description copied from interface: FlatFileIterator
Converts a record in the flat file to a map of attribute name/value pairs.

Specified by:
nextRecord in interface FlatFileIterator
Returns:
map of attribute name/value pairs for a record in the flat file.
Throws:
java.io.IOException

calculateNextRecord

protected void calculateNextRecord()
                            throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Description copied from interface: FlatFileIterator
Intended for clean up of any open streams or readers.

Specified by:
close in interface FlatFileIterator
Throws:
java.io.IOException

writeRecord

protected final void writeRecord(java.util.Map record,
                                 java.io.DataOutputStream dos)
                          throws java.io.IOException
Throws:
java.io.IOException

readRecord

protected final java.util.Map readRecord(long offset,
                                         java.io.RandomAccessFile db)
                                  throws java.io.IOException
Throws:
java.io.IOException