[
https://issues.apache.org/jira/browse/BAHIR-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16077635#comment-16077635
]
ASF GitHub Bot commented on BAHIR-110:
--------------------------------------
Github user emlaver commented on a diff in the pull request:
https://github.com/apache/bahir/pull/45#discussion_r126073211
--- Diff:
sql-cloudant/src/main/scala/org/apache/bahir/cloudant/CloudantChangesConfig.scala
---
@@ -0,0 1,108 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.bahir.cloudant
import org.apache.bahir.cloudant.common.JsonStoreConfigManager
class CloudantChangesConfig(protocol: String, host: String, dbName: String,
indexName: String = null, viewName: String =
null)
(username: String, password: String,
partitions: Int,
maxInPartition: Int, minInPartition: Int,
requestTimeout: Long,
bulkSize: Int, schemaSampleSize: Int,
createDBOnSave: Boolean, apiReceiver: String,
selector: String,
useQuery: Boolean, queryLimit: Int)
extends CloudantConfig(protocol, host, dbName, indexName,
viewName)(username, password,
partitions, maxInPartition, minInPartition, requestTimeout, bulkSize,
schemaSampleSize,
createDBOnSave, apiReceiver, selector, useQuery, queryLimit) {
override val defaultIndex: String = apiReceiver
def getChangesUrl: String = {
dbUrl "/" defaultIndex "?include_docs=true&feed=normal"
}
def getContinuousChangesUrl: String = {
var url = dbUrl "/" defaultIndex
"?include_docs=true&feed=continuous&heartbeat=3000"
if (selector != null) {
url = url "&filter=_selector"
}
url
}
override def getTotalUrl(url: String): String = {
if (url.contains('?')) {
if (selector != null) {
url "&limit=1&filter=_selector"
} else {
url "&limit=1"
}
} else {
if (selector != null) {
url "?limit=1&filter=_selector"
} else {
url "?limit=1"
}
}
}
--- End diff --
Removed in 47064b7.
> Replace use of _all_docs API with _changes API in all receivers
> ---------------------------------------------------------------
>
> Key: BAHIR-110
> URL: https://issues.apache.org/jira/browse/BAHIR-110
> Project: Bahir
> Issue Type: Improvement
> Reporter: Esteban Laver
> Original Estimate: 216h
> Remaining Estimate: 216h
>
> Today we use the _changes API for Spark streaming receiver and _all_docs API
> for non-streaming receiver. _all_docs API supports parallel reads (using
> offset and range) but performance of _changes API is still better in most
> cases (even with single threaded support).
> With this ticket we want to:
> a) re-implement all receivers using _changes API
> b) compare performance between the two implementations based on _changes and
> _all_docs
> Based on the results in b) we could decide to either
> - replace _all_docs implementation with _changes based implementation OR
> - allow customers to pick one (with a solid documentation about pros and
> cons)
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)