|
| 1 | +/* |
| 2 | + * Copyright (c) 2024 Yunshan Networks |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package tagrecorder |
| 18 | + |
| 19 | +import ( |
| 20 | + "github.com/deepflowio/deepflow/server/controller/db/mysql" |
| 21 | + mysqlmodel "github.com/deepflowio/deepflow/server/controller/db/mysql/model" |
| 22 | +) |
| 23 | + |
| 24 | +type ChStatisticTag struct { |
| 25 | + UpdaterComponent[mysqlmodel.ChStatisticTag, StatisticTagKey] |
| 26 | +} |
| 27 | + |
| 28 | +func NewChStatisticTag() *ChStatisticTag { |
| 29 | + updater := &ChStatisticTag{ |
| 30 | + newUpdaterComponent[mysqlmodel.ChStatisticTag, StatisticTagKey]( |
| 31 | + RESOURCE_TYPE_STATISTIC_TAG, |
| 32 | + ), |
| 33 | + } |
| 34 | + updater.updaterDG = updater |
| 35 | + return updater |
| 36 | +} |
| 37 | + |
| 38 | +func (r *ChStatisticTag) generateNewData(db *mysql.DB) (map[StatisticTagKey]mysqlmodel.ChStatisticTag, bool) { |
| 39 | + |
| 40 | + return nil, false |
| 41 | +} |
| 42 | + |
| 43 | +func (r *ChStatisticTag) generateKey(dbItem mysqlmodel.ChStatisticTag) StatisticTagKey { |
| 44 | + return StatisticTagKey{Db: dbItem.Db, Table: dbItem.Table, Type: dbItem.Type, Name: dbItem.Name} |
| 45 | +} |
| 46 | + |
| 47 | +func (r *ChStatisticTag) generateUpdateInfo(oldItem, newItem mysqlmodel.ChStatisticTag) (map[string]interface{}, bool) { |
| 48 | + |
| 49 | + return nil, false |
| 50 | +} |
0 commit comments