org.qi4j.entitystore.file
Interface FileEntityStoreConfiguration

All Superinterfaces:
Composite, ConfigurationComposite, Entity, EntityComposite, Identity

public interface FileEntityStoreConfiguration
extends ConfigurationComposite

Configuration for the FileEntityStoreService


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.qi4j.api.entity.Identity
Identity.IdentityMixin
 
Method Summary
 Property<String> directory()
          The directory where the File Entity Store will be keep its persisted state.
 Property<Integer> slices()
          Defines how many slice directories the store should use.
 
Methods inherited from interface org.qi4j.api.entity.Identity
identity
 
Methods inherited from interface org.qi4j.api.composite.Composite
metaInfo, type
 

Method Detail

directory

@Optional
Property<String> directory()
The directory where the File Entity Store will be keep its persisted state.

Default: System.getProperty( "user.dir" ) + "/qi4j/filestore";

The content inside this directory should not be modified directly, and doing so may corrupt the data.

Returns:
path to data file relative to current path

slices

@Optional
Property<Integer> slices()
Defines how many slice directories the store should use.

Many operating systems run into performance problems when the number of files in a directory grows. If you expect a large number of entities in the file entity store, it is wise to set the number of slices (default is 1) to an approximation of the square root of number of expected entities.

For instance, if you estimate that you will have 1 million entities in the file entity store, you should set the slices to 1000.

There is an limit of minimum 1 slice and maximum 10,000 slices, and if more slices than that is needed, you are probably pushing this entitystore beyond its capabilities.

Note that the slices() can not be changed once it has been set, as it would cause the entity store not to find the entities anymore.

Returns:
the number of slices for the file entity store.