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 {