ts.startRound(this.partitionId);
}
DependencySet result = null;
Status status = Status.OK;
SerializableException error = null;
// Check how many fragments are not marked as ignored
// If the fragment is marked as ignore then it means that it was already
// sent to this partition for prefetching. We need to make sure that we remove
// it from the list of fragmentIds that we need to execute.
int fragmentCount = fragment.getFragmentIdCount();
for (int i = 0; i < fragmentCount; i++) {
if (fragment.getStmtIgnore(i)) {
fragmentCount--;
}
} // FOR
final ParameterSet parameters[] = tmp_fragmentParams.getParameterSet(fragmentCount);
assert(parameters.length == fragmentCount);
// Construct data given to the EE to execute this work fragment
this.tmp_EEdependencies.clear();
long fragmentIds[] = tmp_fragmentIds.getArray(fragmentCount);
int fragmentOffsets[] = tmp_fragmentOffsets.getArray(fragmentCount);
int outputDepIds[] = tmp_outputDepIds.getArray(fragmentCount);
int inputDepIds[] = tmp_inputDepIds.getArray(fragmentCount);
int offset = 0;
for (int i = 0, cnt = fragment.getFragmentIdCount(); i < cnt; i++) {
if (fragment.getStmtIgnore(i) == false) {
fragmentIds[offset] = fragment.getFragmentId(i);
fragmentOffsets[offset] = i;
outputDepIds[offset] = fragment.getOutputDepId(i);
inputDepIds[offset] = fragment.getInputDepId(i);
parameters[offset] = allParameters[fragment.getParamIndex(i)];
this.getFragmentInputs(ts, inputDepIds[offset], this.tmp_EEdependencies);
if (trace.val && ts.isSysProc() == false && is_basepartition == false)
LOG.trace(String.format("%s - Offset:%d FragmentId:%d OutputDep:%d/%d InputDep:%d/%d",
ts, offset, fragmentIds[offset],
outputDepIds[offset], fragment.getOutputDepId(i),
inputDepIds[offset], fragment.getInputDepId(i)));
offset++;
}
} // FOR
assert(offset == fragmentCount);
try {
result = this.executeFragmentIds(ts,
ts.getLastUndoToken(this.partitionId),
fragmentIds,
parameters,
outputDepIds,
inputDepIds,
this.tmp_EEdependencies);
} catch (EvictedTupleAccessException ex) {
// XXX: What do we do if this is not a single-partition txn?
status = Status.ABORT_EVICTEDACCESS;
error = ex;
} catch (ConstraintFailureException ex) {
LOG.info("Found the abort!!!"+ex);
status = Status.ABORT_UNEXPECTED;
error = ex;
} catch (SQLException ex) {
LOG.info("Found the abort!!!"+ex);
status = Status.ABORT_UNEXPECTED;
error = ex;
} catch (EEException ex) {
// this.crash(ex);
LOG.info("Found the abort!!!"+ex);
status = Status.ABORT_UNEXPECTED;
error = ex;
} catch (Throwable ex) {
LOG.info("Found the abort!!!"+ex);
status = Status.ABORT_UNEXPECTED;
if (ex instanceof SerializableException) {
error = (SerializableException)ex;
} else {
error = new SerializableException(ex);
}
} finally {
if (error != null) {
// error.printStackTrace();
// if (error instanceof EvictedTupleAccessException){
// EvictedTupleAccessException ex = (EvictedTupleAccessException) error;
// }
LOG.warn(String.format("%s - Unexpected %s on partition %d",
ts, error.getClass().getSimpleName(), this.partitionId),
error); // (debug.val ? error : null));
}
// Success, but without any results???
if (result == null && status == Status.OK) {
String msg = String.format("The WorkFragment %s executed successfully on Partition %d but " +
"result is null for %s",
fragment.getFragmentIdList(), this.partitionId, ts);
Exception ex = new Exception(msg);
if (debug.val) LOG.warn(ex);
LOG.info("Found the abort!!!"+ex);
status = Status.ABORT_UNEXPECTED;
error = new SerializableException(ex);
}
}
// For single-partition INSERT/UPDATE/DELETE queries, we don't directly
// execute the SendPlanNode in order to get back the number of tuples that