streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbnks <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: Streams 121
Date Mon, 14 Jul 2014 15:09:27 GMT
Github user rbnks commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/53#discussion_r14882859
  
    --- Diff: streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/provider/InstagramRecentMediaProvider.java
---
    @@ -0,0 +1,101 @@
    +package org.apache.streams.instagram.provider;
    +
    +import com.google.common.collect.Queues;
    +import org.apache.streams.config.StreamsConfigurator;
    +import org.apache.streams.core.StreamsDatum;
    +import org.apache.streams.core.StreamsProvider;
    +import org.apache.streams.core.StreamsResultSet;
    +import org.apache.streams.instagram.InstagramConfigurator;
    +import org.apache.streams.instagram.InstagramUserInformationConfiguration;
    +import org.jinstagram.entity.users.feed.MediaFeedData;
    +import org.joda.time.DateTime;
    +
    +import java.math.BigInteger;
    +import java.util.Queue;
    +import java.util.concurrent.ExecutorService;
    +import java.util.concurrent.Executors;
    +import java.util.concurrent.TimeUnit;
    +
    +/**
    + * Instagram {@link org.apache.streams.core.StreamsProvider} that provides the recent
media data for a group of users
    + */
    +public class InstagramRecentMediaProvider implements StreamsProvider {
    +
    +    private InstagramUserInformationConfiguration config;
    +    private InstagramRecentMediaCollector dataCollector;
    +    protected Queue<MediaFeedData> mediaFeedQueue; //exposed for testing
    +    private ExecutorService executorService;
    +    private volatile boolean isCompleted;
    --- End diff --
    
    Are you referring to line 28? A volatile variable is all that is need here because it
is only read and written too.  There are no read then updates.  http://www.javamex.com/tutorials/synchronization_volatile.shtml


---
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