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.RecoveryStatus, IndexShardGateway.Snapshot, IndexShardGateway.SnapshotStatus
 
Field Summary
protected  BlobStore blobStore
           
protected  java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> cachedMd5
           
protected  ByteSizeValue chunkSize
           
protected  ImmutableBlobContainer indexContainer
           
protected  InternalIndexShard indexShard
           
protected  RecoveryThrottler recoveryThrottler
           
protected  BlobPath shardPath
           
protected  Store store
           
protected  ThreadPool threadPool
           
protected  AppendableBlobContainer translogContainer
           
 
Fields inherited from class org.elasticsearch.index.shard.AbstractIndexShardComponent
componentSettings, indexSettings, logger, shardId
 
Constructor Summary
protected BlobStoreIndexShardGateway(ShardId shardId, Settings indexSettings, ThreadPool threadPool, IndexGateway indexGateway, IndexShard indexShard, Store store, RecoveryThrottler recoveryThrottler)
           
 
Method Summary
static org.elasticsearch.common.collect.ImmutableMap<java.lang.String,BlobMetaData> buildVirtualBlobs(ImmutableBlobContainer container, org.elasticsearch.common.collect.ImmutableMap<java.lang.String,BlobMetaData> blobs, java.util.Map<java.lang.String,java.lang.String> cachedMd5)
           
 void close(boolean delete)
          Closes the index component.
 IndexShardGateway.RecoveryStatus recover()
          Recovers the state of the shard from the gateway.
 boolean requiresSnapshotScheduling()
          Returns true if this gateway requires scheduling management for snapshot operations.
 IndexShardGateway.SnapshotStatus snapshot(IndexShardGateway.Snapshot snapshot)
          Snapshots the given shard into the gateway.
 java.lang.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

recoveryThrottler

protected final RecoveryThrottler recoveryThrottler

chunkSize

protected final ByteSizeValue chunkSize

blobStore

protected final BlobStore blobStore

shardPath

protected final BlobPath shardPath

indexContainer

protected final ImmutableBlobContainer indexContainer

translogContainer

protected final AppendableBlobContainer translogContainer

cachedMd5

protected final java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> cachedMd5
Constructor Detail

BlobStoreIndexShardGateway

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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

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

snapshot

public IndexShardGateway.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 IndexShardGateway.RecoveryStatus recover()
                                         throws IndexShardGatewayRecoveryException
Description copied from interface: IndexShardGateway
Recovers the state of the shard from the gateway.

Specified by:
recover in interface IndexShardGateway
Throws:
IndexShardGatewayRecoveryException

buildVirtualBlobs

public static org.elasticsearch.common.collect.ImmutableMap<java.lang.String,BlobMetaData> buildVirtualBlobs(ImmutableBlobContainer container,
                                                                                                             org.elasticsearch.common.collect.ImmutableMap<java.lang.String,BlobMetaData> blobs,
                                                                                                             @Nullable
                                                                                                             java.util.Map<java.lang.String,java.lang.String> cachedMd5)