public class Hasher extends Object
Modifier and Type | Field and Description |
---|---|
private VespaBackEndSearcher[] |
allNodes |
private AtomicInteger |
avoidAllQrsHitSameTld |
private VespaBackEndSearcher[] |
localNodes |
private static Logger |
log |
(package private) boolean |
running |
private static Random |
tldSeeder |
Constructor and Description |
---|
Hasher()
Creates a hasher independent of the programmatic VIP API.
|
Modifier and Type | Method and Description |
---|---|
void |
add(VespaBackEndSearcher node)
Make a node available for search.
|
private static VespaBackEndSearcher[] |
addNode(VespaBackEndSearcher node,
VespaBackEndSearcher[] oldNodes) |
int |
getNodeCount() |
void |
remove(VespaBackEndSearcher node)
Removes a node
|
private VespaBackEndSearcher[] |
removeNode(VespaBackEndSearcher node,
VespaBackEndSearcher[] oldNodes) |
VespaBackEndSearcher |
select(int trynum)
Return a node, prefer local nodes, try to skip already hit nodes.
|
private static int |
tldSeed() |
boolean running
private static final Logger log
private static final Random tldSeeder
private volatile VespaBackEndSearcher[] allNodes
private volatile VespaBackEndSearcher[] localNodes
private AtomicInteger avoidAllQrsHitSameTld
private static int tldSeed()
private static VespaBackEndSearcher[] addNode(VespaBackEndSearcher node, VespaBackEndSearcher[] oldNodes)
public void add(VespaBackEndSearcher node)
node
- the backend searcher (must never be null)private VespaBackEndSearcher[] removeNode(VespaBackEndSearcher node, VespaBackEndSearcher[] oldNodes)
public void remove(VespaBackEndSearcher node)
public int getNodeCount()
public VespaBackEndSearcher select(int trynum)
trynum
- hint for skipping (ignored in current implementation)Copyright © 2018. All rights reserved.