* @throws SQLException if replay cannot occur correctly
* @throws MDBCServiceException
*/
- void replayTransaction(StagingTable digest, Set<Range> ranges) throws SQLException, MDBCServiceException;
+ void replayTransaction(StagingTable digest) throws SQLException, MDBCServiceException;
void disableForeignKeyChecks() throws SQLException;
void enableForeignKeyChecks() throws SQLException;
- void applyTxDigest(StagingTable txDigest, Set<Range> ranges) throws SQLException, MDBCServiceException;
+ void applyTxDigest(StagingTable txDigest) throws SQLException, MDBCServiceException;
Connection getSQLConnection();
* @param transaction - base 64 encoded, serialized digest
* @throws MDBCServiceException
*/
- public void replayTransaction(StagingTable transaction, Set<Range> ranges)
+ public void replayTransaction(StagingTable transaction)
throws SQLException, MDBCServiceException {
boolean autocommit = jdbcConn.getAutoCommit();
jdbcConn.setAutoCommit(false);
ArrayList<Operation> opList = transaction.getOperationList();
for (Operation op : opList) {
- if (Range.overlaps(ranges, op.getTable())) {
try {
replayOperationIntoDB(jdbcStmt, op);
} catch (SQLException | MDBCServiceException e) {
jdbcConn.rollback();
throw e;
}
- }
}
clearReplayedOperations(jdbcStmt);
}
@Override
- public void applyTxDigest(StagingTable txDigest, Set<Range> ranges) throws SQLException, MDBCServiceException {
- replayTransaction(txDigest, ranges);
+ public void applyTxDigest(StagingTable txDigest) throws SQLException, MDBCServiceException {
+ replayTransaction(txDigest);
}
/**
logger.error(EELFLoggerDelegate.errorLogger, "initTables: problem creating th mdbc tables!");
}
}
-
}
\ No newline at end of file
* @param transaction - base 64 encoded, serialized digest
*/
@Override
- public void replayTransaction(StagingTable transaction, Set<Range> ranges)
+ public void replayTransaction(StagingTable transaction)
throws SQLException, MDBCServiceException {
boolean autocommit = jdbcConn.getAutoCommit();
jdbcConn.setAutoCommit(false);
final ArrayList<Operation> opList = transaction.getOperationList();
for (Operation op : opList) {
- if (Range.overlaps(ranges, op.getTable())) {
try {
replayOperationIntoDB(jdbcStmt, op);
} catch (SQLException | MDBCServiceException e) {
jdbcConn.rollback();
throw e;
}
- }
}
clearReplayedOperations(jdbcStmt);
}
@Override
- public void applyTxDigest(StagingTable txDigest, Set<Range> ranges) throws SQLException, MDBCServiceException {
- replayTransaction(txDigest, ranges);
+ public void applyTxDigest(StagingTable txDigest) throws SQLException, MDBCServiceException {
+ replayTransaction(txDigest);
}
/**
}
}
- private void applyTxDigest(Set<Range> ranges, DBInterface di, StagingTable txDigest)
+ private void applyTxDigest(DBInterface di, StagingTable txDigest)
throws MDBCServiceException {
try {
- di.applyTxDigest(txDigest,ranges);
+ di.applyTxDigest(txDigest);
} catch (SQLException e) {
throw new MDBCServiceException("Error applying tx digest in local SQL",e);
}
checkpointLock.unlock();
break;
} else {
- applyDigestAndUpdateDataStructures(mi, di, rangesToWarmup, node, pair);
+ applyDigestAndUpdateDataStructures(mi, di, node, pair);
}
pair = node.nextNotAppliedTransaction(rangeSet);
enableForeignKeys(di);
}
/**
- * Apply tx digest for ranges, update checkpoint location (alreadyApplied)
+ * Apply tx digest for dagnode update checkpoint location (alreadyApplied)
* @param mi
* @param di
- * @param ranges
* @param node
* @param pair
* @throws MDBCServiceException
*/
- private void applyDigestAndUpdateDataStructures(MusicInterface mi, DBInterface di, Set<Range> ranges, DagNode node,
+ private void applyDigestAndUpdateDataStructures(MusicInterface mi, DBInterface di, DagNode node,
Pair<MusicTxDigestId, List<Range>> pair) throws MDBCServiceException {
final StagingTable txDigest;
try {
+" case for txID "+pair.getKey().transactionId.toString());
return;
}
- applyTxDigest(ranges,di, txDigest);
+ applyTxDigest(di, txDigest);
for (Range r : pair.getValue()) {
MusicRangeInformationRow row = node.getRow();
alreadyApplied.put(r, Pair.of(new MriReference(row.getPartitionIndex()), pair.getKey().index));
if(node!=null) {
Pair<MusicTxDigestId, List<Range>> pair = node.nextNotAppliedTransaction(rangeSet);
while (pair != null) {
- applyDigestAndUpdateDataStructures(mi, db, ranges, node, pair);
+ applyDigestAndUpdateDataStructures(mi, db, node, pair);
pair = node.nextNotAppliedTransaction(rangeSet);
if (timeout(ownOpId)) {
enableForeignKeys(db);
for (UUID txTimeID : keys) {
transaction = ecDigestInformation.get(txTimeID);
try {
- dbi.replayTransaction(transaction,
- ranges); // I think this Might change if the data is coming from a new table.. ( what is the new table structure??)
+ dbi.replayTransaction(transaction); // I think this Might change if the data is coming from a new table.. ( what is the new table structure??)
} catch (SQLException e) {
logger.error("EC:Rolling back the entire digest replay.");
return;
Set<Range> ranges = new HashSet<>();
ranges.add(new Range("public.testtable"));
try {
- mixin.applyTxDigest(st,ranges);
+ mixin.applyTxDigest(st);
} catch (SQLException|MDBCServiceException e) {
e.printStackTrace();
fail();