ASF GitHub Bot commented on BAHIR-154:

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

    --- Diff: 
sql-cloudant/src/main/scala/org/apache/bahir/cloudant/CloudantConfig.scala ---
    @@ -54,20 +147,21 @@ class CloudantConfig(val protocol: String, val host: 
    -  def getLastNum(result: JsValue): JsValue = (result \ "last_seq").get
    +  def getClientUrl: URL = {
    +    new URL(protocol + "://" + host)
    +  }
    +  def getLastNum(result: JsonObject): JsonObject = 
       /* Url containing limit for docs in a Cloudant database.
       * If a view is not defined, use the _all_docs endpoint.
       * @return url with one doc limit for retrieving total doc count
       def getUrl(limit: Int, excludeDDoc: Boolean = false): String = {
    --- End diff --
    The comment suggests that this method is used to get a URL with a `limit=1` 
for the purposes of getting a doc count, but then it is not used by 
`getTotalDocCount` it does however appear to be used by `getMany` with a 
different limit for query results.
    FWIW I can't see `getTotalDocCount` being called anywhere in the new code 

> Refactor sql-cloudant to use Cloudant's java-cloudant features
> --------------------------------------------------------------
>                 Key: BAHIR-154
>                 URL: https://issues.apache.org/jira/browse/BAHIR-154
>             Project: Bahir
>          Issue Type: Improvement
>    Affects Versions: Spark-2.2.0
>            Reporter: Esteban Laver
>            Assignee: Esteban Laver
> Cloudant's java-cloudant library (which is currently used for testing) 
> contains several features that sql-cloudant can benefit from:
> - HTTP 429 backoff
> - View builder API to potentially simplify loading for _all_docs/views
> - Improved exception handling when executing HTTP requests
> - Future support for IAM API key
> Would need to replace current scala HTTP library with OkHttp library, and 
> also replace play-json with GSON library.

This message was sent by Atlassian JIRA

Reply via email to