streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject [07/41] git commit: making setup method non-static again
Date Thu, 04 Sep 2014 17:11:55 GMT
making setup method non-static again


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

Branch: refs/heads/pp
Commit: 1360223d93c458412ac6b4b3c36b5ba069cb693b
Parents: e6380ce
Author: sblackmon <sblackmon@w2odigital.com>
Authored: Fri Aug 8 15:25:21 2014 -0500
Committer: sblackmon <sblackmon@apache.org>
Committed: Tue Aug 12 18:04:23 2014 -0500

----------------------------------------------------------------------
 .../streams/datasift/provider/DatasiftManagedSourceSetup.java  | 3 ++-
 .../streams/datasift/provider/DatasiftStreamConfigurator.java  | 6 +++++-
 .../streams/datasift/provider/DatasiftStreamProvider.java      | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/1360223d/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftManagedSourceSetup.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftManagedSourceSetup.java
b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftManagedSourceSetup.java
index 6e648e7..03bd7d1 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftManagedSourceSetup.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftManagedSourceSetup.java
@@ -54,7 +54,8 @@ public class DatasiftManagedSourceSetup implements Runnable {
     }
 
     public void setup() {
-        client = DatasiftStreamProvider.getNewClient(config.getUserName(), config.getApiKey());
+
+        client = new DatasiftStreamProvider(null, config).getNewClient(config.getUserName(),
config.getApiKey());
     }
 
     public void current() {

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/1360223d/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 5726b4f..07716a1 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
@@ -18,9 +18,11 @@ under the License.
 */
 package org.apache.streams.datasift.provider;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.typesafe.config.Config;
 import com.typesafe.config.ConfigRenderOptions;
 import org.apache.streams.datasift.DatasiftConfiguration;
+import org.apache.streams.datasift.util.StreamsDatasiftMapper;
 import org.apache.streams.jackson.StreamsJacksonMapper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -32,12 +34,14 @@ public class DatasiftStreamConfigurator {
 
     private final static Logger LOGGER = LoggerFactory.getLogger(DatasiftStreamConfigurator.class);
 
+    private static final ObjectMapper MAPPER = StreamsDatasiftMapper.getInstance();
+
     public static DatasiftConfiguration detectConfiguration(Config datasift) {
 
         DatasiftConfiguration datasiftConfiguration = null;
 
         try {
-            datasiftConfiguration = mapper.readValue(datasift.root().render(ConfigRenderOptions.concise()),
DatasiftConfiguration.class);
+            datasiftConfiguration = MAPPER.readValue(datasift.root().render(ConfigRenderOptions.concise()),
DatasiftConfiguration.class);
         } catch (Exception e) {
             e.printStackTrace();
             LOGGER.warn("Could not parse datasiftConfiguration");

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/1360223d/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 c3f5ea3..8ed1443 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
@@ -128,7 +128,7 @@ public class DatasiftStreamProvider implements StreamsProvider {
      * @param apiKey
      * @return
      */
-    protected static DataSiftClient getNewClient(String userName, String apiKey) {
+    protected DataSiftClient getNewClient(String userName, String apiKey) {
         return new DataSiftClient(new DataSiftConfig(userName, apiKey));
     }
 


Mime
View raw message