public class AutoSearch extends AbstractBusyThread
Modifier and Type | Field and Description |
---|---|
java.lang.String |
currentQuery |
private java.util.Set<java.lang.String> |
currentTargets |
int |
gotresults |
private long |
lastInitTime |
private java.util.Set<java.lang.String> |
querystack |
(package private) Switchboard |
sb |
busytime, memuse, running
Constructor and Description |
---|
AutoSearch(Switchboard xsb) |
Modifier and Type | Method and Description |
---|---|
private boolean |
checkBookmarkDB()
Check BookmarkDB for existing queries return true if new entry added to
query queue.
|
void |
close() |
void |
freemem()
is called when an outOfMemoryCycle is performed
this method should try to free some memory, so that the job can be executed
|
int |
getJobCount()
Estimate of queries to perform
|
private void |
initPeerList()
Get peers to query (peers connected)
|
boolean |
job()
Process query queue, select one query and peer to ask next
|
private void |
processSingleTarget(Seed seed)
Calls one peer for search results of the current query and adds it to the
local index.
|
private void |
saveasPropFile()
Save current queries to a (temporary) property file to allow continue
after a restart.
|
getBusyCycles, getBusySleep, getHighCPUCycles, getIdleCycles, getIdleSleep, getOutOfMemoryCycles, getSleepTime, intermission, notifyThread, run, setBusySleep, setIdleSleep, setLoadPreReqisite, setMemPreReqisite, setObeyIntermission, setStartupSleep
announceThreadBlockApply, announceThreadBlockRelease, getBlockTime, getExecTime, getLongDescription, getMemoryUse, getMonitorURL, getShortDescription, jobExceptionHandler, open, setDescription, shutdownInProgress, terminate
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBlockTime, getExecTime, getLongDescription, getMemoryUse, getMonitorURL, getShortDescription, isAlive, jobExceptionHandler, open, setDescription, shutdownInProgress, start, terminate
private java.util.Set<java.lang.String> querystack
public java.lang.String currentQuery
private java.util.Set<java.lang.String> currentTargets
final Switchboard sb
public int gotresults
private long lastInitTime
public AutoSearch(Switchboard xsb)
private void saveasPropFile()
private void initPeerList()
private boolean checkBookmarkDB()
public boolean job()
private void processSingleTarget(Seed seed)
seed
- the peer to askpublic int getJobCount()
public void freemem()
BusyThread
public void close()
close
in interface WorkflowThread
close
in class AbstractThread