Skip to content

Commit

Permalink
some errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
vinoja98 committed Sep 8, 2022
1 parent a8f1d51 commit 8f490bc
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)",
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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') "
Expand Down
Binary file not shown.
Binary file not shown.
13 changes: 0 additions & 13 deletions component/target/test-classes/log4j.properties

This file was deleted.

12 changes: 0 additions & 12 deletions component/target/test-classes/testng.xml

This file was deleted.

0 comments on commit 8f490bc

Please sign in to comment.