fn create_segment_writer(
        &self,
        partition: &String,
        start_ts: u64,
    ) -> Result<SegmentWriter<S>, failure::Error> {
        let segment_id: u64;
        let partition_registry = self
            .store
            .get(format!("{}_{}", PARTITION_PREFIX, partition).as_bytes())?;
        match partition_registry {
            Some(registry) => {
                let mut buf = Deserializer::new(&registry[..]);
                let registry: PartitionRegistry = Deserialize::deserialize(&mut buf)?;
                segment_id = registry.last_assigned + 1;
            }
            None => segment_id = 1,
        }
        SegmentWriter::new(
            self.cfg.clone(),
            partition.clone(),
            segment_id,
            self.store.clone(),
            start_ts,
        )
    }
/// create_segment_writer creates segment writer for the given partition.
create_segment_writer creates segment writer for the given partition.
create_segment_writer creates segment writer for the given partition .
fn create_segment_writer(
        &self,
        partition: &String,
        start_ts: u64,
    ) -> Result<SegmentWriter<S>, failure::Error> {
        let segment_id: u64;
        let partition_registry = self
            .store
            .get(format!("{}_{}", PARTITION_PREFIX, partition).as_bytes())?;
        match partition_registry {
            Some(registry) => {
                let mut buf = Deserializer::new(&registry[..]);
                let registry: PartitionRegistry = Deserialize::deserialize(&mut buf)?;
                segment_id = registry.last_assigned + 1;
            }
            None => segment_id = 1,
        }
        SegmentWriter::new(
            self.cfg.clone(),
            partition.clone(),
            segment_id,
            self.store.clone(),
            start_ts,
        )
    }
fn create_segment_writer ( & self , partition : & String , start_ts : u64 , ) -> Result < SegmentWriter < S > , failure :: Error > { let segment_id : u64 ; let partition_registry = self . store . get ( format ! ( " " PARTITION_PREFIX partition ) . as_bytes ( ) ) ? ; match partition_registry { Some ( registry ) => { let mut buf = Deserializer :: new ( & registry [ .. ] ) ; let registry : PartitionRegistry = Deserialize :: deserialize ( & mut buf ) ? ; segment_id = registry . last_assigned + 1 ; } None => segment_id = 1 , } SegmentWriter :: new ( self . cfg . clone ( ) , partition . clone ( ) , segment_id , self . store . clone ( ) , start_ts , ) }
create_segment_writer creates segment writer for the given partition.
create_segment_writer creates segment writer for the given partition .
&self
partition
&String
start_ts
u64