github.com/matrixorigin/matrixone@v0.7.0/pkg/vm/engine/tae/iface/rpchandle/handler.go (about) 1 // Copyright 2021 - 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 rpchandle 16 17 import ( 18 "context" 19 20 apipb "github.com/matrixorigin/matrixone/pkg/pb/api" 21 "github.com/matrixorigin/matrixone/pkg/pb/timestamp" 22 "github.com/matrixorigin/matrixone/pkg/pb/txn" 23 "github.com/matrixorigin/matrixone/pkg/vm/engine/tae/db" 24 ) 25 26 type Handler interface { 27 HandleCommit( 28 ctx context.Context, 29 meta txn.TxnMeta, 30 ) error 31 32 HandleRollback( 33 ctx context.Context, 34 meta txn.TxnMeta, 35 ) error 36 37 HandleCommitting( 38 ctx context.Context, 39 meta txn.TxnMeta, 40 ) error 41 42 HandlePrepare( 43 ctx context.Context, 44 meta txn.TxnMeta, 45 ) ( 46 timestamp.Timestamp, 47 error, 48 ) 49 50 HandleStartRecovery( 51 ctx context.Context, 52 ch chan txn.TxnMeta, 53 ) 54 55 HandleClose(ctx context.Context) error 56 57 HandleDestroy(ctx context.Context) error 58 59 HandleGetLogTail( 60 ctx context.Context, 61 meta txn.TxnMeta, 62 req apipb.SyncLogTailReq, 63 resp *apipb.SyncLogTailResp, 64 ) error 65 66 HandlePreCommitWrite( 67 ctx context.Context, 68 meta txn.TxnMeta, 69 req apipb.PrecommitWriteCmd, 70 resp *apipb.SyncLogTailResp, 71 ) error 72 73 HandleFlushTable( 74 ctx context.Context, 75 meta txn.TxnMeta, 76 req db.FlushTable, 77 resp *apipb.SyncLogTailResp, 78 ) error 79 80 HandleForceCheckpoint( 81 ctx context.Context, 82 meta txn.TxnMeta, 83 req db.Checkpoint, 84 resp *apipb.SyncLogTailResp, 85 ) error 86 87 HandleInspectDN( 88 ctx context.Context, 89 meta txn.TxnMeta, 90 req db.InspectDN, 91 resp *db.InspectResp, 92 ) error 93 }