streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (STREAMS-371) Allow use of ids endpoints in TwitterFollowingProvider
Date Mon, 19 Oct 2015 14:20:05 GMT

    [ https://issues.apache.org/jira/browse/STREAMS-371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963367#comment-14963367
] 

ASF GitHub Bot commented on STREAMS-371:
----------------------------------------

Github user eponvert commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/263#discussion_r42376075
  
    --- Diff: streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterFollowingProviderTask.java
---
    @@ -144,6 +165,57 @@ else if( endpoint.equals("friends") )
             } while (curser != 0 && keepTrying < 10);
         }
     
    +    private void collectIds(Long id) {
    +        int keepTrying = 0;
    +
    +        long curser = -1;
    +
    +        do
    +        {
    +            try
    +            {
    +                twitter4j.IDs ids = null;
    +                if( endpoint.equals("followers") )
    +                    ids = client.friendsFollowers().getFollowersIDs(id.longValue(), curser,
max_per_page);
    +                else if( endpoint.equals("friends") )
    +                    ids = client.friendsFollowers().getFriendsIDs(id.longValue(), curser,
max_per_page);
    +
    +                Preconditions.checkNotNull(ids);
    --- End diff --
    
    This is a little roundabout, right? The conditions where `ids == null` is where either
`!endpoint.equals("followers")` or `!endpoint.equals("friends")`. Really the Preconditions
should be checking *that*, and throwing a more verbose exception in the case it fails.


> Allow use of ids endpoints in TwitterFollowingProvider
> ------------------------------------------------------
>
>                 Key: STREAMS-371
>                 URL: https://issues.apache.org/jira/browse/STREAMS-371
>             Project: Streams
>          Issue Type: Improvement
>            Reporter: Steve Blackmon
>            Assignee: Steve Blackmon
>
> Allow use of ids endpoints in TwitterFollowingProvider
> These ids have higher throughput than the endpoints the provider currently uses, at the
cost of getting only IDs rather than full profiles.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message