/**
* Constructs an instance of StoreLogEntry using parts of a row from ResultSet. Used for creating the store operation for Undo.
*
* @param reader
* ResultSet whose row has operation information.
* @param offset
* Reader offset for column that begins operation information.
*/
public static StoreLogEntry readLogEntry(ResultSet reader,
int offset) throws SQLException {
try {
UUID shardIdRemoves = StringUtilsLocal.isNullOrEmpty(reader.getString(offset + 4)) ? null : UUID.fromString(reader.getString(offset + 4));
UUID shardIdAdds = StringUtilsLocal.isNullOrEmpty(reader.getString(offset + 5)) ? null : UUID.fromString(reader.getString(offset + 5));
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(reader.getSQLXML(offset + 2).getBinaryStream());
return new StoreLogEntry(UUID.fromString(reader.getString(offset)), StoreOperationCode.forValue(reader.getInt(offset + 1)),
(Element) doc.getFirstChild(), StoreOperationState.forValue(reader.getInt(offset + 3)), shardIdRemoves, shardIdAdds);
}
catch (SAXException | IOException | ParserConfigurationException e) {
e.printStackTrace();
return null;
}
}
SqlResults.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:elastic-db-tools-for-java
作者:
评论列表
文章目录