From 5c988c99606080599534a751f061750f241c0945 Mon Sep 17 00:00:00 2001 From: tedyu Date: Wed, 21 Feb 2018 13:05:54 -0800 Subject: [PATCH] HBASE-19166 AsyncProtobufLogWriter persists ProtobufLogWriter as class name for backward compatibility --- .../hbase/regionserver/wal/AsyncProtobufLogWriter.java | 9 +++++++++ .../regionserver/wal/SecureAsyncProtobufLogWriter.java | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java index 67258ec0d62..abdc24e9c6e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java @@ -108,6 +108,15 @@ public class AsyncProtobufLogWriter extends AbstractProtobufLogWriter this.channelClass = channelClass; } + /* + * @return class name which is recognized by hbase-1.x to avoid ProtobufLogReader throwing error: + * IOException: Got unknown writer class: AsyncProtobufLogWriter + */ + @Override + protected String getWriterClassName() { + return "ProtobufLogWriter"; + } + @Override public void append(Entry entry) { int buffered = output.buffered(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureAsyncProtobufLogWriter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureAsyncProtobufLogWriter.java index 7741b5e274d..e2d294ac1f2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureAsyncProtobufLogWriter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureAsyncProtobufLogWriter.java @@ -38,6 +38,14 @@ public class SecureAsyncProtobufLogWriter extends AsyncProtobufLogWriter { super(eventLoopGroup, channelClass); } + /* + * @return class name which is recognized by hbase-1.x to avoid ProtobufLogReader throwing error: + * IOException: Got unknown writer class: SecureAsyncProtobufLogWriter + */ + @Override + protected String getWriterClassName() { + return "SecureProtobufLogWriter"; + } @Override protected WALHeader buildWALHeader(Configuration conf, WALHeader.Builder builder) throws IOException {