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

Why is nebula-client in this repo inconsistent with crates.io? #21

Closed
GG2002 opened this issue Jul 7, 2024 · 5 comments
Closed

Why is nebula-client in this repo inconsistent with crates.io? #21

GG2002 opened this issue Jul 7, 2024 · 5 comments

Comments

@GG2002
Copy link

GG2002 commented Jul 7, 2024

General Question

I tried to run code in demos/tokio/src/v3_graph_client.rs in my new project, and I wrote Cargo.toml as follows:

[package]
name = "test-nebula-rust"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# non-pool
fbthrift-transport = { version = "0.9", features = ["impl_tokio"] }
nebula-client = { version = "0.7.3", features = ["graph", "storage", "meta"] }

# bb8
bb8 = { version = "0.8" }
bb8-nebula = { version = "0.9", features = ["graph"] }

# common
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

When I run cargo run 127.0.0.1 9669 root 'password', it raised an error: Error: DataDeserializeError(DataDeserializeError { field: None, kind: Custom("missing field HTTP port") }).

I found that in this repo, the code in nebula-client/src/v3/graph/client.rs is written like this:

const STMT_SHOW_HOSTS: &[u8] = b"SHOW HOSTS;";
#[derive(Deserialize, Debug)]
pub struct Host {
    #[serde(rename(deserialize = "Host"))]
    pub host: String,
    #[serde(rename(deserialize = "Port"))]
    pub port: u16,
    // #[serde(rename(deserialize = "HTTP port"))]
    // pub http_port: u16,
    #[serde(rename(deserialize = "Status"))]
    pub status: String,
    #[serde(rename(deserialize = "Leader count"))]
    pub leader_count: u64,
    #[serde(rename(deserialize = "Leader distribution"))]
    pub leader_distribution: String,
    #[serde(rename(deserialize = "Partition distribution"))]
    pub partition_distribution: String,
    #[serde(rename(deserialize = "Version"))]
    pub version: String,
}

And in crates.io code is like this:

const STMT_SHOW_HOSTS: &[u8] = b"SHOW HOSTS;";
#[derive(Deserialize, Debug)]
pub struct Host {
    #[serde(rename(deserialize = "Host"))]
    pub host: String,
    #[serde(rename(deserialize = "Port"))]
    pub port: u16,
    #[serde(rename(deserialize = "HTTP port"))]
    pub http_port: u16,
    #[serde(rename(deserialize = "Status"))]
    pub status: String,
    #[serde(rename(deserialize = "Leader count"))]
    pub leader_count: u64,
    #[serde(rename(deserialize = "Leader distribution"))]
    pub leader_distribution: String,
    #[serde(rename(deserialize = "Partition distribution"))]
    pub partition_distribution: String,
    #[serde(rename(deserialize = "Version"))]
    pub version: String,
}

After I commented http_port, the code can run successfully.

So why is the code in this repo inconsistent with crates.io? What is this http_port used for? Can it be deleted?

@GG2002
Copy link
Author

GG2002 commented Jul 7, 2024

I noticed nebula-client in crates.io was published by vkill, what's the relationship between github.com/bk-rs/nebula-rs and this repo? I wanna do some work for nebula-client, which repo should I commit for?

@Nicole00
Copy link

Nicole00 commented Jul 16, 2024

I believe the correct one is nebula-client/src/v3/graph/client.rs, because it is the same with result of "show hosts".

image

the http port looks like useless, you can delete it. For nebula client in crates.io, maybe there's a extra useless field http port in old version.

@GG2002
Copy link
Author

GG2002 commented Jul 16, 2024

the http port looks like useless, you can delete it. For nebula client in crates.io, maybe there's a extra useless field http port in old version.

Thanks for your reply. I got it. So do you know which repo should I contribute for?
I wanna add result set for nebula-client, just like nebula-go and nebula-python do. If I contribute for vesoft-inc/nebula-rust, will these changes be updated in crates.io?

@Nicole00
Copy link

You can submit some pull requests for repo https://github.com/vesoft-inc/nebula-rust, It's very welcome~~~
When we deploy the nebula-rust with new version, the changes will be updated to crates.io.

@GG2002
Copy link
Author

GG2002 commented Jul 16, 2024

It's good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants