Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Query Consolidation::Auto to JNI and Kotlin API #158

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/src/main/kotlin/io.zenoh/ZGet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class ZGet(private val emptyArgs: Boolean) : CliktCommand(
selector.intoSelector().onSuccess { selector ->
selector.use {
session.get(selector)
.consolidation(ConsolidationMode.NONE)
.timeout(Duration.ofMillis(timeout))
.apply {
target?.let {
Expand Down
7 changes: 4 additions & 3 deletions zenoh-jni/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ pub(crate) fn decode_query_target(target: jint) -> Result<QueryTarget> {

pub(crate) fn decode_consolidation(consolidation: jint) -> Result<ConsolidationMode> {
match consolidation {
0 => Ok(ConsolidationMode::None),
1 => Ok(ConsolidationMode::Monotonic),
2 => Ok(ConsolidationMode::Latest),
0 => Ok(ConsolidationMode::Auto),
1 => Ok(ConsolidationMode::None),
2 => Ok(ConsolidationMode::Monotonic),
3 => Ok(ConsolidationMode::Latest),
value => Err(session_error!("Unable to decode consolidation '{}'", value)),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ package io.zenoh.query

/** The kind of consolidation. */
enum class ConsolidationMode {
/** Apply automatic consolidation based on queryable's preferences. */
AUTO,

/** No consolidation applied: multiple samples may be received for the same key-timestamp.*/
NONE,

Expand Down