org.elasticsearch.index.translog.memory
Class MemorySnapshot

java.lang.Object
  extended by org.elasticsearch.index.translog.memory.MemorySnapshot
All Implemented Interfaces:
java.lang.Iterable<Translog.Operation>, Translog.Snapshot, Streamable, Releasable

public class MemorySnapshot
extends java.lang.Object
implements Translog.Snapshot


Constructor Summary
MemorySnapshot()
           
MemorySnapshot(long id, Translog.Operation[] operations)
           
MemorySnapshot(Translog.Snapshot snapshot)
           
 
Method Summary
 java.util.Iterator<Translog.Operation> iterator()
           
 void readFrom(StreamInput in)
           
 boolean release()
           
 int size()
          The number of translog operations in the snapshot.
 java.lang.Iterable<Translog.Operation> skipTo(int skipTo)
           
 long translogId()
          The id of the translog the snapshot was taken with.
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemorySnapshot

public MemorySnapshot()

MemorySnapshot

public MemorySnapshot(Translog.Snapshot snapshot)

MemorySnapshot

public MemorySnapshot(long id,
                      Translog.Operation[] operations)
Method Detail

translogId

public long translogId()
Description copied from interface: Translog.Snapshot
The id of the translog the snapshot was taken with.

Specified by:
translogId in interface Translog.Snapshot

release

public boolean release()
                throws ElasticSearchException
Specified by:
release in interface Releasable
Throws:
ElasticSearchException

size

public int size()
Description copied from interface: Translog.Snapshot
The number of translog operations in the snapshot.

Specified by:
size in interface Translog.Snapshot

iterator

public java.util.Iterator<Translog.Operation> iterator()
Specified by:
iterator in interface java.lang.Iterable<Translog.Operation>

skipTo

public java.lang.Iterable<Translog.Operation> skipTo(int skipTo)
Specified by:
skipTo in interface Translog.Snapshot

readFrom

public void readFrom(StreamInput in)
              throws java.io.IOException
Specified by:
readFrom in interface Streamable
Throws:
java.io.IOException

writeTo

public void writeTo(StreamOutput out)
             throws java.io.IOException
Specified by:
writeTo in interface Streamable
Throws:
java.io.IOException