Package co.cask.tephra

Examples of co.cask.tephra.TransactionContext.abort()


        try {
          ((Closeable) consumer).close();
          txContext.finish();
        } catch (TransactionFailureException e) {
          LOG.warn("Fail to commit transaction when closing consumer.");
          txContext.abort();
        }
      }
    } catch (Exception e) {
      LOG.warn("Fail to close queue consumer.", e);
    }
View Full Code Here


        }

      } catch (Throwable t) {
        LOG.error("System failure: {}", flowletContext, t);
        try {
          txContext.abort();
        } catch (Throwable e) {
          LOG.error("Fail to abort transaction: {}", flowletContext, e);
        }
      }
    } catch (Throwable t) {
View Full Code Here

        flowlet.initialize(flowletContext);

        LOG.info("Flowlet initialized: " + flowletContext);
      } catch (Throwable t) {
        LOG.error("User code exception. Aborting transaction.", t);
        txContext.abort(new TransactionFailureException("User code exception. Aborting transaction", t));
        throw Throwables.propagate(t);
      }
      txContext.finish();
    } catch (TransactionFailureException e) {
      LOG.error("Flowlet throws exception during flowlet initialize: " + flowletContext, e);
View Full Code Here

        LOG.info("Destroying flowlet: " + flowletContext);
        flowlet.destroy();
        LOG.info("Flowlet destroyed: " + flowletContext);
      } catch (Throwable t) {
        LOG.error("User code exception. Aborting transaction.", t);
        txContext.abort(new TransactionFailureException("User code exception. Aborting transaction", t));
        // No need to propagate, as it is shutting down.
      }
      txContext.finish();
    } catch (TransactionFailureException e) {
      LOG.error("Flowlet throws exception during flowlet destroy: " + flowletContext, e);
View Full Code Here

        }

      } catch (Throwable t) {
        LOG.error("System failure: {}", flowletContext, t);
        try {
          txContext.abort();
        } catch (Throwable e) {
          LOG.error("Fail to abort transaction: {}", flowletContext, e);
        }
      }
    } catch (Throwable t) {
View Full Code Here

        try {
          ((Closeable) consumer).close();
          txContext.finish();
        } catch (TransactionFailureException e) {
          LOG.warn("Fail to commit transaction when closing consumer.");
          txContext.abort();
        }
      }
    } catch (Exception e) {
      LOG.warn("Fail to close queue consumer.", e);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.