Skip to content

Commit

Permalink
Digital Twin Graph
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbeitz committed May 3, 2024
1 parent 532a84e commit f3b11fd
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ members = [
"samples/common",
"samples/protobuf_data_access",
"samples/command",
"samples/graph",
"samples/digital_twin_graph",
"samples/managed_subscribe",
"samples/mixed",
"samples/property",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ IBEJI_HOME=/etc/ibeji ./invehicle-digital-twin
The above example tells `invehicle-digital-twin` to load configuration files from `/etc/ibeji` instead of using
the current working directory.

Chariott may be used to discover the in-vehicle digital twin service. We will discuss how to enable this feature.
Chariott may be used to discover the in-vehicle digital twin service. We will discuss how to enable this feature in the section on [Using Chariott](#using-chariott).

### <a name="property-sample">Property Sample</a>

Expand Down
10 changes: 5 additions & 5 deletions core/module/digital_twin_graph/src/digital_twin_graph_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl DigitalTwinGraph for DigitalTwinGraphImpl {
.map_err(tonic::Status::internal)?;

// Build a map of instance id to its associated endpoint infos.
let instance_provide_map: std::collections::HashMap<String, Vec<EndpointInfo>> =
let instance_provider_map: std::collections::HashMap<String, Vec<EndpointInfo>> =
provider_endpoint_info_list
.iter()
.map(|provider_endpoint_info| {
Expand All @@ -203,9 +203,9 @@ impl DigitalTwinGraph for DigitalTwinGraphImpl {

let mut values = vec![];

for instance_id in instance_provide_map.keys() {
for instance_id in instance_provider_map.keys() {
// We will only use the first provider. For a high availability scenario, we can try multiple providers.
let provider_endpoint_info = &instance_provide_map[instance_id][0];
let provider_endpoint_info = &instance_provider_map[instance_id][0];

let provider_uri = provider_endpoint_info.uri.clone();
let instance_id = provider_endpoint_info.context.clone();
Expand Down Expand Up @@ -317,7 +317,7 @@ impl DigitalTwinGraph for DigitalTwinGraphImpl {
.map_err(tonic::Status::internal)?;

if provider_endpoint_info_list.is_empty() {
return Err(tonic::Status::internal("No providers found"));
return Err(tonic::Status::not_found("No providers found"));
}

// We will only use the first provider.
Expand Down Expand Up @@ -438,7 +438,7 @@ impl DigitalTwinGraph for DigitalTwinGraphImpl {
.map_err(tonic::Status::internal)?;

if provider_endpoint_info_list.is_empty() {
return Err(tonic::Status::internal("No providers found"));
return Err(tonic::Status::not_found("No providers found"));
}

// We will only use the first provider.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: MIT

[package]
name = "samples-graph"
name = "samples-digital-twin-graph"
version = "0.1.0"
edition = "2021"
license = "MIT"
Expand Down
File renamed without changes.

0 comments on commit f3b11fd

Please sign in to comment.