Skip to content

Commit

Permalink
chore: rename generated binary from datanode to uniffle-worker
Browse files Browse the repository at this point in the history
  • Loading branch information
zuston committed Jul 25, 2023
1 parent 8808554 commit b35c9f1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[[bin]]
name="datanode"
name="uniffle-worker"
path= "src/main.rs"

[lib]

This comment has been minimized.

Copy link
@advancedxy

advancedxy Jul 27, 2023

Contributor

the name in the lib doesn't change...

I think maybe a follow up pr is needed to rename other occurrences.

This comment has been minimized.

Copy link
@zuston

zuston Jul 27, 2023

Author Owner

This is not the critical problem.

This comment has been minimized.

Copy link
@advancedxy

advancedxy Jul 27, 2023

Contributor

Of cause. But it's better to have code consistence.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ push_gateway_endpoint = "http://xxxxxxxxxxxxxx/pushgateway"

## Run

`DATANODE_IP={ip} RUST_LOG=info DATANODE_CONFIG_PATH=./config.toml ./datanode`
`WORKER_IP={ip} RUST_LOG=info WORKER_CONFIG_PATH=./config.toml ./uniffle-worker`

### HDFS Setup

Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl StorageType {
}
}

const CONFIG_FILE_PATH_KEY: &str = "DATANODE_CONFIG_PATH";
const CONFIG_FILE_PATH_KEY: &str = "WORKER_CONFIG_PATH";

impl Config {
pub fn create_from_env() -> Config {
Expand Down
4 changes: 3 additions & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ use std::net::IpAddr;
use std::sync::Mutex;
use std::time::{SystemTime, UNIX_EPOCH};

const WORKER_IP: &str = "WORKER_IP";

pub fn get_local_ip() -> Result<IpAddr, std::io::Error> {
let ip = std::env::var("DATANODE_IP");
let ip = std::env::var(WORKER_IP);
if ip.is_ok() {
Ok(ip.unwrap().parse().unwrap())
} else {
Expand Down

0 comments on commit b35c9f1

Please sign in to comment.