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:
CloseableIndexComponent, IndexShardComponent

public class IndexShardGatewayService
extends AbstractIndexShardComponent
implements CloseableIndexComponent


Nested Class Summary
static interface IndexShardGatewayService.RecoveryListener
           
 
Field Summary
 
Fields inherited from class org.elasticsearch.index.shard.AbstractIndexShardComponent
componentSettings, indexSettings, logger, shardId
 
Constructor Summary
IndexShardGatewayService(ShardId shardId, Settings indexSettings, IndexSettingsService indexSettingsService, ThreadPool threadPool, IndexShard indexShard, IndexShardGateway shardGateway)
           
 
Method Summary
 void close(boolean delete)
          Closes the index component.
 void recover(boolean indexShouldExists, IndexShardGatewayService.RecoveryListener listener)
          Recovers the state of the shard from the gateway.
 RecoveryStatus recoveryStatus()
           
 void routingStateChanged()
          Should be called when the shard routing state has changed (note, after the state has been set on the shard).
 void snapshot(String reason)
          Snapshots the given shard into the gateway.
 void snapshotOnClose()
           
 SnapshotStatus snapshotStatus()
           
 
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,
                                       IndexSettingsService indexSettingsService,
                                       ThreadPool threadPool,
                                       IndexShard indexShard,
                                       IndexShardGateway shardGateway)
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).


recoveryStatus

public RecoveryStatus recoveryStatus()

snapshotStatus

public SnapshotStatus snapshotStatus()

recover

public void recover(boolean indexShouldExists,
                    IndexShardGatewayService.RecoveryListener listener)
             throws IndexShardGatewayRecoveryException,
                    IgnoreGatewayRecoveryException
Recovers the state of the shard from the gateway.

Throws:
IndexShardGatewayRecoveryException
IgnoreGatewayRecoveryException

snapshot

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

Throws:
IndexShardGatewaySnapshotFailedException

snapshotOnClose

public void snapshotOnClose()

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.


Copyright © 2009-2012. All Rights Reserved.