public class IntersectViewFactory extends Object implements ViewFactory, DataWindowViewFactory, DataWindowViewFactoryUniqueCandidate, ViewFactoryContainer
Modifier and Type | Field and Description |
---|---|
protected ThreadLocal<IntersectAsymetricViewLocalState> |
asymetricViewLocalState |
protected int |
batchViewIndex |
protected ThreadLocal<IntersectBatchViewLocalState> |
batchViewLocalState |
protected ThreadLocal<IntersectDefaultViewLocalState> |
defaultViewLocalState |
protected boolean |
hasAsymetric |
protected EventType |
parentEventType |
protected List<ViewFactory> |
viewFactories |
Constructor and Description |
---|
IntersectViewFactory()
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
attach(EventType parentEventType,
StatementContext statementContext,
ViewFactory optionalParentFactory,
List<ViewFactory> parentViewFactories)
Attaches the factory to a parent event type such that the factory can validate
attach requirements and determine an event type for resulting views.
|
boolean |
canReuse(View view,
AgentInstanceContext agentInstanceContext)
Determines if the given view could be used instead of creating a new view,
requires the view factory to compare view type, parameters and other capabilities provided.
|
IntersectAsymetricViewLocalState |
getAsymetricViewLocalStatePerThread() |
int |
getBatchViewIndex() |
IntersectBatchViewLocalState |
getBatchViewLocalStatePerThread() |
IntersectDefaultViewLocalState |
getDefaultViewLocalStatePerThread() |
EventType |
getEventType()
Returns the event type that the view that is created by the view factory would create for events posted
by the view.
|
EventType |
getParentEventType() |
Set<String> |
getUniquenessCandidatePropertyNames() |
Collection<ViewFactory> |
getViewFactoriesContained() |
String |
getViewName()
Returns the name of the view, not namespace+name but readable name.
|
protected static String |
getViewNameUnionIntersect(boolean intersect,
Collection<ViewFactory> factories) |
boolean |
isHasAsymetric() |
View |
makeView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext)
Create a new view.
|
void |
setParentEventType(EventType parentEventType)
Sets the parent event type.
|
void |
setViewFactories(List<ViewFactory> viewFactories)
Sets the view factories.
|
void |
setViewParameters(ViewFactoryContext viewFactoryContext,
List<ExprNode> viewParameters)
Indicates user EPL query view parameters to the view factory.
|
protected EventType parentEventType
protected List<ViewFactory> viewFactories
protected int batchViewIndex
protected boolean hasAsymetric
protected ThreadLocal<IntersectBatchViewLocalState> batchViewLocalState
protected ThreadLocal<IntersectDefaultViewLocalState> defaultViewLocalState
protected ThreadLocal<IntersectAsymetricViewLocalState> asymetricViewLocalState
public void setParentEventType(EventType parentEventType)
parentEventType
- typepublic void setViewFactories(List<ViewFactory> viewFactories)
viewFactories
- factoriespublic void setViewParameters(ViewFactoryContext viewFactoryContext, List<ExprNode> viewParameters) throws ViewParameterException
ViewFactory
setViewParameters
in interface ViewFactory
viewFactoryContext
- supplied context information for the view factoryviewParameters
- is the objects representing the view parametersViewParameterException
- if the parameters don't match view parameter needspublic void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewParameterException
ViewFactory
attach
in interface ViewFactory
parentEventType
- is the parent event stream's or view factory's event typestatementContext
- contains the services needed for creating a new event typeoptionalParentFactory
- is null when there is no parent view factory, or contains the
parent view factoryparentViewFactories
- is a list of all the parent view factories or empty list if there are noneViewParameterException
- is thrown to indicate that this view factories's view would not play
with the parent view factories viewpublic View makeView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext)
ViewFactory
makeView
in interface ViewFactory
agentInstanceViewFactoryContext
- contextpublic EventType getEventType()
ViewFactory
getEventType
in interface ViewFactory
public boolean canReuse(View view, AgentInstanceContext agentInstanceContext)
ViewFactory
canReuse
in interface ViewFactory
view
- is the candidate view to compare toagentInstanceContext
- agent instance contextpublic Set<String> getUniquenessCandidatePropertyNames()
getUniquenessCandidatePropertyNames
in interface DataWindowViewFactoryUniqueCandidate
public String getViewName()
ViewFactory
getViewName
in interface ViewFactory
public Collection<ViewFactory> getViewFactoriesContained()
getViewFactoriesContained
in interface ViewFactoryContainer
protected static String getViewNameUnionIntersect(boolean intersect, Collection<ViewFactory> factories)
public EventType getParentEventType()
public int getBatchViewIndex()
public boolean isHasAsymetric()
public IntersectBatchViewLocalState getBatchViewLocalStatePerThread()
public IntersectDefaultViewLocalState getDefaultViewLocalStatePerThread()
public IntersectAsymetricViewLocalState getAsymetricViewLocalStatePerThread()