Examples of EventGenerator


Examples of org.apache.jackrabbit.oak.plugins.observation.EventGenerator

    public EventQueue(
            @Nonnull NamePathMapper mapper, CommitInfo info,
            @Nonnull NodeState before, @Nonnull NodeState after,
            @Nonnull Iterable<String> basePaths, @Nonnull EventFilter filter) {
        this.generator = new EventGenerator();
        EventFactory factory = new EventFactory(mapper, info);
        EventHandler handler = new FilteredHandler(
                filter, new QueueingHandler(this, factory, before, after));
        for (String path : basePaths) {
            addHandler(before, after, path, handler, generator);
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.observation.EventGenerator

        }
        handler = new FilteredHandler(
                Filters.all(new VisibleFilter(), filter),
                handler);

        this.generator = new EventGenerator(before, after, handler);
    }
View Full Code Here

Examples of org.apache.s4.ft.EventGenerator

        forkedS4App = TestUtils.forkS4App(getClass().getName(), backendConf);

        CountDownLatch signalTextProcessed = new CountDownLatch(1);
        TestUtils.watchAndSignalCreation("/textProcessed", signalTextProcessed,
                zk);
        EventGenerator gen = new EventGenerator();

        // add authorizations for processing
        for (int i = 1; i <= WordCountTest.SENTENCE_1_TOTAL_WORDS; i++) {
            zk.create("/continue_" + i, new byte[0], Ids.OPEN_ACL_UNSAFE,
                    CreateMode.EPHEMERAL);
        }
        CountDownLatch signalSentence1Processed = new CountDownLatch(1);
        TestUtils.watchAndSignalCreation("/classifierIteration_"
                + WordCountTest.SENTENCE_1_TOTAL_WORDS,
                signalSentence1Processed, zk);
        gen.injectValueEvent(
                new KeyValue("sentence", WordCountTest.SENTENCE_1),
                "Sentences", 0);
        signalSentence1Processed.await(10, TimeUnit.SECONDS);
        Thread.sleep(1000);
       
       
        // crash the app
        forkedS4App.destroy();

        // recovering and making sure checkpointing still works
        forkedS4App = TestUtils.forkS4App(getClass().getName(), backendConf);

        // add authorizations for continuing processing. Without these, the
        // WordClassifier processed keeps waiting
        for (int i = WordCountTest.SENTENCE_1_TOTAL_WORDS + 1; i <= WordCountTest.SENTENCE_1_TOTAL_WORDS
                + WordCountTest.SENTENCE_2_TOTAL_WORDS; i++) {
            zk.create("/continue_" + i, new byte[0], Ids.OPEN_ACL_UNSAFE,
                    CreateMode.EPHEMERAL);
        }

        CountDownLatch sentence2Processed = new CountDownLatch(1);
        TestUtils
                .watchAndSignalCreation(
                        "/classifierIteration_"
                                + (WordCountTest.SENTENCE_1_TOTAL_WORDS + WordCountTest.SENTENCE_2_TOTAL_WORDS),
                        sentence2Processed, zk);

        gen.injectValueEvent(
                new KeyValue("sentence", WordCountTest.SENTENCE_2),
                "Sentences", 0);

        sentence2Processed.await(10, TimeUnit.SECONDS);
        Thread.sleep(1000);

        // crash the app
        forkedS4App.destroy();
        forkedS4App = TestUtils.forkS4App(getClass().getName(), backendConf);

        // add authorizations for continuing processing. Without these, the
        // WordClassifier processed keeps waiting
        for (int i = WordCountTest.SENTENCE_1_TOTAL_WORDS
                + WordCountTest.SENTENCE_2_TOTAL_WORDS + 1; i <= WordCountTest.TOTAL_WORDS; i++) {
            zk.create("/continue_" + i, new byte[0], Ids.OPEN_ACL_UNSAFE,
                    CreateMode.EPHEMERAL);
        }
        gen.injectValueEvent(
                new KeyValue("sentence", WordCountTest.SENTENCE_3),
                "Sentences", 0);
        signalTextProcessed.await(10, TimeUnit.SECONDS);
        File results = new File(S4TestCase.DEFAULT_TEST_OUTPUT_DIR
                + File.separator + "wordcount");
View Full Code Here

Examples of org.apache.s4.ft.EventGenerator

        final ZooKeeper zk = TestUtils.createZkClient();

        CountDownLatch signalTextProcessed = new CountDownLatch(1);
        TestUtils.watchAndSignalCreation("/textProcessed", signalTextProcessed,
                zk);
        EventGenerator gen = new EventGenerator();
       
        // add authorizations for processing
        for (int i = 1; i <= SENTENCE_1_TOTAL_WORDS + SENTENCE_2_TOTAL_WORDS
                + 1; i++) {
            zk.create("/continue_" + i, new byte[0], Ids.OPEN_ACL_UNSAFE,
                    CreateMode.EPHEMERAL);
        }
        gen.injectValueEvent(new KeyValue("sentence", SENTENCE_1),
                    "Sentences", 0);
        gen.injectValueEvent(new KeyValue("sentence", SENTENCE_2), "Sentences",
                0);
        gen.injectValueEvent(new KeyValue("sentence", SENTENCE_3), "Sentences",
                0);
        signalTextProcessed.await();
        File results = new File(S4TestCase.DEFAULT_TEST_OUTPUT_DIR
                + File.separator + "wordcount");
        String s = TestUtils.readFile(results);
View Full Code Here

Examples of org.wso2.carbon.bam.data.publisher.activity.mediation.eventing.EventGenerator

        ActivityPublisherUtils.setEventBroker(eventBrokerService);

        ActivityPublisherAdmin admin = new ActivityPublisherAdmin();
        ActivityPublisherUtils.setActivityPublisherAdmin(admin);

        ActivityQueue queue = new ActivityQueue(new EventGenerator());
        queue.setThreshold(1);
        initSerialization();

        MessageContext synCtx = getTestContext();
        MessageActivity activity = ActivityPublisherUtils.newActivity(synCtx, true);
View Full Code Here

Examples of org.wso2.carbon.bam.data.publisher.activity.mediation.eventing.EventGenerator

        ActivityPublisherUtils.setEventBroker(eventBrokerService);

        ActivityPublisherAdmin admin = new ActivityPublisherAdmin();
        ActivityPublisherUtils.setActivityPublisherAdmin(admin);

        ActivityQueue queue = new ActivityQueue(new EventGenerator());
        queue.setThreshold(10);
        initSerialization();

        for (int i = 0; i < 100; i++) {
            MessageContext synCtx = getTestContext();
View Full Code Here

Examples of org.wso2.carbon.bam.data.publisher.activity.mediation.eventing.EventGenerator

        ActivityPublisherUtils.setEventBroker(eventBrokerService);

        ActivityPublisherAdmin admin = new ActivityPublisherAdmin();
        ActivityPublisherUtils.setActivityPublisherAdmin(admin);

        ActivityQueue queue = new ActivityQueue(new EventGenerator());
        queue.setThreshold(10);
        initSerialization();

        final int TOTAL_THREAD_COUNT = 10;
        for (int i = 0; i < TOTAL_THREAD_COUNT; i++) {
View Full Code Here

Examples of org.wso2.carbon.bam.data.publisher.activity.mediation.eventing.EventGenerator

            }
        }

        // If no processor is specified default to the eventing based activity processor
        if (activityProcessor == null) {
            activityProcessor = new EventGenerator();
        }
        this.activityQueue = new ActivityQueue(activityProcessor);

        // Check whether a threshold value has been specified for the activity queue
        String thresholdProperty = System.getProperty("bam.activity.threshold");
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.