@Override public InputStream getSnapshotInputStream() throws TransactionCouldNotTakeSnapshotException { throw new TransactionCouldNotTakeSnapshotException( "Snapshot not implemented in detached transaction system client"); }
@Override public InputStream getSnapshotInputStream() throws TransactionCouldNotTakeSnapshotException { throw new TransactionCouldNotTakeSnapshotException( "Snapshot not implemented in detached transaction system client"); }
@Override public InputStream getSnapshotInputStream() throws TransactionCouldNotTakeSnapshotException { throw new TransactionCouldNotTakeSnapshotException("Not snapshot to take."); }
@Override public InputStream getSnapshotInputStream() throws TransactionCouldNotTakeSnapshotException { throw new TransactionCouldNotTakeSnapshotException("Not snapshot to take."); }
@Override public InputStream getSnapshotInputStream() throws TransactionCouldNotTakeSnapshotException { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); try { boolean snapshotTaken = txManager.takeSnapshot(out); if (!snapshotTaken) { throw new TransactionCouldNotTakeSnapshotException("Transaction manager did not take a snapshot."); } } finally { out.close(); } return new ByteArrayInputStream(out.toByteArray()); } catch (IOException e) { LOG.error("Snapshot could not be taken", e); throw new TransactionCouldNotTakeSnapshotException(e.getMessage()); } }
@Override public InputStream getSnapshotInputStream() throws TransactionCouldNotTakeSnapshotException { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); try { boolean snapshotTaken = txManager.takeSnapshot(out); if (!snapshotTaken) { throw new TransactionCouldNotTakeSnapshotException("Transaction manager did not take a snapshot."); } } finally { out.close(); } return new ByteArrayInputStream(out.toByteArray()); } catch (IOException e) { LOG.error("Snapshot could not be taken", e); throw new TransactionCouldNotTakeSnapshotException(e.getMessage()); } }
public InputStream getSnapshotStream() throws TException, TransactionCouldNotTakeSnapshotException { try { ByteBuffer buffer = client.getSnapshot(); if (buffer.hasArray()) { return new ByteArrayInputStream(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining()); } // The ByteBuffer is not backed by array. Read the content to a new byte array and return an InputStream of that. byte[] snapshot = new byte[buffer.remaining()]; buffer.get(snapshot); return new ByteArrayInputStream(snapshot); } catch (TTransactionCouldNotTakeSnapshotException e) { throw new TransactionCouldNotTakeSnapshotException(e.getMessage()); } catch (TException e) { isValid.set(false); throw e; } }
public InputStream getSnapshotStream() throws TException, TransactionCouldNotTakeSnapshotException { try { ByteBuffer buffer = client.getSnapshot(); if (buffer.hasArray()) { return new ByteArrayInputStream(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining()); } // The ByteBuffer is not backed by array. Read the content to a new byte array and return an InputStream of that. byte[] snapshot = new byte[buffer.remaining()]; buffer.get(snapshot); return new ByteArrayInputStream(snapshot); } catch (TTransactionCouldNotTakeSnapshotException e) { throw new TransactionCouldNotTakeSnapshotException(e.getMessage()); } catch (TException e) { isValid.set(false); throw e; } }