Documentation ¶
Index ¶
Constants ¶
View Source
const IndexMapping = `` /* 2649-byte string literal not displayed */
IndexMapping is the index structure for metadata entities. TODO(michellenguyen): Remove namespace from the index once we stop writing and reading from it.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ESMDEntityState ¶
type ESMDEntityState int
ESMDEntityState represents state for a metadata entity in elastic.
const ( // ESMDEntityStateUnknown is when the state of the entity is unknown. ESMDEntityStateUnknown ESMDEntityState = iota // ESMDEntityStatePending represents the pending state. ESMDEntityStatePending // ESMDEntityStateRunning represents the running state. ESMDEntityStateRunning // ESMDEntityStateFailed represents the failed state. ESMDEntityStateFailed // ESMDEntityStateTerminated represents the terminated state. ESMDEntityStateTerminated )
type EsMDEntity ¶
type EsMDEntity struct { OrgID string `json:"orgID"` ClusterUID string `json:"clusterUID"` VizierID string `json:"vizierID"` UID string `json:"uid"` Name string `json:"name"` NS string `json:"ns"` Kind string `json:"kind"` TimeStartedNS int64 `json:"timeStartedNS"` TimeStoppedNS int64 `json:"timeStoppedNS"` RelatedEntityNames []string `json:"relatedEntityNames"` UpdateVersion int64 `json:"updateVersion"` State ESMDEntityState `json:"state"` }
EsMDEntity is the struct that is stored in elastic.
type EsMDType ¶
type EsMDType string
EsMDType are the types for metadata entities in elastic.
const ( // EsMDTypeNamespace is for namespace entities. EsMDTypeNamespace EsMDType = "namespace" // EsMDTypeService is for service entities. EsMDTypeService EsMDType = "service" // EsMDTypePod is for pod entities. EsMDTypePod EsMDType = "pod" // EsMDTypeScript is for script entities. EsMDTypeScript EsMDType = "script" // EsMDTypeNode is for node entities. EsMDTypeNode EsMDType = "node" )
type VizierIndexer ¶
type VizierIndexer struct {
// contains filtered or unexported fields
}
VizierIndexer run the indexer for a single vizier index.
func NewVizierIndexer ¶
func NewVizierIndexer(vizierID uuid.UUID, orgID uuid.UUID, k8sUID, indexName string, st msgbus.Streamer, es *elastic.Client) *VizierIndexer
NewVizierIndexer creates a new Vizier indexer.
func NewVizierIndexerWithBulkSettings ¶
func NewVizierIndexerWithBulkSettings(vizierID uuid.UUID, orgID uuid.UUID, k8sUID, indexName string, st msgbus.Streamer, es *elastic.Client, batchFlushInterval time.Duration) *VizierIndexer
NewVizierIndexerWithBulkSettings creates a new Vizier indexer with bulk settings.
func (*VizierIndexer) FlushRoutine ¶
func (v *VizierIndexer) FlushRoutine()
FlushRoutine runs the routine that handles bulk API flushing.
func (*VizierIndexer) HandleResourceUpdate ¶
func (v *VizierIndexer) HandleResourceUpdate(update *metadatapb.ResourceUpdate) error
HandleResourceUpdate indexes the resource update in elastic.
func (*VizierIndexer) Start ¶
func (v *VizierIndexer) Start(topic string) error
Start starts the indexer.
Click to show internal directories.
Click to hide internal directories.