HBASE-27020 Fix spotless warn for master branch (#4417)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Reviewed by: Rushabh Shah <shahrs87@gmail.com>
This commit is contained in:
litao 2022-05-11 14:36:37 +08:00 committed by GitHub
parent c269dc5711
commit a712f9fa34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 18 deletions

View File

@ -1232,13 +1232,11 @@ public class HStore
allowedOnPath = ".*/(HStore|TestHStore).java") allowedOnPath = ".*/(HStore|TestHStore).java")
void replaceStoreFiles(Collection<HStoreFile> compactedFiles, Collection<HStoreFile> result, void replaceStoreFiles(Collection<HStoreFile> compactedFiles, Collection<HStoreFile> result,
boolean writeCompactionMarker) throws IOException { boolean writeCompactionMarker) throws IOException {
storeEngine.replaceStoreFiles(compactedFiles, result, storeEngine.replaceStoreFiles(compactedFiles, result, () -> {
() -> { if (writeCompactionMarker) {
if (writeCompactionMarker) { writeCompactionWalRecord(compactedFiles, result);
writeCompactionWalRecord(compactedFiles, result); }
} }, () -> {
},
() -> {
synchronized (filesCompacting) { synchronized (filesCompacting) {
filesCompacting.removeAll(compactedFiles); filesCompacting.removeAll(compactedFiles);
} }

View File

@ -34,7 +34,6 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.function.Function; import java.util.function.Function;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.CellComparator;
@ -408,7 +407,9 @@ public abstract class StoreEngine<SF extends StoreFlusher, CP extends Compaction
List<HStoreFile> openedFiles = openStoreFiles(toBeAddedFiles, false); List<HStoreFile> openedFiles = openStoreFiles(toBeAddedFiles, false);
// propogate the file changes to the underlying store file manager // propogate the file changes to the underlying store file manager
replaceStoreFiles(toBeRemovedStoreFiles, openedFiles, () -> {}, () -> {}); // won't throw an exception replaceStoreFiles(toBeRemovedStoreFiles, openedFiles, () -> {
}, () -> {
}); // won't throw an exception
} }
/** /**
@ -491,8 +492,8 @@ public abstract class StoreEngine<SF extends StoreFlusher, CP extends Compaction
} }
public void replaceStoreFiles(Collection<HStoreFile> compactedFiles, public void replaceStoreFiles(Collection<HStoreFile> compactedFiles,
Collection<HStoreFile> newFiles, IOExceptionRunnable walMarkerWriter, Collection<HStoreFile> newFiles, IOExceptionRunnable walMarkerWriter, Runnable actionUnderLock)
Runnable actionUnderLock) throws IOException { throws IOException {
storeFileTracker.replace(StoreUtils.toStoreFileInfo(compactedFiles), storeFileTracker.replace(StoreUtils.toStoreFileInfo(compactedFiles),
StoreUtils.toStoreFileInfo(newFiles)); StoreUtils.toStoreFileInfo(newFiles));
walMarkerWriter.run(); walMarkerWriter.run();

View File

@ -538,7 +538,6 @@ public class ReplicationSource implements ReplicationSourceInterface {
} }
} }
if (!this.isSourceActive()) { if (!this.isSourceActive()) {
setSourceStartupStatus(false); setSourceStartupStatus(false);
if (Thread.currentThread().isInterrupted()) { if (Thread.currentThread().isInterrupted()) {
@ -569,7 +568,7 @@ public class ReplicationSource implements ReplicationSourceInterface {
} }
} }
if(!this.isSourceActive()) { if (!this.isSourceActive()) {
setSourceStartupStatus(false); setSourceStartupStatus(false);
if (Thread.currentThread().isInterrupted()) { if (Thread.currentThread().isInterrupted()) {
// If source is not running and thread is interrupted this means someone has tried to // If source is not running and thread is interrupted this means someone has tried to

View File

@ -1,4 +1,4 @@
/** /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information * distributed with this work for additional information
@ -39,7 +39,7 @@ import org.junit.rules.TestName;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@Category({ MediumTests.class, ClientTests.class}) @Category({ MediumTests.class, ClientTests.class })
public class TestBadReplicationPeer { public class TestBadReplicationPeer {
@ClassRule @ClassRule
public static final HBaseClassTestRule CLASS_RULE = public static final HBaseClassTestRule CLASS_RULE =
@ -65,15 +65,15 @@ public class TestBadReplicationPeer {
} }
/* /*
Add dummy peer and make sure that we are able to remove that peer. * Add dummy peer and make sure that we are able to remove that peer.
*/ */
@Test @Test
public void testRemovePeerSucceeds() throws IOException { public void testRemovePeerSucceeds() throws IOException {
String peerId = "dummypeer_1"; String peerId = "dummypeer_1";
try (Connection connection = ConnectionFactory.createConnection(conf); try (Connection connection = ConnectionFactory.createConnection(conf);
Admin admin = connection.getAdmin()){ Admin admin = connection.getAdmin()) {
ReplicationPeerConfigBuilder rpcBuilder = ReplicationPeerConfig.newBuilder(); ReplicationPeerConfigBuilder rpcBuilder = ReplicationPeerConfig.newBuilder();
String quorum = TEST_UTIL.getHBaseCluster().getMaster().getZooKeeper().getQuorum(); String quorum = TEST_UTIL.getHBaseCluster().getMaster().getZooKeeper().getQuorum();
rpcBuilder.setClusterKey(quorum + ":/1"); rpcBuilder.setClusterKey(quorum + ":/1");
ReplicationPeerConfig rpc = rpcBuilder.build(); ReplicationPeerConfig rpc = rpcBuilder.build();
admin.addReplicationPeer(peerId, rpc); admin.addReplicationPeer(peerId, rpc);