Package co.cask.tephra

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


    final T dataSet = (T) dataSetInstantiator.getDataSet(dataSetName);

    try {
      final TransactionContext txContext =
        new TransactionContext(txSystemClient, dataSetInstantiator.getTransactionAware());
      txContext.start();
      return new DataSetManager<T>() {
        @Override
        public T get() {
          return dataSet;
        }
View Full Code Here


        @Override
        public void flush() {
          try {
            txContext.finish();
            txContext.start();
          } catch (TransactionFailureException e) {
            throw Throwables.propagate(e);
          }
        }
      };
View Full Code Here

  @Override
  public void handle(ProcedureRequest request, ProcedureResponder responder) {
    TransactionContext txContext = dataFabricFacade.createTransactionManager();

    try {
      txContext.start();

      TransactionResponder txResponder = new TransactionResponder(txContext, responder);
      try {
        method.invoke(procedure, request, txResponder);
      } catch (Throwable t) {
View Full Code Here

    try {
      if (consumer != null && consumer instanceof Closeable) {
        // Call close in a new transaction.
        // TODO (terence): Actually need to coordinates with other flowlets to drain the queue.
        TransactionContext txContext = dataFabricFacade.createTransactionManager();
        txContext.start();
        try {
          ((Closeable) consumer).close();
          txContext.finish();
        } catch (TransactionFailureException e) {
          LOG.warn("Fail to commit transaction when closing consumer.");
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.