Package org.apache.flume

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


    transaction.begin();
    for (int i = 0; i < 10; i++) {
      channel.put(event);
    }
    transaction.commit();
    transaction.close();

    boolean failed = false;
    try {
      for (int i = 0; i < 5; i++) {
View Full Code Here


    transaction.begin();
    for (int i = 0; i < 10; i++) {
      channel.put(event);
    }
    transaction.commit();
    transaction.close();

    boolean failed = false;
    try {
      for (int i = 0; i < 5; i++) {
View Full Code Here

    sickTransaction.begin();
    for (int i = 0; i < 10; i++) {
      channel.put(event);
    }
    sickTransaction.commit();
    sickTransaction.close();

    for (int i = 0; i < 5; i++) {
      Sink.Status status = sink.process();
      logger.debug("Calling Process " + i + " times:" + status);
View Full Code Here

    Event sourceEvent = sourceChannel.take();
    Assert.assertNotNull(sourceEvent);
    Assert.assertEquals("Channel contained our event", "Hello avro",
        new String(sourceEvent.getBody()));
    sourceTransaction.commit();
    sourceTransaction.close();

    logger.debug("Round trip event:{}", sourceEvent);

    source.stop();
View Full Code Here

    Assert.assertNotNull(transaction);

    transaction.begin();
    Event event2 = channel.take();
    Assert.assertEquals(event, event2);
    transaction.commit();
  }

  @Test
  public void testChannelResize() {
    Context context = new Context();
View Full Code Here

    Transaction transaction = channel.getTransaction();
    transaction.begin();
    for(int i=0; i < 5; i++) {
      channel.put(EventBuilder.withBody(String.format("test event %d", i).getBytes()));
    }
    transaction.commit();
    transaction.close();

    /*
     * Verify overflow semantics
     */
 
View Full Code Here

  // helper function
  private static Event takeEvent(Channel channel) {
    Transaction txn = channel.getTransaction();
    txn.begin();
    Event evt = channel.take();
    txn.commit();
    txn.close();
    return evt;
  }

  /**
 
View Full Code Here

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

    context.putAll(parms);
    Configurables.configure(channel, context);
    transaction = channel.getTransaction();
    transaction.begin();
    channel.put(EventBuilder.withBody("extended capacity event".getBytes()));
    transaction.commit();
    transaction.close();

    /*
     * Attempt to reconfigure capacity to below current entry count and verify
     * it wasn't carried out
View Full Code Here

    Configurables.configure(channel, context);
    for(int i=0; i < 6; i++) {
      transaction = channel.getTransaction();
      transaction.begin();
      Assert.assertNotNull(channel.take());
      transaction.commit();
      transaction.close();
    }
  }

  @Test(expected=ChannelException.class)
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.