java.lang.Object
net.i2p.router.networkdb.kademlia.FloodOnlyLookupSelector
- All Implemented Interfaces:
MessageSelector
Message selector for flood-only database lookup operations.
Matches incoming DatabaseStoreMessage and DatabaseSearchReplyMessage responses to specific flood-only search jobs. Handles response validation, lookup decrement tracking, and coordinates followup searches through SingleLookupJob when appropriate.
Largely superseded by IterativeLookupSelector but retained for compatibility with existing flood-only search implementations. Provides specialized logic for flood-based search response handling with profile management and search lifecycle coordination.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RouterContextThe router running the lookup.private final LogLogger for this class.private booleanTrue once a peer holding the key answered.private final FloodOnlySearchJobThe search choosing these peers.Constructor Summary
ConstructorsConstructorDescriptionFloodOnlyLookupSelector(RouterContext ctx, FloodOnlySearchJob search) Binds the selector to the search whose replies it matches.Method Summary
All MethodsModifier and TypeMethodDescriptionbooleanContinue matching while lookups remain and the match is not yet found.longAbsolute time when the search expires, or -1 once a match is found.booleanisMatch(I2NPMessage message) Whether the message is a store for the searched key.toString()Returns a string representation of this selector.
Field Details
_context
The router running the lookup._search
The search choosing these peers._matchFound
private boolean _matchFoundTrue once a peer holding the key answered._log
Logger for this class.
Constructor Details
FloodOnlyLookupSelector
Binds the selector to the search whose replies it matches.- Parameters:
ctx- the router context whose netDb and job queue the search drivessearch- the flood-only search whose replies this selector matches
Method Details
continueMatching
public boolean continueMatching()Continue matching while lookups remain and the match is not yet found.- Specified by:
continueMatchingin interfaceMessageSelector- Returns:
- true to keep searching for further matches, false to stop searching
getExpiration
public long getExpiration()Absolute time when the search expires, or -1 once a match is found.- Specified by:
getExpirationin interfaceMessageSelector- Returns:
- the number of milliseconds since the context clock's epoch at which the search expires, or -1 once a match has been found
isMatch
Whether the message is a store for the searched key.- Specified by:
isMatchin interfaceMessageSelector- Parameters:
message- the received message to test against this selector- Returns:
- true if the message carries the key being searched for; the match is recorded and the remaining lookup count is decremented
toString