org.elasticsearch.index.translog
Interface Translog

All Superinterfaces:
IndexShardComponent
All Known Implementing Classes:
FsTranslog, MemoryTranslog

@ThreadSafe
public interface Translog
extends IndexShardComponent


Nested Class Summary
static class Translog.Create
           
static class Translog.Delete
           
static class Translog.DeleteByQuery
           
static class Translog.Index
           
static interface Translog.Operation
          A generic interface representing an operation performed on the transaction log.
static interface Translog.Snapshot
          A snapshot of the transaction log, allows to iterate over all the transaction log operations.
 
Method Summary
 void add(Translog.Operation operation)
          Adds a create operation to the transaction log.
 void close()
          Closes the transaction log.
 long currentId()
          Returns the id of the current transaction log.
 ByteSizeValue estimateMemorySize()
          The estimated memory size this translog is taking.
 void newTranslog(long id)
          Creates a new transaction log internally.
 int size()
          Returns the number of operations in the transaction log.
 Translog.Snapshot snapshot()
          Snapshots the current transaction log allowing to safely iterate over the snapshot.
 Translog.Snapshot snapshot(Translog.Snapshot snapshot)
          Snapshots the delta between the current state of the translog, and the state defined by the provided snapshot.
 
Methods inherited from interface org.elasticsearch.index.shard.IndexShardComponent
indexSettings, shardId
 

Method Detail

currentId

long currentId()
Returns the id of the current transaction log.


size

int size()
Returns the number of operations in the transaction log.


estimateMemorySize

ByteSizeValue estimateMemorySize()
The estimated memory size this translog is taking.


newTranslog

void newTranslog(long id)
                 throws TranslogException
Creates a new transaction log internally. Note, users of this class should make sure that no operations are performed on the trans log when this is called.

Throws:
TranslogException

add

void add(Translog.Operation operation)
         throws TranslogException
Adds a create operation to the transaction log.

Throws:
TranslogException

snapshot

Translog.Snapshot snapshot()
                           throws TranslogException
Snapshots the current transaction log allowing to safely iterate over the snapshot.

Throws:
TranslogException

snapshot

Translog.Snapshot snapshot(Translog.Snapshot snapshot)
Snapshots the delta between the current state of the translog, and the state defined by the provided snapshot. If a new translog has been created after the provided snapshot has been take, will return a snapshot on the current trasnlog.


close

void close()
Closes the transaction log.