HDDS-808. Simplify OMAction and DNAction classes used for AuditLogging. Contributed by Dinesh Chitlangia.
This commit is contained in:
parent
07142f54a8
commit
184cced513
@ -21,34 +21,28 @@ package org.apache.hadoop.ozone.audit;
|
|||||||
*/
|
*/
|
||||||
public enum DNAction implements AuditAction {
|
public enum DNAction implements AuditAction {
|
||||||
|
|
||||||
CREATE_CONTAINER("CREATE_CONTAINER"),
|
CREATE_CONTAINER,
|
||||||
READ_CONTAINER("READ_CONTAINER"),
|
READ_CONTAINER,
|
||||||
UPDATE_CONTAINER("UPDATE_CONTAINER"),
|
UPDATE_CONTAINER,
|
||||||
DELETE_CONTAINER("DELETE_CONTAINER"),
|
DELETE_CONTAINER,
|
||||||
LIST_CONTAINER("LIST_CONTAINER"),
|
LIST_CONTAINER,
|
||||||
PUT_BLOCK("PUT_BLOCK"),
|
PUT_BLOCK,
|
||||||
GET_BLOCK("GET_BLOCK"),
|
GET_BLOCK,
|
||||||
DELETE_BLOCK("DELETE_BLOCK"),
|
DELETE_BLOCK,
|
||||||
LIST_BLOCK("LIST_BLOCK"),
|
LIST_BLOCK,
|
||||||
READ_CHUNK("READ_CHUNK"),
|
READ_CHUNK,
|
||||||
DELETE_CHUNK("DELETE_CHUNK"),
|
DELETE_CHUNK,
|
||||||
WRITE_CHUNK("WRITE_CHUNK"),
|
WRITE_CHUNK,
|
||||||
LIST_CHUNK("LIST_CHUNK"),
|
LIST_CHUNK,
|
||||||
COMPACT_CHUNK("COMPACT_CHUNK"),
|
COMPACT_CHUNK,
|
||||||
PUT_SMALL_FILE("PUT_SMALL_FILE"),
|
PUT_SMALL_FILE,
|
||||||
GET_SMALL_FILE("GET_SMALL_FILE"),
|
GET_SMALL_FILE,
|
||||||
CLOSE_CONTAINER("CLOSE_CONTAINER"),
|
CLOSE_CONTAINER,
|
||||||
GET_COMMITTED_BLOCK_LENGTH("GET_COMMITTED_BLOCK_LENGTH");
|
GET_COMMITTED_BLOCK_LENGTH;
|
||||||
|
|
||||||
private String action;
|
|
||||||
|
|
||||||
DNAction(String action) {
|
|
||||||
this.action = action;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAction() {
|
public String getAction() {
|
||||||
return this.action;
|
return this.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,30 +22,24 @@ package org.apache.hadoop.ozone.audit;
|
|||||||
*/
|
*/
|
||||||
public enum DummyAction implements AuditAction {
|
public enum DummyAction implements AuditAction {
|
||||||
|
|
||||||
CREATE_VOLUME("CREATE_VOLUME"),
|
CREATE_VOLUME,
|
||||||
CREATE_BUCKET("CREATE_BUCKET"),
|
CREATE_BUCKET,
|
||||||
CREATE_KEY("CREATE_KEY"),
|
CREATE_KEY,
|
||||||
READ_VOLUME("READ_VOLUME"),
|
READ_VOLUME,
|
||||||
READ_BUCKET("READ_BUCKET"),
|
READ_BUCKET,
|
||||||
READ_KEY("READ_BUCKET"),
|
READ_KEY,
|
||||||
UPDATE_VOLUME("UPDATE_VOLUME"),
|
UPDATE_VOLUME,
|
||||||
UPDATE_BUCKET("UPDATE_BUCKET"),
|
UPDATE_BUCKET,
|
||||||
UPDATE_KEY("UPDATE_KEY"),
|
UPDATE_KEY,
|
||||||
DELETE_VOLUME("DELETE_VOLUME"),
|
DELETE_VOLUME,
|
||||||
DELETE_BUCKET("DELETE_BUCKET"),
|
DELETE_BUCKET,
|
||||||
DELETE_KEY("DELETE_KEY"),
|
DELETE_KEY,
|
||||||
SET_OWNER("SET_OWNER"),
|
SET_OWNER,
|
||||||
SET_QUOTA("SET_QUOTA");
|
SET_QUOTA;
|
||||||
|
|
||||||
private final String action;
|
|
||||||
|
|
||||||
DummyAction(String action) {
|
|
||||||
this.action = action;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAction() {
|
public String getAction() {
|
||||||
return this.action;
|
return this.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,40 +23,34 @@ package org.apache.hadoop.ozone.audit;
|
|||||||
public enum OMAction implements AuditAction {
|
public enum OMAction implements AuditAction {
|
||||||
|
|
||||||
// WRITE Actions
|
// WRITE Actions
|
||||||
ALLOCATE_BLOCK("ALLOCATE_BLOCK"),
|
ALLOCATE_BLOCK,
|
||||||
ALLOCATE_KEY("ALLOCATE_KEY"),
|
ALLOCATE_KEY,
|
||||||
COMMIT_KEY("COMMIT_KEY"),
|
COMMIT_KEY,
|
||||||
CREATE_VOLUME("CREATE_VOLUME"),
|
CREATE_VOLUME,
|
||||||
CREATE_BUCKET("CREATE_BUCKET"),
|
CREATE_BUCKET,
|
||||||
CREATE_KEY("CREATE_KEY"),
|
CREATE_KEY,
|
||||||
DELETE_VOLUME("DELETE_VOLUME"),
|
DELETE_VOLUME,
|
||||||
DELETE_BUCKET("DELETE_BUCKET"),
|
DELETE_BUCKET,
|
||||||
DELETE_KEY("DELETE_KEY"),
|
DELETE_KEY,
|
||||||
RENAME_KEY("RENAME_KEY"),
|
RENAME_KEY,
|
||||||
SET_OWNER("SET_OWNER"),
|
SET_OWNER,
|
||||||
SET_QUOTA("SET_QUOTA"),
|
SET_QUOTA,
|
||||||
UPDATE_VOLUME("UPDATE_VOLUME"),
|
UPDATE_VOLUME,
|
||||||
UPDATE_BUCKET("UPDATE_BUCKET"),
|
UPDATE_BUCKET,
|
||||||
UPDATE_KEY("UPDATE_KEY"),
|
UPDATE_KEY,
|
||||||
// READ Actions
|
// READ Actions
|
||||||
CHECK_VOLUME_ACCESS("CHECK_VOLUME_ACCESS"),
|
CHECK_VOLUME_ACCESS,
|
||||||
LIST_BUCKETS("LIST_BUCKETS"),
|
LIST_BUCKETS,
|
||||||
LIST_VOLUMES("LIST_VOLUMES"),
|
LIST_VOLUMES,
|
||||||
LIST_KEYS("LIST_KEYS"),
|
LIST_KEYS,
|
||||||
READ_VOLUME("READ_VOLUME"),
|
READ_VOLUME,
|
||||||
READ_BUCKET("READ_BUCKET"),
|
READ_BUCKET,
|
||||||
READ_KEY("READ_BUCKET"),
|
READ_KEY,
|
||||||
LIST_S3BUCKETS("LIST_S3BUCKETS");
|
LIST_S3BUCKETS;
|
||||||
|
|
||||||
private String action;
|
|
||||||
|
|
||||||
OMAction(String action) {
|
|
||||||
this.action = action;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAction() {
|
public String getAction() {
|
||||||
return this.action;
|
return this.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user