org.elasticsearch.index.gateway.blobstore
Class BlobStoreIndexShardGateway

java.lang.Object
  extended by org.elasticsearch.index.shard.AbstractIndexShardComponent
      extended by org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway
All Implemented Interfaces:
CloseableIndexComponent, IndexShardGateway, IndexShardComponent
Direct Known Subclasses:
FsIndexShardGateway

public abstract class BlobStoreIndexShardGateway
extends AbstractIndexShardComponent
implements IndexShardGateway


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.index.gateway.IndexShardGateway
IndexShardGateway.Snapshot, IndexShardGateway.SnapshotLock
 
Field Summary
protected  ImmutableBlobContainer blobContainer
           
protected  BlobStore blobStore
           
protected  ByteSizeValue chunkSize
           
protected  InternalIndexShard indexShard
           
protected  BlobPath shardPath
           
protected  Store store
           
protected  ThreadPool threadPool
           
 
Fields inherited from class org.elasticsearch.index.shard.AbstractIndexShardComponent
componentSettings, indexSettings, logger, shardId
 
Fields inherited from interface org.elasticsearch.index.gateway.IndexShardGateway
NO_SNAPSHOT_LOCK
 
Constructor Summary
protected BlobStoreIndexShardGateway(ShardId shardId, Settings indexSettings, ThreadPool threadPool, IndexGateway indexGateway, IndexShard indexShard, Store store)
           
 
Method Summary
 void close(boolean delete)
          Closes the index component.
 SnapshotStatus currentSnapshotStatus()
          The current snapshot status being performed.
 SnapshotStatus lastSnapshotStatus()
          The last snapshot status performed.
 IndexShardGateway.SnapshotLock obtainSnapshotLock()
           
 void recover(boolean indexShouldExists, RecoveryStatus recoveryStatus)
          Recovers the state of the shard from the gateway.
 RecoveryStatus recoveryStatus()
          The last / on going recovery status.
 boolean requiresSnapshot()
          Returns true if snapshot is even required on this gateway (i.e.
 boolean requiresSnapshotScheduling()
          Returns true if this gateway requires scheduling management for snapshot operations.
 SnapshotStatus snapshot(IndexShardGateway.Snapshot snapshot)
          Snapshots the given shard into the gateway.
 String toString()
           
 
Methods inherited from class org.elasticsearch.index.shard.AbstractIndexShardComponent
indexSettings, managementGroupName, nodeName, shardId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.elasticsearch.index.gateway.IndexShardGateway
type
 
Methods inherited from interface org.elasticsearch.index.shard.IndexShardComponent
indexSettings, shardId
 

Field Detail

threadPool

protected final ThreadPool threadPool

indexShard

protected final InternalIndexShard indexShard

store

protected final Store store

chunkSize

protected final ByteSizeValue chunkSize

blobStore

protected final BlobStore blobStore

shardPath

protected final BlobPath shardPath

blobContainer

protected final ImmutableBlobContainer blobContainer
Constructor Detail

BlobStoreIndexShardGateway

protected BlobStoreIndexShardGateway(ShardId shardId,
                                     @IndexSettings
                                     Settings indexSettings,
                                     ThreadPool threadPool,
                                     IndexGateway indexGateway,
                                     IndexShard indexShard,
                                     Store store)
Method Detail

recoveryStatus

public RecoveryStatus recoveryStatus()
Description copied from interface: IndexShardGateway
The last / on going recovery status.

Specified by:
recoveryStatus in interface IndexShardGateway

toString

public String toString()
Overrides:
toString in class Object

requiresSnapshot

public boolean requiresSnapshot()
Description copied from interface: IndexShardGateway
Returns true if snapshot is even required on this gateway (i.e. mainly handles recovery).

Specified by:
requiresSnapshot in interface IndexShardGateway

requiresSnapshotScheduling

public boolean requiresSnapshotScheduling()
Description copied from interface: IndexShardGateway
Returns true if this gateway requires scheduling management for snapshot operations.

Specified by:
requiresSnapshotScheduling in interface IndexShardGateway

obtainSnapshotLock

public IndexShardGateway.SnapshotLock obtainSnapshotLock()
                                                  throws Exception
Specified by:
obtainSnapshotLock in interface IndexShardGateway
Throws:
Exception

close

public void close(boolean delete)
           throws ElasticSearchException
Description copied from interface: CloseableIndexComponent
Closes the index component. A boolean indicating if its part of an actual index deletion or not is passed.

Specified by:
close in interface CloseableIndexComponent
Parameters:
delete - true if the index is being deleted.
Throws:
ElasticSearchException

lastSnapshotStatus

public SnapshotStatus lastSnapshotStatus()
Description copied from interface: IndexShardGateway
The last snapshot status performed. Can be null.

Specified by:
lastSnapshotStatus in interface IndexShardGateway

currentSnapshotStatus

public SnapshotStatus currentSnapshotStatus()
Description copied from interface: IndexShardGateway
The current snapshot status being performed. Can be null indicating that no snapshot is being executed currently.

Specified by:
currentSnapshotStatus in interface IndexShardGateway

snapshot

public SnapshotStatus snapshot(IndexShardGateway.Snapshot snapshot)
                        throws IndexShardGatewaySnapshotFailedException
Description copied from interface: IndexShardGateway
Snapshots the given shard into the gateway.

Specified by:
snapshot in interface IndexShardGateway
Throws:
IndexShardGatewaySnapshotFailedException

recover

public void recover(boolean indexShouldExists,
                    RecoveryStatus recoveryStatus)
             throws IndexShardGatewayRecoveryException
Description copied from interface: IndexShardGateway
Recovers the state of the shard from the gateway.

Specified by:
recover in interface IndexShardGateway
Throws:
IndexShardGatewayRecoveryException


Copyright © 2009-2012. All Rights Reserved.