-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* re #2118: composite sequential / short circuit execution mode * Added a short circuit execution mode * Executes the logics in sequential order (logicName order) * The first logic that returns results will disable the following logics * Added some debugging in the RemoteHttpService to verify we are closing Conflicts: web-services/common/src/main/java/datawave/webservice/common/remote/RemoteHttpService.java web-services/query/src/main/java/datawave/webservice/query/logic/composite/CompositeQueryLogic.java web-services/query/src/main/java/datawave/webservice/query/logic/composite/CompositeQueryLogicResults.java web-services/query/src/main/java/datawave/webservice/query/logic/composite/CompositeQueryLogicResultsIterator.java web-services/query/src/test/java/datawave/webservice/query/logic/composite/CompositeQueryLogicTest.java Conflicts: web-services/query/src/main/java/datawave/webservice/query/logic/composite/CompositeQueryLogic.java web-services/query/src/main/java/datawave/webservice/query/logic/composite/CompositeQueryLogicResultsIterator.java
- Loading branch information
Showing
6 changed files
with
699 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
.../src/main/java/datawave/webservice/query/logic/composite/CompositeQueryConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
package datawave.webservice.query.logic.composite; | ||
|
||
import datawave.webservice.query.Query; | ||
import datawave.webservice.query.QueryImpl; | ||
import datawave.webservice.query.configuration.GenericQueryConfiguration; | ||
|
||
import java.io.Serializable; | ||
|
||
public class CompositeQueryConfiguration extends GenericQueryConfiguration implements Serializable { | ||
|
||
private Query query = null; | ||
|
||
// Specifies whether all queries must succeed initialization | ||
private boolean allMustInitialize = false; | ||
|
||
// Specifies whether queries are run sequentially. We stop after the first query that returns any results. | ||
private boolean shortCircuitExecution = false; | ||
|
||
public CompositeQueryConfiguration() { | ||
super(); | ||
query = new QueryImpl(); | ||
} | ||
|
||
/** | ||
* Performs a deep copy of the provided CompositeQueryConfiguration into a new instance | ||
* | ||
* @param other | ||
* - another CompositeQueryConfiguration instance | ||
*/ | ||
public CompositeQueryConfiguration(CompositeQueryConfiguration other) { | ||
|
||
// GenericQueryConfiguration copy first | ||
super(other); | ||
} | ||
|
||
/** | ||
* Factory method that instantiates an fresh CompositeQueryConfiguration | ||
* | ||
* @return - a clean CompositeQueryConfiguration | ||
*/ | ||
public static CompositeQueryConfiguration create() { | ||
return new CompositeQueryConfiguration(); | ||
} | ||
|
||
/** | ||
* Factory method that returns a deep copy of the provided CompositeQueryConfiguration | ||
* | ||
* @param other | ||
* - another instance of a CompositeQueryConfiguration | ||
* @return - copy of provided CompositeQueryConfiguration | ||
*/ | ||
public static CompositeQueryConfiguration create(CompositeQueryConfiguration other) { | ||
return new CompositeQueryConfiguration(other); | ||
} | ||
|
||
/** | ||
* Factory method that creates a CompositeQueryConfiguration deep copy from a CompositeQueryLogic | ||
* | ||
* @param compositeQueryLogic | ||
* - a configured CompositeQueryLogic | ||
* @return - a CompositeQueryConfiguration | ||
*/ | ||
public static CompositeQueryConfiguration create(CompositeQueryLogic compositeQueryLogic) { | ||
|
||
CompositeQueryConfiguration config = create(compositeQueryLogic.getConfig()); | ||
|
||
return config; | ||
} | ||
|
||
/** | ||
* Factory method that creates a CompositeQueryConfiguration from a CompositeQueryLogic and a Query | ||
* | ||
* @param compositeQueryLogic | ||
* - a configured CompositeQueryLogic | ||
* @param query | ||
* - a configured Query object | ||
* @return - a CompositeQueryConfiguration | ||
*/ | ||
public static CompositeQueryConfiguration create(CompositeQueryLogic compositeQueryLogic, Query query) { | ||
CompositeQueryConfiguration config = create(compositeQueryLogic); | ||
config.setQuery(query); | ||
return config; | ||
} | ||
|
||
public Query getQuery() { | ||
return query; | ||
} | ||
|
||
public void setQuery(Query query) { | ||
this.query = query; | ||
} | ||
|
||
public boolean isAllMustInitialize() { | ||
return allMustInitialize; | ||
} | ||
|
||
public void setAllMustInitialize(boolean allMustInitialize) { | ||
this.allMustInitialize = allMustInitialize; | ||
} | ||
|
||
public boolean isShortCircuitExecution() { | ||
return shortCircuitExecution; | ||
} | ||
|
||
public void setShortCircuitExecution(boolean shortCircuitExecution) { | ||
this.shortCircuitExecution = shortCircuitExecution; | ||
} | ||
} |
Oops, something went wrong.