org.elasticsearch.index.translog.fs
Class FsTranslogFile

java.lang.Object
  extended by org.elasticsearch.index.translog.fs.FsTranslogFile

public class FsTranslogFile
extends java.lang.Object


Constructor Summary
FsTranslogFile(ShardId shardId, long id, RafReference raf)
           
 
Method Summary
 Translog.Location add(byte[] data, int from, int size)
           
 void close(boolean delete)
           
 int estimatedNumberOfOperations()
           
 long id()
           
 byte[] read(Translog.Location location)
           
 FsChannelSnapshot snapshot()
          Returns a snapshot on this file, null if it failed to snapshot.
 void sync()
           
 long translogSizeInBytes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FsTranslogFile

public FsTranslogFile(ShardId shardId,
                      long id,
                      RafReference raf)
               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

id

public long id()

estimatedNumberOfOperations

public int estimatedNumberOfOperations()

translogSizeInBytes

public long translogSizeInBytes()

add

public Translog.Location add(byte[] data,
                             int from,
                             int size)
                      throws java.io.IOException
Throws:
java.io.IOException

read

public byte[] read(Translog.Location location)
            throws java.io.IOException
Throws:
java.io.IOException

close

public void close(boolean delete)

snapshot

public FsChannelSnapshot snapshot()
                           throws TranslogException
Returns a snapshot on this file, null if it failed to snapshot.

Throws:
TranslogException

sync

public void sync()