org.elasticsearch.index.store.support
Class AbstractStore

java.lang.Object
  extended by org.elasticsearch.index.shard.AbstractIndexShardComponent
      extended by org.elasticsearch.index.store.support.AbstractStore
All Implemented Interfaces:
IndexShardComponent, Store
Direct Known Subclasses:
ByteBufferStore, FsStore, RamStore

public abstract class AbstractStore
extends AbstractIndexShardComponent
implements Store


Field Summary
protected  IndexStore indexStore
           
 
Fields inherited from class org.elasticsearch.index.shard.AbstractIndexShardComponent
componentSettings, indexSettings, logger, shardId
 
Constructor Summary
protected AbstractStore(ShardId shardId, Settings indexSettings, IndexStore indexStore)
           
 
Method Summary
 void close()
          Close the store.
 org.apache.lucene.store.IndexOutput createOutputWithNoChecksum(java.lang.String name)
           
 void deleteContent()
          Just deletes the content of the store.
 ByteSizeValue estimateSize()
          The estimated size this store is using.
 void fullDelete()
          Deletes the store completely.
 org.elasticsearch.common.collect.ImmutableMap<java.lang.String,StoreFileMetaData> list()
           
 StoreFileMetaData metaData(java.lang.String name)
           
static java.util.Map<java.lang.String,java.lang.String> readChecksums(org.apache.lucene.store.Directory dir)
           
 boolean suggestUseCompoundFile()
          Returns true by default.
protected  org.apache.lucene.store.Directory wrapDirectory(org.apache.lucene.store.Directory dir)
           
 void writeChecksum(java.lang.String name, java.lang.String checksum)
           
 void writeChecksums()
           
 
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
 
Methods inherited from interface org.elasticsearch.index.store.Store
directory
 
Methods inherited from interface org.elasticsearch.index.shard.IndexShardComponent
indexSettings, shardId
 

Field Detail

indexStore

protected final IndexStore indexStore
Constructor Detail

AbstractStore

protected AbstractStore(ShardId shardId,
                        @IndexSettings
                        Settings indexSettings,
                        IndexStore indexStore)
Method Detail

wrapDirectory

protected org.apache.lucene.store.Directory wrapDirectory(org.apache.lucene.store.Directory dir)
                                                   throws java.io.IOException
Throws:
java.io.IOException

list

public org.elasticsearch.common.collect.ImmutableMap<java.lang.String,StoreFileMetaData> list()
                                                                                       throws java.io.IOException
Specified by:
list in interface Store
Throws:
java.io.IOException

metaData

public StoreFileMetaData metaData(java.lang.String name)
                           throws java.io.IOException
Specified by:
metaData in interface Store
Throws:
java.io.IOException

deleteContent

public void deleteContent()
                   throws java.io.IOException
Description copied from interface: Store
Just deletes the content of the store.

Specified by:
deleteContent in interface Store
Throws:
java.io.IOException

fullDelete

public void fullDelete()
                throws java.io.IOException
Description copied from interface: Store
Deletes the store completely. For example, in FS ones, also deletes the parent directory.

Specified by:
fullDelete in interface Store
Throws:
java.io.IOException

estimateSize

public ByteSizeValue estimateSize()
                           throws java.io.IOException
Description copied from interface: Store
The estimated size this store is using.

Specified by:
estimateSize in interface Store
Throws:
java.io.IOException

readChecksums

public static java.util.Map<java.lang.String,java.lang.String> readChecksums(org.apache.lucene.store.Directory dir)
                                                                      throws java.io.IOException
Throws:
java.io.IOException

writeChecksums

public void writeChecksums()
                    throws java.io.IOException
Throws:
java.io.IOException

suggestUseCompoundFile

public boolean suggestUseCompoundFile()
Returns true by default.

Specified by:
suggestUseCompoundFile in interface Store

close

public void close()
           throws java.io.IOException
Description copied from interface: Store
Close the store.

Specified by:
close in interface Store
Throws:
java.io.IOException

createOutputWithNoChecksum

public org.apache.lucene.store.IndexOutput createOutputWithNoChecksum(java.lang.String name)
                                                               throws java.io.IOException
Specified by:
createOutputWithNoChecksum in interface Store
Throws:
java.io.IOException

writeChecksum

public void writeChecksum(java.lang.String name,
                          java.lang.String checksum)
                   throws java.io.IOException
Specified by:
writeChecksum in interface Store
Throws:
java.io.IOException