org.apache.derby.impl.services.daemon
Class IndexStatisticsDaemonImpl.KeyComparator

java.lang.Object
  extended by org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.KeyComparator
Enclosing class:
IndexStatisticsDaemonImpl

private static class IndexStatisticsDaemonImpl.KeyComparator
extends java.lang.Object

Support class used to compare keys when scanning indexes.


Field Summary
private  DataValueDescriptor[] curr
           
private static int FETCH_SIZE
          Number of rows fetched per iteration.
private  DataValueDescriptor[] lastUniqueKey
           
private  long numRows
           
private  DataValueDescriptor[] prev
           
private  DataValueDescriptor[][] rowBufferArray
           
private  int rowsReadLastRead
           
 
Constructor Summary
IndexStatisticsDaemonImpl.KeyComparator(ExecIndexRow ir)
          Creates a key comparator for the given index.
 
Method Summary
 int compareWithPrevKey(int index)
          Compares the key at the specified index with the previous key.
 int fetchRows(GroupFetchScanController gsc)
          Fetches rows from the scan controller.
 long getRowCount()
          Returns the number of rows fetched.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FETCH_SIZE

private static final int FETCH_SIZE
Number of rows fetched per iteration.

See Also:
Constant Field Values

rowBufferArray

private final DataValueDescriptor[][] rowBufferArray

lastUniqueKey

private DataValueDescriptor[] lastUniqueKey

curr

private DataValueDescriptor[] curr

prev

private DataValueDescriptor[] prev

rowsReadLastRead

private int rowsReadLastRead

numRows

private long numRows
Constructor Detail

IndexStatisticsDaemonImpl.KeyComparator

public IndexStatisticsDaemonImpl.KeyComparator(ExecIndexRow ir)
Creates a key comparator for the given index.

Parameters:
ir - index row (template)
Method Detail

fetchRows

public int fetchRows(GroupFetchScanController gsc)
              throws StandardException
Fetches rows from the scan controller.

Parameters:
gsc - the scan controller
Returns:
Number of rows fetched.
Throws:
StandardException - if fetching rows fails

compareWithPrevKey

public int compareWithPrevKey(int index)
                       throws StandardException
Compares the key at the specified index with the previous key.

Parameters:
index - row index
Returns:
-1 if the current and previous key are identical, the index of the changed part of the key otherwise ([0, key length>)
Throws:
StandardException - if comparing the two keys fails

getRowCount

public long getRowCount()
Returns the number of rows fetched.

Returns:
Number of rows fetched.

Built on Wed 2013-06-12 15:21:56+0000, from revision ???

Apache Derby V10.10 Internals - Copyright © 2004,2013 The Apache Software Foundation. All Rights Reserved.