bahir-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ricellis <>
Subject [GitHub] bahir pull request #61: [BAHIR-154] Refactor sql-cloudant to use Cloudant's ...
Date Fri, 05 Jan 2018 14:49:58 GMT
Github user ricellis commented on a diff in the pull request:
    --- Diff: sql-cloudant/src/main/scala/org/apache/bahir/cloudant/CloudantConfig.scala ---
    @@ -16,34 +16,127 @@
     package org.apache.bahir.cloudant
    +import{URL, URLEncoder}
    -import play.api.libs.json.{JsArray, JsObject, Json, JsValue}
    +import scala.collection.JavaConverters._
    +import scala.collection.mutable
    +import com.cloudant.client.api.{ClientBuilder, CloudantClient, Database}
    +import com.cloudant.client.api.model.SearchResult
    +import com.cloudant.client.api.views._
    +import com.cloudant.http.{Http, HttpConnection}
    +import com.cloudant.http.interceptors.Replay429Interceptor
    +import{JsonObject, JsonParser}
     import org.apache.bahir.cloudant.common._
    +import org.apache.bahir.cloudant.common.JsonUtil.JsonConverter
     * Only allow one field pushdown now
     * as the filter today does not tell how to link the filters out And v.s. Or
     class CloudantConfig(val protocol: String, val host: String,
    -                     val dbName: String, val indexName: String, val viewName: String)
    +                     val dbName: String, val indexPath: String, val viewPath: String)
                         (implicit val username: String, val password: String,
                          val partitions: Int, val maxInPartition: Int, val minInPartition:
                          val requestTimeout: Long, val bulkSize: Int, val schemaSampleSize:
                          val createDBOnSave: Boolean, val endpoint: String,
                          val useQuery: Boolean = false, val queryLimit: Int)
       extends Serializable {
    +  @transient private lazy val client: CloudantClient = ClientBuilder
    +    .url(getClientUrl)
    +    .username(username)
    +    .password(password)
    +    .interceptors(Replay429Interceptor.WITH_DEFAULTS)
    --- End diff --
    It may be worth adding an additional interceptor here to change/augment the UA.


View raw message