Skip to content

Commit

Permalink
Merge pull request #11 from zhihu/bump
Browse files Browse the repository at this point in the history
Cherry pick from private repo
  • Loading branch information
sunxiaoguang authored Nov 23, 2020
2 parents 782d1bb + b2e7b12 commit 5b55f84
Show file tree
Hide file tree
Showing 9 changed files with 210 additions and 218 deletions.
2 changes: 0 additions & 2 deletions src/core/codec/doc_values/doc_values_producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ pub trait DocValuesProducer: Send + Sync {
/// Returns an instance optimized for merging.
fn get_merge_instance(&self) -> Result<Box<dyn DocValuesProducer>>;
}

pub type DocValuesProducerRef = Arc<dyn DocValuesProducer>;
4 changes: 2 additions & 2 deletions src/core/index/merge/merge_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,9 @@ impl TieredMergePolicy {
next_merges.iter().map(|i| info_seg_bytes[*i]).collect();

info!(
"segment_count={} curr_merge_bytes={} one_merge={:?}",
next_merges_bytes.len(),
"curr_merge_bytes={} segment_count={} one_merge={:?}",
curr_merge_bytes,
next_merges_bytes.len(),
next_merges_bytes
);
let mut segments = Vec::with_capacity(next_merges.len());
Expand Down
4 changes: 2 additions & 2 deletions src/core/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub mod tests {
use std::collections::HashMap;

use core::codec::doc_values::{
BinaryDocValues, DocValuesProducerRef, NumericDocValues, SortedDocValues,
BinaryDocValues, DocValuesProducer, NumericDocValues, SortedDocValues,
SortedNumericDocValues, SortedSetDocValues,
};
use core::codec::field_infos::{FieldInfo, FieldInfos};
Expand Down Expand Up @@ -271,7 +271,7 @@ pub mod tests {
unimplemented!()
}

fn doc_values_reader(&self) -> Result<Option<DocValuesProducerRef>> {
fn doc_values_reader(&self) -> Result<Option<Arc<dyn DocValuesProducer>>> {
unimplemented!()
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/index/reader/leaf_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// limitations under the License.

use core::codec::doc_values::{
BinaryDocValues, DocValuesProducerRef, NumericDocValues, SortedDocValues,
SortedNumericDocValues, SortedSetDocValues,
BinaryDocValues, DocValuesProducer, NumericDocValues, SortedDocValues, SortedNumericDocValues,
SortedSetDocValues,
};
use core::codec::field_infos::{FieldInfo, FieldInfos};
use core::codec::norms::NormsProducer;
Expand Down Expand Up @@ -176,7 +176,7 @@ pub trait LeafReader {

fn norms_reader(&self) -> Result<Option<Self::NormsReader>>;

fn doc_values_reader(&self) -> Result<Option<DocValuesProducerRef>>;
fn doc_values_reader(&self) -> Result<Option<Arc<dyn DocValuesProducer>>>;

fn postings_reader(&self) -> Result<Self::FieldsProducer>;
}
Expand Down
Loading

0 comments on commit 5b55f84

Please sign in to comment.