org.elasticsearch.index.translog.fs
Class SimpleFsTranslogFile

java.lang.Object
  extended by org.elasticsearch.index.translog.fs.SimpleFsTranslogFile
All Implemented Interfaces:
FsTranslogFile

public class SimpleFsTranslogFile
extends Object
implements FsTranslogFile


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.index.translog.fs.FsTranslogFile
FsTranslogFile.Type
 
Constructor Summary
SimpleFsTranslogFile(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)
           
 void reuse(FsTranslogFile other)
           
 FsChannelSnapshot snapshot()
          Returns a snapshot on this file, null if it failed to snapshot.
 void sync()
           
 boolean syncNeeded()
           
 long translogSizeInBytes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFsTranslogFile

public SimpleFsTranslogFile(ShardId shardId,
                            long id,
                            RafReference raf)
                     throws IOException
Throws:
IOException
Method Detail

id

public long id()
Specified by:
id in interface FsTranslogFile

estimatedNumberOfOperations

public int estimatedNumberOfOperations()
Specified by:
estimatedNumberOfOperations in interface FsTranslogFile

translogSizeInBytes

public long translogSizeInBytes()
Specified by:
translogSizeInBytes in interface FsTranslogFile

add

public Translog.Location add(byte[] data,
                             int from,
                             int size)
                      throws IOException
Specified by:
add in interface FsTranslogFile
Throws:
IOException

read

public byte[] read(Translog.Location location)
            throws IOException
Specified by:
read in interface FsTranslogFile
Throws:
IOException

close

public void close(boolean delete)
Specified by:
close in interface FsTranslogFile

snapshot

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

Specified by:
snapshot in interface FsTranslogFile
Throws:
TranslogException

syncNeeded

public boolean syncNeeded()
Specified by:
syncNeeded in interface FsTranslogFile

sync

public void sync()
Specified by:
sync in interface FsTranslogFile

reuse

public void reuse(FsTranslogFile other)
Specified by:
reuse in interface FsTranslogFile


Copyright © 2009-2012. All Rights Reserved.