public class FsTranslog extends AbstractIndexShardComponent implements Translog
Translog.Create, Translog.Delete, Translog.DeleteByQuery, Translog.Index, Translog.Location, Translog.Operation, Translog.Snapshot, Translog.Source
Modifier and Type | Field and Description |
---|---|
static String |
INDEX_TRANSLOG_FS_TYPE |
componentSettings, indexSettings, logger, shardId
INACTIVE_SHARD_TRANSLOG_BUFFER, TRANSLOG_ID_KEY
Constructor and Description |
---|
FsTranslog(ShardId shardId,
Settings indexSettings,
File location) |
FsTranslog(ShardId shardId,
Settings indexSettings,
IndexSettingsService indexSettingsService,
BigArrays bigArrays,
IndexStore indexStore) |
Modifier and Type | Method and Description |
---|---|
Translog.Location |
add(Translog.Operation operation)
Adds a create operation to the transaction log.
|
int |
clearUnreferenced()
Clears unreferenced transaction logs.
|
void |
close()
Closes the index component.
|
void |
closeWithDelete() |
long |
currentId()
Returns the id of the current transaction log.
|
int |
estimatedNumberOfOperations()
Returns the number of operations in the transaction log.
|
File[] |
locations() |
void |
makeTransientCurrent()
Swaps the transient translog to be the current one.
|
void |
newTransientTranslog(long id)
Creates a new transient translog, where added ops will be added to the current one, and to
it.
|
void |
newTranslog(long id)
Creates a new transaction log internally.
|
long |
ramBytesUsed() |
Translog.Operation |
read(Translog.Location location)
Read the Operation object from the given location, returns null if the
Operation could not be read.
|
void |
revertTransient()
Reverts back to not have a transient translog.
|
FsChannelSnapshot |
snapshot()
Snapshots the current transaction log allowing to safely iterate over the snapshot.
|
Translog.Snapshot |
snapshot(Translog.Snapshot snapshot)
Snapshots the delta between the current state of the translog, and the state defined
by the provided snapshot.
|
TranslogStats |
stats()
return stats
|
void |
sync()
Sync's the translog.
|
boolean |
syncNeeded() |
void |
syncOnEachOperation(boolean syncOnEachOperation) |
long |
translogSizeInBytes()
Returns the size in bytes of the translog.
|
void |
updateBuffer(ByteSizeValue bufferSize) |
indexSettings, nodeName, shardId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
indexSettings, shardId
public static final String INDEX_TRANSLOG_FS_TYPE
@Inject public FsTranslog(ShardId shardId, @IndexSettings Settings indexSettings, IndexSettingsService indexSettingsService, BigArrays bigArrays, IndexStore indexStore) throws IOException
IOException
public FsTranslog(ShardId shardId, @IndexSettings Settings indexSettings, File location)
public void closeWithDelete()
closeWithDelete
in interface Translog
public void close() throws ElasticsearchException
CloseableIndexComponent
close
in interface Closeable
close
in interface AutoCloseable
close
in interface CloseableIndexComponent
ElasticsearchException
public void updateBuffer(ByteSizeValue bufferSize)
updateBuffer
in interface Translog
public File[] locations()
public long currentId()
Translog
public int estimatedNumberOfOperations()
Translog
estimatedNumberOfOperations
in interface Translog
public long ramBytesUsed()
ramBytesUsed
in interface org.apache.lucene.util.Accountable
public long translogSizeInBytes()
Translog
translogSizeInBytes
in interface Translog
public int clearUnreferenced()
Translog
clearUnreferenced
in interface Translog
public void newTranslog(long id) throws TranslogException
Translog
Can only be called by one thread.
newTranslog
in interface Translog
TranslogException
public void newTransientTranslog(long id) throws TranslogException
Translog
Can only be called by one thread.
newTransientTranslog
in interface Translog
TranslogException
public void makeTransientCurrent()
Translog
Can only be called by one thread.
makeTransientCurrent
in interface Translog
public void revertTransient()
Translog
revertTransient
in interface Translog
public Translog.Operation read(Translog.Location location)
public Translog.Location add(Translog.Operation operation) throws TranslogException
Translog
add
in interface Translog
TranslogException
public FsChannelSnapshot snapshot() throws TranslogException
Translog
snapshot
in interface Translog
TranslogException
public Translog.Snapshot snapshot(Translog.Snapshot snapshot)
Translog
public void sync() throws IOException
Translog
sync
in interface Translog
IOException
public boolean syncNeeded()
syncNeeded
in interface Translog
public void syncOnEachOperation(boolean syncOnEachOperation)
syncOnEachOperation
in interface Translog
public TranslogStats stats()
Translog
Copyright © 2009–2015. All rights reserved.