public class RTTEstimator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RTTEstimator.IPv4Prefix
An IPv4 address and a netmask length in the standard CIDR notation.
|
| Constructor and Description |
|---|
RTTEstimator() |
| Modifier and Type | Method and Description |
|---|---|
static int |
addrToInt(java.net.InetAddress address) |
static int |
addrToPrefixInt(java.net.InetAddress address) |
static void |
closest(java.net.InetSocketAddress sender,
java.util.Map<java.net.InetAddress,java.lang.Long> nearestMap) |
static org.json.JSONObject |
getAmazonIPToRegionFile() |
static java.util.Set<java.net.InetAddress> |
getClosest(java.net.InetAddress clientAddr) |
static long |
getRTT(java.net.InetAddress address) |
static void |
main(java.lang.String[] args) |
static long |
ping(java.net.InetAddress address) |
protected static java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String> |
populateAWSIPToRegionMap() |
static java.lang.String |
print() |
static void |
record(java.net.InetAddress address)
Relies on Java implementation of (typically) ICMP echo.
|
static long |
record(java.net.InetAddress address,
long rtt) |
public static void record(java.net.InetAddress address)
address - public static long record(java.net.InetAddress address,
long rtt)
address - rtt - rtt in quartets.public static long getRTT(java.net.InetAddress address)
address - address if any, else -1.public static long ping(java.net.InetAddress address)
throws java.io.IOException
address - java.io.IOExceptionpublic static org.json.JSONObject getAmazonIPToRegionFile()
throws java.io.IOException,
org.json.JSONException
java.io.IOExceptionorg.json.JSONExceptionprotected static java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String> populateAWSIPToRegionMap()
public static int addrToInt(java.net.InetAddress address)
address - public static int addrToPrefixInt(java.net.InetAddress address)
address - public static java.lang.String print()
public static void closest(java.net.InetSocketAddress sender,
java.util.Map<java.net.InetAddress,java.lang.Long> nearestMap)
sender - nearestMap - public static java.util.Set<java.net.InetAddress> getClosest(java.net.InetAddress clientAddr)
clientAddr - clientAddr if any recorded.public static void main(java.lang.String[] args)
throws java.net.UnknownHostException
args - java.net.UnknownHostException