com.continuent.tungsten.replicator.applier.batch
Class CsvInfo

java.lang.Object
  extended by com.continuent.tungsten.replicator.applier.batch.CsvInfo

public class CsvInfo
extends java.lang.Object

Defines a struct to hold batch CSV file information. When using staging the stage table metadata field is filled in. Otherwise it is null.


Field Summary
 Table baseTableMetadata
           
 java.io.File file
           
 java.lang.String schema
           
protected  java.lang.String stagePkeyColumn
           
 Table stageTableMetadata
           
 java.lang.String table
           
 CsvWriter writer
           
 
Constructor Summary
CsvInfo(java.lang.String stagePkeyColumn)
          Instantiates a new instance.
 
Method Summary
 java.lang.String getPKColumn()
          Determines primary key name for the given CsvInfo object.
 java.util.Map<java.lang.String,java.lang.String> getSqlParameters()
          Returns SQL substitution parameters for this CSV file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stagePkeyColumn

protected java.lang.String stagePkeyColumn

schema

public java.lang.String schema

table

public java.lang.String table

baseTableMetadata

public Table baseTableMetadata

stageTableMetadata

public Table stageTableMetadata

file

public java.io.File file

writer

public CsvWriter writer
Constructor Detail

CsvInfo

public CsvInfo(java.lang.String stagePkeyColumn)
Instantiates a new instance.

Parameters:
stagePkeyColumn - Name of the primary key column
Method Detail

getSqlParameters

public java.util.Map<java.lang.String,java.lang.String> getSqlParameters()
                                                                  throws ReplicatorException
Returns SQL substitution parameters for this CSV file.

Throws:
ReplicatorException

getPKColumn

public java.lang.String getPKColumn()
                             throws ReplicatorException
Determines primary key name for the given CsvInfo object. If underlying meta data table contains a primary key, it is used. If not, user's configured default one is taken.
Currently, only single-column primary keys are supported.

Returns:
Primary key column name.
Throws:
ReplicatorException - Thrown if primary key cannot be found