com.continuent.tungsten.replicator.consistency
Class ConsistencyCheckAbstract

java.lang.Object
  extended by com.continuent.tungsten.replicator.consistency.ConsistencyCheckAbstract
All Implemented Interfaces:
ConsistencyCheck, java.io.Serializable
Direct Known Subclasses:
ConsistencyCheckMD5

public abstract class ConsistencyCheckAbstract
extends java.lang.Object
implements ConsistencyCheck

This class defines a ConsistencyCheckAbstract

Version:
1.0
Author:
Alex Yurchenko
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.continuent.tungsten.replicator.consistency.ConsistencyCheck
ConsistencyCheck.Method
 
Field Summary
protected  int id
           
protected  java.lang.String method
           
protected  Table table
           
 
Constructor Summary
protected ConsistencyCheckAbstract(int id, Table table, java.lang.String method)
           
 
Method Summary
static ConsistencyCheck deserialize(byte[] bytes)
           
 int getCheckId()
          
 java.lang.String getMethod()
          
 int getRowLimit()
          
 int getRowOffset()
          
 java.lang.String getSchemaName()
          
 java.lang.String getTableName()
          
abstract  java.sql.ResultSet performConsistencyCheck(Database conn)
          
 byte[] serialize()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected int id

table

protected Table table

method

protected java.lang.String method
Constructor Detail

ConsistencyCheckAbstract

protected ConsistencyCheckAbstract(int id,
                                   Table table,
                                   java.lang.String method)
Method Detail

getCheckId

public final int getCheckId()

Specified by:
getCheckId in interface ConsistencyCheck
Returns:
consistency check ID
See Also:
ConsistencyCheck.getCheckId()

getSchemaName

public final java.lang.String getSchemaName()

Specified by:
getSchemaName in interface ConsistencyCheck
Returns:
schema of the checked table
See Also:
ConsistencyCheck.getSchemaName()

getTableName

public final java.lang.String getTableName()

Specified by:
getTableName in interface ConsistencyCheck
Returns:
name of the checked table
See Also:
ConsistencyCheck.getTableName()

getRowOffset

public int getRowOffset()

Specified by:
getRowOffset in interface ConsistencyCheck
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.
See Also:
ConsistencyCheck.getRowOffset()

getRowLimit

public int getRowLimit()

Specified by:
getRowLimit in interface ConsistencyCheck
Returns:
how many rows to check
See Also:
ConsistencyCheck.getRowLimit()

getMethod

public final java.lang.String getMethod()

Specified by:
getMethod in interface ConsistencyCheck
Returns:
String representation of a consistency check method
See Also:
ConsistencyCheck.getMethod()

performConsistencyCheck

public abstract java.sql.ResultSet performConsistencyCheck(Database conn)
                                                    throws ConsistencyException

Specified by:
performConsistencyCheck in interface ConsistencyCheck
Returns:
ResultSet should contain at least two values: int 'this_cnt' and char[] 'this_crc'.
Throws:
ConsistencyException
See Also:
ConsistencyCheck.performConsistencyCheck(com.continuent.tungsten.replicator.database.Database)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

serialize

public byte[] serialize()
                 throws ConsistencyException
Throws:
ConsistencyException

deserialize

public static ConsistencyCheck deserialize(byte[] bytes)
                                    throws ConsistencyException
Throws:
ConsistencyException