Package org.apache.flume

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


    channel.put(EventBuilder.withBody(eventBody));
    tx.rollback();
    tx.close();

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


    Configurables.configure(channel,  context);

    byte[] eventBody = new byte[405];

    Transaction tx = channel.getTransaction();
    tx.begin();
    channel.put(EventBuilder.withBody(eventBody));
    tx.commit();
    tx.close();
    channel.stop();
    parms.put("byteCapacity", "1500");
View Full Code Here

    parms.put("byteCapacity", "1500");
    context.putAll(parms);
    Configurables.configure(channel,  context);
    channel.start();
    tx = channel.getTransaction();
    tx.begin();
    channel.put(EventBuilder.withBody(eventBody));
    try {
      channel.put(EventBuilder.withBody(eventBody));
      tx.commit();
      Assert.fail();
View Full Code Here

    parms.put("byteCapacityBufferPercentage", "20");
    context.putAll(parms);
    Configurables.configure(channel,  context);
    channel.start();
    tx = channel.getTransaction();
    tx.begin();
    channel.put(EventBuilder.withBody(eventBody));
    tx.commit();
    tx.close();
    channel.stop();
View Full Code Here

    Assert.assertTrue(LifecycleController.waitForOneOf(sink,
        LifecycleState.START_OR_ERROR, 5000));

    Transaction transaction = channel.getTransaction();

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

    parms.put("byteCapacity", "300");
    context.putAll(parms);
    Configurables.configure(channel,  context);
    channel.start();
    tx = channel.getTransaction();
    tx.begin();
    try {
      for(int i = 0; i < 2; i++) {
        channel.put(EventBuilder.withBody(eventBody));
      }
      tx.commit();
View Full Code Here

    parms.put("byteCapacity", "3300");
    context.putAll(parms);
    Configurables.configure(channel,  context);
    channel.start();
    tx = channel.getTransaction();
    tx.begin();

    try {
      for(int i = 0; i < 15; i++) {
        channel.put(EventBuilder.withBody(eventBody));
      }
View Full Code Here

    sink.start();
    Assert.assertTrue(LifecycleController.waitForOneOf(sink,
        LifecycleState.START_OR_ERROR, 5000));

    Transaction txn = channel.getTransaction();
    txn.begin();
    for (int i = 0; i < 4; i++) {
      channel.put(event);
    }
    txn.commit();
    txn.close();
View Full Code Here

    parms.put("byteCapacity", "4000");
    context.putAll(parms);
    Configurables.configure(channel,  context);
    channel.start();
    tx = channel.getTransaction();
    tx.begin();

    try {
      for(int i = 0; i < 25; i++) {
        channel.put(EventBuilder.withBody(eventBody));
      }
View Full Code Here

    source.start();
    Thread.sleep(2000);
    Transaction transaction = channel.getTransaction();

    transaction.begin();
    Event event;

    FileOutputStream outputStream = new FileOutputStream(ouputFile);

    while ((event = channel.take()) != null) {
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.