Package com.biglybt.core.content
Class RelatedContentSearcher
java.lang.Object
com.biglybt.core.content.RelatedContentSearcher
- All Implemented Interfaces:
DistributedDatabaseTransferHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) DistributedDatabase
(package private) final DHTPluginBasicInterface
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
(package private) final AsyncDispatcher
private static final int
private static final int
private BloomFilter
private BloomFilter
(package private) ByteArrayHashMap
<RelatedContentSearcher.ForeignBloom> (package private) ByteArrayHashMap
<String> private static final int
private static final int
private static final int
private static final int
private BloomFilter
private BloomFilter
private long
(package private) final RelatedContentManager
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final boolean
private final DistributedDatabaseTransferType
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
RelatedContentSearcher
(RelatedContentManager _manager, DistributedDatabaseTransferType _transfer_type, DHTPluginBasicInterface _dht_plugin, boolean _defer_ddb_check) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkDDB()
private void
private String
private String
(package private) void
private List
<RelatedContentManager.DownloadInfo> protected DHTPluginBasicInterface
private BloomFilter
getKeyBloom
(boolean include_dht_local) private void
(package private) DistributedDatabaseContact
importContact
(DHTPluginContact contact, int network) private boolean
isPopularity
(String term) (package private) void
private SearchResult
(package private) List
<RelatedContent> matchContent
(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 SearchInstance
searchRCM
(Map<String, Object> search_parameters, SearchObserver _observer) protected BloomFilter
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) protected BloomFilter
protected void
timerTick
(boolean enabled, int tick_count) private String
transformTerm
(String term) private String
unescapeTag
(String tag) protected void
write
(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) -
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:
read
in interfaceDistributedDatabaseTransferHandler
- Throws:
DistributedDatabaseException
-
write
public DistributedDatabaseValue write(DistributedDatabaseContact contact, DistributedDatabaseTransferType type, DistributedDatabaseKey key, DistributedDatabaseValue value) throws DistributedDatabaseException - Specified by:
write
in 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
-