public class MaterializedView
extends java.lang.Object
MaterializedViewManager
to ensure
that if a view needs to be updated, the updates are properly created and fed into the view.
This class does the job of translating the base row to the view row.
It handles reading existing state and figuring out what tombstones need to be generated.
createMutations below is the "main method"Modifier and Type | Field and Description |
---|---|
java.lang.String |
name |
Constructor and Description |
---|
MaterializedView(MaterializedViewDefinition definition,
ColumnFamilyStore baseCfs) |
Modifier and Type | Method and Description |
---|---|
void |
build() |
java.util.Collection<Mutation> |
createMutations(java.nio.ByteBuffer key,
AbstractBTreePartition partition,
boolean isBuilding) |
static CFMetaData |
findBaseTable(java.lang.String keyspace,
java.lang.String view) |
static CFMetaData |
getCFMetaData(MaterializedViewDefinition definition,
CFMetaData baseCf,
CFProperties properties) |
ColumnFamilyStore |
getViewCfs()
Lazily fetch the CFS instance for the view.
|
boolean |
updateAffectsView(AbstractBTreePartition partition)
Check to see if the update could possibly modify a view.
|
boolean |
updateDefinition(MaterializedViewDefinition definition)
This updates the columns stored which are dependent on the base CFMetaData.
|
public MaterializedView(MaterializedViewDefinition definition, ColumnFamilyStore baseCfs)
public ColumnFamilyStore getViewCfs()
public boolean updateDefinition(MaterializedViewDefinition definition)
public boolean updateAffectsView(AbstractBTreePartition partition)
public java.util.Collection<Mutation> createMutations(java.nio.ByteBuffer key, AbstractBTreePartition partition, boolean isBuilding)
isBuilding
- If the view is currently being built, we do not query the values which are already stored,
since all of the update will already be present in the base table.public void build()
@Nullable public static CFMetaData findBaseTable(java.lang.String keyspace, java.lang.String view)
public static CFMetaData getCFMetaData(MaterializedViewDefinition definition, CFMetaData baseCf, CFProperties properties)
Copyright © 2015 The Apache Software Foundation