count = 0;
}
if (getMonitor().getFailedLines() > failedLinesThreshold) {
logger.error(writerID
+ " Mysqlwriter :Failed lines threshold is larger than expect");
throw new WormholeException(
"Mysqlwriter :Failed lines threshold is larger than expect",
JobStatus.WRITE_FAILED.getStatus(), writerID);
}
}
if (count != 0) {
if ("update".equalsIgnoreCase(operation)) {
builder.append(updateOpAppendStr);
}
updateOneBlock(builder.toString(), count);
}
logger.info(writerID + ": Write to mysql ends .");
} catch (WormholeException e) {
e.setStatusCode(e.getStatusCode() + errorCodeAdd);
throw e;
} catch (Exception e) {
throw new WormholeException(e, JobStatus.WRITE_FAILED.getStatus()
+ errorCodeAdd, writerID);
} finally {
if (null != this.conn) {
try {
conn.close();
} catch (SQLException e1) {
logger.error(writerID + " close failed");
throw new WormholeException(e1,
JobStatus.WRITE_FAILED.getStatus() + errorCodeAdd,
writerID);
}
}
}