Examples of EventProcessor


Examples of com.alibaba.otter.shared.etl.extend.processor.EventProcessor

            for (DataMediaPair dataMediaPair : dataMediaPairs) {
                if (!dataMediaPair.isExistFilter()) {
                    continue;
                }

                EventProcessor eventProcessor = extensionFactory.getExtension(EventProcessor.class,
                                                                              dataMediaPair.getFilterData());
                boolean process = eventProcessor.process(eventData);
                if (!process) {
                    removeDatas.add(eventData);// 添加到删除记录中
                    break;
                }
            }
View Full Code Here

Examples of com.alibaba.otter.shared.etl.extend.processor.EventProcessor

                for (DataMediaPair dataMediaPair : dataMediaPairs) {
                    if (!dataMediaPair.isExistFilter()) {
                        continue;
                    }

                    final EventProcessor eventProcessor = extensionFactory.getExtension(EventProcessor.class,
                        dataMediaPair.getFilterData());
                    if (eventProcessor instanceof DataSourceFetcherAware) {
                        ((DataSourceFetcherAware) eventProcessor).setDataSourceFetcher(new DataSourceFetcher() {

                            @Override
                            public DataSource fetch(Long tableId) {
                                DataMedia dataMedia = ConfigHelper.findDataMedia(pipeline, tableId);
                                return dataSourceService.getDataSource(pipeline.getId(), dataMedia.getSource());
                            }
                        });

                        executorTemplate.submit(new Runnable() {

                            @Override
                            public void run() {
                                MDC.put(OtterConstants.splitPipelineLogFileKey, String.valueOf(pipeline.getId()));
                                boolean process = eventProcessor.process(eventData);
                                if (!process) {
                                    removeDatas.add(eventData);// 添加到删除记录中
                                }
                            }
                        });
                    } else {
                        boolean process = eventProcessor.process(eventData);
                        if (!process) {
                            removeDatas.add(eventData);// 添加到删除记录中
                            break;
                        }
                    }
View Full Code Here

Examples of com.lmax.disruptor.EventProcessor

                waitStrategy);

        // Initial barrier
        SequenceBarrier translationBarrier = ringBuffer.newBarrier();

        EventProcessor tradeProcessor = createTradeProcessor(ringBuffer, translationBarrier);
        EventProcessor rateProcessor = createRateProcessor(ringBuffer, translationBarrier);

        // Add the portfolio position aggregator with a barrier after both
        // processors.
        SequenceBarrier positionBarrier = ringBuffer.newBarrier(tradeProcessor.getSequence(),
                rateProcessor.getSequence());
        EventProcessor portfolioPositionProcessor = createPortfolioPositionProcessor(ringBuffer, positionBarrier);
       
        // Netty Event Publisher
        TextMessageGateway gateway = createGatewayEventPublisher(ringBuffer);

        // The producer can't move past this barrier.
        ringBuffer.setGatingSequences(tradeProcessor.getSequence(), rateProcessor.getSequence(),
                portfolioPositionProcessor.getSequence());

        // Start the threads
        tasks[0] = threadPool.submit(gateway);
        tasks[1] = threadPool.submit(tradeProcessor);
        tasks[2] = threadPool.submit(rateProcessor);
View Full Code Here

Examples of com.lmax.disruptor.EventProcessor

     * @return
     */
    private EventProcessor createPortfolioPositionProcessor(RingBuffer<MarketEvent> ringBuffer,
            SequenceBarrier positionBarrier) {
        PortfolioPositionEventHandler portfolioPositionHandler = new PortfolioPositionEventHandler();
        EventProcessor portfolioPositionProcessor = new BatchEventProcessor<MarketEvent>(ringBuffer, positionBarrier,
                portfolioPositionHandler);
        eventProcessors[2] = portfolioPositionProcessor;
        return portfolioPositionProcessor;
    }
View Full Code Here

Examples of com.lmax.disruptor.EventProcessor

     * @param translationBarrier
     * @return
     */
    private EventProcessor createRateProcessor(RingBuffer<MarketEvent> ringBuffer, SequenceBarrier translationBarrier) {
        MarketRateEventHandler rateHandler = new MarketRateEventHandler();
        EventProcessor rateProcessor = new BatchEventProcessor<MarketEvent>(ringBuffer, translationBarrier, rateHandler);
        eventProcessors[1] = rateProcessor;
        return rateProcessor;
    }
View Full Code Here

Examples of com.lmax.disruptor.EventProcessor

     * @param translationBarrier
     * @return
     */
    private EventProcessor createTradeProcessor(RingBuffer<MarketEvent> ringBuffer, SequenceBarrier translationBarrier) {
        MarketTradeEventHandler tradeHandler = new MarketTradeEventHandler();
        EventProcessor tradeProcessor = new BatchEventProcessor<MarketEvent>(ringBuffer, translationBarrier,
                tradeHandler);
        eventProcessors[0] = tradeProcessor;
        return tradeProcessor;
    }
View Full Code Here

Examples of org.apache.cxf.event.EventProcessor

    public void testConstructionWithExtensions() throws BusException {
       
        IMocksControl control;
        BindingFactoryManager bindingFactoryManager;
        WSDLManager wsdlManager;
        EventProcessor eventProcessor;
        InstrumentationManager instrumentationManager;
        PhaseManager phaseManager;
       
        control = EasyMock.createNiceControl();
       
View Full Code Here

Examples of org.apache.cxf.event.EventProcessor

    public void testConstructionWithExtensions() throws BusException {
       
        IMocksControl control;
        BindingFactoryManager bindingFactoryManager;
        WSDLManager wsdlManager;
        EventProcessor eventProcessor;
        InstrumentationManager instrumentationManager;
        PhaseManager phaseManager;
       
        control = EasyMock.createNiceControl();
       
View Full Code Here

Examples of org.apache.cxf.event.EventProcessor

    public void testConstructionWithExtensions() throws BusException {
       
        IMocksControl control;
        BindingFactoryManager bindingFactoryManager;
        WSDLManager wsdlManager;
        EventProcessor eventProcessor;
        InstrumentationManager instrumentationManager;
        PhaseManager phaseManager;
       
        control = EasyMock.createNiceControl();
       
View Full Code Here

Examples of org.apache.cxf.event.EventProcessor

    public void testWorkQueueInstrumentation() throws Exception {
        assertTrue("Instrumentation Manager should not be null", im != null);
        //im.getAllInstrumentation();
        WorkQueueManagerImpl wqm = new WorkQueueManagerImpl();
        wqm.setBus(bus);
        EventProcessor ep = bus.getExtension(EventProcessor.class);
        QName eventID = new QName(ComponentEventFilter.COMPONENT_CREATED_EVENT);
        if (null != ep) {        
            ep.sendEvent(new Event(wqm, eventID));
        }       
       
        //NOTE: now the bus WorkQueueManager is lazy load , if WorkQueueManager
        //create with bus , this test could be failed.
        List<Instrumentation> list = im.getAllInstrumentation();
        //NOTE: change for the BindingManager and TransportFactoryManager instrumentation
        // create with the bus.
        assertEquals("Too many instrumented items", 1, list.size());
        Instrumentation it1 = list.get(0);
        //Instrumentation it2 = list.get(3);
        assertTrue("Item 1 not a WorkQueueInstrumentation",
                   WorkQueueInstrumentation.class.isAssignableFrom(it1.getClass()));
       
        // not check for the instrumentation unique name
        // sleep for the MBServer connector thread startup
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            // do nothing
        }
        eventID = new QName(ComponentEventFilter.COMPONENT_REMOVED_EVENT);
        if (null != ep) {
            ep.sendEvent(new Event(wqm, eventID));
        }   
        assertEquals("Instrumented stuff not removed from list", 0, list.size());
        bus.shutdown(true);
        assertEquals("Instrumented stuff not removed from list", 0, list.size());
    }
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.