org.elasticsearch.index.translog.fs
Class FsChannelSnapshot

java.lang.Object
  extended by org.elasticsearch.index.translog.fs.FsChannelSnapshot
All Implemented Interfaces:
Releasable, Translog.Snapshot

public class FsChannelSnapshot
extends Object
implements Translog.Snapshot


Constructor Summary
FsChannelSnapshot(long id, RafReference raf, long length, int totalOperations)
           
 
Method Summary
 int estimatedTotalOperations()
          The total number of operations in the translog.
 boolean hasNext()
           
 long length()
          Returns the internal length (*not* number of operations) of this snapshot.
 long lengthInBytes()
          The length in bytes of this stream.
 Translog.Operation next()
           
 long position()
           
 boolean release()
           
 void seekForward(long length)
           
 InputStream stream()
          Returns a stream of this snapshot.
 long translogId()
          The id of the translog the snapshot was taken with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FsChannelSnapshot

public FsChannelSnapshot(long id,
                         RafReference raf,
                         long length,
                         int totalOperations)
                  throws FileNotFoundException
Throws:
FileNotFoundException
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

position

public long position()
Specified by:
position in interface Translog.Snapshot

length

public long length()
Description copied from interface: Translog.Snapshot
Returns the internal length (*not* number of operations) of this snapshot.

Specified by:
length in interface Translog.Snapshot

estimatedTotalOperations

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

Specified by:
estimatedTotalOperations in interface Translog.Snapshot

stream

public InputStream stream()
                   throws IOException
Description copied from interface: Translog.Snapshot
Returns a stream of this snapshot.

Specified by:
stream in interface Translog.Snapshot
Throws:
IOException

lengthInBytes

public long lengthInBytes()
Description copied from interface: Translog.Snapshot
The length in bytes of this stream.

Specified by:
lengthInBytes in interface Translog.Snapshot

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Translog.Snapshot

next

public Translog.Operation next()
Specified by:
next in interface Translog.Snapshot

seekForward

public void seekForward(long length)
Specified by:
seekForward in interface Translog.Snapshot

release

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


Copyright © 2009-2012. All Rights Reserved.