Skip to content

Commit

Permalink
Added "member-addrs" to GossipRouter's probe handler (https://issues.…
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Jan 8, 2024
1 parent a06bc44 commit fbfbbd6
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/org/jgroups/stack/GossipRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@

import javax.net.ssl.*;
import java.io.DataInput;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.UnknownHostException;
import java.net.*;
import java.nio.ByteBuffer;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
Expand Down Expand Up @@ -422,13 +419,27 @@ public Map<String,String> handleProbe(String... keys) {
}
}
map.put(key, sb.toString());
continue;
}
if(key.startsWith("member-addrs")) {
InetSocketAddress sa=(InetSocketAddress)diag.getLocalAddress();
if(sa != null) {
Set<PhysicalAddress> physical_addrs=Set.of(new IpAddress(sa.getAddress(), sa.getPort()));
// Set<PhysicalAddress> physical_addrs=diag.getLocalAddress();
String list=Util.print(physical_addrs);
map.put(key, list);
}
continue;
}
if(key.startsWith("dump")) {
map.put(key, Util.dumpThreads());
}
}
return map;
}

public String[] supportedKeys() {
return new String[]{"ops", "op", "invoke", "keys"};
return new String[]{"ops", "op", "invoke", "keys", "member-addrs", "dump"};
}

protected ByteArrayDataOutputStream getOutputStream(Address mbr, int size) {
Expand Down

0 comments on commit fbfbbd6

Please sign in to comment.