From 2cb5cf647206d30d11b98d0b91a0f21f8da1c48d Mon Sep 17 00:00:00 2001 From: chenhang Date: Wed, 23 Aug 2023 14:33:16 +0800 Subject: [PATCH] fix check style --- .../client/RackawareEnsemblePlacementPolicyImpl.java | 4 ++-- .../client/TestRackawareEnsemblePlacementPolicy.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java index 774eac57885..490d8fb9712 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java @@ -209,8 +209,8 @@ public Integer getSample() { BookieNode bn = null; if (!ignoreLocalNodeInPlacementPolicy) { try { - String hostname = useHostnameResolveLocalNodePlacementPolicy ? - InetAddress.getLocalHost().getCanonicalHostName() : InetAddress.getLocalHost().getHostAddress(); + String hostname = useHostnameResolveLocalNodePlacementPolicy + ? InetAddress.getLocalHost().getCanonicalHostName() : InetAddress.getLocalHost().getHostAddress(); bn = createDummyLocalBookieNode(hostname); } catch (IOException e) { LOG.error("Failed to get local host address : ", e); diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java index f3624687aaf..e535497dd80 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRackawareEnsemblePlacementPolicy.java @@ -1714,8 +1714,8 @@ public void testNewEnsemblePickLocalRackBookiesInternal(boolean useHostnameResol StaticDNSResolver.addNodeToRack(addr4.getHostName(), "/default-region/r2"); StaticDNSResolver.addNodeToRack(addr5.getHostName(), "/default-region/r3"); - String hostname = useHostnameResolveLocalNodePlacementPolicy ? - InetAddress.getLocalHost().getCanonicalHostName() : InetAddress.getLocalHost().getHostAddress(); + String hostname = useHostnameResolveLocalNodePlacementPolicy + ? InetAddress.getLocalHost().getCanonicalHostName() : InetAddress.getLocalHost().getHostAddress(); StaticDNSResolver.addNodeToRack(hostname, "/default-region/r1"); if (useHostnameResolveLocalNodePlacementPolicy) { conf.setUseHostnameResolveLocalNodePlacementPolicy(useHostnameResolveLocalNodePlacementPolicy);