// Meta metadata object type Meta struct { Key string `orm:"column(key); size(256); pk"` Type string `orm:"column(type); size(32)"` Value string `orm:"column(value); null; type(text)"` }
// MetaV2 record k8s api object type MetaV2 struct { // Key is the primary key of a line record, format like k8s obj key in etcd: // /Group/Version/Resources/Namespace/Name //0/1 /2 /3 /4 /5 // /core/v1/pods/{namespaces}/{name} normal obj // /core/v1/pods/{namespaces} List obj // /extensions/v1beta1/ingresses/{namespaces}/{name} normal obj // /storage.k8s.io/v1beta1/csidrivers/null/{name} cluster scope obj Key string `orm:"column(key); size(256); pk"` // GroupVersionResource are set buy gvr.String() like "/v1, Resource=endpoints" GroupVersionResource string `orm:"column(groupversionresource); size(256);"` // Namespace is the namespace of an api object, and set as metadata.namespace Namespace string `orm:"column(namespace); size(256)"` // Name is the name of api object, and set as metadata.name Name string `orm:"column(name); size(256)"` // ResourceVersion is the resource version of the obj, and set as metadata.resourceVersion ResourceVersion uint64 `orm:"column(resourceversion); size(256)"` // Value is the api object in json format // TODO: change to []byte Value string `orm:"column(value); null; type(text)"` }
func (m *metaManager) process(message model.Message) { operation := message.GetOperation() switch operation { case model.InsertOperation: m.processInsert(message) case model.UpdateOperation: m.processUpdate(message) case model.DeleteOperation: m.processDelete(message) case model.QueryOperation: m.processQuery(message) case model.ResponseOperation: m.processResponse(message) case messagepkg.OperationNodeConnection: m.processNodeConnection(message) case OperationMetaSync: m.processSync() case OperationFunctionAction: m.processFunctionAction(message) case OperationFunctionActionResult: m.processFunctionActionResult(message) case constants.CSIOperationTypeCreateVolume, constants.CSIOperationTypeDeleteVolume, constants.CSIOperationTypeControllerPublishVolume, constants.CSIOperationTypeControllerUnpublishVolume: m.processVolume(message) default: klog.Errorf("metamanager not supported operation: %v", operation) } }