github.com/matrixorigin/matrixone@v1.2.0/pkg/vm/engine/tae/txn/txnbase/handle.go (about) 1 // Copyright 2021 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 txnbase 16 17 import ( 18 "context" 19 20 "github.com/matrixorigin/matrixone/pkg/container/types" 21 "github.com/matrixorigin/matrixone/pkg/objectio" 22 apipb "github.com/matrixorigin/matrixone/pkg/pb/api" 23 "github.com/matrixorigin/matrixone/pkg/vm/engine/tae/common" 24 "github.com/matrixorigin/matrixone/pkg/vm/engine/tae/containers" 25 "github.com/matrixorigin/matrixone/pkg/vm/engine/tae/iface/handle" 26 "github.com/matrixorigin/matrixone/pkg/vm/engine/tae/iface/txnif" 27 ) 28 29 type TxnDatabase struct { 30 Txn txnif.AsyncTxn 31 } 32 33 type TxnRelation struct { 34 Txn txnif.AsyncTxn 35 DB handle.Database 36 } 37 38 type TxnObject struct { 39 Txn txnif.AsyncTxn 40 Rel handle.Relation 41 } 42 43 type TxnBlock struct { 44 Txn txnif.AsyncTxn 45 Seg handle.Object 46 } 47 48 var _ handle.Relation = &TxnRelation{} 49 50 func (db *TxnDatabase) GetID() uint64 { return 0 } 51 func (db *TxnDatabase) GetName() string { return "" } 52 func (db *TxnDatabase) String() string { return "" } 53 func (db *TxnDatabase) Close() error { return nil } 54 func (db *TxnDatabase) CreateRelation(def any) (rel handle.Relation, err error) { return } 55 func (db *TxnDatabase) DropRelationByName(name string) (rel handle.Relation, err error) { return } 56 func (db *TxnDatabase) GetRelationByName(name string) (rel handle.Relation, err error) { return } 57 func (db *TxnDatabase) UnsafeGetRelation(id uint64) (rel handle.Relation, err error) { return } 58 func (db *TxnDatabase) RelationCnt() int64 { return 0 } 59 func (db *TxnDatabase) Relations() (rels []handle.Relation) { return } 60 func (db *TxnDatabase) MakeRelationIt() (it handle.RelationIt) { return } 61 func (db *TxnDatabase) GetMeta() any { return nil } 62 63 func (rel *TxnRelation) SimplePPString(_ common.PPLevel) string { return "" } 64 func (rel *TxnRelation) String() string { return "" } 65 func (rel *TxnRelation) Close() error { return nil } 66 func (rel *TxnRelation) ID() uint64 { return 0 } 67 func (rel *TxnRelation) Rows() int64 { return 0 } 68 func (rel *TxnRelation) Size(attr string) int64 { return 0 } 69 func (rel *TxnRelation) GetCardinality(attr string) int64 { return 0 } 70 func (rel *TxnRelation) Schema() any { return nil } 71 func (rel *TxnRelation) MakeObjectIt() handle.ObjectIt { return nil } 72 func (rel *TxnRelation) MakeObjectItOnSnap() handle.ObjectIt { return nil } 73 func (rel *TxnRelation) BatchDedup(containers.Vector) error { return nil } 74 func (rel *TxnRelation) Append(ctx context.Context, data *containers.Batch) error { return nil } 75 func (rel *TxnRelation) AddObjsWithMetaLoc(context.Context, containers.Vector) error { 76 return nil 77 } 78 func (rel *TxnRelation) GetMeta() any { return nil } 79 func (rel *TxnRelation) GetDB() (handle.Database, error) { return nil, nil } 80 func (rel *TxnRelation) GetObject(id *types.Objectid) (obj handle.Object, err error) { return } 81 func (rel *TxnRelation) SoftDeleteObject(id *types.Objectid) (err error) { return } 82 func (rel *TxnRelation) CreateObject(bool) (obj handle.Object, err error) { return } 83 func (rel *TxnRelation) CreateNonAppendableObject(bool, *objectio.CreateObjOpt) (obj handle.Object, err error) { 84 return 85 } 86 func (rel *TxnRelation) GetValue(*common.ID, uint32, uint16) (v any, isNull bool, err error) { 87 return 88 } 89 func (rel *TxnRelation) GetValueByPhyAddrKey(any, int) (v any, isNull bool, err error) { 90 return 91 } 92 func (rel *TxnRelation) Update(*common.ID, uint32, uint16, any, bool) (err error) { return } 93 func (rel *TxnRelation) DeleteByPhyAddrKey(any) (err error) { return } 94 func (rel *TxnRelation) DeleteByPhyAddrKeys(containers.Vector, containers.Vector) (err error) { return } 95 func (rel *TxnRelation) RangeDelete(*common.ID, uint32, uint32, handle.DeleteType) (err error) { 96 return 97 } 98 func (rel *TxnRelation) TryDeleteByDeltaloc(id *common.ID, deltaloc objectio.Location) (ok bool, err error) { 99 return 100 } 101 func (rel *TxnRelation) GetByFilter(context.Context, *handle.Filter) (id *common.ID, offset uint32, err error) { 102 return 103 } 104 func (rel *TxnRelation) GetValueByFilter(context.Context, *handle.Filter, int) (v any, isNull bool, err error) { 105 return 106 } 107 func (rel *TxnRelation) UpdateByFilter(ctx context.Context, filter *handle.Filter, col uint16, v any, isNull bool) (err error) { 108 return 109 } 110 func (rel *TxnRelation) DeleteByFilter(ctx context.Context, filter *handle.Filter) (err error) { 111 return 112 } 113 func (rel *TxnRelation) LogTxnEntry(entry txnif.TxnEntry, readed []*common.ID) (err error) { 114 return 115 } 116 func (rel *TxnRelation) AlterTable(context.Context, *apipb.AlterTableReq) (err error) { return } 117 118 func (obj *TxnObject) Reset() { 119 obj.Txn = nil 120 obj.Rel = nil 121 } 122 func (obj *TxnObject) GetMeta() any { return nil } 123 func (obj *TxnObject) String() string { return "" } 124 func (obj *TxnObject) Close() error { return nil } 125 func (obj *TxnObject) GetID() uint64 { return 0 } 126 127 // func (obj *TxnObject) GetByFilter(*handle.Filter) (id *common.ID, offset uint32, err error) { 128 // return 129 // } 130 131 func (obj *TxnObject) GetRelation() (rel handle.Relation) { return } 132 func (obj *TxnObject) Update(uint64, uint32, uint16, any) (err error) { return } 133 func (obj *TxnObject) RangeDelete(uint64, uint32, uint32, handle.DeleteType) (err error) { return } 134 135 func (obj *TxnObject) PushDeleteOp(handle.Filter) (err error) { return } 136 func (obj *TxnObject) PushUpdateOp(handle.Filter, string, any) (err error) { return } 137 func (obj *TxnObject) SoftDeleteBlock(id types.Blockid) (err error) { return } 138 func (obj *TxnObject) BatchDedup(containers.Vector) (err error) { return } 139 140 // func (blk *TxnBlock) IsAppendable() bool { return true } 141 142 func (blk *TxnBlock) Reset() { 143 blk.Txn = nil 144 blk.Seg = nil 145 } 146 func (blk *TxnBlock) GetTotalChanges() int { return 0 } 147 func (blk *TxnBlock) IsAppendableBlock() bool { return true } 148 func (blk *TxnBlock) Fingerprint() *common.ID { return &common.ID{} } 149 func (blk *TxnBlock) Rows() int { return 0 } 150 func (blk *TxnBlock) ID() uint64 { return 0 } 151 func (blk *TxnBlock) String() string { return "" } 152 func (blk *TxnBlock) Close() error { return nil } 153 func (blk *TxnBlock) GetMeta() any { return nil } 154 func (blk *TxnBlock) GetByFilter(*handle.Filter) (offset uint32, err error) { return } 155 156 func (blk *TxnBlock) GetObject() (obj handle.Object) { return } 157 158 func (blk *TxnBlock) Append(*containers.Batch, uint32) (n uint32, err error) { return } 159 func (blk *TxnBlock) Update(uint32, uint16, any) (err error) { return } 160 func (blk *TxnBlock) RangeDelete(uint32, uint32, handle.DeleteType) (err error) { return } 161 func (blk *TxnBlock) PushDeleteOp(handle.Filter) (err error) { return } 162 func (blk *TxnBlock) PushUpdateOp(handle.Filter, string, any) (err error) { return }