streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject [02/14] git commit: additions to enable streams-api
Date Fri, 08 Aug 2014 20:10:17 GMT
additions to enable streams-api


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/f9d484b8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/f9d484b8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/f9d484b8

Branch: refs/heads/master
Commit: f9d484b8421640e501e84f1c056b079a1404446d
Parents: c454d52
Author: Steve Blackmon <sblackmon@w2odigital.com>
Authored: Tue Jul 15 16:59:23 2014 -0500
Committer: Steve Blackmon <sblackmon@w2odigital.com>
Committed: Sun Jul 27 19:14:12 2014 -0500

----------------------------------------------------------------------
 pom.xml                                                   |  2 +-
 streams-contrib/streams-provider-datasift/pom.xml         |  2 +-
 .../datasift/provider/DatasiftStreamConfigurator.java     | 10 ++++------
 .../streams/datasift/provider/DatasiftStreamProvider.java |  8 ++++++--
 4 files changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/f9d484b8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index eebd5be..419ef89 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,7 +60,7 @@
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <java.version>1.6</java.version>
+        <java.version>1.7</java.version>
         <org.osgi.service.http.port>8080</org.osgi.service.http.port>
         <org.osgi.service.http.port.secure>8443</org.osgi.service.http.port.secure>
         <jackson.version>2.3.2</jackson.version>

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/f9d484b8/streams-contrib/streams-provider-datasift/pom.xml
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/pom.xml b/streams-contrib/streams-provider-datasift/pom.xml
index 5c5f674..3b9f96f 100644
--- a/streams-contrib/streams-provider-datasift/pom.xml
+++ b/streams-contrib/streams-provider-datasift/pom.xml
@@ -83,7 +83,7 @@
 
     <build>
         <sourceDirectory>src/main/java</sourceDirectory>
-        <testSourceDirectory>src/test/java</testSourceDirectory>
+        <testSourceDirectory>src/test/java17</testSourceDirectory>
         <resources>
             <resource>
                 <directory>src/main/resources</directory>

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/f9d484b8/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamConfigurator.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamConfigurator.java
b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamConfigurator.java
index d85d6e5..7025d39 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamConfigurator.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamConfigurator.java
@@ -19,7 +19,9 @@ under the License.
 package org.apache.streams.datasift.provider;
 
 import com.typesafe.config.Config;
+import com.typesafe.config.ConfigRenderOptions;
 import org.apache.streams.datasift.DatasiftConfiguration;
+import org.apache.streams.jackson.StreamsJacksonMapper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -32,12 +34,8 @@ public class DatasiftStreamConfigurator {
 
     public static DatasiftConfiguration detectConfiguration(Config datasift) {
 
-        DatasiftConfiguration datasiftConfiguration = new DatasiftConfiguration();
-
-        datasiftConfiguration.setApiKey(datasift.getString("apiKey"));
-        datasiftConfiguration.setUserName(datasift.getString("userName"));
-        datasiftConfiguration.setStreamHash(datasift.getStringList("hashes"));
-
+        DatasiftConfiguration datasiftConfiguration;
+        datasiftConfiguration = StreamsJacksonMapper.getInstance().convertValue(datasift.root().render(ConfigRenderOptions.concise()),
DatasiftConfiguration.class);
         return datasiftConfiguration;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/f9d484b8/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamProvider.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamProvider.java
b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamProvider.java
index 0dc4c92..09c01b0 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamProvider.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamProvider.java
@@ -55,7 +55,7 @@ public class DatasiftStreamProvider implements StreamsProvider {
     private final static Logger LOGGER = LoggerFactory.getLogger(DatasiftStreamProvider.class);
 
     private DatasiftConfiguration config;
-    private ConcurrentLinkedQueue<Interaction> interactions;
+    private ConcurrentLinkedQueue<Interaction> interactions = new ConcurrentLinkedQueue<Interaction>();
     private Map<String, DataSiftClient> clients;
     private StreamEventListener eventListener;
     private ObjectMapper mapper;
@@ -69,6 +69,11 @@ public class DatasiftStreamProvider implements StreamsProvider {
         this(listener, null);
     }
 
+    // to set up a webhook we need to be able to return a reference to this queue
+    public Queue<Interaction> getInteractions() {
+        return interactions;
+    }
+
     /**
      * @param listener {@link com.datasift.client.stream.StreamEventListener} that handles
deletion notices received from twitter.
      * @param config   Configuration to use
@@ -184,7 +189,6 @@ public class DatasiftStreamProvider implements StreamsProvider {
         return null;
     }
 
-    @Override
     public StreamsResultSet readRange(DateTime start, DateTime end) {
         return null;
     }


Mime
View raw message