org.apache.cassandra.db.view

## Class ViewManager

- java.lang.Object
- - org.apache.cassandra.db.view.ViewManager

-     public class ViewManager
      extends java.lang.Object

  Manages `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 Summary

    Constructors
    Constructor and Description
    `ViewManager(Keyspace keyspace)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.concurrent.locks.Lock` | `acquireLockFor(int keyAndCfidHash)`
    `void` | `addView(ViewDefinition definition)`
    `void` | `buildAllViews()`
    `TableViews` | `forTable(CFMetaData metadata)`
    `View` | `getByName(java.lang.String name)`
    `void` | `reload()`
    `void` | `removeView(java.lang.String name)`
    `void` | `update(java.lang.String viewName)`
    `boolean` | `updatesAffectView(java.util.Collection<? extends IMutation> mutations, boolean coordinatorBatchlog)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ViewManager

          public ViewManager(Keyspace keyspace)

  - ### Method Detail

    - #### updatesAffectView

          public boolean updatesAffectView(java.util.Collection<? extends IMutation> mutations,
                                           boolean coordinatorBatchlog)

    - #### update

          public void update(java.lang.String viewName)

    - #### reload

          public void reload()

    - #### addView

          public void addView(ViewDefinition definition)

    - #### removeView

          public void removeView(java.lang.String name)

    - #### getByName

          public View getByName(java.lang.String name)

    - #### buildAllViews

          public void buildAllViews()

    - #### forTable

          public TableViews forTable(CFMetaData metadata)

    - #### acquireLockFor

          public static java.util.concurrent.locks.Lock acquireLockFor(int keyAndCfidHash)

Copyright © 2018 The Apache Software Foundation