|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.ic.doc.automed.p2p.qproc.planner.QPlannerMain
public class QPlannerMain
Nested Class Summary | |
---|---|
(package private) class |
QPlannerMain.Timer
Timer for each peer to time-out its processing |
Field Summary | |
---|---|
private static java.lang.String |
BANNER_END
|
private static java.lang.String |
BANNER_START
|
private AppContext |
cxt
|
protected boolean |
debug
|
protected boolean |
debugAll
|
protected boolean |
debugDetailed
|
protected static java.util.List |
eventHandlers
|
private Indexer |
indexer
|
private static long |
instanceCount
|
protected long |
instanceID
|
private static java.lang.String |
line
|
private java.util.Map |
lookUpCache
|
private Match |
matcher
|
private java.lang.Object |
myMsgID
|
protected QueryPlannerResult |
myQPlannerResult
|
protected ObjectCache |
objCache
|
private Match |
objMatcher
|
protected static int |
section
|
protected java.util.concurrent.ExecutorService |
threadPool
|
protected QPlannerMain.Timer |
timer
|
private java.util.Map |
timers
|
Constructor Summary | |
---|---|
QPlannerMain(AppContext cxt)
|
Method Summary | |
---|---|
void |
addEventHandler(P2PListener listener)
|
private void |
addFetchMappingHandler()
Prepare a protocol handler for handling top-k mapping request |
private void |
addGetCoverageStatsHandler()
Prepare a handler for top-k mapping request |
private void |
addKQueryResultHandler()
Add a handler to handle the event of receiving the k-query result |
private void |
addLookUpWithFilterHandler()
Add a handler to handle look-up with filter function |
void |
clear()
|
private void |
execute(QueryPlannerResult qpresult)
Execution performed by each internal peer or root peer. |
private void |
executeInit(RuntimeParameters params)
Invoked by the query peer to plan the processing of the query |
java.lang.Object |
fetchMappings(java.lang.Object dhtIDAndAddress,
RuntimeParameters params)
This method is used by a user-application wanting to request the next top-k mapppings |
private java.util.Map |
fetchMappings(RuntimeParameters params)
Method to process top-k mapping message |
void |
fireEvent(int event,
java.lang.Object data)
|
private java.util.Map |
getCoverageSetStats(RuntimeParameters params)
Method to process get-coverageset message. Obtain statistics about all the coverage sets of a given k-edge |
java.lang.Object |
getCoverageSetStats(RuntimeParameters params,
java.lang.Object dhtIDAddress)
This method is used by a user-application the coverage set statistics |
static java.lang.String |
getName()
|
protected void |
gmatch(Node n,
java.util.Collection kedges,
Graph qgraph)
perform local matching of the schema graphs matching a given k-edge |
protected java.io.Serializable |
handle_LUP_WFILTER(ow.id.ID key,
QueryPlannerResult qpresult,
RuntimeParameters params,
boolean forward)
|
java.lang.Object[] |
handleResult(java.lang.Object result)
Handle the search results returned by peers. |
private void |
init(RuntimeParameters params)
Initialise caching based on the handler object of the query planner result that this planner has received |
protected void |
initDebug(RuntimeParameters params)
|
boolean |
isIConfigBPF(RuntimeParameters params)
|
private boolean |
isMyMessage(RuntimeParameters params)
Return true if a DHT message has the same id as the message id of this object |
protected boolean |
match(Node n,
java.util.Collection ngraphs,
Node nj,
java.util.Collection njgraphs,
RuntimeParameters params,
QueryPlannerResult qpresult)
Match a pair of k-nodes using the corresponding HDM graphs that are mapped to them. |
QueryPlannerResult |
plan(ow.id.ID key,
Graph query,
RuntimeParameters params)
The main method to execute the matchgraphtopkp2p() algorithm. |
private QueryPlannerResult |
plan(ow.id.ID key,
RuntimeParameters params)
invoked by methods that are involved in processing the current query of this object |
protected void |
postExecute(Node knode)
Invoked to perform post-processing. |
protected void |
preExecute(Node knode)
Invoked by internal or root peer to match its k-node with the leaf child k-node (of its sub-tree), from which this call was initiated. In other words, this method is invoked each time a leaf child k-node has completed its processing and forwarded the result to this node (its parent). |
private void |
prematching()
Ensures that necessary resources are available for matching. |
private void |
updateResult(QueryPlannerResult source,
QueryPlannerResult target,
int topK,
boolean memOnly)
Update the query planner result with information from the query planner result of this object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected QueryPlannerResult myQPlannerResult
protected long instanceID
protected static final transient int section
protected transient boolean debug
protected transient boolean debugDetailed
protected transient boolean debugAll
protected static java.util.List eventHandlers
protected transient ObjectCache objCache
private static transient long instanceCount
private transient Match objMatcher
private transient Match matcher
protected transient QPlannerMain.Timer timer
private transient java.util.Map timers
private transient java.util.Map lookUpCache
protected transient java.util.concurrent.ExecutorService threadPool
private static final transient java.lang.String BANNER_START
private static final transient java.lang.String BANNER_END
private static final transient java.lang.String line
private AppContext cxt
private Indexer indexer
private java.lang.Object myMsgID
Constructor Detail |
---|
public QPlannerMain(AppContext cxt)
Method Detail |
---|
public static java.lang.String getName()
protected void initDebug(RuntimeParameters params)
private void init(RuntimeParameters params)
private QueryPlannerResult plan(ow.id.ID key, RuntimeParameters params) throws QProcException
key
- params
-
QProcException
public QueryPlannerResult plan(ow.id.ID key, Graph query, RuntimeParameters params) throws QProcException
plan
in interface QPlannerAlgorithmRecursive
key
- graph
- config
-
QProcException
private void executeInit(RuntimeParameters params)
initPeer
- the query peerparams
- query message parametersgraph
- query graphqpresult
- result object to store answers or answer statistics (depending on
the algorithm)private void execute(QueryPlannerResult qpresult) throws QProcException
graph
-
QProcException
private void updateResult(QueryPlannerResult source, QueryPlannerResult target, int topK, boolean memOnly)
qpresult
- protected void gmatch(Node n, java.util.Collection kedges, Graph qgraph) throws QProcException
initPeer
- n
- the k-node that is the parent of a sub-tree of the k-querygraph
-
QProcException
private void prematching()
protected boolean match(Node n, java.util.Collection ngraphs, Node nj, java.util.Collection njgraphs, RuntimeParameters params, QueryPlannerResult qpresult) throws AutoMedException
n
- the first k-nodengraphs
- the set of index graphs of the first k-nodenj
- the second k-node (to be matched with the first k-node)njgraphs
- the set of index graphs of the second k-nodeparams
- qpresult
- the query planner result object in which to store answers
(mappings)
AutoMedException
public java.lang.Object[] handleResult(java.lang.Object result) throws QProcException
handleResult
in interface QPlannerAlgorithmRecursive
QProcException
protected void preExecute(Node knode)
AutoMedException
protected void postExecute(Node knode) throws QProcException
QProcException
protected java.io.Serializable handle_LUP_WFILTER(ow.id.ID key, QueryPlannerResult qpresult, RuntimeParameters params, boolean forward) throws AutoMedException
AutoMedException
public void addEventHandler(P2PListener listener)
addEventHandler
in interface QPlannerAlgorithmRecursive
public void fireEvent(int event, java.lang.Object data)
fireEvent
in interface QPlannerAlgorithmRecursive
public void clear()
clear
in interface QPlannerAlgorithmRecursive
public boolean isIConfigBPF(RuntimeParameters params)
private boolean isMyMessage(RuntimeParameters params)
private void addKQueryResultHandler()
private void addLookUpWithFilterHandler()
public java.lang.Object getCoverageSetStats(RuntimeParameters params, java.lang.Object dhtIDAddress)
private void addGetCoverageStatsHandler()
private java.util.Map getCoverageSetStats(RuntimeParameters params)
cfg
-
public java.lang.Object fetchMappings(java.lang.Object dhtIDAndAddress, RuntimeParameters params)
private void addFetchMappingHandler()
private java.util.Map fetchMappings(RuntimeParameters params)
cfg
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |