Tsz-wo Sze created HDDS-16070:
---------------------------------
Summary: Move LeveledResource to a standalone class
Key: HDDS-16070
URL: https://issues.apache.org/jira/browse/HDDS-16070
Project: Apache Ozone
Issue Type: Sub-task
Components: OM
Reporter: Tsz-wo Sze
Assignee: Tsz-wo Sze
LeveledResource currently is an inner class of OzoneManagerLock. The javadoc of
the OzoneManagerLock class mentions some details of LeveledResource; see below.
It gives an impression that OzoneManagerLock supports only LeveledResource.
However, OzoneManagerLock also support DAGLeveledResource.
- Let's move LeveledResource to a standalone class.
- Move all the LeveledResource related javadoc/comments to that class.
{code:java}
/**
* Provides different locks to handle concurrency in OzoneMaster.
* We also maintain lock hierarchy, based on the weight.
*
* <table>
* <caption></caption>
* <tr>
* <td><b> WEIGHT </b></td> <td><b> LOCK </b></td>
* </tr>
* <tr>
* <td> 0 </td> <td> S3 Bucket Lock </td>
* </tr>
* <tr>
* <td> 1 </td> <td> Volume Lock </td>
* </tr>
* <tr>
* <td> 2 </td> <td> Bucket Lock </td>
* </tr>
* <tr>
* <td> 3 </td> <td> User Lock </td>
* </tr>
* <tr>
* <td> 4 </td> <td> S3 Secret Lock</td>
* </tr>
* <tr>
* <td> 5 </td> <td> Prefix Lock </td>
* </tr>
* </table>
*
* One cannot obtain a lower weight lock while holding a lock with higher
* weight. The other way around is possible. <br>
* <br>
* <p>
* For example:
* <br>
* {@literal ->} acquire volume lock (will work)<br>
* {@literal +->} acquire bucket lock (will work)<br>
* {@literal +-->} acquire s3 bucket lock (will throw Exception)<br>
* </p>
* <br>
*/
public class OzoneManagerLock implements IOzoneManagerLock {
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]