Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureWALCellCodec.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/Secur
- index 4ee3738..a516fef 100644
- --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureWALCellCodec.java
- +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureWALCellCodec.java
- @@ -46,6 +46,10 @@ public class SecureWALCellCodec extends WALCellCodec {
- private Encryptor encryptor;
- private Decryptor decryptor;
- + public SecureWALCellCodec(Configuration conf, CompressionContext compression) {
- + super(conf, compression);
- + }
- +
- public SecureWALCellCodec(Configuration conf, Encryptor encryptor) {
- super(conf, null);
- this.encryptor = encryptor;
- @@ -68,11 +72,16 @@ public class SecureWALCellCodec extends WALCellCodec {
- public EncryptedKvDecoder(InputStream in, Decryptor decryptor) {
- super(in);
- this.decryptor = decryptor;
- - this.iv = new byte[decryptor.getIvLength()];
- + if (decryptor != null) {
- + this.iv = new byte[decryptor.getIvLength()];
- + }
- }
- @Override
- protected Cell parseCell() throws IOException {
- + if (this.iv == null) {
- + return super.parseCell();
- + }
- int ivLength = 0;
- try {
- ivLength = StreamUtils.readRawVarint32(in);
- @@ -171,6 +180,10 @@ public class SecureWALCellCodec extends WALCellCodec {
- @Override
- public void write(Cell cell) throws IOException {
- if (!(cell instanceof KeyValue)) throw new IOException("Cannot write non-KV cells to WAL");
- + if (encryptor == null) {
- + super.write(cell);
- + return;
- + }
- KeyValue kv = (KeyValue)cell;
- byte[] kvBuffer = kv.getBuffer();
Advertisement
Add Comment
Please, Sign In to add comment