forked from apache/linkis
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RM resource operation optimization lock bit segment lock close apache…
- Loading branch information
Showing
15 changed files
with
767 additions
and
584 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...ager/src/main/java/org/apache/linkis/manager/rm/exception/RMLockFailedRetryException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* 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.rm.exception; | ||
|
||
import org.apache.linkis.common.exception.LinkisRetryException; | ||
|
||
public class RMLockFailedRetryException extends LinkisRetryException { | ||
|
||
public RMLockFailedRetryException(int errCode, String desc) { | ||
super(errCode, desc); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...ication-manager/src/main/scala/org/apache/linkis/manager/rm/entity/LabelResourceMap.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* 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.rm.entity | ||
|
||
import org.apache.linkis.manager.common.entity.resource.Resource | ||
import org.apache.linkis.manager.label.entity.Label | ||
import org.apache.linkis.manager.rm.entity.ResourceOperationType.ResourceOperationType | ||
|
||
class LabelResourceMapping( | ||
label: Label[_], | ||
resource: Resource, | ||
resourceOperationType: ResourceOperationType | ||
) { | ||
|
||
override def equals(obj: Any): Boolean = { | ||
obj match { | ||
case labelResourceMap: LabelResourceMapping => | ||
labelResourceMap.getLabel().getStringValue.equals(label.getStringValue) | ||
case _ => false | ||
} | ||
} | ||
|
||
override def hashCode(): Int = { | ||
super.hashCode() | ||
} | ||
|
||
def getLabel(): Label[_] = label | ||
|
||
def getResource(): Resource = resource | ||
|
||
def getResourceOperationType: ResourceOperationType = resourceOperationType | ||
|
||
override def toString: String = { | ||
s"Label ${label.getStringValue} mapping resource ${resource}" | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...on-manager/src/main/scala/org/apache/linkis/manager/rm/entity/ResourceOperationType.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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.rm.entity | ||
|
||
object ResourceOperationType extends Enumeration { | ||
|
||
type ResourceOperationType = Value | ||
|
||
val LOCK, USED, USED_RELEASE, LOCKER_RELEASE = Value | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.