diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java index 7f8a5c716a2..23ddc14494c 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java @@ -109,7 +109,7 @@ public class WALPlayer extends Configured implements Tool { throws IOException { try { // skip all other tables - if (Bytes.equals(table, key.getTablename().getName())) { + if (Bytes.equals(table, key.getTableName().getName())) { for (Cell cell : value.getCells()) { KeyValue kv = KeyValueUtil.ensureKeyValue(cell); if (WALEdit.isMetaEditFamily(kv)) { @@ -150,7 +150,7 @@ public class WALPlayer extends Configured implements Tool { throws IOException { try { // skip all other tables - if (Bytes.equals(table, key.getTablename().getName())) { + if (Bytes.equals(table, key.getTableName().getName())) { for (Cell cell : value.getCells()) { if (WALEdit.isMetaEditFamily(cell)) { continue; @@ -190,10 +190,10 @@ public class WALPlayer extends Configured implements Tool { public void map(WALKey key, WALEdit value, Context context) throws IOException { try { - if (tables.isEmpty() || tables.containsKey(key.getTablename())) { + if (tables.isEmpty() || tables.containsKey(key.getTableName())) { TableName targetTable = tables.isEmpty() ? - key.getTablename() : - tables.get(key.getTablename()); + key.getTableName() : + tables.get(key.getTableName()); ImmutableBytesWritable tableOut = new ImmutableBytesWritable(targetTable.getName()); Put put = null; Delete del = null; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellBasedImportExport2.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellBasedImportExport2.java index cb179cce70e..d52863e99a7 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellBasedImportExport2.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellBasedImportExport2.java @@ -794,7 +794,7 @@ public class TestCellBasedImportExport2 { @Override public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) { - if (logKey.getTablename().getNameAsString().equalsIgnoreCase( + if (logKey.getTableName().getNameAsString().equalsIgnoreCase( this.regionInfo.getTable().getNameAsString()) && (!logEdit.isMetaEdit())) { isVisited = true; } diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellBasedWALPlayer2.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellBasedWALPlayer2.java index d25603c9996..9a63ae9bf3d 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellBasedWALPlayer2.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestCellBasedWALPlayer2.java @@ -173,7 +173,7 @@ public class TestCellBasedWALPlayer2 { configuration.set(tableConfigKey, "table"); WALCellMapper mapper = new WALCellMapper(); WALKey key = mock(WALKey.class); - when(key.getTablename()).thenReturn(TableName.valueOf("table")); + when(key.getTableName()).thenReturn(TableName.valueOf("table")); @SuppressWarnings("unchecked") Mapper.Context context = mock(Context.class); when(context.getConfiguration()).thenReturn(configuration); diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java index 6d323c9b419..0dbf738d6d0 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java @@ -794,7 +794,7 @@ public class TestImportExport { @Override public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) { - if (logKey.getTablename().getNameAsString().equalsIgnoreCase( + if (logKey.getTableName().getNameAsString().equalsIgnoreCase( this.regionInfo.getTable().getNameAsString()) && (!logEdit.isMetaEdit())) { isVisited = true; } diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java index eedada88f89..7ddcb449ee4 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALPlayer.java @@ -173,7 +173,7 @@ public class TestWALPlayer { configuration.set(tableConfigKey, "table"); WALKeyValueMapper mapper = new WALKeyValueMapper(); WALKey key = mock(WALKey.class); - when(key.getTablename()).thenReturn(TableName.valueOf("table")); + when(key.getTableName()).thenReturn(TableName.valueOf("table")); @SuppressWarnings("unchecked") Mapper.Context context = mock(Context.class); when(context.getConfiguration()).thenReturn(configuration); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java index 79fd0007125..81dd59e6478 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java @@ -46,7 +46,6 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos; import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.hbase.wal.WAL.Entry; -import org.apache.hadoop.hbase.wal.WALKey; @InterfaceAudience.Private public class ReplicationProtbufUtil { @@ -116,7 +115,7 @@ public class ReplicationProtbufUtil { UnsafeByteOperations.unsafeWrap(encodedRegionName == null ? key.getEncodedRegionName() : encodedRegionName)); - keyBuilder.setTableName(UnsafeByteOperations.unsafeWrap(key.getTablename().getName())); + keyBuilder.setTableName(UnsafeByteOperations.unsafeWrap(key.getTableName().getName())); long sequenceId = key.getSequenceId(); keyBuilder.setLogSequenceNumber(sequenceId); keyBuilder.setWriteTime(key.getWriteTime()); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ReaderBase.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ReaderBase.java index f0573587a63..f242cef5389 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ReaderBase.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ReaderBase.java @@ -100,7 +100,7 @@ public abstract class ReaderBase implements AbstractFSWALProvider.Reader { try { hasEntry = readNext(e); } catch (IllegalArgumentException iae) { - TableName tableName = e.getKey().getTablename(); + TableName tableName = e.getKey().getTableName(); if (tableName != null && tableName.equals(TableName.OLD_ROOT_TABLE_NAME)) { // It is old ROOT table edit, ignore it LOG.info("Got an old ROOT edit, ignoring "); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java index b540416fec5..ad6e5a64f3a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java @@ -57,7 +57,7 @@ public class NamespaceTableCfWALEntryFilter implements WALEntryFilter, WALCellFi @Override public Entry filter(Entry entry) { - TableName tabName = entry.getKey().getTablename(); + TableName tabName = entry.getKey().getTableName(); String namespace = tabName.getNamespaceAsString(); ReplicationPeerConfig peerConfig = this.peer.getPeerConfig(); @@ -110,10 +110,10 @@ public class NamespaceTableCfWALEntryFilter implements WALEntryFilter, WALCellFi if (CellUtil.matchingColumn(cell, WALEdit.METAFAMILY, WALEdit.BULK_LOAD)) { cell = bulkLoadFilter.filterCell(cell, - fam -> filterByExcludeTableCfs(entry.getKey().getTablename(), Bytes.toString(fam), + fam -> filterByExcludeTableCfs(entry.getKey().getTableName(), Bytes.toString(fam), excludeTableCfs)); } else { - if (filterByExcludeTableCfs(entry.getKey().getTablename(), + if (filterByExcludeTableCfs(entry.getKey().getTableName(), Bytes.toString(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength()), excludeTableCfs)) { return null; @@ -130,9 +130,9 @@ public class NamespaceTableCfWALEntryFilter implements WALEntryFilter, WALCellFi if (CellUtil.matchingColumn(cell, WALEdit.METAFAMILY, WALEdit.BULK_LOAD)) { cell = bulkLoadFilter.filterCell(cell, - fam -> filterByTableCfs(entry.getKey().getTablename(), Bytes.toString(fam), tableCfs)); + fam -> filterByTableCfs(entry.getKey().getTableName(), Bytes.toString(fam), tableCfs)); } else { - if (filterByTableCfs(entry.getKey().getTablename(), + if (filterByTableCfs(entry.getKey().getTableName(), Bytes.toString(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength()), tableCfs)) { return null; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/SystemTableWALEntryFilter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/SystemTableWALEntryFilter.java index dc9aaf4604a..1984436019a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/SystemTableWALEntryFilter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/SystemTableWALEntryFilter.java @@ -28,7 +28,7 @@ import org.apache.hadoop.hbase.wal.WAL.Entry; public class SystemTableWALEntryFilter implements WALEntryFilter { @Override public Entry filter(Entry entry) { - if (entry.getKey().getTablename().isSystemTable()) { + if (entry.getKey().getTableName().isSystemTable()) { return null; } return entry; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java index 5872d0852ad..5467de01882 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java @@ -258,7 +258,7 @@ public class HBaseInterClusterReplicationEndpoint extends HBaseReplicationEndpoi ArrayList thisList = new ArrayList(entries.size()); entryLists.add(thisList); for (Entry e : entries) { - if (!e.getKey().getTablename().equals(table)) { + if (!e.getKey().getTableName().equals(table)) { thisList.add(e); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKey.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKey.java index 0c818dbac87..af3cf7115ec 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKey.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKey.java @@ -29,7 +29,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.NavigableMap; import java.util.UUID; @@ -57,7 +56,7 @@ public interface WALKey extends SequenceId, Comparable { /** * @return table name */ - TableName getTablename(); + TableName getTableName(); /** * @return the write time @@ -96,7 +95,7 @@ public interface WALKey extends SequenceId, Comparable { */ default Map toStringMap() { Map stringMap = new HashMap<>(); - stringMap.put("table", getTablename()); + stringMap.put("table", getTableName()); stringMap.put("region", Bytes.toStringBinary(getEncodedRegionName())); stringMap.put("sequence", getSequenceId()); return stringMap; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKeyImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKeyImpl.java index 0a5acdad6ae..7abd4a52387 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKeyImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKeyImpl.java @@ -352,7 +352,7 @@ public class WALKeyImpl implements WALKey { /** @return table name */ @Override - public TableName getTablename() { + public TableName getTableName() { return tablename; } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java index 97f80e02445..e442fd81f55 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java @@ -469,7 +469,7 @@ public class WALSplitter { static Path getRegionSplitEditsPath(final FileSystem fs, final Entry logEntry, final Path rootDir, String fileNameBeingSplit) throws IOException { - Path tableDir = FSUtils.getTableDir(rootDir, logEntry.getKey().getTablename()); + Path tableDir = FSUtils.getTableDir(rootDir, logEntry.getKey().getTableName()); String encodedRegionName = Bytes.toString(logEntry.getKey().getEncodedRegionName()); Path regiondir = HRegion.getRegionDir(tableDir, encodedRegionName); Path dir = getRegionDirRecoveredEditsDir(regiondir); @@ -876,7 +876,7 @@ public class WALSplitter { synchronized (this) { buffer = buffers.get(key.getEncodedRegionName()); if (buffer == null) { - buffer = new RegionEntryBuffer(key.getTablename(), key.getEncodedRegionName()); + buffer = new RegionEntryBuffer(key.getTableName(), key.getEncodedRegionName()); buffers.put(key.getEncodedRegionName(), buffer); } incrHeap= buffer.appendEntry(entry); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java index 0d864b628e9..62623b00e5c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java @@ -600,7 +600,7 @@ public class SimpleRegionObserver implements RegionCoprocessor, RegionObserver { @Override public void preWALRestore(ObserverContext env, RegionInfo info, WALKey logKey, WALEdit logEdit) throws IOException { - String tableName = logKey.getTablename().getNameAsString(); + String tableName = logKey.getTableName().getNameAsString(); if (tableName.equals(TABLE_SKIPPED)) { // skip recovery of TABLE_SKIPPED for testing purpose env.bypass(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java index 7abba4c7008..e973a335694 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java @@ -590,14 +590,14 @@ public class TestWALLockup { @Override public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) throws IOException { - if (logKey.getTablename().getNameAsString().equalsIgnoreCase("sleep")) { + if (logKey.getTableName().getNameAsString().equalsIgnoreCase("sleep")) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } - if (logKey.getTablename().getNameAsString() + if (logKey.getTableName().getNameAsString() .equalsIgnoreCase("DamagedWALException")) { throw new DamagedWALException("Failed appending"); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestProtobufLog.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestProtobufLog.java index c0510d33b14..e9d147fca0f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestProtobufLog.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestProtobufLog.java @@ -178,7 +178,7 @@ public abstract class AbstractTestProtobufLog { assertNotNull(entry); assertEquals(columnCount, entry.getEdit().size()); assertArrayEquals(hri.getEncodedNameAsBytes(), entry.getKey().getEncodedRegionName()); - assertEquals(tableName, entry.getKey().getTablename()); + assertEquals(tableName, entry.getKey().getTableName()); int idx = 0; for (Cell val : entry.getEdit().getCells()) { assertTrue(Bytes.equals(row, 0, row.length, val.getRowArray(), val.getRowOffset(), diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpointNoMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpointNoMaster.java index 33ea8d750f0..15066dd2642 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpointNoMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplicationEndpointNoMaster.java @@ -167,7 +167,7 @@ public class TestRegionReplicaReplicationEndpointNoMaster { public void postWALWrite(ObserverContext ctx, RegionInfo info, WALKey logKey, WALEdit logEdit) throws IOException { // only keep primary region's edits - if (logKey.getTablename().equals(tableName) && info.getReplicaId() == 0) { + if (logKey.getTableName().equals(tableName) && info.getReplicaId() == 0) { // Presume type is a WALKeyImpl entries.add(new Entry((WALKeyImpl)logKey, logEdit)); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFactory.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFactory.java index 5679d96cd03..3a4c85231b8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFactory.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFactory.java @@ -536,7 +536,7 @@ public class TestWALFactory { WALKey key = entry.getKey(); WALEdit val = entry.getEdit(); assertTrue(Bytes.equals(info.getEncodedNameAsBytes(), key.getEncodedRegionName())); - assertTrue(htd.getTableName().equals(key.getTablename())); + assertTrue(htd.getTableName().equals(key.getTableName())); Cell cell = val.getCells().get(0); assertTrue(Bytes.equals(row, 0, row.length, cell.getRowArray(), cell.getRowOffset(), cell.getRowLength())); @@ -592,7 +592,7 @@ public class TestWALFactory { for (Cell val : entry.getEdit().getCells()) { assertTrue(Bytes.equals(hri.getEncodedNameAsBytes(), entry.getKey().getEncodedRegionName())); - assertTrue(htd.getTableName().equals(entry.getKey().getTablename())); + assertTrue(htd.getTableName().equals(entry.getKey().getTableName())); assertTrue(Bytes.equals(row, 0, row.length, val.getRowArray(), val.getRowOffset(), val.getRowLength())); assertEquals((byte) (idx + '0'), CellUtil.cloneValue(val)[0]);