Class RelatedContentSearcher
java.lang.Object
com.biglybt.core.content.RelatedContentSearcher
- All Implemented Interfaces:
DistributedDatabaseTransferHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) DistributedDatabase(package private) final DHTPluginBasicInterfaceprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final int(package private) final AsyncDispatcherprivate static final intprivate static final intprivate BloomFilterprivate BloomFilter(package private) ByteArrayHashMap<RelatedContentSearcher.ForeignBloom> (package private) ByteArrayHashMap<String> private static final intprivate static final intprivate static final intprivate static final intprivate BloomFilterprivate BloomFilterprivate long(package private) final RelatedContentManagerprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final booleanprivate final DistributedDatabaseTransferType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRelatedContentSearcher(RelatedContentManager _manager, DistributedDatabaseTransferType _transfer_type, DHTPluginBasicInterface _dht_plugin, boolean _defer_ddb_check) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckDDB()private voidprivate Stringprivate String(package private) voidprivate List<RelatedContentManager.DownloadInfo> protected DHTPluginBasicInterfaceprivate BloomFiltergetKeyBloom(boolean include_dht_local) private void(package private) DistributedDatabaseContactimportContact(DHTPluginContact contact, int network) private booleanisPopularity(String term) (package private) voidprivate SearchResult(package private) List<RelatedContent> matchContent(String term, int min_seeds, int min_leechers, int max_age_secs, boolean is_local) (package private) List<RelatedContent> matchContent0(String term, int min_seeds, int min_leechers, int max_age_secs, boolean is_local) read(DistributedDatabaseContact contact, DistributedDatabaseTransferType type, DistributedDatabaseKey ddb_key) receiveRemoteRequest(DistributedDatabaseContact originator, Map<String, Object> request) (package private) List<DistributedDatabaseContact> searchForeignBlooms(String term) protected SearchInstancesearchRCM(Map<String, Object> search_parameters, SearchObserver _observer) protected BloomFilterprotected List<DistributedDatabaseContact> sendRemoteSearch(SearchInstance si, Set<String> hashes_sync_me, DistributedDatabaseContact contact, String term, int min_seeds, int min_leechers, int max_age_secs, SearchObserver _observer) protected BloomFilterprotected voidtimerTick(boolean enabled, int tick_count) private StringtransformTerm(String term) private StringunescapeTag(String tag) protected voidwrite(DistributedDatabaseContact contact, DistributedDatabaseTransferType type, DistributedDatabaseKey key, DistributedDatabaseValue value)
-
Field Details
-
TRACE_SEARCH
private static final boolean TRACE_SEARCH- See Also:
-
SEARCH_MIN_SEEDS_DEFAULT
private static final int SEARCH_MIN_SEEDS_DEFAULT- See Also:
-
SEARCH_MIN_LEECHERS_DEFAULT
private static final int SEARCH_MIN_LEECHERS_DEFAULT- See Also:
-
SEARCH_MAX_AGE_SECS_DEFAULT
private static final int SEARCH_MAX_AGE_SECS_DEFAULT- See Also:
-
SEARCH_POP_MIN_SEEDS_DEFAULT
private static final int SEARCH_POP_MIN_SEEDS_DEFAULT- See Also:
-
SEARCH_POP_MIN_LEECHERS_DEFAULT
private static final int SEARCH_POP_MIN_LEECHERS_DEFAULT- See Also:
-
SEARCH_POP_MAX_AGE_SECS_DEFAULT
private static final int SEARCH_POP_MAX_AGE_SECS_DEFAULT- See Also:
-
MAX_REMOTE_SEARCH_RESULTS
private static final int MAX_REMOTE_SEARCH_RESULTS- See Also:
-
MAX_REMOTE_SEARCH_CONTACTS
private static final int MAX_REMOTE_SEARCH_CONTACTS- See Also:
-
MAX_REMOTE_SEARCH_MILLIS
private static final int MAX_REMOTE_SEARCH_MILLIS- See Also:
-
REDUCED_REMOTE_SEARCH_MILLIS
private static final int REDUCED_REMOTE_SEARCH_MILLIS- See Also:
-
MAX_LOCAL_POPULAR_RESULTS
private static final int MAX_LOCAL_POPULAR_RESULTS- See Also:
-
HARVEST_MAX_BLOOMS
private static final int HARVEST_MAX_BLOOMS- See Also:
-
HARVEST_MAX_FAILS_HISTORY
private static final int HARVEST_MAX_FAILS_HISTORY- See Also:
-
HARVEST_BLOOM_UPDATE_MILLIS
private static final int HARVEST_BLOOM_UPDATE_MILLIS- See Also:
-
HARVEST_BLOOM_DISCARD_MILLIS
private static final int HARVEST_BLOOM_DISCARD_MILLIS- See Also:
-
HARVEST_BLOOM_OP_RESET_MILLIS
private static final int HARVEST_BLOOM_OP_RESET_MILLIS- See Also:
-
HARVEST_BLOOM_OP_RESET_TICKS
private static final int HARVEST_BLOOM_OP_RESET_TICKS- See Also:
-
HARVEST_BLOOM_SE_RESET_MILLIS
private static final int HARVEST_BLOOM_SE_RESET_MILLIS- See Also:
-
HARVEST_BLOOM_SE_RESET_TICKS
private static final int HARVEST_BLOOM_SE_RESET_TICKS- See Also:
-
KEY_BLOOM_LOAD_FACTOR
private static final int KEY_BLOOM_LOAD_FACTOR- See Also:
-
KEY_BLOOM_MIN_BITS
private static final int KEY_BLOOM_MIN_BITS- See Also:
-
KEY_BLOOM_MAX_BITS
private static final int KEY_BLOOM_MAX_BITS- See Also:
-
KEY_BLOOM_MAX_ENTRIES
private static final int KEY_BLOOM_MAX_ENTRIES- See Also:
-
key_bloom_with_local
-
key_bloom_without_local
-
last_key_bloom_update
private volatile long last_key_bloom_update -
ignore_words
-
harvested_blooms
ByteArrayHashMap<RelatedContentSearcher.ForeignBloom> harvested_blooms -
harvested_fails
ByteArrayHashMap<String> harvested_fails -
harvest_op_requester_bloom
-
harvest_se_requester_bloom
-
harvest_dispatcher
-
manager
-
transfer_type
-
dht_plugin
-
ddb
-
-
Constructor Details
-
RelatedContentSearcher
protected RelatedContentSearcher(RelatedContentManager _manager, DistributedDatabaseTransferType _transfer_type, DHTPluginBasicInterface _dht_plugin, boolean _defer_ddb_check)
-
-
Method Details
-
getDHTPlugin
-
timerTick
protected void timerTick(boolean enabled, int tick_count) -
checkDDB
private void checkDDB() -
searchRCM
protected SearchInstance searchRCM(Map<String, Object> search_parameters, SearchObserver _observer) throws SearchException- Throws:
SearchException
-
mapResult
-
fixupTerm
-
escapeTag
-
unescapeTag
-
transformTerm
-
matchContent
List<RelatedContent> matchContent(String term, int min_seeds, int min_leechers, int max_age_secs, boolean is_local) -
matchContent0
List<RelatedContent> matchContent0(String term, int min_seeds, int min_leechers, int max_age_secs, boolean is_local) -
sendRemoteSearch
protected List<DistributedDatabaseContact> sendRemoteSearch(SearchInstance si, Set<String> hashes_sync_me, DistributedDatabaseContact contact, String term, int min_seeds, int min_leechers, int max_age_secs, SearchObserver _observer) -
sendRemoteFetch
-
sendRemoteUpdate
-
receiveRemoteRequest
-
read
public DistributedDatabaseValue read(DistributedDatabaseContact contact, DistributedDatabaseTransferType type, DistributedDatabaseKey ddb_key) throws DistributedDatabaseException - Specified by:
readin interfaceDistributedDatabaseTransferHandler- Throws:
DistributedDatabaseException
-
write
public DistributedDatabaseValue write(DistributedDatabaseContact contact, DistributedDatabaseTransferType type, DistributedDatabaseKey key, DistributedDatabaseValue value) throws DistributedDatabaseException - Specified by:
writein interfaceDistributedDatabaseTransferHandler- Throws:
DistributedDatabaseException
-
checkKeyBloom
private void checkKeyBloom() -
getKeyBloom
-
getDHTWords
-
updateKeyBloom
-
getDHTInfos
-
harvestBlooms
private void harvestBlooms() -
importContact
DistributedDatabaseContact importContact(DHTPluginContact contact, int network) throws DistributedDatabaseException - Throws:
DistributedDatabaseException
-
foreignBloomFailed
-
isPopularity
-
searchForeignBlooms
-
logSearch
-