[
https://issues.apache.org/jira/browse/BAHIR-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16324219#comment-16324219
]
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_r161270944
--- Diff:
sql-cloudant/src/main/scala/org/apache/bahir/cloudant/common/JsonStoreDataAccess.scala
---
@@ -58,35 +54,30 @@ class JsonStoreDataAccess (config: CloudantConfig) {
}
}
- def getAll[T](url: String)
- (implicit columns: Array[String] = null): Seq[String] = {
- this.getQueryResult[Seq[String]](url, processAll)
- }
-
def getIterator(skip: Int, limit: Int, url: String)
(implicit columns: Array[String] = null,
postData: String = null): Iterator[String] = {
+ logger.info(s"Loading data from Cloudant using: $url , postData:
$postData")
val newUrl = config.getSubSetUrl(url, skip, limit, postData != null)
this.getQueryResult[Iterator[String]](newUrl, processIterator)
}
def getTotalRows(url: String, queryUsed: Boolean)
- (implicit postData: String = null): Int = {
- if (queryUsed) config.queryLimit // Query can not retrieve total row
now.
- else {
- val totalUrl = config.getTotalUrl(url)
- this.getQueryResult[Int](totalUrl,
- { result => config.getTotalRows(Json.parse(result))})
- }
+ (implicit postData: String = null): Int = {
--- End diff --
is this a bit too indented?
> 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)