Class SelectAndViewAnalyzer
java.lang.Object
com.illumon.iris.db.v2.select.analyzers.SelectAndViewAnalyzer
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable
- Direct Known Subclasses:
BaseLayer
,DependencyLayerBase
,RedirectionLayer
public abstract class SelectAndViewAnalyzer extends Object implements com.fishlib.base.log.LogOutputAppendable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SelectAndViewAnalyzer.ImmediateJobScheduler
static interface
SelectAndViewAnalyzer.JobScheduler
An interface for submitting jobs to be executed and accumulating their performance.static class
SelectAndViewAnalyzer.LiveTableMonitorJobScheduler
static class
SelectAndViewAnalyzer.Mode
static class
SelectAndViewAnalyzer.SelectLayerCompletionHandler
A class that handles the completion of one select column.static class
SelectAndViewAnalyzer.TableMapTransformJobScheduler
static class
SelectAndViewAnalyzer.UpdateHelper
-
Constructor Summary
Constructors Constructor Description SelectAndViewAnalyzer(int layerIndex)
-
Method Summary
Modifier and Type Method Description abstract void
applyUpdate(ShiftAwareListener.Update upstream, ReadOnlyIndex toClear, SelectAndViewAnalyzer.UpdateHelper helper, SelectAndViewAnalyzer.JobScheduler jobScheduler, SelectAndViewAnalyzer.SelectLayerCompletionHandler onCompletion)
Apply this update to this SelectAndViewAnalyzer.Map<String,String[]>
calcEffects()
Our job here is to calculate the effects: a map from incoming column to a list of columns that it effects.static SelectAndViewAnalyzer
create(SelectAndViewAnalyzer.Mode mode, Map<String,ColumnSource> columnSources, Index index, ModifiedColumnSet parentMcs, boolean publishTheseSources, SelectColumn... selectColumns)
SelectAndViewAnalyzer.SelectLayerCompletionHandler
futureCompletionHandler(CompletableFuture<Void> waitForResult)
Create a completion handler that signals a future when the update is completed.Map<String,ColumnSource>
getAllColumnSources()
abstract SelectAndViewAnalyzer
getInner()
Map<String,ColumnSource>
getNewColumnSources()
Map<String,ColumnSource>
getPublishedColumnSources()
void
setAllNewColumns(BitSet bitset)
Set the bits in bitset that represent all of the new columns, this is used to identify when the select or update operaiton is completeabstract void
startTrackingPrev()
String
toString()
abstract void
updateColumnDefinitionsFromTopLayer(Map<String,com.illumon.dataobjects.ColumnDefinition> columnDefinitions)
-
Constructor Details
-
SelectAndViewAnalyzer
public SelectAndViewAnalyzer(int layerIndex)
-
-
Method Details
-
create
public static SelectAndViewAnalyzer create(SelectAndViewAnalyzer.Mode mode, Map<String,ColumnSource> columnSources, Index index, ModifiedColumnSet parentMcs, boolean publishTheseSources, SelectColumn... selectColumns) -
setAllNewColumns
Set the bits in bitset that represent all of the new columns, this is used to identify when the select or update operaiton is complete- Parameters:
bitset
- the bitset to manipulate.
-
getAllColumnSources
-
getNewColumnSources
-
getPublishedColumnSources
-
applyUpdate
public abstract void applyUpdate(ShiftAwareListener.Update upstream, ReadOnlyIndex toClear, SelectAndViewAnalyzer.UpdateHelper helper, SelectAndViewAnalyzer.JobScheduler jobScheduler, SelectAndViewAnalyzer.SelectLayerCompletionHandler onCompletion)Apply this update to this SelectAndViewAnalyzer.- Parameters:
upstream
- the upstream updatetoClear
- rows that used to exist and no longer existhelper
- convenience class that memoizes reusable calculations for this updateonCompletion
- called when an inner column is complete, the outer layer should pass the completion on to other layers and if it all of it's dependencies have been satisfied schedule execution of that column update
-
calcEffects
Our job here is to calculate the effects: a map from incoming column to a list of columns that it effects. We do this in two stages. In the first stage we create a map from column to (set of dependent columns). In the second stage we reverse that map. -
getInner
-
updateColumnDefinitionsFromTopLayer
-
startTrackingPrev
public abstract void startTrackingPrev() -
futureCompletionHandler
public SelectAndViewAnalyzer.SelectLayerCompletionHandler futureCompletionHandler(CompletableFuture<Void> waitForResult)Create a completion handler that signals a future when the update is completed.- Parameters:
waitForResult
- a void future indicating success or failure- Returns:
- a completion handler that will signal the future
-
toString
-