public class Probe extends java.lang.Object implements ByteCounter
Explanation of Metropolis-Hastings correction
Modifier and Type | Field and Description |
---|---|
int |
COUNTER_MAX_LOCAL
Maximum number of probes started locally in the past minute.
|
int |
COUNTER_MAX_PEER
Maximum number of probes accepted from a single peer in the past minute.
|
static float |
DECREMENT_PROBABILITY
Probability of HTL decrement at HTL = 1.
|
static byte |
MAX_HTL
Maximum hopsToLive value to clamp requests to.
|
static int |
MAX_SEND_ATTEMPTS
Maximum number of forwarding attempts to make before failing with DISCONNECTED.
|
static long |
TIMEOUT_HTL1
In ms, to account for probabilistic decrement at HTL = 1.
|
static long |
TIMEOUT_PER_HTL
In ms, per HTL above HTL = 1.
|
static long |
WAIT_BASE
To make the timing less obvious when a node responds with a local result instead of forwarding at
HTL = 1, delay for a number of milliseconds, specifically an exponential distribution with this constant as
its mean.
|
static long |
WAIT_MAX
Maximum number of milliseconds to wait before sending a response.
|
Modifier and Type | Method and Description |
---|---|
void |
receivedBytes(int bytes)
Counts as probe request transfer.
|
void |
request(Message message,
PeerNode source)
Processes an incoming probe request; relays results back to source.
|
void |
sentBytes(int bytes)
Counts as probe request transfer.
|
void |
sentPayload(int bytes)
No payload in probes.
|
void |
start(byte htl,
long uid,
Type type,
Listener listener)
Sends an outgoing probe request.
|
public static final byte MAX_HTL
public static final int MAX_SEND_ATTEMPTS
public static final float DECREMENT_PROBABILITY
public static final long TIMEOUT_PER_HTL
public static final long TIMEOUT_HTL1
public static final long WAIT_BASE
public static final long WAIT_MAX
public final int COUNTER_MAX_PEER
public final int COUNTER_MAX_LOCAL
public Probe(Node node)
public void sentBytes(int bytes)
sentBytes
in interface ByteCounter
bytes
- Bytes received.public void receivedBytes(int bytes)
receivedBytes
in interface ByteCounter
bytes
- Bytes received.public void sentPayload(int bytes)
sentPayload
in interface ByteCounter
bytes
- Ignored.public void start(byte htl, long uid, Type type, Listener listener)
htl
- htl for this outgoing probe: should be [1, MAX_HTL]listener
- will be called with results.Listener
public void request(Message message, PeerNode source)
message
- probe request, containing HTL