HBASE-10433 SecureProtobufWALReader does not handle unencrypted WALs if configured to encrypt (Anoop Sam John)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1562545 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2014-01-29 18:55:40 +00:00
parent 3b21be1303
commit b75d3a54c1
1 changed files with 9 additions and 5 deletions

View File

@ -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();
}
}
}