com.continuent.tungsten.replicator.consistency
Interface ConsistencyCheck

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ConsistencyCheckAbstract, ConsistencyCheckMD5

public interface ConsistencyCheck
extends java.io.Serializable

This interface defines a ConsistencyCheck. Each consistency check class represents a consistency check specification. It consists of integer check ID, String schema and table names of a table to be checked and a method that returns SELECT statment that actually does the crc/count calculation for the given DBMS. Result set from SELECT should contain integer field 'this_cnt' and String field 'this_crc'

Version:
1.0
Author:
Alex Yurchenko

Nested Class Summary
static class ConsistencyCheck.Method
          Enumeration of supported methods
 
Method Summary
 int getCheckId()
           
 java.lang.String getMethod()
           
 int getRowLimit()
           
 int getRowOffset()
           
 java.lang.String getSchemaName()
           
 java.lang.String getTableName()
           
 java.sql.ResultSet performConsistencyCheck(Database conn)
           
 

Method Detail

getCheckId

int getCheckId()
Returns:
consistency check ID

getSchemaName

java.lang.String getSchemaName()
Returns:
schema of the checked table

getTableName

java.lang.String getTableName()
Returns:
name of the checked table

getRowOffset

int getRowOffset()
Returns:
offset of the row the check starts with. 1st row has offset 0. Rows counted as sorted by primary key or by all columns if there's no primary key.

getRowLimit

int getRowLimit()
Returns:
how many rows to check

getMethod

java.lang.String getMethod()
Returns:
String representation of a consistency check method

performConsistencyCheck

java.sql.ResultSet performConsistencyCheck(Database conn)
                                           throws ConsistencyException
Returns:
ResultSet should contain at least two values: int 'this_cnt' and char[] 'this_crc'.
Throws:
ConsistencyException