Package org.apache.flume

Examples of org.apache.flume.Transaction.rollback()


    } catch (Throwable th) {
      // catch-all for any unhandled Throwable so that the transaction is
      // correctly rolled back.
      if (transaction != null) {
        try {
          transaction.rollback();
        } catch (Exception ex) {
          LOG.error("Transaction rollback failed", ex);
          throw Throwables.propagate(ex);
        }
      }
View Full Code Here


      channelEvents.add(e);
    }
    try {
      txn.commit();
    } catch (Throwable t) {
      txn.rollback();
    } finally {
      txn.close();
    }
    //Since events can arrive out of order, search for each event in the array
    for (int i = 0; i < 1000 ; i++) {
View Full Code Here

      transaction.begin();
      channel.put(EventBuilder.withBody("overflow event".getBytes()));
      transaction.commit();
    } catch (ChannelException e) {
      overflowed = true;
      transaction.rollback();
    } finally {
      transaction.close();
    }
    Assert.assertTrue(overflowed);
View Full Code Here

    Transaction tx = channel.getTransaction();
    tx.begin();
    channel.put(EventBuilder.withBody("test".getBytes()));
    channel.put(EventBuilder.withBody("test".getBytes()));
    channel.put(EventBuilder.withBody("test".getBytes()));
    tx.rollback();
    tx.close();

    tx = channel.getTransaction();
    tx.begin();
    channel.put(EventBuilder.withBody("test".getBytes()));
View Full Code Here

    Transaction tx = channel.getTransaction();
    tx.begin();
    channel.put(EventBuilder.withBody(eventBody));
    channel.put(EventBuilder.withBody(eventBody));
    channel.put(EventBuilder.withBody(eventBody));
    tx.rollback();
    tx.close();

    tx = channel.getTransaction();
    tx.begin();
    channel.put(EventBuilder.withBody(eventBody));
View Full Code Here

      channel.put(EventBuilder.withBody(eventBody));
      tx.commit();
      Assert.fail();
    } catch ( ChannelException e ) {
      //success
      tx.rollback();
    } finally {
      tx.close();
    }

    channel.stop();
View Full Code Here

      }
      tx.commit();
      Assert.fail();
    } catch ( ChannelException e ) {
      //success
      tx.rollback();
    } finally {
      tx.close();
    }

    channel.stop();
View Full Code Here

      }
      tx.commit();
      Assert.fail();
    } catch ( ChannelException e ) {
      //success
      tx.rollback();
    } finally {
      tx.close();
    }
    channel.stop();
    parms.put("byteCapacity", "4000");
View Full Code Here

      }
      tx.commit();
      Assert.fail();
    } catch ( ChannelException e ) {
      //success
      tx.rollback();
    } finally {
      tx.close();
    }
    channel.stop();
  }
View Full Code Here

        count += 1;
      }
      t.commit();
      return count;
    } catch (Throwable th) {
      t.rollback();
      Throwables.propagateIfInstanceOf(th, Error.class);
      Throwables.propagateIfInstanceOf(th, EventDeliveryException.class);
      throw new EventDeliveryException(th);
    } finally {
      t.close();
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.