Skip to content

Commit

Permalink
feat: announce disable shared for scheduler (#735)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Sep 14, 2024
1 parent 9174799 commit e0914ff
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
40 changes: 20 additions & 20 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dragonfly-client-backend = { path = "dragonfly-client-backend", version = "0.1.1
dragonfly-client-util = { path = "dragonfly-client-util", version = "0.1.108" }
dragonfly-client-init = { path = "dragonfly-client-init", version = "0.1.108" }
thiserror = "1.0"
dragonfly-api = "=2.0.154"
dragonfly-api = "=2.0.157"
reqwest = { version = "0.12.4", features = ["stream", "native-tls", "default-tls", "rustls-tls"] }
rcgen = { version = "0.12.1", features = ["x509-parser"] }
hyper = { version = "1.4", features = ["full"] }
Expand Down
4 changes: 4 additions & 0 deletions dragonfly-client-config/src/dfdaemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,9 @@ pub struct Upload {
// server is the upload server configuration for dfdaemon.
pub server: UploadServer,

// disable_shared indicates whether disable to share data for other peers.
pub disable_shared: bool,

// rate_limit is the rate limit of the upload speed in GiB/Mib/Kib per second.
#[serde(with = "bytesize_serde", default = "default_upload_rate_limit")]
pub rate_limit: ByteSize,
Expand All @@ -449,6 +452,7 @@ impl Default for Upload {
fn default() -> Self {
Upload {
server: UploadServer::default(),
disable_shared: false,
rate_limit: default_upload_rate_limit(),
}
}
Expand Down
2 changes: 0 additions & 2 deletions dragonfly-client-storage/src/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ impl Content {
#[instrument(skip_all)]
pub async fn read_task_by_range(&self, task_id: &str, range: Range) -> Result<impl AsyncRead> {
let task_path = self.dir.join(task_id);

let mut from_f = File::open(task_path.as_path()).await.map_err(|err| {
error!("open {:?} failed: {}", task_path, err);
err
Expand Down Expand Up @@ -243,7 +242,6 @@ impl Content {
range: Option<Range>,
) -> Result<impl AsyncRead> {
let task_path = self.dir.join(task_id);

if let Some(range) = range {
let target_offset = max(offset, range.start);
let target_length =
Expand Down
1 change: 1 addition & 0 deletions dragonfly-client/src/announcer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ impl SchedulerAnnouncer {

// TODO: Get scheduler cluster id from dynconfig.
scheduler_cluster_id: 0,
disable_shared: self.config.upload.disable_shared,
};

Ok(AnnounceHostRequest {
Expand Down

0 comments on commit e0914ff

Please sign in to comment.