Class AbstractDatabaseWriter
java.lang.Object
org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter
- All Implemented Interfaces:
IDataResource
,IDataWriter
- Direct Known Subclasses:
DefaultDatabaseWriter
,HbaseDatabaseWriter
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Batch
static final String
static final String
protected IDatabaseWriterConflictResolver
protected DataContext
protected boolean
protected boolean
protected CsvData
protected boolean
protected Table
protected Map<Batch,
Statistics> protected Table
static final String
protected long
protected DatabaseWriterSettings
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractDatabaseWriter
(DatabaseWriterSettings settings) AbstractDatabaseWriter
(IDatabaseWriterConflictResolver conflictResolver, DatabaseWriterSettings settings) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
allowInsertIntoAutoIncrementColumns
(boolean value, Table table) protected void
bindVariables
(Map<String, Object> variables) protected void
void
close()
protected void
commit
(boolean earlyCommit) protected abstract boolean
protected abstract AbstractDatabaseWriter.LoadStatus
void
void
protected void
filterAfter
(CsvData data) protected boolean
filterBefore
(CsvData data) protected boolean
filterError
(CsvData data, Exception ex) getBatch()
getLookupDataMap
(CsvData data, Conflict conflict) protected String
getPkDataFor
(CsvData data, Column column) protected String[]
getRowData
(CsvData data, String dataType) protected boolean
protected abstract AbstractDatabaseWriter.LoadStatus
protected abstract void
logFailureDetails
(Throwable e, CsvData data, boolean logLastDmlDetails) protected Table
lookupTableAtTarget
(Table sourceTable) protected void
protected void
protected void
protected void
void
open
(DataContext context) protected void
rollback()
protected boolean
void
setConflictResolver
(IDatabaseWriterConflictResolver conflictResolver) protected abstract boolean
boolean
void
protected void
targetTableWasChangedByFilter
(Table oldTargetTable) protected abstract AbstractDatabaseWriter.LoadStatus
void
-
Field Details
-
CONFLICT_ERROR
- See Also:
-
TRANSACTION_ABORTED
- See Also:
-
CONFLICT_IGNORE
- See Also:
-
lastUseConflictDetection
protected boolean lastUseConflictDetection -
lastApplyChangesOnly
protected boolean lastApplyChangesOnly -
isRequiresSavePointsInTransaction
protected boolean isRequiresSavePointsInTransaction -
sourceTable
-
targetTable
-
targetTables
-
lastData
-
batch
-
context
-
uncommittedCount
protected long uncommittedCount -
writerSettings
-
statistics
-
conflictResolver
-
missingTables
-
-
Constructor Details
-
AbstractDatabaseWriter
public AbstractDatabaseWriter() -
AbstractDatabaseWriter
-
AbstractDatabaseWriter
public AbstractDatabaseWriter(IDatabaseWriterConflictResolver conflictResolver, DatabaseWriterSettings settings)
-
-
Method Details
-
open
- Specified by:
open
in interfaceIDataResource
-
start
- Specified by:
start
in interfaceIDataWriter
-
start
- Specified by:
start
in interfaceIDataWriter
-
write
- Specified by:
write
in interfaceIDataWriter
-
checkForEarlyCommit
protected void checkForEarlyCommit() -
commit
protected void commit(boolean earlyCommit) -
rollback
protected void rollback() -
filterError
-
filterBefore
-
targetTableWasChangedByFilter
-
notifyFiltersEarlyCommit
protected void notifyFiltersEarlyCommit() -
notifyFiltersBatchComplete
protected void notifyFiltersBatchComplete() -
notifyFiltersBatchCommitted
protected void notifyFiltersBatchCommitted() -
notifyFiltersBatchRolledback
protected void notifyFiltersBatchRolledback() -
filterAfter
-
insert
-
delete
protected abstract AbstractDatabaseWriter.LoadStatus delete(CsvData data, boolean useConflictDetection) -
update
protected abstract AbstractDatabaseWriter.LoadStatus update(CsvData data, boolean applyChangesOnly, boolean useConflictDetection) -
create
-
sql
-
logFailureDetails
-
getRowData
-
bindVariables
-
script
-
getLookupDataMap
-
getPkDataFor
-
end
- Specified by:
end
in interfaceIDataWriter
-
end
- Specified by:
end
in interfaceIDataWriter
-
close
public void close()- Specified by:
close
in interfaceIDataResource
-
hasFilterThatHandlesMissingTable
-
allowInsertIntoAutoIncrementColumns
-
lookupTableAtTarget
-
getBatch
-
getContext
-
getConflictResolver
-
setConflictResolver
-
getTargetTable
-
getSourceTable
-
getStatistics
- Specified by:
getStatistics
in interfaceIDataResource
-
getWriterSettings
-