volcano.sh/volcano@v1.9.0/pkg/controllers/cache/interface.go (about) 1 /* 2 Copyright 2019 The Volcano Authors. 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 cache 18 19 import ( 20 v1 "k8s.io/api/core/v1" 21 22 "volcano.sh/apis/pkg/apis/batch/v1alpha1" 23 "volcano.sh/volcano/pkg/controllers/apis" 24 ) 25 26 // Cache Interface. 27 type Cache interface { 28 Run(stopCh <-chan struct{}) 29 30 Get(key string) (*apis.JobInfo, error) 31 GetStatus(key string) (*v1alpha1.JobStatus, error) 32 Add(obj *v1alpha1.Job) error 33 Update(obj *v1alpha1.Job) error 34 Delete(obj *v1alpha1.Job) error 35 36 AddPod(pod *v1.Pod) error 37 UpdatePod(pod *v1.Pod) error 38 DeletePod(pod *v1.Pod) error 39 40 TaskCompleted(jobKey, taskName string) bool 41 TaskFailed(jobKey, taskName string) bool 42 }