[
https://issues.apache.org/jira/browse/BAHIR-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16313233#comment-16313233
]
ASF GitHub Bot commented on BAHIR-154:
--------------------------------------
Github user ricellis commented on a diff in the pull request:
https://github.com/apache/bahir/pull/61#discussion_r159847773
--- Diff:
sql-cloudant/src/main/scala/org/apache/bahir/cloudant/CloudantConfig.scala ---
@@ -54,20 +147,21 @@ class CloudantConfig(val protocol: String, val host:
String,
createDBOnSave
}
- def getLastNum(result: JsValue): JsValue = (result \ "last_seq").get
+ def getClientUrl: URL = {
+ new URL(protocol + "://" + host)
+ }
+
+ def getLastNum(result: JsonObject): JsonObject =
result.get("last_seq").getAsJsonObject
/* 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
either.
> 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
(v6.4.14#64029)