public class View
extends java.lang.Object
ViewManager
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(AbstractBTreePartition, TemporalRow.Set, boolean)
is the "main method"Modifier and Type | Field and Description |
---|---|
java.lang.String |
name |
Constructor and Description |
---|
View(ViewDefinition definition,
ColumnFamilyStore baseCfs) |
Modifier and Type | Method and Description |
---|---|
void |
build() |
static java.lang.String |
buildSelectStatement(java.lang.String cfName,
java.util.Collection<ColumnDefinition> includedColumns,
java.lang.String whereClause)
Builds the string text for a materialized view's SELECT statement.
|
java.util.Collection<Mutation> |
createMutations(AbstractBTreePartition partition,
org.apache.cassandra.db.view.TemporalRow.Set rowSet,
boolean isBuilding) |
static java.lang.Iterable<ViewDefinition> |
findAll(java.lang.String keyspace,
java.lang.String baseTable) |
static CFMetaData |
findBaseTable(java.lang.String keyspace,
java.lang.String viewName) |
ViewDefinition |
getDefinition() |
ReadQuery |
getReadQuery()
Returns the ReadQuery used to filter this view.
|
SelectStatement |
getSelectStatement()
Returns the SelectStatement used to populate and filter this view.
|
org.apache.cassandra.db.view.TemporalRow.Set |
getTemporalRowSet(AbstractBTreePartition partition,
org.apache.cassandra.db.view.TemporalRow.Set existing,
boolean isBuilding)
Splits the partition update up and adds the existing state to each row.
|
static java.lang.String |
relationsToWhereClause(java.util.List<Relation> whereClause) |
boolean |
updateAffectsView(AbstractBTreePartition partition)
Check to see if the update could possibly modify a view.
|
boolean |
updateDefinition(ViewDefinition definition)
This updates the columns stored which are dependent on the base CFMetaData.
|
public View(ViewDefinition definition, ColumnFamilyStore baseCfs)
public ViewDefinition getDefinition()
public boolean updateDefinition(ViewDefinition definition)
public boolean updateAffectsView(AbstractBTreePartition partition)
public org.apache.cassandra.db.view.TemporalRow.Set getTemporalRowSet(AbstractBTreePartition partition, org.apache.cassandra.db.view.TemporalRow.Set existing, boolean isBuilding)
partition
- the mutationisBuilding
- 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 SelectStatement getSelectStatement()
public ReadQuery getReadQuery()
public java.util.Collection<Mutation> createMutations(AbstractBTreePartition partition, org.apache.cassandra.db.view.TemporalRow.Set rowSet, 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 viewName)
public static java.lang.Iterable<ViewDefinition> findAll(java.lang.String keyspace, java.lang.String baseTable)
public static java.lang.String buildSelectStatement(java.lang.String cfName, java.util.Collection<ColumnDefinition> includedColumns, java.lang.String whereClause)
public static java.lang.String relationsToWhereClause(java.util.List<Relation> whereClause)
Copyright © 2015 The Apache Software Foundation