@Override public void commitRow(byte[] row, long startId, long commitId, boolean isDelete, Integer lockId) throws IOException { table.coprocessorProxy(DominoIface.class, row).commitRow(row, startId, commitId, isDelete); }
@Override public void rollbackRow(byte[] row, long startId, Integer lockId) throws IOException { table.coprocessorProxy(DominoIface.class, row).rollbackRow(row, startId); }
@Override public Result get(Get get) throws IOException { DResult res = table.coprocessorProxy(DominoIface.class, get.getRow()).get( get, startId); if (res.getErrMsg() != null) { throw new IOException(res.getErrMsg()); } return res.getResult(); }
public void putStateful(Put put, HTableInterface table) throws IOException { checkIfReadyToContinue(); try { DominoIface iface = table.coprocessorProxy(DominoIface.class, put.getRow()); DResult res = iface.put(put, startId, true); if (res != null) { throw new IOException(res.getErrMsg()); } addCommit(put.getRow(), false, table); } catch (IOException e) { readyToCommit = false; throw e; } catch (Throwable t) { readyToCommit = false; throw new IOException(t); } }
public void delete(byte[] row, HTableInterface table) throws IOException { checkIfReadyToContinue(); try { DominoIface iface = table.coprocessorProxy(DominoIface.class, row); iface.delete(row, startId); addCommit(row, true, table); } catch (IOException e) { readyToCommit = false; throw e; } catch (Throwable t) { readyToCommit = false; throw new IOException(t); } }
public Result get(Get get, HTableInterface table) throws IOException { checkIfReadyToContinue(); try { DominoIface iface = table.coprocessorProxy(DominoIface.class, get.getRow()); DResult res = iface.get(get, startId); if (res.getErrMsg() != null) { throw new IOException(res.getErrMsg()); } return res.getResult(); } catch (IOException e) { readyToCommit = false; throw e; } catch (Throwable t) { readyToCommit = false; throw new IOException(t); } }
public void put(Put put, HTableInterface table) throws IOException { checkIfReadyToContinue(); try { DominoIface iface = table.coprocessorProxy(DominoIface.class, put.getRow()); DResult res = iface.put(put, startId, false); if (res != null) { throw new IOException(res.getErrMsg()); } addCommit(put.getRow(), false, table); } catch (IOException e) { readyToCommit = false; throw e; } catch (Throwable t) { readyToCommit = false; throw new IOException(t); } }
public Result get(Get get, HTableInterface table) throws IOException { checkIfReadyToContinue(); try { DominoIface iface = table.coprocessorProxy(DominoIface.class, get.getRow()); DResult res = iface.get(get, startId); if (res.getErrMsg() != null) { throw new IOException(res.getErrMsg()); } return res.getResult(); } catch (IOException e) { disable(); throw e; } catch (Throwable t) { disable(); throw new IOException(t); } }
private void commitPuts() { for (byte[] key : commits.keySet()) { Commit commit = commits.get(key); for (Entry<byte[], Boolean> entry : commit) { byte[] row = entry.getKey(); try { commit.table.coprocessorProxy(DominoIface.class, row).commitRow(row, startId, commitId, entry.getValue()); } catch (Throwable t) { // Maybe print some log here. It doesn't matter when failed. clearTrasactionStatus = false; } } } }
private void rollbackPuts() { for (byte[] key : commits.keySet()) { Commit commit = commits.get(key); for (Entry<byte[], Boolean> entry : commit) { byte[] row = entry.getKey(); try { commit.table.coprocessorProxy(DominoIface.class, row).rollbackRow( row, startId); } catch (Throwable t) { // Wait for other threads to clean the status. // So transaction metadata shouldn't be cleared. clearTrasactionStatus = false; } } } }