public final class TranslogConfig extends Object
Modifier and Type | Field and Description |
---|---|
static String |
INDEX_TRANSLOG_BUFFER_SIZE |
static String |
INDEX_TRANSLOG_DURABILITY |
static String |
INDEX_TRANSLOG_FS_TYPE |
static String |
INDEX_TRANSLOG_SYNC_INTERVAL |
Constructor and Description |
---|
TranslogConfig(ShardId shardId,
Path translogPath,
Settings indexSettings,
Translog.Durabilty durabilty,
BigArrays bigArrays,
ThreadPool threadPool)
Creates a new TranslogConfig instance
|
Modifier and Type | Method and Description |
---|---|
BigArrays |
getBigArrays()
Returns a BigArrays instance for this engine
|
int |
getBufferSize()
Retruns the current translog buffer size.
|
Translog.Durabilty |
getDurabilty()
Returns the current durability mode of this translog.
|
Settings |
getIndexSettings()
Returns the current index settings
|
ShardId |
getShardId()
Returns the shard ID this config is created for
|
TimeValue |
getSyncInterval()
Returns the current async fsync interval
|
ThreadPool |
getThreadPool()
Returns a
ThreadPool to schedule async durability operations |
Translog.TranslogGeneration |
getTranslogGeneration()
Returns the translog generation to open.
|
Path |
getTranslogPath()
Returns the translog path for this engine
|
TranslogWriter.Type |
getType()
Returns the translog type
|
boolean |
isSyncOnEachOperation()
Returns
true iff each low level operation shoudl be fsynced |
void |
setBufferSize(int bufferSize)
Sets the current buffer size - for setting a live setting use
Translog.updateBuffer(ByteSizeValue) |
void |
setDurabilty(Translog.Durabilty durabilty)
Sets the current durability mode for the translog.
|
void |
setTranslogGeneration(Translog.TranslogGeneration translogGeneration)
Set the generation to be opened.
|
void |
setType(TranslogWriter.Type type)
Sets the TranslogType for this Translog.
|
public static final String INDEX_TRANSLOG_DURABILITY
public static final String INDEX_TRANSLOG_FS_TYPE
public static final String INDEX_TRANSLOG_BUFFER_SIZE
public static final String INDEX_TRANSLOG_SYNC_INTERVAL
public TranslogConfig(ShardId shardId, Path translogPath, Settings indexSettings, Translog.Durabilty durabilty, BigArrays bigArrays, @Nullable ThreadPool threadPool)
shardId
- the shard ID this translog belongs totranslogPath
- the path to use for the transaction log filesindexSettings
- the index settings used to set internal variablesdurabilty
- the default durability setting for the translogbigArrays
- a bigArrays instance used for temporarily allocating write operationsthreadPool
- a ThreadPool
to schedule async sync durabilitypublic ThreadPool getThreadPool()
ThreadPool
to schedule async durability operationspublic Translog.Durabilty getDurabilty()
public void setDurabilty(Translog.Durabilty durabilty)
public TranslogWriter.Type getType()
public void setType(TranslogWriter.Type type)
public boolean isSyncOnEachOperation()
true
iff each low level operation shoudl be fsyncedpublic int getBufferSize()
public void setBufferSize(int bufferSize)
Translog.updateBuffer(ByteSizeValue)
public TimeValue getSyncInterval()
public Settings getIndexSettings()
public ShardId getShardId()
public BigArrays getBigArrays()
public Path getTranslogPath()
public Translog.TranslogGeneration getTranslogGeneration()
null
a new translog is created. If non-null
the translog tries to open the given translog generation. The generation is treated as the last generation referenced
form already committed data. This means all operations that have not yet been committed should be in the translog
file referenced by this generation. The translog creation will fail if this generation can't be opened.public void setTranslogGeneration(Translog.TranslogGeneration translogGeneration)
null
to start with a fresh translog.getTranslogGeneration()
Copyright © 2009–2016. All rights reserved.