diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureProtobufLogReader.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureProtobufLogReader.java index 149dec2e5d2..0c9de4b28df 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureProtobufLogReader.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureProtobufLogReader.java @@ -114,11 +114,15 @@ public class SecureProtobufLogReader extends ProtobufLogReader { @Override protected void initAfterCompression() throws IOException { - WALCellCodec codec = SecureWALCellCodec.getCodec(this.conf, decryptor); - this.cellDecoder = codec.getDecoder(this.inputStream); - // We do not support compression - this.compressionContext = null; - this.hasCompression = false; + if (decryptor != null) { + WALCellCodec codec = SecureWALCellCodec.getCodec(this.conf, decryptor); + this.cellDecoder = codec.getDecoder(this.inputStream); + // We do not support compression with WAL encryption + this.compressionContext = null; + this.hasCompression = false; + } else { + super.initAfterCompression(); + } } }