Class BaseIndexOptions
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.base.api.BaseIndexOptions
-
public class BaseIndexOptions extends java.lang.ObjectThe base index options indicate how the indices are built.One of the options is to build indices in wildcard mode, meaning that all EClasses, EDataTypes, EReferences and EAttributes are indexed. This is convenient, but comes at a high memory cost. To save memory, one can disable wildcard mode and manually register those EClasses, EDataTypes, EReferences and EAttributes that should be indexed.
Another choice is whether to build indices in dynamic EMF mode, meaning that types are identified by the String IDs that are ultimately derived from the nsURI of the EPackage. Multiple types with the same ID are treated as the same. This is useful if dynamic EMF is used, where there can be multiple copies (instantiations) of the same EPackage, representing essentially the same metamodel. If one disables dynamic EMF mode, an error is logged if duplicate EPackages with the same nsURI are encountered.
- No Implement:
- This class is not intended to be subclasses outside of VIATRA runtime
-
-
Field Summary
Fields Modifier and Type Field Description protected static booleanDANGLING_FREE_ASSUMPTION_DEFAULTBy default, the scope will make the assumption that it is free from dangling edges.protected booleandanglingFreeAssumptionprotected static booleanDYNAMIC_EMF_MODE_DEFAULTBy default, base indices will be constructed with dynamic EMF mode set as false.protected booleandynamicEMFModeprotected IBaseIndexFeatureFilterfeatureFilterConfigurationprotected static ProfilerModeINDEX_PROFILER_MODE_DEFAULTprotected ProfilerModeindexerProfilerModeReturns whether base index profiling should be turned on.protected IBaseIndexObjectFilternotifierFilterConfigurationprotected IBaseIndexResourceFilterresourceFilterConfigurationprotected static booleanSTRICT_NOTIFICATION_MODE_DEFAULTBy default, duplicate notifications are only logged.protected booleanstrictNotificationModeIf strict notification mode is turned on, errors related to inconsistent notifications, e.g.protected booleantraverseOnlyWellBehavingDerivedFeaturesprotected static IndexingLevelWILDCARD_MODE_DEFAULTBy default, base indices will be constructed with wildcard mode set as false.protected IndexingLevelwildcardMode
-
Constructor Summary
Constructors Constructor Description BaseIndexOptions()Creates a base index options with the default values.BaseIndexOptions(boolean dynamicEMFMode, IndexingLevel wildcardMode)Creates a base index options using the provided values for dynamic EMF mode and wildcard mode.
-
Method Summary
-
-
-
Field Detail
-
WILDCARD_MODE_DEFAULT
protected static final IndexingLevel WILDCARD_MODE_DEFAULT
By default, base indices will be constructed with wildcard mode set as false.
-
DYNAMIC_EMF_MODE_DEFAULT
protected static final boolean DYNAMIC_EMF_MODE_DEFAULT
By default, base indices will be constructed with dynamic EMF mode set as false.- See Also:
- Constant Field Values
-
DANGLING_FREE_ASSUMPTION_DEFAULT
protected static final boolean DANGLING_FREE_ASSUMPTION_DEFAULT
By default, the scope will make the assumption that it is free from dangling edges.- Since:
- 1.6
- See Also:
- Constant Field Values
-
STRICT_NOTIFICATION_MODE_DEFAULT
protected static final boolean STRICT_NOTIFICATION_MODE_DEFAULT
By default, duplicate notifications are only logged.- Since:
- 1.6
- See Also:
- Constant Field Values
-
INDEX_PROFILER_MODE_DEFAULT
protected static final ProfilerMode INDEX_PROFILER_MODE_DEFAULT
- Since:
- 2.3
-
danglingFreeAssumption
protected boolean danglingFreeAssumption
- Since:
- 1.6
-
dynamicEMFMode
protected boolean dynamicEMFMode
-
traverseOnlyWellBehavingDerivedFeatures
protected boolean traverseOnlyWellBehavingDerivedFeatures
-
wildcardMode
protected IndexingLevel wildcardMode
-
notifierFilterConfiguration
protected IBaseIndexObjectFilter notifierFilterConfiguration
-
resourceFilterConfiguration
protected IBaseIndexResourceFilter resourceFilterConfiguration
-
featureFilterConfiguration
protected IBaseIndexFeatureFilter featureFilterConfiguration
- Since:
- 1.5
-
strictNotificationMode
protected boolean strictNotificationMode
If strict notification mode is turned on, errors related to inconsistent notifications, e.g. duplicate deletions cause the entire Base index to be considered invalid, e.g. the query engine on top of the index should become tainted.- Since:
- 1.6
-
indexerProfilerMode
protected ProfilerMode indexerProfilerMode
Returns whether base index profiling should be turned on.- Since:
- 2.3
-
-
Constructor Detail
-
BaseIndexOptions
public BaseIndexOptions()
Creates a base index options with the default values.
-
BaseIndexOptions
public BaseIndexOptions(boolean dynamicEMFMode, IndexingLevel wildcardMode)Creates a base index options using the provided values for dynamic EMF mode and wildcard mode.- Since:
- 1.4
-
-
Method Detail
-
withDynamicEMFMode
public BaseIndexOptions withDynamicEMFMode(boolean dynamicEMFMode)
- Parameters:
dynamicEMFMode-- Since:
- 0.9
-
withDanglingFreeAssumption
public BaseIndexOptions withDanglingFreeAssumption(boolean danglingFreeAssumption)
Sets the dangling edge handling property of the index option. If not set explicitly, it is considered as `true`.- Parameters:
danglingFreeAssumption- if true, the base index will assume that there are no dangling references (pointing out of scope or to proxies)- Since:
- 1.6
-
withObjectFilterConfiguration
public BaseIndexOptions withObjectFilterConfiguration(IBaseIndexObjectFilter filter)
Adds an object-level filter to the indexer configuration. Warning - object-level indexing can increase indexing time noticeably. If possibly, usewithResourceFilterConfiguration(IBaseIndexResourceFilter)instead.- Parameters:
filter-- Since:
- 0.9
-
getObjectFilterConfiguration
public IBaseIndexObjectFilter getObjectFilterConfiguration()
- Returns:
- the selected object filter configuration, or null if not set
-
withResourceFilterConfiguration
public BaseIndexOptions withResourceFilterConfiguration(IBaseIndexResourceFilter filter)
Returns a copy of the configuration with a specified resource filter- Parameters:
filter-- Since:
- 0.9
-
getResourceFilterConfiguration
public IBaseIndexResourceFilter getResourceFilterConfiguration()
- Returns:
- the selected resource filter, or null if not set
-
withFeatureFilterConfiguration
public BaseIndexOptions withFeatureFilterConfiguration(IBaseIndexFeatureFilter filter)
Returns a copy of the configuration with a specified feature filter- Parameters:
filter-- Since:
- 1.5
-
getFeatureFilterConfiguration
public IBaseIndexFeatureFilter getFeatureFilterConfiguration()
- Returns:
- the selected feature filter, or null if not set
- Since:
- 1.5
-
isDynamicEMFMode
public boolean isDynamicEMFMode()
- Returns:
- whether the base index option has dynamic EMF mode set
-
isDanglingFreeAssumption
public boolean isDanglingFreeAssumption()
- Returns:
- whether the base index makes the assumption that there can be no dangling edges
- Since:
- 1.6
-
isTraverseOnlyWellBehavingDerivedFeatures
public boolean isTraverseOnlyWellBehavingDerivedFeatures()
- Returns:
- whether the base index option has traverse only well-behaving derived features set
-
withWildcardLevel
public BaseIndexOptions withWildcardLevel(IndexingLevel wildcardLevel)
- Parameters:
wildcardMode-- Since:
- 1.4
-
withStrictNotificationMode
public BaseIndexOptions withStrictNotificationMode(boolean strictNotificationMode)
- Since:
- 1.6
-
withIndexProfilerMode
public BaseIndexOptions withIndexProfilerMode(ProfilerMode indexerProfilerMode)
- Since:
- 2.3
-
isWildcardMode
public boolean isWildcardMode()
- Returns:
- whether the base index option has wildcard mode set
-
getWildcardLevel
public IndexingLevel getWildcardLevel()
- Returns:
- the wildcardMode level
- Since:
- 1.4
-
isStrictNotificationMode
public boolean isStrictNotificationMode()
If strict notification mode is turned on, errors related to inconsistent notifications, e.g. duplicate deletions cause the entire Base index to be considered invalid, e.g. the query engine on top of the index should become tainted.- Since:
- 1.6
-
getIndexerProfilerMode
public ProfilerMode getIndexerProfilerMode()
Returns whether base indexer profiling is enabled. The profiling causes some slowdown, but provides information about how much time the base indexer takes for initialization and updates.- Since:
- 2.3
-
copy
public BaseIndexOptions copy()
Creates an independent copy of itself. The values of each option will be the same as this options. This method is used when a provided option must be copied to avoid external option changes afterward.- Returns:
- the copy of this options
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-