Skip to content

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

@GG2002

Description

@GG2002

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions