Skip to content

Commit

Permalink
fix storage compile error according to the compiler's suggestion (I H…
Browse files Browse the repository at this point in the history
…AVE NO IDEA WHAT I DID)
  • Loading branch information
xxchan committed Mar 18, 2024
1 parent 601e35e commit 6c1cfc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/storage/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ pub fn to_owned_item((key, value): StateStoreIterItemRef<'_>) -> StorageResult<S
}

pub trait StateStoreIterExt<T: IterItem = StateStoreIterItem>: StateStoreIter<T> + Sized {
type ItemStream<O: Send, F: Send>: Stream<Item = StorageResult<O>> + Send;
type ItemStream<O: Send, F: Send + for<'a> Fn(T::ItemRef<'a>) -> StorageResult<O>>: Stream<Item = StorageResult<O>>
+ Send;

fn into_stream<O: Send, F: for<'a> Fn(T::ItemRef<'a>) -> StorageResult<O> + Send>(
self,
Expand Down Expand Up @@ -150,7 +151,8 @@ impl<T: IterItem, I: StateStoreIter<T>> FusedStateStoreIter<I, T> {
}

impl<T: IterItem, I: StateStoreIter<T>> StateStoreIterExt<T> for I {
type ItemStream<O: Send, F: Send> = impl Stream<Item = StorageResult<O>> + Send;
type ItemStream<O: Send, F: Send + for<'a> Fn(T::ItemRef<'a>) -> StorageResult<O>> =
impl Stream<Item = StorageResult<O>> + Send;

fn into_stream<O: Send, F: for<'a> Fn(T::ItemRef<'a>) -> StorageResult<O> + Send>(
self,
Expand Down
3 changes: 2 additions & 1 deletion src/stream/src/common/log_store_impl/kv_log_store/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use risingwave_storage::row_serde::row_serde_util::{serialize_pk, serialize_pk_w
use risingwave_storage::row_serde::value_serde::ValueRowSerdeNew;
use risingwave_storage::store::{StateStoreIterExt, StateStoreReadIter};
use risingwave_storage::table::{compute_vnode, TableDistribution, SINGLETON_VNODE};
use risingwave_storage::StateStoreIter;
use rw_futures_util::select_all;

use crate::common::log_store_impl::kv_log_store::{
Expand Down Expand Up @@ -544,7 +545,7 @@ impl<S: StateStoreReadIter> LogStoreRowOpStream<S> {
}
}

pub(crate) type LogStoreItemMergeStream<S> =
pub(crate) type LogStoreItemMergeStream<S: StateStoreIter + 'static> =
impl Stream<Item = LogStoreResult<(u64, KvLogStoreItem)>>;
pub(crate) fn merge_log_store_item_stream<S: StateStoreReadIter>(
iters: Vec<S>,
Expand Down

0 comments on commit 6c1cfc5

Please sign in to comment.