com.thinkaurelius.titan.diskstorage.indexing

## Class IndexTransaction

- java.lang.Object
- - com.thinkaurelius.titan.diskstorage.indexing.IndexTransaction

- All Implemented Interfaces:
    BaseTransaction, LoggableTransaction

      public class IndexTransaction
      extends Object
      implements BaseTransaction, LoggableTransaction

  Wraps the transaction handle of an index and buffers all mutations against an index for efficiency. Also acts as a proxy to the `IndexProvider` methods.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexTransaction(IndexProvider index, KeyInformation.IndexRetriever keyInformations, BaseTransactionConfig config, Duration maxWriteTime)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(String store, String docid, IndexEntry entry, boolean isNew)`
    `void` | `add(String store, String docid, String key, Object value, boolean isNew)`
    `void` | `commit()` Commits the transaction and persists all modifications to the backend.
    `void` | `delete(String store, String docid, String key, Object value, boolean deleteAll)`
    `void` | `logMutations(DataOutput out)`
    `List<String>` | `query(IndexQuery query)`
    `Iterable<RawQuery.Result<String>>` | `query(RawQuery query)`
    `void` | `register(String store, String key, KeyInformation information)`
    `void` | `restore(Map<String,Map<String,List<IndexEntry>>> documents)`
    `void` | `rollback()` Aborts (or rolls back) the transaction.

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

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

- - ### Constructor Detail

    - #### IndexTransaction

          public IndexTransaction(IndexProvider index,
                          KeyInformation.IndexRetriever keyInformations,
                          BaseTransactionConfig config,
                          Duration maxWriteTime)
                           throws BackendException

      Throws:
        `BackendException`

  - ### Method Detail

    - #### add

          public void add(String store,
                 String docid,
                 IndexEntry entry,
                 boolean isNew)

    - #### add

          public void add(String store,
                 String docid,
                 String key,
                 Object value,
                 boolean isNew)

    - #### delete

          public void delete(String store,
                    String docid,
                    String key,
                    Object value,
                    boolean deleteAll)

    - #### register

          public void register(String store,
                      String key,
                      KeyInformation information)
                        throws BackendException

      Throws:
        `BackendException`

    - #### query

          public List<String> query(IndexQuery query)
                             throws BackendException

      Throws:
        `BackendException`

    - #### query

          public Iterable<RawQuery.Result<String>> query(RawQuery query)
                                                  throws BackendException

      Throws:
        `BackendException`

    - #### restore

          public void restore(Map<String,Map<String,List<IndexEntry>>> documents)
                       throws BackendException

      Throws:
        `BackendException`

    - #### commit

          public void commit()
                      throws BackendException

      Description copied from interface: `BaseTransaction`
      Commits the transaction and persists all modifications to the backend. Call either this method or `BaseTransaction.rollback()` at most once per instance.
      Specified by:
        `commit` in interface `BaseTransaction`
      Throws:
        `BackendException`

    - #### rollback

          public void rollback()
                        throws BackendException

      Description copied from interface: `BaseTransaction`
      Aborts (or rolls back) the transaction. Call either this method or `BaseTransaction.commit()` at most once per instance.
      Specified by:
        `rollback` in interface `BaseTransaction`
      Throws:
        `BackendException`

    - #### logMutations

          public void logMutations(DataOutput out)

      Specified by:
        `logMutations` in interface `LoggableTransaction`

Copyright © 2012–2014. All rights reserved.