skeleton of leaf searcher
This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.concurrent.ConcurrentHashMap
|
|||||||
|
|
||||||
import com.muwire.core.EventBus
|
import com.muwire.core.EventBus
|
||||||
import com.muwire.core.hostcache.HostCache
|
import com.muwire.core.hostcache.HostCache
|
||||||
|
import com.muwire.core.search.QueryEvent
|
||||||
|
|
||||||
import groovy.util.logging.Log
|
import groovy.util.logging.Log
|
||||||
import net.i2p.data.Destination
|
import net.i2p.data.Destination
|
||||||
@@ -81,4 +82,8 @@ class UltrapeerConnectionManager extends ConnectionManager {
|
|||||||
if (removed == null)
|
if (removed == null)
|
||||||
log.severe("Removed connection not present in either leaf or peer map ${e.destination.toBase32()}")
|
log.severe("Removed connection not present in either leaf or peer map ${e.destination.toBase32()}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void forwardQueryToLeaf(Destination leaf, QueryEvent e) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.muwire.core.search
|
||||||
|
|
||||||
|
import com.muwire.core.connection.DisconnectionEvent
|
||||||
|
import com.muwire.core.connection.UltrapeerConnectionManager
|
||||||
|
|
||||||
|
import net.i2p.data.Destination
|
||||||
|
|
||||||
|
class LeafSearcher {
|
||||||
|
|
||||||
|
final UltrapeerConnectionManager connectionManager
|
||||||
|
final SearchIndex searchIndex = new SearchIndex()
|
||||||
|
|
||||||
|
final Map<String, Set<byte[]>> fileNameToHashes = new HashMap<>()
|
||||||
|
final Map<byte[], Set<Destination>> hashToLeafs = new HashMap<>()
|
||||||
|
|
||||||
|
final Map<Destination, Map<byte[], Set<String>>> leafToFiles = new HashMap<>()
|
||||||
|
|
||||||
|
LeafSearcher(UltrapeerConnectionManager connectionManager) {
|
||||||
|
this.connectionManager = connectionManager
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpsertEvent(UpsertEvent e) {
|
||||||
|
// TODO: implement
|
||||||
|
}
|
||||||
|
|
||||||
|
void onDeleteEvent(DeleteEvent e) {
|
||||||
|
// TODO: implement
|
||||||
|
}
|
||||||
|
|
||||||
|
void onDisconnectionEvent(DisconnectionEvent e) {
|
||||||
|
// TODO: implement
|
||||||
|
}
|
||||||
|
|
||||||
|
void onQueryEvent(QueryEvent e) {
|
||||||
|
// TODO: implement
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ import net.i2p.data.Destination
|
|||||||
|
|
||||||
class UpsertEvent extends Event {
|
class UpsertEvent extends Event {
|
||||||
|
|
||||||
List<String> names
|
Set<String> names
|
||||||
byte [] infoHash
|
byte [] infoHash
|
||||||
Destination leaf
|
Destination leaf
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user