public Transaction startLong() throws TException { try { return TransactionConverterUtils.unwrap(client.startLong()); } catch (TException e) { isValid.set(false); throw e; } }
public Transaction startShort() throws TException { try { return TransactionConverterUtils.unwrap(client.startShort()); } catch (TException e) { isValid.set(false); throw e; } }
@Override public void abortTx(TTransaction tx) throws TException { txManager.abort(TransactionConverterUtils.unwrap(tx)); }
public Transaction checkpoint(Transaction tx) throws TException { try { return TransactionConverterUtils.unwrap(client.checkpoint(TransactionConverterUtils.wrap(tx))); } catch (TException e) { isValid.set(false); throw e; } }
public Transaction startShort(String clientId) throws TException { try { return TransactionConverterUtils.unwrap(client.startShortClientId(clientId)); } catch (TGenericException e) { // currently, we only expect IllegalArgumentException here, if the clientId is null if (!IllegalArgumentException.class.getName().equals(e.getOriginalExceptionClass())) { LOG.trace("Expecting only {} as the original exception class but found {}", IllegalArgumentException.class.getName(), e.getOriginalExceptionClass()); throw e; } throw new IllegalArgumentException(e.getMessage()); } catch (TException e) { isValid.set(false); throw e; } }
public Transaction startLong(String clientId) throws TException { try { return TransactionConverterUtils.unwrap(client.startLongClientId(clientId)); } catch (TGenericException e) { // currently, we only expect IllegalArgumentException here, if the clientId is null if (!IllegalArgumentException.class.getName().equals(e.getOriginalExceptionClass())) { LOG.trace("Expecting only {} as the original exception class but found {}", IllegalArgumentException.class.getName(), e.getOriginalExceptionClass()); throw e; } throw new IllegalArgumentException(e.getMessage()); } catch (TException e) { isValid.set(false); throw e; } }
public Transaction decode(byte[] encoded) throws IOException { TTransaction thriftTx = new TTransaction(); TDeserializer deserializer = new TDeserializer(); try { deserializer.deserialize(thriftTx, encoded); return TransactionConverterUtils.unwrap(thriftTx); } catch (TException te) { throw new IOException(te); } } }
public Transaction startShort(int timeout) throws TException { try { return TransactionConverterUtils.unwrap(client.startShortWithTimeout(timeout)); } catch (TGenericException e) { // currently, we only expect IllegalArgumentException here, if the timeout is invalid if (!IllegalArgumentException.class.getName().equals(e.getOriginalExceptionClass())) { LOG.trace("Expecting only {} as the original exception class but found {}", IllegalArgumentException.class.getName(), e.getOriginalExceptionClass()); throw e; } throw new IllegalArgumentException(e.getMessage()); } catch (TException e) { isValid.set(false); throw e; } }
public Transaction startShort(String clientId, int timeout) throws TException { try { return TransactionConverterUtils.unwrap(client.startShortWithClientIdAndTimeOut(clientId, timeout)); } catch (TGenericException e) { // currently, we only expect IllegalArgumentException here, if the timeout is invalid or if clientId is null if (!IllegalArgumentException.class.getName().equals(e.getOriginalExceptionClass())) { LOG.trace("Expecting only {} as the original exception class but found {}", IllegalArgumentException.class.getName(), e.getOriginalExceptionClass()); throw e; } throw new IllegalArgumentException(e.getMessage()); } catch (TException e) { isValid.set(false); throw e; } }
@Override public TTransaction checkpoint(TTransaction originalTx) throws TException { try { return TransactionConverterUtils.wrap( txManager.checkpoint(TransactionConverterUtils.unwrap(originalTx))); } catch (TransactionNotInProgressException e) { throw new TTransactionNotInProgressException(e.getMessage()); } }