org.apache.storm.cassandra.trident.state

## Class CassandraBackingMap<T>

- java.lang.Object
- - org.apache.storm.cassandra.trident.state.CassandraBackingMap<T>

- All Implemented Interfaces:
    IBackingMap<T>

      public class CassandraBackingMap<T>
      extends Object
      implements IBackingMap<T>

  An IBackingState implementation for Cassandra.

  The implementation stores state as a binary blob in cassandra using a `Serializer`. It supports Opaque, Transactional and NonTransactional states, given a matching serializer.

  Configuration is done with three separate constructs: - One tuple mapper for multiGet, which should map keys to a select statement and return `Values`. - One state mapper, which maps the state to/from a `Values` representation, which is used for binding. - One tuple mapper for multiPut, which should map `Values` to an INSERT or UPDATE statement.

  `multiPut(List, List)` updates Cassandra with parallel statements. `multiGet(List)` queries Cassandra with parallel statements.

  Parallelism defaults to half the maximum requests per host, either local or remote whichever is lower. The driver defaults to 256 for remote hosts and 1024 for local hosts, so the default value is 128 unless the driver is configured otherwise.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CassandraBackingMap.Options<T>`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `CassandraBackingMap(Map<String,Object> conf, CassandraBackingMap.Options<T> options)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<T>` | `multiGet(List<List<Object>> keys)`
    `void` | `multiPut(List<List<Object>> keys, List<T> values)`
    `void` | `prepare()`

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

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

- - ### Constructor Detail

    - #### CassandraBackingMap

          protected CassandraBackingMap(Map<String,Object> conf,
                                        CassandraBackingMap.Options<T> options)

  - ### Method Detail

    - #### prepare

          public void prepare()

    - #### multiGet

          public List<T> multiGet(List<List<Object>> keys)

      Specified by:
        `multiGet` in interface `IBackingMap<T>`

    - #### multiPut

          public void multiPut(List<List<Object>> keys,
                               List<T> values)

      Specified by:
        `multiPut` in interface `IBackingMap<T>`

Copyright © 2021 The Apache Software Foundation. All rights reserved.