diff --git a/pageserver/client_grpc/src/lib.rs b/pageserver/client_grpc/src/lib.rs index 479054d0e2..d846d6e09f 100644 --- a/pageserver/client_grpc/src/lib.rs +++ b/pageserver/client_grpc/src/lib.rs @@ -73,7 +73,7 @@ impl PageserverClient { pub async fn get_page( &self, shard: ShardIndex, - request: &GetPageRequest, + request: GetPageRequest, ) -> Result, PageserverClientError> { // FIXME: calculate the shard number correctly let chan = self.get_client(shard).await?; @@ -81,7 +81,7 @@ impl PageserverClient { let mut client = PageServiceClient::with_interceptor(chan, self.auth_interceptor.for_shard(shard)); - let request = proto::GetPageRequest::from(request); + let request = proto::GetPageRequest::try_from(request)?; let request_stream = futures::stream::once(std::future::ready(request)); let mut response_stream = client diff --git a/pageserver/page_api/src/model.rs b/pageserver/page_api/src/model.rs index baaf65942f..f4e76c23fe 100644 --- a/pageserver/page_api/src/model.rs +++ b/pageserver/page_api/src/model.rs @@ -102,14 +102,6 @@ impl TryFrom for proto::ReadLsn { } } -impl From<&ReadLsn> for proto::ReadLsn { - fn from(value: &ReadLsn) -> proto::ReadLsn { - proto::ReadLsn { - request_lsn: value.request_lsn.into(), - not_modified_since_lsn: value.not_modified_since_lsn.unwrap_or_default().0, - } - } -} // RelTag is defined in pageserver_api::reltag. pub type RelTag = pageserver_api::reltag::RelTag; @@ -141,16 +133,6 @@ impl From for proto::RelTag { } } -impl From<&RelTag> for proto::RelTag { - fn from(value: &RelTag) -> proto::RelTag { - proto::RelTag { - spc_oid: value.spcnode, - db_oid: value.dbnode, - rel_number: value.relnode, - fork_number: value.forknum as u32, - } - } -} /// Checks whether a relation exists, at the given LSN. Only valid on shard 0, other shards error. #[derive(Clone, Copy, Debug)] pub struct CheckRelExistsRequest { @@ -330,17 +312,6 @@ impl TryFrom for GetPageRequest { } } -impl From<&GetPageRequest> for proto::GetPageRequest { - fn from(request: &GetPageRequest) -> proto::GetPageRequest { - proto::GetPageRequest { - request_id: request.request_id, - request_class: request.request_class.into(), - read_lsn: Some(request.read_lsn.try_into().unwrap()), - rel: Some(request.rel.into()), - block_number: request.block_numbers.clone().into_vec(), - } - } -} impl TryFrom for proto::GetPageRequest { type Error = ProtocolError;