You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jason Brown (JIRA)" <ji...@apache.org> on 2018/01/17 20:55:00 UTC
[jira] [Comment Edited] (CASSANDRA-13855) URL Seed provider
[ https://issues.apache.org/jira/browse/CASSANDRA-13855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16328759#comment-16328759 ]
Jason Brown edited comment on CASSANDRA-13855 at 1/17/18 8:54 PM:
------------------------------------------------------------------
[~gangil] This is a nice start, thanks!. Here are my initial thoughts:
- you don't need a reference to {{Config}}. By convention, usually do everything config-related through {{DatabaseDescriptor}}
- you don't need to instantiate a new {{ArrayList}} in {{#getSeeds()}} (right before the try block), as that instance only used in the case of an exception being thrown. In that case we can collapse the two {{catch}} blocks down to one, and just create the empty {{ArrayList}} there (You might be able to use {{Collections#emptyList}} to avoid instantiating an empty list).
- set connect and read timeouts. You already have the {{URLConnection}} object, so you can call {{#setReadTimeout}} and so on before opening up the input stream (the socket/connection is lazily created at that point, not when when you instantiate the {{URLConnection}})
- retry logic - I'm not sure we need this (or if it's beyond the scope of this ticket), or we can do it in a follow up ticket. wdyt, [~rustyrazorblade]?
- TLS support - If we do need this, we can do this in a follow up ticket
- in {{#getUrlContent}}, please close the resources in a {{finally}} block.
- might want to log a warning if there are no seeds returned from the call
was (Author: jasobrown):
[~akash] This is a nice start, thanks!. Here are my initial thoughts:
- you don't need a reference to {{Config}}. By convention, usually do everything config-related through {{DatabaseDescriptor}}
- you don't need to instantiate a new {{ArrayList}} in {{#getSeeds()}} (right before the try block), as that instance only used in the case of an exception being thrown. In that case we can collapse the two {{catch}} blocks down to one, and just create the empty {{ArrayList}} there (You might be able to use {{Collections#emptyList}} to avoid instantiating an empty list).
- set connect and read timeouts. You already have the {{URLConnection}} object, so you can call {{#setReadTimeout}} and so on before opening up the input stream (the socket/connection is lazily created at that point, not when when you instantiate the {{URLConnection}})
- retry logic - I'm not sure we need this (or if it's beyond the scope of this ticket), or we can do it in a follow up ticket. wdyt, [~rustyrazorblade]?
- TLS support - If we do need this, we can do this in a follow up ticket
- in {{#getUrlContent}}, please close the resources in a {{finally}} block.
- might want to log a warning if there are no seeds returned from the call
> URL Seed provider
> -----------------
>
> Key: CASSANDRA-13855
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13855
> Project: Cassandra
> Issue Type: Improvement
> Components: Coordination, Core
> Reporter: Jon Haddad
> Assignee: Akash Gangil
> Priority: Minor
> Labels: lhf
> Attachments: 0001-Add-URL-Seed-Provider-trunk.txt
>
>
> Seems like including a dead simple seed provider that can fetch from a URL, 1 line per seed, would be useful.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org