|
@@ -118,11 +118,10 @@ import com.google.common.base.Preconditions;
|
|
|
@InterfaceStability.Unstable
|
|
|
public abstract class FSEditLogOp {
|
|
|
public final FSEditLogOpCodes opCode;
|
|
|
- long txid;
|
|
|
+ long txid = HdfsConstants.INVALID_TXID;
|
|
|
byte[] rpcClientId = RpcConstants.DUMMY_CLIENT_ID;
|
|
|
int rpcCallId = RpcConstants.INVALID_CALL_ID;
|
|
|
|
|
|
- @SuppressWarnings("deprecation")
|
|
|
final public static class OpInstanceCache {
|
|
|
private EnumMap<FSEditLogOpCodes, FSEditLogOp> inst =
|
|
|
new EnumMap<FSEditLogOpCodes, FSEditLogOp>(FSEditLogOpCodes.class);
|
|
@@ -147,13 +146,10 @@ public abstract class FSEditLogOp {
|
|
|
inst.put(OP_REASSIGN_LEASE, new ReassignLeaseOp());
|
|
|
inst.put(OP_GET_DELEGATION_TOKEN, new GetDelegationTokenOp());
|
|
|
inst.put(OP_RENEW_DELEGATION_TOKEN, new RenewDelegationTokenOp());
|
|
|
- inst.put(OP_CANCEL_DELEGATION_TOKEN,
|
|
|
- new CancelDelegationTokenOp());
|
|
|
+ inst.put(OP_CANCEL_DELEGATION_TOKEN, new CancelDelegationTokenOp());
|
|
|
inst.put(OP_UPDATE_MASTER_KEY, new UpdateMasterKeyOp());
|
|
|
- inst.put(OP_START_LOG_SEGMENT,
|
|
|
- new LogSegmentOp(OP_START_LOG_SEGMENT));
|
|
|
- inst.put(OP_END_LOG_SEGMENT,
|
|
|
- new LogSegmentOp(OP_END_LOG_SEGMENT));
|
|
|
+ inst.put(OP_START_LOG_SEGMENT, new LogSegmentOp(OP_START_LOG_SEGMENT));
|
|
|
+ inst.put(OP_END_LOG_SEGMENT, new LogSegmentOp(OP_END_LOG_SEGMENT));
|
|
|
inst.put(OP_UPDATE_BLOCKS, new UpdateBlocksOp());
|
|
|
|
|
|
inst.put(OP_ALLOW_SNAPSHOT, new AllowSnapshotOp());
|
|
@@ -163,12 +159,10 @@ public abstract class FSEditLogOp {
|
|
|
inst.put(OP_RENAME_SNAPSHOT, new RenameSnapshotOp());
|
|
|
inst.put(OP_SET_GENSTAMP_V2, new SetGenstampV2Op());
|
|
|
inst.put(OP_ALLOCATE_BLOCK_ID, new AllocateBlockIdOp());
|
|
|
- inst.put(OP_ADD_CACHE_DIRECTIVE,
|
|
|
- new AddCacheDirectiveInfoOp());
|
|
|
- inst.put(OP_MODIFY_CACHE_DIRECTIVE,
|
|
|
- new ModifyCacheDirectiveInfoOp());
|
|
|
- inst.put(OP_REMOVE_CACHE_DIRECTIVE,
|
|
|
- new RemoveCacheDirectiveInfoOp());
|
|
|
+
|
|
|
+ inst.put(OP_ADD_CACHE_DIRECTIVE, new AddCacheDirectiveInfoOp());
|
|
|
+ inst.put(OP_MODIFY_CACHE_DIRECTIVE, new ModifyCacheDirectiveInfoOp());
|
|
|
+ inst.put(OP_REMOVE_CACHE_DIRECTIVE, new RemoveCacheDirectiveInfoOp());
|
|
|
inst.put(OP_ADD_CACHE_POOL, new AddCachePoolOp());
|
|
|
inst.put(OP_MODIFY_CACHE_POOL, new ModifyCachePoolOp());
|
|
|
inst.put(OP_REMOVE_CACHE_POOL, new RemoveCachePoolOp());
|
|
@@ -185,7 +179,6 @@ public abstract class FSEditLogOp {
|
|
|
*/
|
|
|
private FSEditLogOp(FSEditLogOpCodes opCode) {
|
|
|
this.opCode = opCode;
|
|
|
- this.txid = HdfsConstants.INVALID_TXID;
|
|
|
}
|
|
|
|
|
|
public long getTransactionId() {
|
|
@@ -3332,9 +3325,7 @@ public abstract class FSEditLogOp {
|
|
|
* @param in The stream to read from.
|
|
|
* @param logVersion The version of the data coming from the stream.
|
|
|
*/
|
|
|
- @SuppressWarnings("deprecation")
|
|
|
- public Reader(DataInputStream in, StreamLimiter limiter,
|
|
|
- int logVersion) {
|
|
|
+ public Reader(DataInputStream in, StreamLimiter limiter, int logVersion) {
|
|
|
this.logVersion = logVersion;
|
|
|
if (LayoutVersion.supports(Feature.EDITS_CHESKUM, logVersion)) {
|
|
|
this.checksum = new PureJavaCrc32();
|