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

Fix/createdb #162

Merged
merged 18 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b214c10
build: Sync with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#119)
eclipse-zenoh-bot May 22, 2024
fc46db4
fix: createdb not functioning due to application/json header in request
Charles-Schleich May 28, 2024
a2521ec
build: Sync with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#120)
eclipse-zenoh-bot May 29, 2024
aa57f57
fix: Createdb + implemen get_all_entries
Charles-Schleich May 29, 2024
a98e50b
fix: fmt
Charles-Schleich May 29, 2024
d093bc1
build: Sync with eclipse-zenoh/zenoh@009f666 from 2024-05-30 (#122)
eclipse-zenoh-bot May 31, 2024
5a51995
fix: createdb + impl get_all_queries, cleanup
Charles-Schleich May 31, 2024
ca5409e
build: Sync with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#123)
eclipse-zenoh-bot Jun 4, 2024
063b579
build: Sync with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#124)
eclipse-zenoh-bot Jun 6, 2024
fdf5720
build: Sync with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#125)
eclipse-zenoh-bot Jun 11, 2024
9d8a353
build: Sync with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#126)
eclipse-zenoh-bot Jun 12, 2024
bedc328
build: Sync with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#127)
eclipse-zenoh-bot Jun 13, 2024
1626e58
Merge updated Cargo.lock
Charles-Schleich Jun 13, 2024
64936ee
Merge dev/1.0.0 -> fix/createdb
Charles-Schleich Jul 8, 2024
9a036b2
cleanup old comments, small refactor, fix empty query string bug
Charles-Schleich Jul 10, 2024
fce2f35
Cleanup, re-write get to build up query, include wildcard keyexpressi…
Charles-Schleich Jul 22, 2024
2090f85
cleanup, add lazy execution if no KeyExpr in function calls, refactor…
Charles-Schleich Jul 28, 2024
679787c
remove debug
Charles-Schleich Jul 30, 2024
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.94"
tracing = "0.1"
uuid = { version = "1.3.0", features = ["v4"] }

zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", features = [
"unstable",
"internal",
Expand Down
16 changes: 6 additions & 10 deletions v1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,16 @@ impl Storage for InfluxDbStorage {
// Note: tags are stored as strings in InfluxDB, while fileds are typed.
// For simpler/faster deserialization, we store encoding, timestamp and base64 as fields.
// while the kind is stored as a tag to be indexed by InfluxDB and have faster queries on it.
let encoding_string_rep = value.encoding().clone().to_string(); // add_field only supports Strings and not Vec<u8>
let encoding: Encoding = (value.encoding().clone()).into();
let encoding_string_rep = value.encoding().to_string(); // add_field only supports Strings and not Vec<u8>
let encoding: &Encoding = value.encoding();

let query = InfluxWQuery::new(
InfluxTimestamp::Nanoseconds(influx_time),
measurement.clone(),
)
.add_tag("kind", "PUT")
.add_field("timestamp", timestamp.to_string())
.add_field("encoding_prefix", u16::from(encoding.id()))
.add_field("encoding_prefix", encoding.id())
.add_field("encoding_suffix", encoding_string_rep) // TODO: Rename To Encoding and only keep String rep
.add_field("base64", base64)
.add_field("value", strvalue);
Expand Down Expand Up @@ -501,7 +501,7 @@ impl Storage for InfluxDbStorage {
key: Option<OwnedKeyExpr>,
parameters: &str,
) -> ZResult<Vec<StoredData>> {
let measurement = match key.clone() {
let measurement = match key {
Some(k) => k,
None => OwnedKeyExpr::from_str(NONE_KEY).unwrap(),
};
Expand All @@ -527,7 +527,7 @@ impl Storage for InfluxDbStorage {
base64: bool,
value: String,
}
debug!("Get {:?} with Influx query: {}", key, influx_query_str);

let mut result = Vec::new();
match self.client.json_query(influx_query).await {
Ok(mut query_result) => {
Expand All @@ -551,13 +551,9 @@ impl Storage for InfluxDbStorage {
// for each point
for zpoint in serie.values {
// get the encoding
let encoding_prefix: u16 =
zpoint.encoding_prefix.try_into().map_err(|_| {
zerror!("Unknown encoding {}", zpoint.encoding_prefix)
})?;

let encoding = if zpoint.encoding_suffix.is_empty() {
Encoding::new(encoding_prefix, None)
Encoding::new(zpoint.encoding_prefix.into(), None)
} else {
Encoding::from(zpoint.encoding_suffix)
};
Expand Down
3 changes: 2 additions & 1 deletion v2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ base64 = { workspace = true }
chrono = { version = "0.4.31", features = ["serde"] }
futures = "0.3.28"
git-version = { workspace = true }
influxdb2 = { version = "0.4.5", features = [

influxdb2 = { version = "0.5.2", features = [
"rustls",
], default-features = false }
influxdb2-derive = "0.1.1"
Expand Down
Loading