public class ViewManager
extends java.lang.Object
View
's for a single ColumnFamilyStore
. All of the views for that table are created when this
manager is initialized.
The main purposes of the manager are to provide a single location for updates to be vetted to see whether they update
any views updatesAffectView(Collection, boolean)
, provide locks to prevent multiple
updates from creating incoherent updates in the view acquireLockFor(int)
, and
to affect change on the view.
TODO: I think we can get rid of that class. For addition/removal of view by names, we could move it Keyspace. And we
not sure it's even worth keeping viewsByName as none of the related operation are performance sensitive so we could
find the view by iterating over the CFStore.viewManager directly.
For the lock, it could move to Keyspace too, but I don't remmenber why it has to be at the keyspace level and if it
can be at the table level, maybe that's where it should be.Constructor and Description |
---|
ViewManager(Keyspace keyspace) |
Modifier and Type | Method and Description |
---|---|
static java.util.concurrent.locks.Lock |
acquireLockFor(int keyAndCfidHash) |
void |
addView(ViewMetadata definition) |
void |
buildAllViews() |
void |
dropView(java.lang.String name)
Stops the building of the specified view, no-op if it isn't building.
|
TableViews |
forTable(TableId id) |
View |
getByName(java.lang.String name) |
void |
reload(boolean buildAllViews) |
boolean |
updatesAffectView(java.util.Collection<? extends IMutation> mutations,
boolean coordinatorBatchlog) |
public ViewManager(Keyspace keyspace)
public boolean updatesAffectView(java.util.Collection<? extends IMutation> mutations, boolean coordinatorBatchlog)
public void reload(boolean buildAllViews)
public void addView(ViewMetadata definition)
public void dropView(java.lang.String name)
name
- the name of the viewpublic View getByName(java.lang.String name)
public void buildAllViews()
public TableViews forTable(TableId id)
public static java.util.concurrent.locks.Lock acquireLockFor(int keyAndCfidHash)
Copyright © 2009-2021 The Apache Software Foundation