Skip to content

Commit

Permalink
fix: import
Browse files Browse the repository at this point in the history
  • Loading branch information
hunjixin committed Aug 3, 2024
1 parent b67e591 commit eb2351d
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 35 deletions.
1 change: 0 additions & 1 deletion crates/compute_unit_runner/src/bin/compute_unit_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use jz_action::utils::StdIntoAnyhowResult;
use anyhow::{anyhow, Result};
use clap::Parser;
use media_data_tracker::MediaDataTracker;
use std::path::PathBuf;
use std::str::FromStr;
use std::sync::Arc;
use tokio::select;
Expand Down
3 changes: 1 addition & 2 deletions crates/compute_unit_runner/src/fs_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use jz_action::{
};
use std::{
collections::HashMap,
hash::Hash,
path::{Path, PathBuf},
sync::Arc,
time::Instant,
Expand Down Expand Up @@ -132,7 +131,7 @@ impl FileCache for MemCache {

async fn read(&self, id: &str) -> Result<MediaDataBatchResponse> {
let now = Instant::now();
let mut store = self.0.lock().await;
let store = self.0.lock().await;
let result = match store.get(id) {
Some(val) => Ok(val.clone()),
None => Err(anyhow!("data {} not foud", id)),
Expand Down
10 changes: 2 additions & 8 deletions crates/compute_unit_runner/src/media_data_tracker.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
use crate::fs_cache::FileCache;
use crate::ipc::{AvaiableDataResponse, CompleteDataReq, SubmitOuputDataReq};
use crate::mprc::Mprs;
use anyhow::{anyhow, Ok, Result};
use jz_action::core::models::{DataRecord, DataState, DbRepo, Direction, NodeRepo, TrackerState};
use jz_action::network::common::Empty;
use jz_action::network::datatransfer::data_stream_client::DataStreamClient;
use jz_action::network::datatransfer::{MediaDataBatchResponse, MediaDataCell};
use std::collections::HashMap;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::mpsc::error::TrySendError;
use tonic::transport::Channel;
use tonic::{Code, Status};
use tonic::Code;
use tracing::{debug, error, info, warn};
use walkdir::WalkDir;

use crate::multi_sender::MultiSender;
use tokio::fs;
use tokio::select;
use tokio::sync::mpsc;
use tokio::sync::Mutex;
use tokio::sync::{broadcast, oneshot};
use tokio::sync::oneshot;
use tokio::time::{self, sleep, Instant};
use tokio_stream::StreamExt;

Expand Down
1 change: 0 additions & 1 deletion crates/compute_unit_runner/src/multi_sender.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use jz_action::network::datatransfer::{
data_stream_client::DataStreamClient, MediaDataBatchResponse,
};
use std::collections::{hash_map::Entry, HashMap};
use tokio::time::Instant;
use tonic::transport::Channel;
use tracing::{debug, error};
Expand Down
13 changes: 3 additions & 10 deletions crates/dp_runner/src/channel_tracker.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
use anyhow::{anyhow, Error, Result};
use anyhow::{anyhow, Result};
use compute_unit_runner::fs_cache::FileCache;
use compute_unit_runner::ipc::AvaiableDataResponse;
use jz_action::core::models::{DataRecord, DataState, DbRepo, Direction, TrackerState};
use jz_action::network::common::Empty;
use jz_action::network::datatransfer::data_stream_client::DataStreamClient;
use jz_action::network::datatransfer::MediaDataBatchResponse;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::mpsc::Sender;
use tokio::sync::{mpsc, oneshot, Mutex};
use tokio::time::{self, sleep, Instant};
use tokio::{fs, select};
use tokio_stream::StreamExt;
use tonic::Status;
use tokio::time::{self, Instant};
use tokio::select;
use tracing::{debug, error, info, warn};
use uuid::Uuid;

pub struct ChannelTracker<R>
where
Expand Down
2 changes: 0 additions & 2 deletions crates/dp_runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ use anyhow::{anyhow, Result};
use channel_tracker::ChannelTracker;
use clap::Parser;
use compute_unit_runner::fs_cache::*;
use std::fs::File;
use std::path::PathBuf;
use std::str::FromStr;
use std::sync::Arc;
use stream::ChannelDataStream;
Expand Down
9 changes: 3 additions & 6 deletions crates/dp_runner/src/stream.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
use anyhow::Result;
use jz_action::core::models::{DbRepo, NodeRepo};
use jz_action::core::models::DbRepo;
use jz_action::network::common::Empty;
use jz_action::network::datatransfer::data_stream_server::DataStream;
use jz_action::network::datatransfer::{MediaDataBatchResponse, TabularDataBatchResponse};
use jz_action::utils::{AnyhowToGrpc, IntoAnyhowResult};
use std::sync::Arc;
use tokio::sync::Mutex;
use tokio::sync::{mpsc, oneshot};
use tokio_stream::wrappers::ReceiverStream;
use tonic::{Code, Request, Response, Status};
use tracing::info;
use tokio::sync::oneshot;
use tonic::{Request, Response, Status};

use super::channel_tracker::ChannelTracker;

Expand Down
3 changes: 1 addition & 2 deletions nodes/dummy_out/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ use anyhow::{anyhow, Result};
use clap::Parser;
use compute_unit_runner::ipc::{self, IPCClient};
use jz_action::utils::StdIntoAnyhowResult;
use std::path::{Path, PathBuf};
use std::path::Path;
use std::str::FromStr;
use std::time::Duration;
use tokio::fs;
use tokio::select;
use tokio::signal::unix::{signal, SignalKind};
use tokio::sync::mpsc;
Expand Down
2 changes: 1 addition & 1 deletion nodes/jz_writer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use jiaozifs_client_rs::apis::{self};
use jiaozifs_client_rs::models::RefType;
use jz_action::utils::IntoAnyhowResult;
use jz_action::utils::StdIntoAnyhowResult;
use std::path::{Path, PathBuf};
use std::path::Path;
use std::str::FromStr;
use std::time::Duration;
use tokio::fs;
Expand Down
4 changes: 2 additions & 2 deletions src/dbrepo/mongo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ impl DataRepo for MongoRepo {
#[cfg(test)]
mod tests {
use super::*;
use std::env;
use tracing_subscriber;



fn is_send<T>()
where
Expand Down

0 comments on commit eb2351d

Please sign in to comment.