Jump to: navigation, search

SMILA/Documentation/ObjectStore/Bundle org.eclipse.smila.objectstore.filesystem

< SMILA‎ | Documentation
Revision as of 04:52, 16 January 2013 by Dhaenssgen.brox.de (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

org.eclipse.smila.objectstore.filesystem

Description

This package provides a file system based implementation of the ObjectStoreService (org.eclipse.smila.objectstore package).

The objects are temporarily written to a shadow store, so they will not be visible until they have been committed (an exception to this is the append operation, that will append to the live object).

The storage is divided into two parts: Stores and Objects.

The following rules apply to this file system based implementation:

  • Store
    • A store is represented by a plain directory in the base store path.
    • A store can include plain files or a hierarchy of files that can be listed with getStoreObjectInfos(String, String).
    • A valid store name may contain up to 256 characters and no other characters than a-z, A-Z, 0-9, and '-' (hyphen). Expressed as a regular expression this is equal to: "[a-zA-Z0-9-]{0,256}").
  • Object
    • An object represents a file in a store.
    • An object will be invisible until the corresponding SimpleStoreOutputStream is closed or an invocation of writeObject(String, String) method succeeded
      • Exception: A invocation of the appendToObject(String, String, byte[]) method will append directly to the visible object.

Hierarchies within the store can be created by using object ids that contain a path, e.g. creating an object path/to/the/object in a store with the name storename will result in the following file system hierarchy (starting with the store-base file system): storename/path/to/the/object

JavaDoc

JavaDoc can be found at org.eclipse.smila.objectstore.filesystem.

For the interfaces implemented and the exceptions used, see org.eclipse.smila.objectstore.

SimpleObjectStoreService

API

SimpleObjectStoreService implements the org.eclipse.smila.objectstore.ObjectStoreService API of the ObjectStoreService.

This implementation does not support the method void finishObject(final String storeName, final String objectId), that is meant to prevent further append calls for the object. Any call to this method is ignored.

You can find information of the ObjectStoreService in bundle org.eclipse.smila.objectstore.

Configuration

The only configuration that can be provided (but is not necessary) is a configuration property file located at configuration/org.eclipse.smila.objectstore.filesystem/objectstoreservice.properties.

In this file you can specify the following settings:

  • root.path
    • Defines the path to the root directory of the object store. In this directory, the store root folder objectstore and shadow directory .objectstore will be created to hold the stores and the visible (resp. temporary) objects of the stores.
    • Default: If the property is not set, a default directory for the bundle is created in the SMILA workspace.
  • file.locking
    • This option is experimental!
    • If set to true, access to the file will be accompanied by a files system lock to prohibit parallel access by other programs. Whether or not the operating system or the file system used will honor this lock cannot be guaranteed, so it is not recommended.
    • Default: false.