components/global/core/io.cellery.observability.k8s.client/src/test/java/io/cellery/observability/k8s/client/GetComponentPodsStreamProcessorTestCase.java
private void initializeSiddhiAppRuntime() {
        String inStreamDefinition = "@App:name(\"test-siddhi-app\")\n" +
                "define stream " + INPUT_STREAM + " (inputValue string);";
        String query = "@info(name = \"query\")\n" +
                "from inputStream#k8sClient:getComponentPods()\n" +
                "select inputValue, instance, instanceKind, component, podName, creationTimestamp, nodeName\n" +
                "insert into outputStream;";
        SiddhiManager siddhiManager = new SiddhiManager();
        siddhiManager.setPersistenceStore(new InMemoryPersistenceStore());
        siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inStreamDefinition + "\n" + query);
        siddhiAppRuntime.addCallback("query", new QueryCallback() {
            @Override
            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
                EventPrinter.print(timeStamp, inEvents, removeEvents);
                for (Event event : inEvents) {
                    synchronized (this) {
                        receivedEvents.add(event);
                    }
                    eventCount.incrementAndGet();
                }
            }
        });
        siddhiAppRuntime.start();
        if (logger.isDebugEnabled()) {
            logger.debug("Initialized Siddhi App Runtime");
        }
    }
/**
     * Initialize the Siddhi App Runtime.
     */
Initialize the Siddhi App Runtime.
Initialize the Siddhi App Runtime .
private void initializeSiddhiAppRuntime() {
        String inStreamDefinition = "@App:name(\"test-siddhi-app\")\n" +
                "define stream " + INPUT_STREAM + " (inputValue string);";
        String query = "@info(name = \"query\")\n" +
                "from inputStream#k8sClient:getComponentPods()\n" +
                "select inputValue, instance, instanceKind, component, podName, creationTimestamp, nodeName\n" +
                "insert into outputStream;";
        SiddhiManager siddhiManager = new SiddhiManager();
        siddhiManager.setPersistenceStore(new InMemoryPersistenceStore());
        siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inStreamDefinition + "\n" + query);
        siddhiAppRuntime.addCallback("query", new QueryCallback() {
            @Override
            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
                EventPrinter.print(timeStamp, inEvents, removeEvents);
                for (Event event : inEvents) {
                    synchronized (this) {
                        receivedEvents.add(event);
                    }
                    eventCount.incrementAndGet();
                }
            }
        });
        siddhiAppRuntime.start();
        if (logger.isDebugEnabled()) {
            logger.debug("Initialized Siddhi App Runtime");
        }
    }
private void initializeSiddhiAppRuntime ( ) { String inStreamDefinition = "@App:name(\"test-siddhi-app\")\n" + "define stream " + INPUT_STREAM + " (inputValue string);" ; String query = "@info(name = \"query\")\n" + "from inputStream#k8sClient:getComponentPods()\n" + "select inputValue, instance, instanceKind, component, podName, creationTimestamp, nodeName\n" + "insert into outputStream;" ; SiddhiManager siddhiManager = new SiddhiManager ( ) ; siddhiManager . setPersistenceStore ( new InMemoryPersistenceStore ( ) ) ; siddhiAppRuntime = siddhiManager . createSiddhiAppRuntime ( inStreamDefinition + "\n" + query ) ; siddhiAppRuntime . addCallback ( "query" , new QueryCallback ( ) { @ Override public void receive ( long timeStamp , Event [ ] inEvents , Event [ ] removeEvents ) { EventPrinter . print ( timeStamp , inEvents , removeEvents ) ; for ( Event event : inEvents ) { synchronized ( this ) { receivedEvents . add ( event ) ; } eventCount . incrementAndGet ( ) ; } } } ) ; siddhiAppRuntime . start ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Initialized Siddhi App Runtime" ) ; } }
Initialize the Siddhi App Runtime.
Initialize the Siddhi App Runtime .