HBASE-26564 Retire the method visitLogEntryBeforeWrite without RegionInfo in WALActionListner (#3938)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
543582e7eb
commit
a599d52820
|
@ -810,7 +810,7 @@ public class TestImportExport {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) {
|
||||
public void visitLogEntryBeforeWrite(RegionInfo info, WALKey logKey, WALEdit logEdit) {
|
||||
if (logKey.getTableName().getNameAsString().equalsIgnoreCase(
|
||||
this.regionInfo.getTable().getNameAsString()) && (!logEdit.isMetaEdit())) {
|
||||
isVisited = true;
|
||||
|
|
|
@ -1129,7 +1129,7 @@ public abstract class AbstractFSWAL<W extends WriterBase> implements WAL {
|
|||
coprocessorHost.preWALWrite(entry.getRegionInfo(), entry.getKey(), entry.getEdit());
|
||||
if (!listeners.isEmpty()) {
|
||||
for (WALActionsListener i : listeners) {
|
||||
i.visitLogEntryBeforeWrite(entry.getKey(), entry.getEdit());
|
||||
i.visitLogEntryBeforeWrite(entry.getRegionInfo(), entry.getKey(), entry.getEdit());
|
||||
}
|
||||
}
|
||||
doAppend(writer, entry);
|
||||
|
|
|
@ -89,16 +89,6 @@ public interface WALActionsListener {
|
|||
*/
|
||||
default void visitLogEntryBeforeWrite(RegionInfo info, WALKey logKey, WALEdit logEdit) {}
|
||||
|
||||
/**
|
||||
* @param logKey
|
||||
* @param logEdit TODO: Retire this in favor of
|
||||
* {@link #visitLogEntryBeforeWrite(RegionInfo, WALKey, WALEdit)} It only exists to get
|
||||
* scope when replicating. Scope should be in the WALKey and not need us passing in a
|
||||
* <code>htd</code>.
|
||||
* @throws IOException If failed to parse the WALEdit
|
||||
*/
|
||||
default void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) throws IOException {}
|
||||
|
||||
/**
|
||||
* For notification post append to the writer. Used by metrics system at least.
|
||||
* TODO: Combine this with above.
|
||||
|
|
|
@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.replication.regionserver;
|
|||
import java.io.IOException;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.hadoop.hbase.client.RegionInfo;
|
||||
import org.apache.hadoop.hbase.regionserver.wal.WALActionsListener;
|
||||
import org.apache.hadoop.hbase.replication.ReplicationUtils;
|
||||
import org.apache.hadoop.hbase.wal.WALEdit;
|
||||
|
@ -53,7 +54,7 @@ class ReplicationSourceWALActionListener implements WALActionsListener {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) throws IOException {
|
||||
public void visitLogEntryBeforeWrite(RegionInfo info, WALKey logKey, WALEdit logEdit) {
|
||||
scopeWALEdits(logKey, logEdit, conf);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ import org.apache.hadoop.hbase.TableName;
|
|||
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
|
||||
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
|
||||
import org.apache.hadoop.hbase.client.Connection;
|
||||
import org.apache.hadoop.hbase.client.RegionInfo;
|
||||
import org.apache.hadoop.hbase.client.RegionLocator;
|
||||
import org.apache.hadoop.hbase.client.Result;
|
||||
import org.apache.hadoop.hbase.client.ResultScanner;
|
||||
|
@ -407,7 +408,7 @@ public class TestHRegionServerBulkLoad {
|
|||
private boolean found = false;
|
||||
|
||||
@Override
|
||||
public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) {
|
||||
public void visitLogEntryBeforeWrite(RegionInfo info, WALKey logKey, WALEdit logEdit) {
|
||||
for (Cell cell : logEdit.getCells()) {
|
||||
KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
|
||||
for (Map.Entry entry : kv.toStringMap().entrySet()) {
|
||||
|
|
|
@ -545,7 +545,7 @@ public abstract class AbstractTestFSWAL {
|
|||
wal.init();
|
||||
wal.registerWALActionsListener(new WALActionsListener() {
|
||||
@Override
|
||||
public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) throws IOException {
|
||||
public void visitLogEntryBeforeWrite(RegionInfo info, WALKey logKey, WALEdit logEdit) {
|
||||
if (startHoldingForAppend.get()) {
|
||||
try {
|
||||
holdAppend.await();
|
||||
|
|
|
@ -240,8 +240,7 @@ public class TestFSHLog extends AbstractTestFSWAL {
|
|||
log.init();
|
||||
log.registerWALActionsListener(new WALActionsListener() {
|
||||
@Override
|
||||
public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit)
|
||||
throws IOException {
|
||||
public void visitLogEntryBeforeWrite(RegionInfo info, WALKey logKey, WALEdit logEdit) {
|
||||
if (startHoldingForAppend.get()) {
|
||||
try {
|
||||
holdAppend.await();
|
||||
|
|
|
@ -675,13 +675,6 @@ public class TestWALFactory {
|
|||
public void visitLogEntryBeforeWrite(RegionInfo info, WALKey logKey, WALEdit logEdit) {
|
||||
increments++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) {
|
||||
// To change body of implemented methods use File | Settings | File
|
||||
// Templates.
|
||||
increments++;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -471,7 +471,7 @@ public final class WALPerformanceEvaluation extends Configured implements Tool {
|
|||
private int appends = 0;
|
||||
|
||||
@Override
|
||||
public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) {
|
||||
public void visitLogEntryBeforeWrite(RegionInfo info, WALKey logKey, WALEdit logEdit) {
|
||||
this.appends++;
|
||||
if (this.appends % whenToRoll == 0) {
|
||||
LOG.info("Rolling after " + appends + " edits");
|
||||
|
|
Loading…
Reference in New Issue