Examples of OtterDownStreamHandler


Examples of com.alibaba.otter.node.etl.select.selector.canal.OtterDownStreamHandler

    }

    @Test
    public void testSimple() {
        final OtterDownStreamHandler handler = new OtterDownStreamHandler();
        handler.setPipelineId(388L);
        handler.setDetectingIntervalInSeconds(1);

        ((AutowireCapableBeanFactory) TestedObject.getSpringBeanFactory()).autowireBeanProperties(handler,
            AutowireCapableBeanFactory.AUTOWIRE_BY_NAME,
            false);

        final CountDownLatch count = new CountDownLatch(1);
        ExecutorService executor = Executors.newFixedThreadPool(1);
        executor.submit(new Runnable() {

            public void run() {
                int times = 50;
                handler.before(Arrays.asList(buildEvent()));
                while (--times > 0) {
                    try {
                        Thread.sleep(50000);
                    } catch (InterruptedException e) {
                    }

                    handler.before(Arrays.asList(buildEvent()));
                }

                count.countDown();
            }
        });
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.