Package com.cloudera.flume.handlers.text.TailSource

Examples of com.cloudera.flume.handlers.text.TailSource.Cursor.tailBody()


    File f2 = createDataFile(5);
    Cursor c2 = new Cursor(q, f2);

    assertTrue(c1.tailBody()); // open the file
    assertTrue(c2.tailBody()); // open the file
    assertTrue(c1.tailBody()); // open the file
    assertTrue(c2.tailBody()); // open the file
    assertFalse(c1.tailBody()); // read the file
    assertFalse(c2.tailBody()); // no new data.
    assertEquals(10, q.size()); // should be 5 in queue.
View Full Code Here


    Cursor c2 = new Cursor(q, f2);

    assertTrue(c1.tailBody()); // open the file
    assertTrue(c2.tailBody()); // open the file
    assertTrue(c1.tailBody()); // open the file
    assertTrue(c2.tailBody()); // open the file
    assertFalse(c1.tailBody()); // read the file
    assertFalse(c2.tailBody()); // no new data.
    assertEquals(10, q.size()); // should be 5 in queue.

    appendData(f1, 5, 5);
View Full Code Here

    assertTrue(c1.tailBody()); // open the file
    assertTrue(c2.tailBody()); // open the file
    assertTrue(c1.tailBody()); // open the file
    assertTrue(c2.tailBody()); // open the file
    assertFalse(c1.tailBody()); // read the file
    assertFalse(c2.tailBody()); // no new data.
    assertEquals(10, q.size()); // should be 5 in queue.

    appendData(f1, 5, 5);
    assertTrue(c1.tailBody()); // open the file
    assertFalse(c2.tailBody()); // open the file
View Full Code Here

    assertFalse(c2.tailBody()); // no new data.
    assertEquals(10, q.size()); // should be 5 in queue.

    appendData(f1, 5, 5);
    assertTrue(c1.tailBody()); // open the file
    assertFalse(c2.tailBody()); // open the file
    assertEquals(15, q.size()); // should be 5 in queue.

    appendData(f2, 5, 5);
    assertFalse(c1.tailBody()); // open the file
    assertTrue(c2.tailBody()); // open the file
View Full Code Here

    assertFalse(c2.tailBody()); // open the file
    assertEquals(15, q.size()); // should be 5 in queue.

    appendData(f2, 5, 5);
    assertFalse(c1.tailBody()); // open the file
    assertTrue(c2.tailBody()); // open the file
    assertEquals(20, q.size()); // should be 5 in queue.

    assertFalse(c1.tailBody()); // open the file
    assertFalse(c2.tailBody()); // open the file
View Full Code Here

    assertFalse(c1.tailBody()); // open the file
    assertTrue(c2.tailBody()); // open the file
    assertEquals(20, q.size()); // should be 5 in queue.

    assertFalse(c1.tailBody()); // open the file
    assertFalse(c2.tailBody()); // open the file

  }

  // /////////////////////////////////////////////////////////////////////////
View Full Code Here

    for (int i = 0; i < 3000; i++) {
      f2.delete();

      appendData(f, i * 5, 5);

      assertTrue(c.tailBody()); // open the file

      f.renameTo(f2); // move the file (should be no problem).

      assertTrue(c.tailBody()); // finish reading the file
      assertEquals(5, q.size()); // should be 5 in queue.
View Full Code Here

      assertTrue(c.tailBody()); // open the file

      f.renameTo(f2); // move the file (should be no problem).

      assertTrue(c.tailBody()); // finish reading the file
      assertEquals(5, q.size()); // should be 5 in queue.

      assertFalse(c.tailBody()); // No more to read
      assertEquals(5, q.size()); // should be 5 in queue.
View Full Code Here

      f.renameTo(f2); // move the file (should be no problem).

      assertTrue(c.tailBody()); // finish reading the file
      assertEquals(5, q.size()); // should be 5 in queue.

      assertFalse(c.tailBody()); // No more to read
      assertEquals(5, q.size()); // should be 5 in queue.

      q.clear();
    }
    Log.info("file handles didn't leak!");
View Full Code Here

    // queue for single threaded testing
    BlockingQueue<Event> q = new ArrayBlockingQueue<Event>(100);
    File f = createDataFile(5);
    Cursor c = new Cursor(q, f);

    assertTrue(c.tailBody()); // open the file
    assertTrue(c.tailBody()); // read the file
    assertFalse(c.tailBody()); // no new data.
    assertEquals(5, q.size()); // should be 5 in queue.
  }
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.