Examples of generateEvents()


Examples of com.linkedin.databus.core.test.DbusEventGenerator.generateEvents()

    DbusEventBufferReflector bufferReflector = new DbusEventBufferReflector(dbusBuf);
   // BufferPositionParser parser = dbusBuf.getBufferPositionParser();
    log.info("append initial events");
    DbusEventGenerator generator = new DbusEventGenerator();
    Vector<DbusEvent> events = new Vector<DbusEvent>();
    generator.generateEvents(12, 2, 120, 39, events);


    // add first window with 2 events
    dbusBuf.start(-1);
    int i=0;
View Full Code Here

Examples of com.linkedin.databus.core.test.DbusEventGenerator.generateEvents()

    streamThread.start();

    log.info("append initial events");
    DbusEventGenerator generator = new DbusEventGenerator();
    Vector<DbusEvent> events = new Vector<DbusEvent>();
    generator.generateEvents(70000, 1, 120, 39, events);

    // Add events to the EventBuffer. Now the buffer is full
    DbusEventAppender appender = new DbusEventAppender(events, dbusBuf, null);
    appender.run(); // running in the same thread
    genComplete.set(true);
View Full Code Here

Examples of com.linkedin.databus.core.test.DbusEventGenerator.generateEvents()

      int maxEventSize = 100;
      int payloadSize = 5;
      events.clear();
      DbusEventGenerator eventGen = new DbusEventGenerator(startScn + 1);
      long newScn =
          eventGen.generateEvents(numEvents,
                                  eventsPerWindow,
                                  maxEventSize,
                                  payloadSize,
                                  true,
                                  events);
View Full Code Here

Examples of com.linkedin.databus.core.test.DbusEventGenerator.generateEvents()

    dbusBuf.start(1);
    dbusBuf.startEvents();
    DbusEventGenerator generator = new DbusEventGenerator();
    Vector<DbusEvent> events = new Vector<DbusEvent>();

    generator.generateEvents(numEvents, 1, 100, 10, events);

    // set end of windows
    for (int i=0; i < numEvents-1; ++i)
    {
      long scn = events.get(i).sequence();
View Full Code Here

Examples of com.linkedin.databus.core.test.DbusEventGenerator.generateEvents()

    DbusEventGenerator generator = new DbusEventGenerator();

    // Generate one event that equals the size of the first buffer. We won't be able to
    // append that to the buffer.
    Vector<DbusEvent> events = new Vector<DbusEvent>();
    generator.generateEvents(1, 2, 500, 439, events);
    DbusEventAppender appender = new DbusEventAppender(events,dbusBuf,null, false);
    int eventCount = 0;
    boolean exceptionCaught = false;

    dbusBuf.startEvents();
View Full Code Here

Examples of com.linkedin.databus.core.test.DbusEventGenerator.generateEvents()

    events.clear();
    dbusBuf =
        new DbusEventBuffer(getConfig(1144, 500, 100, 500, AllocationPolicy.HEAP_MEMORY,
                                      QueuePolicy.OVERWRITE_ON_WRITE, AssertLevel.ALL));
    appender = new DbusEventAppender(events,dbusBuf,null, false);
    generator.generateEvents(1, 20, 500, 438, events)// total event size = 499
    generator.generateEvents(1, 20, 500, 10, events);   // total event size = 71
    generator.generateEvents(1, 20, 500, 367, events);   // total event size = 428
    generator.generateEvents(1, 1, 500, 10, events);   // event + EOP = 132.

    // We should be able to append the first three events above, filling the two byte buffers completely.
View Full Code Here

Examples of com.linkedin.databus.core.test.DbusEventGenerator.generateEvents()

    dbusBuf =
        new DbusEventBuffer(getConfig(1144, 500, 100, 500, AllocationPolicy.HEAP_MEMORY,
                                      QueuePolicy.OVERWRITE_ON_WRITE, AssertLevel.ALL));
    appender = new DbusEventAppender(events,dbusBuf,null, false);
    generator.generateEvents(1, 20, 500, 438, events)// total event size = 499
    generator.generateEvents(1, 20, 500, 10, events);   // total event size = 71
    generator.generateEvents(1, 20, 500, 367, events);   // total event size = 428
    generator.generateEvents(1, 1, 500, 10, events);   // event + EOP = 132.

    // We should be able to append the first three events above, filling the two byte buffers completely.
    // And then the last event along with EOP marker in the last byte buffer, filling that to complete
View Full Code Here

Examples of com.linkedin.databus.core.test.DbusEventGenerator.generateEvents()

        new DbusEventBuffer(getConfig(1144, 500, 100, 500, AllocationPolicy.HEAP_MEMORY,
                                      QueuePolicy.OVERWRITE_ON_WRITE, AssertLevel.ALL));
    appender = new DbusEventAppender(events,dbusBuf,null, false);
    generator.generateEvents(1, 20, 500, 438, events)// total event size = 499
    generator.generateEvents(1, 20, 500, 10, events);   // total event size = 71
    generator.generateEvents(1, 20, 500, 367, events);   // total event size = 428
    generator.generateEvents(1, 1, 500, 10, events);   // event + EOP = 132.

    // We should be able to append the first three events above, filling the two byte buffers completely.
    // And then the last event along with EOP marker in the last byte buffer, filling that to complete
    // one window.
View Full Code Here

Examples of com.linkedin.databus.core.test.DbusEventGenerator.generateEvents()

                                      QueuePolicy.OVERWRITE_ON_WRITE, AssertLevel.ALL));
    appender = new DbusEventAppender(events,dbusBuf,null, false);
    generator.generateEvents(1, 20, 500, 438, events)// total event size = 499
    generator.generateEvents(1, 20, 500, 10, events);   // total event size = 71
    generator.generateEvents(1, 20, 500, 367, events);   // total event size = 428
    generator.generateEvents(1, 1, 500, 10, events);   // event + EOP = 132.

    // We should be able to append the first three events above, filling the two byte buffers completely.
    // And then the last event along with EOP marker in the last byte buffer, filling that to complete
    // one window.
    appender.run();
View Full Code Here

Examples of com.linkedin.databus.core.test.DbusEventGenerator.generateEvents()

    // Now try to add one event. Because ScnIndex still has head as -1 for this buffer,
    // we end up getting a DatabusRuntimeException and not being able to add an event.
    // Since this is a rare case, it is TBD whether we need to support this case or not.
    events.clear();
    generator.generateEvents(1, 20, 500, 10, events);   // event size = 71, can append.
    exceptionCaught = false;
    try
    {
      appender.run();
    }
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.