use asm features

Signed-off-by: junxiang Mu <1948535941@qq.com>
This commit is contained in:
junxiang Mu
2024-10-08 14:11:28 +08:00
parent 10c63effd4
commit 9cf7dc128e
3 changed files with 91 additions and 98 deletions
Generated
+12
View File
@@ -1502,6 +1502,8 @@ version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7263373d500d4d4f505d43a2a662d475a894aa94503a1ee28e9188b5f3960d4f" checksum = "7263373d500d4d4f505d43a2a662d475a894aa94503a1ee28e9188b5f3960d4f"
dependencies = [ dependencies = [
"cc",
"libc",
"libm", "libm",
"lru", "lru",
"parking_lot", "parking_lot",
@@ -1838,6 +1840,16 @@ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
"digest", "digest",
"sha2-asm",
]
[[package]]
name = "sha2-asm"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b845214d6175804686b2bd482bcffe96651bb2d1200742b712003504a2dac1ab"
dependencies = [
"cc",
] ]
[[package]] [[package]]
@@ -580,7 +580,13 @@ pub struct GenerallyLockResponse {
} }
/// Generated client implementations. /// Generated client implementations.
pub mod node_service_client { pub mod node_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] #![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*; use tonic::codegen::*;
use tonic::codegen::http::Uri; use tonic::codegen::http::Uri;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
@@ -602,8 +608,8 @@ pub mod node_service_client {
where where
T: tonic::client::GrpcService<tonic::body::BoxBody>, T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>, T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static, T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send, <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{ {
pub fn new(inner: T) -> Self { pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner); let inner = tonic::client::Grpc::new(inner);
@@ -628,7 +634,7 @@ pub mod node_service_client {
>, >,
<T as tonic::codegen::Service< <T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>, http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync, >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{ {
NodeServiceClient::new(InterceptedService::new(inner, interceptor)) NodeServiceClient::new(InterceptedService::new(inner, interceptor))
} }
@@ -672,8 +678,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -697,8 +702,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -722,8 +726,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -747,8 +750,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -772,8 +774,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -797,8 +798,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -822,8 +822,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -844,8 +843,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -869,8 +867,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -894,8 +891,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -916,8 +912,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -941,8 +936,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -967,8 +961,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -992,8 +985,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1017,8 +1009,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1042,8 +1033,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1067,8 +1057,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1092,8 +1081,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1117,8 +1105,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1142,8 +1129,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1167,8 +1153,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1192,8 +1177,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1217,8 +1201,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1242,8 +1225,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1264,8 +1246,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1289,8 +1270,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1314,8 +1294,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1339,8 +1318,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1364,8 +1342,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1389,8 +1366,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1414,8 +1390,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1439,8 +1414,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1464,8 +1438,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1489,8 +1462,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1514,8 +1486,7 @@ pub mod node_service_client {
.ready() .ready()
.await .await
.map_err(|e| { .map_err(|e| {
tonic::Status::new( tonic::Status::unknown(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()), format!("Service was not ready: {}", e.into()),
) )
})?; })?;
@@ -1532,11 +1503,17 @@ pub mod node_service_client {
} }
/// Generated server implementations. /// Generated server implementations.
pub mod node_service_server { pub mod node_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] #![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*; use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with NodeServiceServer. /// Generated trait containing gRPC methods that should be implemented for use with NodeServiceServer.
#[async_trait] #[async_trait]
pub trait NodeService: Send + Sync + 'static { pub trait NodeService: std::marker::Send + std::marker::Sync + 'static {
/// -------------------------------meta service-------------------------- /// -------------------------------meta service--------------------------
async fn ping( async fn ping(
&self, &self,
@@ -1607,7 +1584,7 @@ pub mod node_service_server {
type WriteStreamStream: tonic::codegen::tokio_stream::Stream< type WriteStreamStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::WriteResponse, tonic::Status>, Item = std::result::Result<super::WriteResponse, tonic::Status>,
> >
+ Send + std::marker::Send
+ 'static; + 'static;
async fn write_stream( async fn write_stream(
&self, &self,
@@ -1620,7 +1597,7 @@ pub mod node_service_server {
type ReadAtStream: tonic::codegen::tokio_stream::Stream< type ReadAtStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ReadAtResponse, tonic::Status>, Item = std::result::Result<super::ReadAtResponse, tonic::Status>,
> >
+ Send + std::marker::Send
+ 'static; + 'static;
/// rpc Append(AppendRequest) returns (AppendResponse) {}; /// rpc Append(AppendRequest) returns (AppendResponse) {};
async fn read_at( async fn read_at(
@@ -1774,14 +1751,14 @@ pub mod node_service_server {
>; >;
} }
#[derive(Debug)] #[derive(Debug)]
pub struct NodeServiceServer<T: NodeService> { pub struct NodeServiceServer<T> {
inner: Arc<T>, inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings, accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>, max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>, max_encoding_message_size: Option<usize>,
} }
impl<T: NodeService> NodeServiceServer<T> { impl<T> NodeServiceServer<T> {
pub fn new(inner: T) -> Self { pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner)) Self::from_arc(Arc::new(inner))
} }
@@ -1835,8 +1812,8 @@ pub mod node_service_server {
impl<T, B> tonic::codegen::Service<http::Request<B>> for NodeServiceServer<T> impl<T, B> tonic::codegen::Service<http::Request<B>> for NodeServiceServer<T>
where where
T: NodeService, T: NodeService,
B: Body + Send + 'static, B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + Send + 'static, B::Error: Into<StdError> + std::marker::Send + 'static,
{ {
type Response = http::Response<tonic::body::BoxBody>; type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible; type Error = std::convert::Infallible;
@@ -3428,23 +3405,25 @@ pub mod node_service_server {
} }
_ => { _ => {
Box::pin(async move { Box::pin(async move {
Ok( let mut response = http::Response::new(empty_body());
http::Response::builder() let headers = response.headers_mut();
.status(200) headers
.header("grpc-status", tonic::Code::Unimplemented as i32) .insert(
.header( tonic::Status::GRPC_STATUS,
http::header::CONTENT_TYPE, (tonic::Code::Unimplemented as i32).into(),
tonic::metadata::GRPC_CONTENT_TYPE, );
) headers
.body(empty_body()) .insert(
.unwrap(), http::header::CONTENT_TYPE,
) tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
}) })
} }
} }
} }
} }
impl<T: NodeService> Clone for NodeServiceServer<T> { impl<T> Clone for NodeServiceServer<T> {
fn clone(&self) -> Self { fn clone(&self) -> Self {
let inner = self.inner.clone(); let inner = self.inner.clone();
Self { Self {
@@ -3456,7 +3435,9 @@ pub mod node_service_server {
} }
} }
} }
impl<T: NodeService> tonic::server::NamedService for NodeServiceServer<T> { /// Generated gRPC service name
const NAME: &'static str = "node_service.NodeService"; pub const SERVICE_NAME: &str = "node_service.NodeService";
impl<T> tonic::server::NamedService for NodeServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
} }
} }
+2 -2
View File
@@ -23,7 +23,7 @@ tracing-error.workspace = true
http.workspace = true http.workspace = true
url.workspace = true url.workspace = true
uuid = { version = "1.8.0", features = ["v4", "fast-rng", "serde"] } uuid = { version = "1.8.0", features = ["v4", "fast-rng", "serde"] }
reed-solomon-erasure = "6.0.0" reed-solomon-erasure = { version = "6.0.0", features = [ "simd-accel" ] }
transform-stream = "0.3.0" transform-stream = "0.3.0"
lazy_static.workspace = true lazy_static.workspace = true
lock.workspace = true lock.workspace = true
@@ -37,7 +37,7 @@ s3s = "0.10.0"
crc32fast = "1.4.2" crc32fast = "1.4.2"
siphasher = "1.0.1" siphasher = "1.0.1"
base64-simd = "0.8.0" base64-simd = "0.8.0"
sha2 = "0.10.8" sha2 = { version = "0.10.8", features = ["asm"] }
hex-simd = "0.8.0" hex-simd = "0.8.0"
path-clean = "1.0.1" path-clean = "1.0.1"
tokio = { workspace = true, features = ["io-util", "sync"] } tokio = { workspace = true, features = ["io-util", "sync"] }