/
ResourceLabelService.scala
69 lines (53 loc) · 2.04 KB
/
ResourceLabelService.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.linkis.manager.label.service
import org.apache.linkis.manager.common.entity.resource.NodeResource
import org.apache.linkis.manager.label.entity.Label
trait ResourceLabelService {
def setEngineConnResourceToLabel(label: Label[_], nodeResource: NodeResource, source: String): Unit
/**
* 通过传入的Labels 查找所有和Resource相关的Label
* 包含CombineLabel,需要CombineLabel的所有Label Key 出现过
*
* @param labels
* @return
*/
def getResourceLabels(labels: java.util.List[Label[_]]): java.util.List[Label[_]]
/**
* 设置某个Label的资源数值,如果不存在add,存在对应的Label update
*
* @param label
* @param resource
*/
def setResourceToLabel(label: Label[_], resource: NodeResource, source: String)
/**
* 通过Label 返回对应的Resource
*
* @param label
* @return
*/
def getResourceByLabel(label: Label[_]): NodeResource
/**
* 清理Label的资源信息和记录
* 1. 清理Label对应的Resource信息
* 2. 清理包含改Label的CombinedLabel的Resource信息
*
* @param label
*/
def removeResourceByLabel(label: Label[_]): Unit
def removeResourceByLabels(labels: java.util.List[Label[_]]): Unit
}