streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steveblackmon <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: Streams 138
Date Tue, 05 Aug 2014 14:55:49 GMT
Github user steveblackmon commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/59#discussion_r15817614
  
    --- Diff: streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftPushProvider.java
---
    @@ -0,0 +1,133 @@
    +/*
    +Licensed to the Apache Software Foundation (ASF) under one
    +or more contributor license agreements.  See the NOTICE file
    +distributed with this work for additional information
    +regarding copyright ownership.  The ASF 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 org.apache.streams.datasift.provider;
    +
    +import com.datasift.client.stream.DeletedInteraction;
    +import com.datasift.client.stream.StreamEventListener;
    +import com.google.common.base.Preconditions;
    +import com.google.common.collect.Queues;
    +import org.apache.streams.core.StreamsDatum;
    +import org.apache.streams.core.StreamsProvider;
    +import org.apache.streams.core.StreamsResultSet;
    +import org.apache.streams.datasift.DatasiftConfiguration;
    +import org.joda.time.DateTime;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.math.BigInteger;
    +import java.util.Queue;
    +import java.util.concurrent.locks.ReadWriteLock;
    +import java.util.concurrent.locks.ReentrantReadWriteLock;
    +
    +/**
    + * Requires Java Version 1.7!
    + * {@code DatasiftStreamProvider} is an implementation of the {@link org.apache.streams.core.StreamsProvider}
interface.  The provider
    + * uses the Datasift java api to make connections. A single provider creates one connection
per StreamHash in the configuration.
    + */
    +public class DatasiftPushProvider implements StreamsProvider {
    --- End diff --
    
    This class is meant to be extended / wrapped in a manner similar to this:
    https://github.com/w2ogroup/streams-examples/tree/master/datasift-webhook
    
    If there is a generic method already in streams to collect json documents from a ServerSocket
and route them into downstream processors and persisters, we should explore that and deprecate
this approach.  It was not obvious to me how to make that happen within the existing code
base.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message