|
2.9.2: 2009-01-08 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.clients.migrate.Manager
net.sf.basedb.clients.migrate.Transfer
net.sf.basedb.clients.migrate.ReporterTransfer
public class ReporterTransfer
This class provides methods for transferring reporter data from base 1 to BASE 2.
Field Summary | |
---|---|
private ReporterBatcher |
batcher
Used for inserting reporter into Base 2. |
private Map<Integer,Integer> |
duplicates
Maps BASE 1 reporters that are considered duplicate by BASE 2 after whitespace has been trimmed from the external ID. |
private Map<String,Integer> |
externalIdMap
Maps Reporter external ID to Base 1 ID. |
private static Logger |
log
Logger for this class |
private Map<Integer,ReporterData> |
reporterMap
Maps Base 1 ID to ReporterData object. |
private boolean |
RESUME
Flag that indicates if we should run in RESUME mode (ie. |
private String[] |
stringProperties
Set string and text properties, order must match the select statement except for the id and reporterId in the beginning Extended properties are defined in the extended-properties.xml file for class ReporterData. |
Fields inherited from class net.sf.basedb.clients.migrate.Transfer |
---|
BASE2, FROM, itemList, LIMIT, LOCAL_MYSQL_TRANSFER, mapIds, progress, properties, QUICK_TRANSFER, selectOffset, sessionControl, TO |
Constructor Summary | |
---|---|
ReporterTransfer(boolean resume)
Reporters are independant from other transfers. |
Method Summary | |
---|---|
private ReporterData |
createDataItem(ResultSet rs)
Creates a ReporterData from the current position in
ResultSet . |
Integer |
getBase2Id(DbControl dc,
int base1ReporterId)
|
ReporterData |
getReporterById(DbControl dc,
int base1ReporterId)
|
private void |
mapDuplicateReporters()
|
private void |
mapMigratedReporters(DbControl dc,
DynamicReporterQuery query)
|
protected void |
run(PreparedStatement ps,
int from,
int size)
Recursive run over a SQL query defined by a prepared statement and LIMIT values from and size. |
void |
start()
Starts the actual transfer. |
Methods inherited from class net.sf.basedb.clients.migrate.Transfer |
---|
cleanUpMemory, commit, createItem, createItem, dependencyFailure, done, getBase2Id, getBatchSize, getCount, getDependencyStatus, getIdMap, getInt, getProperty, initIdMap, isDone, mapId, newDbControl, readRestorePointData, run, runUnBatched, saveItem, setup, startProgress, writeRestorePointData |
Methods inherited from class net.sf.basedb.clients.migrate.Manager |
---|
getPreparedStatements, prepareStatementFromFile, print, printDate, setPreparedStatements, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger log
private Map<Integer,ReporterData> reporterMap
private Map<String,Integer> externalIdMap
private Map<Integer,Integer> duplicates
private ReporterBatcher batcher
private boolean RESUME
private String[] stringProperties
Constructor Detail |
---|
ReporterTransfer(boolean resume)
Method Detail |
---|
public void start()
Transfer
start
in class Transfer
protected void run(PreparedStatement ps, int from, int size)
run
in class Transfer
ps
- PreparedStatement
which includes a "LIMIT ?,?"
at the end.from
- int
indicating start position of the
ResultSet.size
- int
indicating number of rows to include.Manager.prepareStatementFromFile(String)
private void mapMigratedReporters(DbControl dc, DynamicReporterQuery query)
private void mapDuplicateReporters()
private ReporterData createDataItem(ResultSet rs) throws BaseException, SQLException
ReporterData
from the current position in
ResultSet
.
rs
- ResultSet
containing the data for this item.
ReporterData
or null if another reporter with same ID has already been created
BaseException
SQLException
- If current ResultSet position is invalid or number
of columns in the select statement is to low.public ReporterData getReporterById(DbControl dc, int base1ReporterId)
public Integer getBase2Id(DbControl dc, int base1ReporterId)
|
2.9.2: 2009-01-08 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |