java.lang.Object
org.apache.derby.impl.sql.execute.RIBulkChecker
- public class RIBulkChecker
- extends java.lang.Object
Do a merge run comparing all the foreign keys from the
foreign key conglomerate against the referenced keys
from the primary key conglomerate. The scanControllers
are passed in by the caller (caller controls locking on
said conglomerates).
The comparision is done via a merge. Consequently,
it is imperative that the scans are on keyed conglomerates
(indexes) and that the referencedKeyScan is a unique scan.
Performance is no worse than N + M where N is foreign key
rows and M is primary key rows.
Bulk fetch is used to further speed performance. The
fetch size is LanguageProperties.BULK_FETCH_DEFAULT
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EQUAL
private static final int EQUAL
- See Also:
- Constant Field Values
GREATER_THAN
private static final int GREATER_THAN
- See Also:
- Constant Field Values
LESS_THAN
private static final int LESS_THAN
- See Also:
- Constant Field Values
fkInfo
private FKInfo fkInfo
referencedKeyScan
private org.apache.derby.iapi.store.access.GroupFetchScanController referencedKeyScan
referencedKeyRowArray
private org.apache.derby.iapi.types.DataValueDescriptor[][] referencedKeyRowArray
foreignKeyScan
private org.apache.derby.iapi.store.access.GroupFetchScanController foreignKeyScan
foreignKeyRowArray
private org.apache.derby.iapi.types.DataValueDescriptor[][] foreignKeyRowArray
unreferencedCC
private org.apache.derby.iapi.store.access.ConglomerateController unreferencedCC
failedCounter
private int failedCounter
quitOnFirstFailure
private boolean quitOnFirstFailure
numColumns
private int numColumns
currRefRowIndex
private int currRefRowIndex
currFKRowIndex
private int currFKRowIndex
lastRefRowIndex
private int lastRefRowIndex
lastFKRowIndex
private int lastFKRowIndex
firstRowToFail
private org.apache.derby.iapi.sql.execute.ExecRow firstRowToFail
RIBulkChecker
public RIBulkChecker(org.apache.derby.iapi.store.access.GroupFetchScanController referencedKeyScan,
org.apache.derby.iapi.store.access.GroupFetchScanController foreignKeyScan,
org.apache.derby.iapi.sql.execute.ExecRow templateRow,
boolean quitOnFirstFailure,
org.apache.derby.iapi.store.access.ConglomerateController unreferencedCC,
org.apache.derby.iapi.sql.execute.ExecRow firstRowToFail)
- Create a RIBulkChecker
doCheck
public int doCheck()
throws org.apache.derby.iapi.error.StandardException
- Perform the check.
getNextFK
private org.apache.derby.iapi.types.DataValueDescriptor[] getNextFK()
throws org.apache.derby.iapi.error.StandardException
getNextRef
private org.apache.derby.iapi.types.DataValueDescriptor[] getNextRef()
throws org.apache.derby.iapi.error.StandardException
failure
private void failure(org.apache.derby.iapi.types.DataValueDescriptor[] foreignKeyRow)
throws org.apache.derby.iapi.error.StandardException
anyNull
private boolean anyNull(org.apache.derby.iapi.types.DataValueDescriptor[] fkRowArray)
throws org.apache.derby.iapi.error.StandardException
greaterThan
private int greaterThan(org.apache.derby.iapi.types.DataValueDescriptor[] fkRowArray,
org.apache.derby.iapi.types.DataValueDescriptor[] refRowArray)
throws org.apache.derby.iapi.error.StandardException