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, shardIdINACTIVE_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, shardIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitindexSettings, shardIdpublic static final String INDEX_TRANSLOG_FS_TYPE
@Inject public FsTranslog(ShardId shardId, @IndexSettings Settings indexSettings, IndexSettingsService indexSettingsService, BigArrays bigArrays, IndexStore indexStore) throws IOException
IOExceptionpublic FsTranslog(ShardId shardId, @IndexSettings Settings indexSettings, File location)
public void closeWithDelete()
closeWithDelete in interface Translogpublic void close()
throws ElasticsearchException
CloseableIndexComponentclose in interface Closeableclose in interface AutoCloseableclose in interface CloseableIndexComponentElasticsearchExceptionpublic void updateBuffer(ByteSizeValue bufferSize)
updateBuffer in interface Translogpublic File[] locations()
public long currentId()
Translogpublic int estimatedNumberOfOperations()
TranslogestimatedNumberOfOperations in interface Translogpublic long ramBytesUsed()
ramBytesUsed in interface org.apache.lucene.util.Accountablepublic long translogSizeInBytes()
TranslogtranslogSizeInBytes in interface Translogpublic int clearUnreferenced()
TranslogclearUnreferenced in interface Translogpublic void newTranslog(long id)
throws TranslogException
TranslogCan only be called by one thread.
newTranslog in interface TranslogTranslogExceptionpublic void newTransientTranslog(long id)
throws TranslogException
TranslogCan only be called by one thread.
newTransientTranslog in interface TranslogTranslogExceptionpublic void makeTransientCurrent()
TranslogCan only be called by one thread.
makeTransientCurrent in interface Translogpublic void revertTransient()
TranslogrevertTransient in interface Translogpublic Translog.Operation read(Translog.Location location)
public Translog.Location add(Translog.Operation operation) throws TranslogException
Translogadd in interface TranslogTranslogExceptionpublic FsChannelSnapshot snapshot() throws TranslogException
Translogsnapshot in interface TranslogTranslogExceptionpublic Translog.Snapshot snapshot(Translog.Snapshot snapshot)
Translogpublic void sync()
throws IOException
Translogsync in interface TranslogIOExceptionpublic boolean syncNeeded()
syncNeeded in interface Translogpublic void syncOnEachOperation(boolean syncOnEachOperation)
syncOnEachOperation in interface Translogpublic TranslogStats stats()
TranslogCopyright © 2009–2016. All rights reserved.