Skip to content

Commit

Permalink
Issue 28: Fix cluster get-instances command to avoid "readonly" eleme…
Browse files Browse the repository at this point in the history
…nt in Bookie list. (#32)

Remove "readonly" artifact when listing Bookies registered in Zookeeper.

Signed-off-by: Raúl Gracia <raul.gracia@emc.com>
  • Loading branch information
RaulGracia authored May 28, 2019
1 parent d8b8777 commit 494e69f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;
Expand Down Expand Up @@ -77,7 +79,8 @@ public List<String> getSegmentStores() {
* @return A list of bookies.
*/
public List<String> getBookies() {
return getChild(BK_PATH);
List<String> bookies = getChild(BK_PATH);
return bookies != null ? bookies.stream().filter(s -> s.contains(":")).collect(Collectors.toList()) : null;
}

/**
Expand Down

0 comments on commit 494e69f

Please sign in to comment.