|
3.2.4: 2013-12-06 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.core.AbstractBatcher
net.sf.basedb.core.ReporterCloneBatcher
public class ReporterCloneBatcher
Batcher implementation that is used to handle cloned reporter information in the dynamic database.
Nested Class Summary | |
---|---|
static class |
ReporterCloneBatcher.CloneSource
Specifies which source table to use for finding out which reporters that are part of the current experiment. |
Field Summary | |
---|---|
private long |
bytesPerRow
The number of bytes used by a single row. |
private Experiment |
experiment
The experiment this batcher inserts data for. |
private PreparedStatement |
insertSql
The statement that inserts cloned reporter data. |
private String |
insertSqlStatement
The SQL string for the insertSql statement. |
private int[] |
parameterTypes
|
private VirtualDb |
virtualDb
|
Fields inherited from class net.sf.basedb.core.AbstractBatcher |
---|
debugSqlEnabled, logSql |
Constructor Summary | |
---|---|
ReporterCloneBatcher(DbControl dc,
Experiment experiment)
|
Method Summary | |
---|---|
private PreparedStatement |
buildInsertSql()
Builds the insert SQL statement. |
private DynamicRawDataQuery |
buildRawSelectQuery()
|
private DynamicPositionQuery |
buildSelectQuery()
Builds a query that select all reporter properties that should be cloned from the real reporter table. |
int |
cloneReporters(ReporterCloneBatcher.CloneSource source,
ReporterCloneTemplate template,
ProgressReporter progress)
Create a reporter clone table in the dynamic database for this experiment and populate it with the current reporter annotations for all reporters that are part of the experiment. |
void |
dropClonedReporters()
Drop the cloned reporter information from the dynamic database. |
void |
flush()
Flush the batcher and send all remaining items in memory to the database. |
private void |
flushInternal()
|
Experiment |
getExperiment()
Get the current experiment this batcher is used with. |
(package private) void |
onBeforeClose()
Update disk usage and close open SQL statements. |
Methods inherited from class net.sf.basedb.core.AbstractBatcher |
---|
analyzeTable, close, getBatchSize, getDbControl, getSessionControl, isClosed, setBatchSize, setDbControl, updateLastAccess |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Experiment experiment
private final VirtualDb virtualDb
private final long bytesPerRow
private PreparedStatement insertSql
INSERT INTO D#Reporter# (id, version, external_id, ...) VALUES (?, ?, ?, ...)
private String insertSqlStatement
insertSql
statement.
private int[] parameterTypes
Constructor Detail |
---|
ReporterCloneBatcher(DbControl dc, Experiment experiment)
Method Detail |
---|
public void flush() throws BaseException
Batcher
BaseException
- If there is an errorBatcher.close()
void onBeforeClose() throws BaseException
onBeforeClose
in class AbstractBatcher
BaseException
public Experiment getExperiment()
public void dropClonedReporters()
PermissionDeniedException
- If the logged in user does't have
write permission in this experimentpublic int cloneReporters(ReporterCloneBatcher.CloneSource source, ReporterCloneTemplate template, ProgressReporter progress)
To find out which reporters that are part of the experiment, the batcher
can use either what has already been inserted into the VirtualTable.POSITION
table (source=ReporterCloneBatcher.CloneSource.VIRTUAL
) or the reporters that are referenced
by the RawBioAssay
:s attached to the experiment (source=ReporterCloneBatcher.CloneSource.RAW
).
The AUTO method uses the position table if it exists. The RAW method can't be used
with raw data types that doesn't store raw data in the database.
This method will create an immutable copy of the template so that we can always know which fields that have been cloned, even if the template is modified. If there already is a cloned reporter information it will be removed.
template
- The reporter clone template to use or null to clone
all propertiessource
- The source of the cloned reporters, null is the same as AUTOprogress
- An optional progress reporter
InvalidUseOfNullException
- If the template is null
PermissionDeniedException
- If the logged in user does't have
write permission in this experiment or use permission for the template
or read permission for reportersprivate void flushInternal() throws SQLException
SQLException
private PreparedStatement buildInsertSql() throws SQLException, BaseException
SQLException
BaseException
BatchUtil.buildInsertSql(VirtualDb, VirtualTable, VirtualColumn[], Object[])
private DynamicPositionQuery buildSelectQuery()
private DynamicRawDataQuery buildRawSelectQuery()
|
3.2.4: 2013-12-06 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |