Class IndexStatisticsDaemonImpl.KeyComparator
java.lang.Object
org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.KeyComparator
- Enclosing class:
IndexStatisticsDaemonImpl
Support class used to compare keys when scanning indexes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DataValueDescriptor[]
private static final int
Number of rows fetched per iteration.private DataValueDescriptor[]
private long
private DataValueDescriptor[]
private final DataValueDescriptor[][]
private int
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a key comparator for the given index. -
Method Summary
Modifier and TypeMethodDescriptionint
compareWithPrevKey
(int index) Compares the key at the specified index with the previous key.int
Fetches rows from the scan controller.long
Returns the number of rows fetched.
-
Field Details
-
FETCH_SIZE
private static final int FETCH_SIZENumber of rows fetched per iteration.- See Also:
-
rowBufferArray
-
lastUniqueKey
-
curr
-
prev
-
rowsReadLastRead
private int rowsReadLastRead -
numRows
private long numRows
-
-
Constructor Details
-
KeyComparator
Creates a key comparator for the given index.- Parameters:
ir
- index row (template)
-
-
Method Details
-
fetchRows
Fetches rows from the scan controller.- Parameters:
gsc
- the scan controller- Returns:
- Number of rows fetched.
- Throws:
StandardException
- if fetching rows fails
-
compareWithPrevKey
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.
-