github.com/matrixorigin/matrixone@v1.2.0/pkg/txn/storage/memorystorage/handler.go (about)

     1  // Copyright 2022 Matrix Origin
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package memorystorage
    16  
    17  import (
    18  	"context"
    19  
    20  	"github.com/matrixorigin/matrixone/pkg/pb/timestamp"
    21  	"github.com/matrixorigin/matrixone/pkg/pb/txn"
    22  	"github.com/matrixorigin/matrixone/pkg/vm/engine/memoryengine"
    23  )
    24  
    25  type Handler interface {
    26  	memoryengine.OperationHandler
    27  
    28  	HandleCommit(
    29  		ctx context.Context,
    30  		meta txn.TxnMeta,
    31  	) (timestamp.Timestamp, error)
    32  
    33  	HandleRollback(
    34  		ctx context.Context,
    35  		meta txn.TxnMeta,
    36  	) error
    37  
    38  	HandleCommitting(
    39  		ctx context.Context,
    40  		meta txn.TxnMeta,
    41  	) error
    42  
    43  	HandlePrepare(
    44  		ctx context.Context,
    45  		meta txn.TxnMeta,
    46  	) (
    47  		timestamp.Timestamp,
    48  		error,
    49  	)
    50  
    51  	HandleStartRecovery(
    52  		ctx context.Context,
    53  		ch chan txn.TxnMeta,
    54  	)
    55  
    56  	HandleClose(ctx context.Context) error
    57  
    58  	HandleDestroy(ctx context.Context) error
    59  }