Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-27020 Fix spotless warn for master branch #4417

Merged
merged 4 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1232,13 +1232,11 @@ private void writeCompactionWalRecord(Collection<HStoreFile> filesCompacted,
allowedOnPath = ".*/(HStore|TestHStore).java")
void replaceStoreFiles(Collection<HStoreFile> compactedFiles, Collection<HStoreFile> result,
boolean writeCompactionMarker) throws IOException {
storeEngine.replaceStoreFiles(compactedFiles, result,
() -> {
if (writeCompactionMarker) {
writeCompactionWalRecord(compactedFiles, result);
}
},
() -> {
storeEngine.replaceStoreFiles(compactedFiles, result, () -> {
if (writeCompactionMarker) {
writeCompactionWalRecord(compactedFiles, result);
}
}, () -> {
synchronized (filesCompacting) {
filesCompacting.removeAll(compactedFiles);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.function.Function;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.CellComparator;
Expand Down Expand Up @@ -408,7 +407,9 @@ private void refreshStoreFilesInternal(Collection<StoreFileInfo> newFiles) throw
List<HStoreFile> openedFiles = openStoreFiles(toBeAddedFiles, false);

// 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
}

/**
Expand Down Expand Up @@ -491,8 +492,8 @@ public void addStoreFiles(Collection<HStoreFile> storeFiles,
}

public void replaceStoreFiles(Collection<HStoreFile> compactedFiles,
Collection<HStoreFile> newFiles, IOExceptionRunnable walMarkerWriter,
Runnable actionUnderLock) throws IOException {
Collection<HStoreFile> newFiles, IOExceptionRunnable walMarkerWriter, Runnable actionUnderLock)
throws IOException {
storeFileTracker.replace(StoreUtils.toStoreFileInfo(compactedFiles),
StoreUtils.toStoreFileInfo(newFiles));
walMarkerWriter.run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ private void initialize() {
}
}


if (!this.isSourceActive()) {
setSourceStartupStatus(false);
if (Thread.currentThread().isInterrupted()) {
Expand Down Expand Up @@ -569,7 +568,7 @@ private void initialize() {
}
}

if(!this.isSourceActive()) {
if (!this.isSourceActive()) {
setSourceStartupStatus(false);
if (Thread.currentThread().isInterrupted()) {
// If source is not running and thread is interrupted this means someone has tried to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Expand Down Expand Up @@ -39,7 +39,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Category({ MediumTests.class, ClientTests.class})
@Category({ MediumTests.class, ClientTests.class })
public class TestBadReplicationPeer {
@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
Expand All @@ -65,15 +65,15 @@ public static void tearDownAfterClass() throws Exception {
}

/*
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
public void testRemovePeerSucceeds() throws IOException {
String peerId = "dummypeer_1";
try (Connection connection = ConnectionFactory.createConnection(conf);
Admin admin = connection.getAdmin()){
Admin admin = connection.getAdmin()) {
ReplicationPeerConfigBuilder rpcBuilder = ReplicationPeerConfig.newBuilder();
String quorum = TEST_UTIL.getHBaseCluster().getMaster().getZooKeeper().getQuorum();
String quorum = TEST_UTIL.getHBaseCluster().getMaster().getZooKeeper().getQuorum();
rpcBuilder.setClusterKey(quorum + ":/1");
ReplicationPeerConfig rpc = rpcBuilder.build();
admin.addReplicationPeer(peerId, rpc);
Expand Down