Package co.cask.tephra

Examples of co.cask.tephra.TransactionFailureException


        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

    try {
      if (success) {
        LOG.info("Committing Spark Program transaction: {}", context);
        if (!txClient.commit(transaction)) {
          LOG.warn("Spark Job transaction failed to commit");
          throw new TransactionFailureException("Failed to commit transaction for Spark " + context.toString());
        }
      } else {
        // invalidate the transaction as spark might have written to datasets too
        txClient.invalidate(transaction.getWritePointer());
      }
View Full Code Here

        // committing long running tx: no need to commit datasets, as they were committed in external processes
        // also no need to rollback changes if commit fails, as these changes where performed by mapreduce tasks
        // NOTE: can't call afterCommit on datasets in this case: the changes were made by external processes.
        if (!txClient.commit(transaction)) {
          LOG.warn("MapReduce Job transaction failed to commit");
          throw new TransactionFailureException("Failed to commit transaction for MapReduce " + context.toString());
        }
      } else {
        // invalids long running tx. All writes done by MR cannot be undone at this point.
        txClient.invalidate(transaction.getWritePointer());
      }
View Full Code Here

TOP

Related Classes of co.cask.tephra.TransactionFailureException

Copyright © 2018 www.massapicom. 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.