pub async fn rollover_partition(
        &self,
        partition_key: &str,
        table_name: &str,
    ) -> Result<Option<Arc<DbChunk>>> {
        let partition = self
            .preserved_catalog
            .state()
            .valid_partition(partition_key)
            .context(RollingOverPartition {
                partition_key,
                table_name,
            })?;

        let partition = partition.write();
        if let Some(chunk) = partition
            .open_chunk(table_name)
            .context(RollingOverPartition {
                partition_key,
                table_name,
            })?
        {
            let mut chunk = chunk.write();
            chunk.freeze().context(RollingOverPartition {
                partition_key,
                table_name,
            })?;

            Ok(Some(DbChunk::snapshot(&chunk)))
        } else {
            Ok(None)
        }
    }
/// Rolls over the active chunk in the database's specified
/// partition. Returns the previously open (now closed) Chunk if there was any.
Rolls over the active chunk in the database's specified
partition. Returns the previously open (now closed) Chunk if there was any.
Rolls over the active chunk in the database ' s specified partition . Returns the previously open ( now closed ) Chunk if there was any .
pub async fn rollover_partition(
        &self,
        partition_key: &str,
        table_name: &str,
    ) -> Result<Option<Arc<DbChunk>>> {
        let partition = self
            .preserved_catalog
            .state()
            .valid_partition(partition_key)
            .context(RollingOverPartition {
                partition_key,
                table_name,
            })?;
        let partition = partition.write();
        if let Some(chunk) = partition
            .open_chunk(table_name)
            .context(RollingOverPartition {
                partition_key,
                table_name,
            })?
        {
            let mut chunk = chunk.write();
            chunk.freeze().context(RollingOverPartition {
                partition_key,
                table_name,
            })?;
            Ok(Some(DbChunk::snapshot(&chunk)))
        } else {
            Ok(None)
        }
    }
pub async fn rollover_partition ( & self , partition_key : & str , table_name : & str , ) -> Result < Option < Arc < DbChunk > > > { let partition = self . preserved_catalog . state ( ) . valid_partition ( partition_key ) . context ( RollingOverPartition { partition_key , table_name , } ) ? ; let partition = partition . write ( ) ; if let Some ( chunk ) = partition . open_chunk ( table_name ) . context ( RollingOverPartition { partition_key , table_name , } ) ? { let mut chunk = chunk . write ( ) ; chunk . freeze ( ) . context ( RollingOverPartition { partition_key , table_name , } ) ? ; Ok ( Some ( DbChunk :: snapshot ( & chunk ) ) ) } else { Ok ( None ) } }
Rolls over the active chunk in the database's specified
partition.
Rolls over the active chunk in the database ' s specified partition .
&self
partition_key
&str
table_name
&str
&self
partition_key
&str
table_name
&str