org.elasticsearch.index.gateway
Class IndexShardGatewayService

java.lang.Object
  extended by org.elasticsearch.index.shard.AbstractIndexShardComponent
      extended by org.elasticsearch.index.gateway.IndexShardGatewayService
All Implemented Interfaces:
IndexShardComponent, CloseableIndexComponent

public class IndexShardGatewayService
extends AbstractIndexShardComponent
implements CloseableIndexComponent


Field Summary
 
Fields inherited from class org.elasticsearch.index.shard.AbstractIndexShardComponent
componentSettings, indexSettings, logger, shardId
 
Constructor Summary
IndexShardGatewayService(ShardId shardId, Settings indexSettings, ThreadPool threadPool, IndexShard indexShard, IndexShardGateway shardGateway, Store store)
           
 
Method Summary
 void close(boolean delete)
          Closes the index component.
 void recover()
          Recovers the state of the shard from the gateway.
 void routingStateChanged()
          Should be called when the shard routing state has changed (note, after the state has been set on the shard).
 void snapshot()
          Snapshots the given shard into the gateway.
 
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, toString, wait, wait, wait
 

Constructor Detail

IndexShardGatewayService

@Inject
public IndexShardGatewayService(ShardId shardId,
                                       @IndexSettings
                                       Settings indexSettings,
                                       ThreadPool threadPool,
                                       IndexShard indexShard,
                                       IndexShardGateway shardGateway,
                                       Store store)
Method Detail

routingStateChanged

public void routingStateChanged()
Should be called when the shard routing state has changed (note, after the state has been set on the shard).


recover

public void recover()
             throws IndexShardGatewayRecoveryException,
                    IgnoreGatewayRecoveryException
Recovers the state of the shard from the gateway.

Throws:
IndexShardGatewayRecoveryException
IgnoreGatewayRecoveryException

snapshot

public void snapshot()
              throws IndexShardGatewaySnapshotFailedException
Snapshots the given shard into the gateway.

Throws:
IndexShardGatewaySnapshotFailedException

close

public void close(boolean delete)
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.