github.com/matrixorigin/matrixone@v1.2.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 ) (timestamp.Timestamp, 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 ) (func(), 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 ) (func(), error) 79 80 HandleCommitMerge( 81 ctx context.Context, 82 meta txn.TxnMeta, 83 req *apipb.MergeCommitEntry, 84 resp *db.InspectResp, 85 ) (func(), error) 86 87 HandleForceCheckpoint( 88 ctx context.Context, 89 meta txn.TxnMeta, 90 req *db.Checkpoint, 91 resp *apipb.SyncLogTailResp, 92 ) (func(), error) 93 94 HandleForceGlobalCheckpoint( 95 ctx context.Context, 96 meta txn.TxnMeta, 97 req *db.Checkpoint, 98 resp *apipb.SyncLogTailResp, 99 ) (func(), error) 100 HandleInspectTN( 101 ctx context.Context, 102 meta txn.TxnMeta, 103 req *db.InspectTN, 104 resp *db.InspectResp, 105 ) (func(), error) 106 107 HandleAddFaultPoint( 108 ctx context.Context, 109 meta txn.TxnMeta, 110 req *db.FaultPoint, 111 resp *apipb.SyncLogTailResp, 112 ) (func(), error) 113 114 HandleBackup( 115 ctx context.Context, 116 meta txn.TxnMeta, 117 req *db.Checkpoint, 118 resp *apipb.SyncLogTailResp, 119 ) (func(), error) 120 121 HandleTraceSpan( 122 ctx context.Context, 123 meta txn.TxnMeta, 124 req *db.TraceSpan, 125 resp *apipb.SyncLogTailResp, 126 ) (func(), error) 127 128 HandleStorageUsage( 129 ctx context.Context, 130 meta txn.TxnMeta, 131 req *db.StorageUsageReq, 132 resp *db.StorageUsageResp, 133 ) (func(), error) 134 135 HandleInterceptCommit( 136 ctx context.Context, 137 meta txn.TxnMeta, 138 req *db.InterceptCommit, 139 resp *apipb.SyncLogTailResp, 140 ) (func(), error) 141 }