You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sink_commit.rs
    path of file: ./repos/databend/src/query/storages/fuse/src/operations/common/processors
    
    the code of the file until where you have to start completion: // Copyright 2021 Datafuse Labs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use std::any::Any;
use std::sync::Arc;
use std::time::Duration;
use std::time::Instant;

use backoff::backoff::Backoff;
use backoff::ExponentialBackoff;
use databend_common_catalog::lock::Lock;
use databend_common_catalog::table::Table;
use databend_common_catalog::table::TableExt;
use databend_common_catalog::table_context::TableContext;
use databend_common_exception::ErrorCode;
use databend_common_exception::Result;
use databend_common_expression::BlockMetaInfoDowncast;
use databend_common_meta_app::sche
    
    fn process(&mut self) -> Result<()> {
        match std::mem::replace(&mut self.state, State::None) {
            State::GenerateSnapshot {
                previous,
                cluster_key_meta,
                table_info,
            } => {
                if !self.change_tracking && self.table.change_tracking_enabled() {
                    // If change tracing is disabled when the txn start, but is enabled when commit,
                    // then the txn should be aborted.
                    error!("commit mutation failed cause change tracking is enabled when commit");
                    self.state = State::AbortOperation;
                } else {
                    let schema = self.table.schema().as_ref().clone();
                    match self.snapshot_gen.generate_new_snapshot(
                        schema,
                        cluster_key_meta,
                        previous,
                    ) {
                        Ok(snapshot) => {
                            self.state = State::TryCommit {
                                data: snapshot.to_bytes()?,
                                snapshot,
                                table_info,
                            };
                        }
                        Err(e) => {
                            error!(
                                "commit mutation failed after {} retries, error: {:?}",
                                self.retries, e,
                            );
                            self.state = State::AbortOperation;
                        }
                    }
                }
            }
            _ => return Err(ErrorCode::Internal("It's a bug.")),
        }
        Ok(())
    }