Examples of generateEvents()


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, _maxWindowSize, maxEventSize, payloadSize, true, events);
        DbusEventInternalWritable p = null;
        for (DbusEvent e : events)
        {
          if (p != null && (p.sequence() != e.sequence()))
          {
View Full Code Here

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

            srcIdList.add(srcId);
            int numEvents = 100;
            int payloadSize = 20;
            int maxWindowSize = 80;
            DbusEventGenerator evGen = new DbusEventGenerator(0,srcIdList);
            Assert.assertTrue(evGen.generateEvents(numEvents, maxWindowSize, 512, payloadSize, srcTestEvents) > 0);

            int size=0;
            for (DbusEvent e : srcTestEvents)
            {
                if (!e.isControlMessage()) {
View Full Code Here

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

            srcIdList.add(srcId);
            int numEvents = 100;
            int payloadSize = 20;
            int maxWindowSize =1;
            DbusEventGenerator evGen = new DbusEventGenerator(0,srcIdList);
            Assert.assertTrue(evGen.generateEvents(numEvents, maxWindowSize, payloadSize+62, payloadSize, srcTestEvents) > 0);

            long lastWindowScn = srcTestEvents.get(srcTestEvents.size()-1).sequence();
            int size = 0;
            for (DbusEvent e : srcTestEvents)
            {
View Full Code Here

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

            Vector<DbusEvent> srcTestEvents = new Vector<DbusEvent>();
            Vector<Short> srcIdList = new Vector<Short> ();
            srcIdList.add(srcId);

            DbusEventGenerator evGen = new DbusEventGenerator(0,srcIdList);
            Assert.assertTrue(evGen.generateEvents(numEvents, maxWindowSize, 512, payloadSize, srcTestEvents) > 0);

            int totalSize=0;
            int maxSize=0;
            for (DbusEvent e : srcTestEvents)
            {
View Full Code Here

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

        Vector<Short> srcIdList = new Vector<Short> ();
        srcIdList.add(srcId);

        DbusEventGenerator evGen = new DbusEventGenerator(15000,srcIdList);
        //Assumption: generates events with  non-decreasing timestamps
        Assert.assertTrue(evGen.generateEvents(numEvents, maxWindowSize, 512, payloadSize,true, srcTestEvents) > 0);

        int totalSize=0; int maxSize=0;
        for (DbusEvent e : srcTestEvents)
        {
            totalSize += e.size();
View Full Code Here

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

        Vector<DbusEvent> srcTestEvents = new Vector<DbusEvent>();
        Vector<Short> srcIdList = new Vector<Short> ();
        srcIdList.add(srcId);

        DbusEventGenerator evGen = new DbusEventGenerator(15000,srcIdList);
        Assert.assertTrue(evGen.generateEvents(numEvents, maxWindowSize, 512, payloadSize,true, srcTestEvents) > 0);

        int totalSize=0; int maxSize=0;
        for (DbusEvent e : srcTestEvents)
        {
            totalSize += e.size();
View Full Code Here

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

      srcIdList.add(srcId);

      DbusEventGenerator evGen = new DbusEventGenerator(0,srcIdList);
      //the schemaIds generated here are random. They will not be the same as those computed in the dispatcher.
      //The result is either the processing will fail early (desired behaviour) or during event decoding in the onDataEvent()
      Assert.assertTrue(evGen.generateEvents(numEvents, maxWindowSize, 512, payloadSize, srcTestEvents) > 0);

      int totalSize=0; int maxSize=0;
      for (DbusEvent e : srcTestEvents)
      {
          totalSize += e.size();
View Full Code Here

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

      DbusEventGenerator evGen = new DbusEventGenerator(0,srcIdList);
      Vector<DbusEvent> srcTestEvents = new Vector<DbusEvent>();
      final int numEvents = 8;
      final int numEventsPerWindow = 4;
      final int payloadSize = 200;
      Assert.assertTrue(evGen.generateEvents(numEvents, numEventsPerWindow, 500, payloadSize, srcTestEvents) > 0);

      // find out how much data we need to stream for the failure
      int win1Size= payloadSize - 1; // account for the EOW event which is < payload size
      for (DbusEvent e : srcTestEvents)
      {
View Full Code Here

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

      final int numEvents = 9;
      final int numOfFailureEvent = 5; //1-based number of the event callback to fail
      final int numEventsPerWindow = 3;
      final int payloadSize = 200;
      final int numWindows = (int)Math.ceil(1.0 * numEvents / numEventsPerWindow);
      Assert.assertTrue(evGen.generateEvents(numEvents, numEventsPerWindow, 500, payloadSize, srcTestEvents) > 0);

      // find out how much data we need to stream for the failure
      int win1Size= payloadSize - 1; // account for the EOW event which is < payload size
      int win2Size = 0;
      int eventN = 0;
View Full Code Here

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

    Assert.assertEquals(dbusBuf._busyIteratorPool.size(), 1);

    log.info("append a full window of events");
    final DbusEventGenerator generator = new DbusEventGenerator();
    final Vector<DbusEvent> events = new Vector<DbusEvent>();
    generator.generateEvents(5, 5, 120, 39, events);
    injectEventsInBuffer(dbusBuf, events, false);

    log.info("verify we can read all events");
    //old iterator has not changed
    Assert.assertTrue(!iter0.hasNext());
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.