Skip to content

Commit

Permalink
Make changes to rebase to current master.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghatage committed Jul 12, 2024
1 parent c30ab3c commit ad48ed4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import static java.nio.charset.StandardCharsets.UTF_8;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.util.concurrent.RateLimiter;
import com.google.protobuf.InvalidProtocolBufferException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void testMarkLedgerUnderreplicatedBasic() throws Exception {

// mark when it hasn't been marked before
FutureUtils.result(urMgr.markLedgerUnderreplicatedAsync(ledgerId, missingBookies));
UnderreplicatedLedgerFormat urLedgerFormat = urMgr.getLedgerUnreplicationInfo(ledgerId);
UnderreplicatedLedger urLedgerFormat = urMgr.getLedgerUnreplicationInfo(ledgerId);
assertEquals(missingBookies, urLedgerFormat.getReplicaList());
assertTrue(urLedgerFormat.getCtime() > prevCtime);
prevCtime = urLedgerFormat.getCtime();
Expand Down Expand Up @@ -168,7 +168,7 @@ public void testMarkLedgerUnderreplicatedConcurrently() throws Exception {
}
FutureUtils.result(FutureUtils.collect(futures));

UnderreplicatedLedgerFormat urLedgerFormat = urMgr.getLedgerUnreplicationInfo(ledgerId);
UnderreplicatedLedger urLedgerFormat = urMgr.getLedgerUnreplicationInfo(ledgerId);
Set<String> actualBookies = Sets.newHashSet();
actualBookies.addAll(urLedgerFormat.getReplicaList());

Expand Down Expand Up @@ -198,7 +198,7 @@ public void testMarkLedgerUnderreplicatedConcurrentlyWithDifferentClients() thro

FutureUtils.result(FutureUtils.collect(futures));

UnderreplicatedLedgerFormat urLedgerFormat = urMgr.getLedgerUnreplicationInfo(ledgerId);
UnderreplicatedLedger urLedgerFormat = urMgr.getLedgerUnreplicationInfo(ledgerId);
Set<String> actualBookies = Sets.newHashSet();
actualBookies.addAll(urLedgerFormat.getReplicaList());

Expand Down Expand Up @@ -232,10 +232,10 @@ public void testMarkLedgerUnderreplicatedWhenSessionExpired() throws Exception {
// expected
}
try {
UnderreplicatedLedgerFormat urLedgerFormat =
UnderreplicatedLedger urLedgerFormat =
ZkLedgerUnderreplicationManagerTest.this.urMgr.getLedgerUnreplicationInfo(ledgerId);
fail("The ledger shouldn't been marked as underreplicated");
} catch (NoNodeException nee) {
} catch (ReplicationException.UnavailableException ue) {
// expected
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import io.netty.buffer.PooledByteBufAllocator;
import lombok.extern.slf4j.Slf4j;
import org.apache.bookkeeper.bookie.MockUncleanShutdownDetection;
import org.apache.bookkeeper.bookie.TestBookieImpl;
import org.apache.bookkeeper.client.BookKeeperAdmin;
import org.apache.bookkeeper.common.net.ServiceURI;
import org.apache.bookkeeper.conf.ClientConfiguration;
import org.apache.bookkeeper.conf.ServerConfiguration;
import org.apache.bookkeeper.conf.TestBKConfiguration;
import org.apache.bookkeeper.proto.BookieServer;
import org.apache.bookkeeper.test.PortManager;
import org.apache.bookkeeper.stats.NullStatsLogger;
import org.apache.bookkeeper.test.TestStatsProvider;
import org.apache.bookkeeper.util.IOUtils;
import org.apache.bookkeeper.util.PortManager;
import org.apache.commons.io.FileUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -112,8 +116,9 @@ private static void startNumBookies(int numBookies) throws Exception {

private static BookieServer startBookie(ServerConfiguration conf) throws Exception {
conf.setAutoRecoveryDaemonEnabled(true);
TestStatsProvider provider = new TestStatsProvider();
BookieServer server = new BookieServer(conf, provider.getStatsLogger(""));
BookieServer server = new BookieServer( conf, new TestBookieImpl(conf),
NullStatsLogger.INSTANCE, PooledByteBufAllocator.DEFAULT,
new MockUncleanShutdownDetection());
server.start();
return server;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class ZKMetadataStore implements MetadataStore {

@Override
public void start() throws Exception {
this.zkUtil.startServer();
this.zkUtil.startCluster();
}

@Override
public void close() throws Exception {
this.zkUtil.killServer();
this.zkUtil.killCluster();
}

@Override
Expand Down

0 comments on commit ad48ed4

Please sign in to comment.