@API(value=INTERNAL) public class SyntheticRecordPlanner extends Object
SyntheticRecordPlan
and SyntheticRecordFromStoredRecordPlan
plans.
The planner is invoked when plans are needed for index maintenance, either to generate all synthetic
records for rebuilding a whole index or to generate affected synthetic records when a stored record
is modified (the FromStoredRecord
case). The planner is initialized with a RecordMetaData
,
for getting synthetic record type definitions (such as the joins that make up a joined record type) and
a RecordQueryPlanner
, which is used to plan the underlying scans of stored records from which the
records to be indexed can be synthesized.Constructor and Description |
---|
SyntheticRecordPlanner(FDBRecordStore store)
Initialize a new planner.
|
SyntheticRecordPlanner(RecordMetaData recordMetaData,
RecordStoreState storeState)
Initialize a new planner.
|
Modifier and Type | Method and Description |
---|---|
SyntheticRecordFromStoredRecordPlan |
forIndex(Index index)
Construct a plan for generating synthetic records for a given index.
|
SyntheticRecordFromStoredRecordPlan |
forJoinConstituent(JoinedRecordType joinedRecordType,
JoinedRecordType.JoinConstituent joinConstituent)
Construct a plan for generating synthetic records from a constituent of a joined record type.
|
SyntheticRecordFromStoredRecordPlan |
forType(JoinedRecordType joinedRecordType)
Construct a plan for generating all joined records of a given type.
|
SyntheticRecordFromStoredRecordPlan |
forType(SyntheticRecordType<?> syntheticRecordType)
Construct a plan for generating all synthetic records of a given type.
|
SyntheticRecordFromStoredRecordPlan |
fromStoredType(RecordType storedRecordType,
boolean onlyIfIndexed)
Construct a plan for generating synthetic records from a record of a given stored record type.
|
SyntheticRecordPlan |
scanForType(SyntheticRecordType<?> syntheticRecordType)
Construct a plan for generating all synthetic records of a given type.
|
Set<RecordType> |
storedRecordTypesForIndex(Index index,
Collection<RecordType> recordTypes)
Determine what stored record types would be need to scanned in order to rebuild a given index.
|
public SyntheticRecordPlanner(@Nonnull RecordMetaData recordMetaData, @Nonnull RecordStoreState storeState)
recordMetaData
- meta-data to use for planningstoreState
- index enabling state to use for planningpublic SyntheticRecordPlanner(@Nonnull FDBRecordStore store)
store
- a record store@Nonnull public SyntheticRecordPlan scanForType(@Nonnull SyntheticRecordType<?> syntheticRecordType)
syntheticRecordType
- the synthetic record type@Nonnull public SyntheticRecordFromStoredRecordPlan forType(@Nonnull SyntheticRecordType<?> syntheticRecordType)
syntheticRecordType
- the synthetic record type@Nonnull public SyntheticRecordFromStoredRecordPlan forType(@Nonnull JoinedRecordType joinedRecordType)
joinedRecordType
- the joined record type@Nullable public SyntheticRecordFromStoredRecordPlan fromStoredType(@Nonnull RecordType storedRecordType, boolean onlyIfIndexed)
storedRecordType
- the stored record typeonlyIfIndexed
- only include synthetic types on which indexes are definednull
if
no indexed synthetic types include the given stored record type.public Set<RecordType> storedRecordTypesForIndex(@Nonnull Index index, @Nullable Collection<RecordType> recordTypes)
In cases such as full outer join, there is no single record type from which all joins can be produced.
index
- the index that needs to be builtrecordTypes
- a subset of the index's record types or null
for all@Nonnull public SyntheticRecordFromStoredRecordPlan forIndex(@Nonnull Index index)
OnlineIndexer
to build from a full scan of stored records.index
- an index on synthetic record types@Nonnull public SyntheticRecordFromStoredRecordPlan forJoinConstituent(@Nonnull JoinedRecordType joinedRecordType, @Nonnull JoinedRecordType.JoinConstituent joinConstituent)
joinedRecordType
- the joined record typejoinConstituent
- the constituent type