diff --git a/component/src/main/java/io/siddhi/extension/io/live/source/LiveSource.java b/component/src/main/java/io/siddhi/extension/io/live/source/LiveSource.java index 33e4f6c..6cdad4d 100644 --- a/component/src/main/java/io/siddhi/extension/io/live/source/LiveSource.java +++ b/component/src/main/java/io/siddhi/extension/io/live/source/LiveSource.java @@ -19,13 +19,14 @@ import io.siddhi.core.util.snapshot.state.StateFactory; import io.siddhi.core.util.transport.OptionHolder; import io.siddhi.extension.io.live.utils.LiveSourceConstants; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.apache.log4j.LogManager; -import org.apache.log4j.Logger; + import javax.security.auth.login.CredentialException; @@ -111,7 +112,8 @@ }, examples = { @Example( - syntax = "@source(type = 'live', sql.query='Select * from table', host.name='api-varden-example'," + + syntax = "@source(type = 'live', sql.query='Select * from table'," + + "\nhost.name='api-varden-example'," + "\napi.key = 'apikey-xxxxxxxxx', " + "\n@map(type='keyvalue'), @attributes(id = 'id', name = 'name'))" + "\ndefine stream inputStream (id int, name string)", @@ -187,7 +189,7 @@ protected ServiceDeploymentInfo exposeServiceDeploymentInfo() { * @throws ConnectionUnavailableException if it cannot connect to the source backend immediately. */ @Override - public void connect(ConnectionCallback connectionCallback,State state) throws ConnectionUnavailableException { + public void connect(ConnectionCallback connectionCallback , State state) throws ConnectionUnavailableException { C8DB db; try { db = new C8DB.Builder() @@ -218,7 +220,6 @@ public void connect(ConnectionCallback connectionCallback,State state) throws Co } catch (IOException e) { throw new RuntimeException(e); } -// System.out.println(r.toString()); logger.info("Event " + r.toString()); sourceEventListener.onEvent(r.toString(), requestedTransportPropertyNames); diff --git a/component/src/main/java/io/siddhi/extension/io/live/utils/LiveSourceConstants.java b/component/src/main/java/io/siddhi/extension/io/live/utils/LiveSourceConstants.java index 1663ebd..0cca21a 100644 --- a/component/src/main/java/io/siddhi/extension/io/live/utils/LiveSourceConstants.java +++ b/component/src/main/java/io/siddhi/extension/io/live/utils/LiveSourceConstants.java @@ -1,5 +1,25 @@ +/* + * Copyright (c) 2017 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ package io.siddhi.extension.io.live.utils; - +/** + * Live source constants. + */ public class LiveSourceConstants { public static final String SQLQUERY = "sql.query"; public static final String HOSTNAME = "host.name"; diff --git a/component/src/test/java/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.java b/component/src/test/java/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.java index 790ef1d..96f7128 100644 --- a/component/src/test/java/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.java +++ b/component/src/test/java/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.java @@ -16,9 +16,7 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.net.URI; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; @@ -51,8 +49,11 @@ public void liveSelect() throws Exception { siddhiManager.setPersistenceStore(persistenceStore); siddhiManager.setExtension("xml-input-mapper", XmlSourceMapper.class); String inStreamDefinition = "@App:name('TestSiddhiApp')" + - "@source(type='live', sql.query='select count from network_traffic', host.name='api-varden-4f0f3c4f.paas.macrometa.io'," + - "api.key = 'madu140_gmail.com.AccessPortal.2PL8EeyIAMn2sx7YHKWMM58tmJLES4NyIWq6Cnsj0BTMjygJyF3b14zb2sidcauXccccb8'," + + "@source(type='live'," + + "sql.query='select count from network_traffic'," + + "host.name='api-varden-4f0f3c4f.paas.macrometa.io'," + + "api.key = 'madu140_gmail.com." + + "AccessPortal.2PL8EeyIAMn2sx7YHKWMM58tmJLES4NyIWq6Cnsj0BTMjygJyF3b14zb2sidcauXccccb8'," + " @map(type='keyvalue'), @attributes(id = 'id', name = 'name'))," + "define stream inputStream (count int)"; String query = ("@info(name = 'query') " diff --git a/component/target/classes/io/siddhi/extension/io/live/source/LiveSource.class b/component/target/classes/io/siddhi/extension/io/live/source/LiveSource.class deleted file mode 100644 index a445e04..0000000 Binary files a/component/target/classes/io/siddhi/extension/io/live/source/LiveSource.class and /dev/null differ diff --git a/component/target/test-classes/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.class b/component/target/test-classes/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.class deleted file mode 100644 index e1b88f6..0000000 Binary files a/component/target/test-classes/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.class and /dev/null differ diff --git a/component/target/test-classes/log4j.properties b/component/target/test-classes/log4j.properties deleted file mode 100644 index b52a2f1..0000000 --- a/component/target/test-classes/log4j.properties +++ /dev/null @@ -1,13 +0,0 @@ -# For the general syntax of property based configuration files see the -# documenation of org.apache.log4j.PropertyConfigurator. -# The root category uses the appender called A1. Since no priority is -# specified, the root category assumes the default priority for root -# which is DEBUG in log4j. The root category is the only category that -# has a default priority. All other categories need not be assigned a -# priority in which case they inherit their priority from the -# hierarchy. -#log4j.rootLogger=DEBUG, stdout -log4j.rootLogger=INFO, stdout -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%m%n diff --git a/component/target/test-classes/testng.xml b/component/target/test-classes/testng.xml deleted file mode 100644 index a04f603..0000000 --- a/component/target/test-classes/testng.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - -