Package com.linkedin.databus.client.pub

Examples of com.linkedin.databus.client.pub.DatabusStreamConsumer


            new TestGenericDispatcherEventBuffer(_generic100KBufferStaticConfig);
        eventsBuf.start(0);

        final StateVerifyingStreamConsumer svsConsumer = new StateVerifyingStreamConsumer(null);
        //svsConsumer.getLog().setLevel(Level.DEBUG);
        DatabusStreamConsumer mockConsumer =
                new EventCountingConsumer(svsConsumer, keyCounts, srcidCounts);
        SelectingDatabusCombinedConsumer sdccMockConsumer = new SelectingDatabusCombinedConsumer(mockConsumer);

        List<String> sources = new ArrayList<String>();
        Map<Long, IdNamePair> sourcesMap = new HashMap<Long, IdNamePair>();
View Full Code Here


            initBufferWithEvents(eventsBuf, curEventNum, source2EventsNum, (short)2, keyCounts, srcidCounts);
            curEventNum += source2EventsNum;
            eventsBuf.endEvents(100L * (w + 1),null);
        }

        DatabusStreamConsumer mockConsumer =
                new EventCountingConsumer(new StateVerifyingStreamConsumer(null), keyCounts, srcidCounts);
        SelectingDatabusCombinedConsumer sdccMockConsumer = new SelectingDatabusCombinedConsumer(mockConsumer);

        List<String> sources = new ArrayList<String>();
        Map<Long, IdNamePair> sourcesMap = new HashMap<Long, IdNamePair>();
View Full Code Here

        for (Short srcid: srcidCounts.keySet())
        {
            srcidCounts2.put(srcid, new AtomicInteger(0));
        }

        DatabusStreamConsumer mockConsumer =
                new EventCountingConsumer(new StateVerifyingStreamConsumer(null), keyCounts, srcidCounts);
        DatabusStreamConsumer mockConsumer2 =
                new EventCountingConsumer(new StateVerifyingStreamConsumer(null), keyCounts2, srcidCounts2);

        SelectingDatabusCombinedConsumer sdccMockConsumer = new SelectingDatabusCombinedConsumer(mockConsumer);
        SelectingDatabusCombinedConsumer sdccMockConsumer2 = new SelectingDatabusCombinedConsumer(mockConsumer2);
View Full Code Here

        initBufferWithEvents(eventsBuf, 1, source1EventsNum, (short)1, keyCounts, srcidCounts);
        initBufferWithEvents(eventsBuf, 1 + source1EventsNum, source2EventsNum, (short)2, keyCounts,
                srcidCounts);
        eventsBuf.endEvents(100L);

        DatabusStreamConsumer mockConsumer =
                new EventCountingConsumer(new StateVerifyingStreamConsumer(null), keyCounts, srcidCounts);
        DatabusStreamConsumer mockConsumer2 =
                new EventCountingConsumer(new StateVerifyingStreamConsumer(null), keyCounts, srcidCounts);

        DatabusCombinedConsumer sdccMockConsumer = new SelectingDatabusCombinedConsumer(mockConsumer);
        DatabusCombinedConsumer sdccMockConsumer2 = new SelectingDatabusCombinedConsumer(mockConsumer2);
View Full Code Here

        eventsBuf.endEvents(100L);
        eventsBuf.startEvents();
        initBufferWithEvents(eventsBuf, 1 + source1EventsNum, source2EventsNum, (short)2, keyCounts, srcidCounts);
        eventsBuf.endEvents(200L);

        DatabusStreamConsumer mockConsumer =
                new EventCountingConsumer(
                        new StateVerifyingStreamConsumer(
                                new DataEventFailingStreamConsumer((short)2)), keyCounts, srcidCounts);
        SelectingDatabusCombinedConsumer sdccMockConsumer = new SelectingDatabusCombinedConsumer(mockConsumer);
View Full Code Here

        eventsBuf.endEvents(100L);
        eventsBuf.startEvents();
        initBufferWithEvents(eventsBuf, 1 + source1EventsNum, source2EventsNum, (short)2, keyCounts, srcidCounts);
        eventsBuf.endEvents(200L);

        DatabusStreamConsumer mockConsumer =
                new EventCountingConsumer(
                        new StateVerifyingStreamConsumer(
                                new DataSourceFailingStreamConsumer("source2")),
                                keyCounts, srcidCounts);
        SelectingDatabusCombinedConsumer sdccMockConsumer = new SelectingDatabusCombinedConsumer(mockConsumer);

        Hashtable<Long, AtomicInteger> keyCounts2 = new Hashtable<Long, AtomicInteger>();
        Hashtable<Short, AtomicInteger> srcidCounts2 = new Hashtable<Short, AtomicInteger>();
        for (Long key: keyCounts.keySet())
        {
            keyCounts2.put(key, new AtomicInteger(0));
        }
        for (Short srcid: srcidCounts.keySet())
        {
            srcidCounts2.put(srcid, new AtomicInteger(0));
        }

        DatabusStreamConsumer mockConsumer2 =
                new EventCountingConsumer(new StateVerifyingStreamConsumer(null),
                        keyCounts2, srcidCounts2);
        SelectingDatabusCombinedConsumer sdccMockConsumer2 = new SelectingDatabusCombinedConsumer(mockConsumer2);

        List<String> sources = new ArrayList<String>();
View Full Code Here

    {
      final Logger log = Logger.getLogger("TestGenericDispatcher.testLargeWindowCheckpointFrequency");
      log.info("start");
            /* Consumer creation */
            int timeTakenForEventInMs = 1;
            DatabusStreamConsumer tConsumer = new TimeoutTestConsumer(timeTakenForEventInMs);
            DatabusCombinedConsumer sdccTConsumer = new SelectingDatabusCombinedConsumer(tConsumer);
            HashMap<Long, List<RegisterResponseEntry>> schemaMap =
                    new HashMap<Long, List<RegisterResponseEntry>>();

            short srcId=1;
View Full Code Here

            new TestGenericDispatcherEventBuffer(_generic100KBufferStaticConfig);
        eventsBuf.start(0);

        final StateVerifyingStreamConsumer svsConsumer = new StateVerifyingStreamConsumer(null);
        //svsConsumer.getLog().setLevel(Level.DEBUG);
        DatabusStreamConsumer mockConsumer =
                new EventCountingConsumer(svsConsumer, keyCounts, srcidCounts);
        SelectingDatabusCombinedConsumer sdccMockConsumer = new SelectingDatabusCombinedConsumer(mockConsumer);

        List<String> sources = new ArrayList<String>();
        Map<Long, IdNamePair> sourcesMap = new HashMap<Long, IdNamePair>();
View Full Code Here

      client.registerDatabusStreamListener(listener2 , null, "S1");
      int consumersNum = safeListSize(client.getRelayGroupStreamConsumers().get(ls1)) +
      safeListSize(client.getRelayGroupStreamConsumers().get(ls2));
      assertEquals("expect two consumers in (S1,S2) or (S1,S3)", 2, consumersNum);

      DatabusStreamConsumer listener3 = new LoggingConsumer(clientConfig.getLoggingListener());
      client.registerDatabusStreamListener(listener3, null, "S5");
      assertEquals("expect one consumer in (S3,S4,S5)", 1,
                   safeListSize(client.getRelayGroupStreamConsumers().get(ls3)));

View Full Code Here

    DbusEventBuffer.DbusEventIterator iter = eventsBuf.acquireIterator("myIter1");
    assert iter.hasNext() : "unable to read event";
    iter.next();
    DbusEvent event1 = iter.next();

    DatabusStreamConsumer logConsumer = new LoggingConsumer();
    SelectingDatabusCombinedConsumer sdccLogConsumer = new SelectingDatabusCombinedConsumer(logConsumer);

    DatabusV2ConsumerRegistration consumerReg =
        new DatabusV2ConsumerRegistration(sdccLogConsumer, sources, null);
    ConsumerCallbackStats consumerStatsCollector = new ConsumerCallbackStats(1, "test","test", true,false, null);
View Full Code Here

TOP

Related Classes of com.linkedin.databus.client.pub.DatabusStreamConsumer

Copyright © 2018 www.massapicom. 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.