Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SMILA/Documentation/ObjectStore/Bundle org.eclipse.smila.objectstore"

(No difference)

Revision as of 05:36, 29 June 2011

Bundle org.eclipse.smila.objectstore

since SMILA 0.9.0

This page only gives a rough overview of the components. Please refer to the JavaDoc for specific information: org.eclipse.smila.objectstore JavaDoc

org.eclipse.smila.objectstore.ObjectStoreService

JavaDoc

The JavaDoc for the ObjectStoreService API can be found in org.eclipse.smila.objectstore.ObjectStoreService.

Description

An ObjectStoreService is mainly used in SMILA to store binary data during bulk processing. Data objects in this service are for example big bulks of records that are to be processed in a single step by some worker.

The interface of ObjectStore services are defined in the interface org.eclipse.smila.objectstore.ObjectStoreService.

org.eclipse.smila.objectstore.StoreObject

JavaDoc

The JavaDoc for the StoreObject interface can be found in org.eclipse.smila.objectstore.StoreObject.

Description

A StoreObject contains information about an object in a store.

Common information are:

  • ID (String)
    • the ID of the object. With this ID the object can be adressed within a store.
  • size (long)
    • the size (in bytes) of the object
  • timestamp (Date)
    • the timestamp of the file, in the filesystem based objectstore this is the time of the last modification of this object.

Any ObjectStore implementation might add additional information to the above.

org.eclipse.smila.objectstore.StoreOutputStream

JavaDoc

The JavaDoc for the StoreOutputStream interface can be found in org.eclipse.smila.objectstore.StoreOutputStream.

Description

The StoreOutputStream interface defines an extension of the java.io.OutputStream that allows a stream to be aborted (if it has not been closed yet). I.e. the content of the stream will not be visible but will be discarded.

Thus the content of the StoreOutputStream will only be visible after close() is called sucessfully.


Exceptions defined in org.eclipse.smila.objectstore

JavaDoc

The JavaDoc for the Exceptions interface can be found in org.eclipse.smila.objectstore.

Description

The exceptions of the org.eclipse.smila.objectstore are:

  • ObjectStoreException
    • the base class of the object store exceptions. There are subclasses to give more detailed information:
  • BadRequestException
    • caused by invalid arguments or other conditions that make it impossible to perform an operation
  • NoSuchObjectException
    • the requested object does not exist
  • InvalidStoreNameException
    • the store name does not apply to the service implementation's restrictions for store names.
  • NoSuchStoreException
    • the requested store does not exist
  • StoreExistsException
    • the store to be created already exists
  • ServiceUnavailableException
    • due to some temporary conditions the request cannot be fulfilles by the service. The client can retry a short period of time later.

The hierarchie of the exception is as follows:

  • ObjectStoreException
    • BadRequestException
      • InvalidStoreNameException
      • NoSuchObjectException
      • NoSuchStoreException
      • StoreExistsException
    • ServiceUnavailableException

org.eclipse.smila.objectstore handlers

JavaDoc

The JavaDoc for the org.eclipse.smila.objectstore bundle's handlers can be found in org.eclipse.smila.objectstore.httphandler.

Description

The following handlers exist:

ObjectStoreServiceHandler

This handler lists the stores handled by the ObjectStoreService.

  • URL:
    http://<hostname>:8080/smila/store/
    .
  • Allowed methods: GET, no further parameters or request body
  • Response Status Codes:
    • 200 OK: Successful execution
    • 500 INTERNAL SERVER ERROR: An internal error occurred
    • 503 SERVICE UNAVAILABLE: The service is currently unable to perform the requested operation, please retry later.

Example:

GET http://<hostname>:8080/smila/store/
200 OK
{
  "stores" : [ {
    "store" : "store1",
    "url" : "http://localhost:8080/smila/store/store1/"
  }, {
    "store" : "store2",
    "url" : "http://localhost:8080/smila/store/store2/"
  } ]
}

StoreAdminHandler

This handler allows the stores handled by the ObjectStoreService to be managed or queried.

Operations:

  • GET: returns the store information, without the optional parameter
    returnObjects
    set to
    false
    also information on the contained objects will be returned
  • PUT: creates a new store, optionally parameters can be sent with the PUT command as a JSON body.
  • DELETE: deletes a store (if the store does not exist, it will be ignored and 200 OK will be returned)
  • URL:
    http://<hostname>:8080/smila/store/<store-name>
    .
  • Allowed methods: GET, with an optional parameter
    returnObjects
    , PUT, DELETE
  • Response Status Codes:
    • 200 OK: Successful execution (GET, DELETE)
    • 201 CREATED: Successful creation of a store (PUT)
    • 400 BAD REQUEST: the user provided information that lead to an error, e.g. an invalid store name, or tried to create a store that already existed, etc.
    • 404 NOT FOUND: the requested store could not be found
    • 500 INTERNAL SERVER ERROR: An internal error occurred
    • 503 SERVICE UNAVAILABLE: The service is currently unable to perform the requested operation, please retry later.

Examples:

GET http://<hostname>:8080/smila/store/store1?returnObjects=false
200 OK
{
  "storeName" : "store1",
  "storeProperties" : {
  },
  "objectCount" : 1,
  "size" : 25
}
GET http://<hostname>:8080/smila/store/store1
200 OK
{
  "storeName" : "store1",
  "storeProperties" : {
  },
  "objectCount" : 1,
  "size" : 25,
  "objects" : [ {
    "id" : "sample-object",
    "size" : 25,
    "timestamp" : "2011-06-20T17:12:35.417+0200"
  } ]
}

StoreObjectHandler

This handler allows to PUT, GET or DELETE objects to or from a store.

Operations:

  • GET: retrieves an object from a store.
  • PUT: puts a new object (or updates an existing one) in a store. The content of the object is sent with the PUT command as a JSON body.
  • DELETE: deletes an object from a store (if the object does not exist, it will be ignored and 200 OK will be returned)
  • URL:
    http://<hostname>:8080/smila/store/<store-name>
    .
  • Allowed methods: GET, PUT, DELETE
  • Response Status Codes:
    • 200 OK: Successful execution
    • 400 BAD REQUEST: the user provided information that lead to an error, e.g. an invalid store or object name etc.
    • 404 NOT FOUND: the requested object (or the store) could not be found
    • 500 INTERNAL SERVER ERROR: An internal error occurred
    • 503 SERVICE UNAVAILABLE: The service is currently unable to perform the requested operation, please retry later.

Examples:

PUT http://<hostname>:8080/smila/store/store2/object1
{
  "id": "object1",
  "content": "my content."
}
200 OK
GET http://<hostname>:8080/smila/store/store2/object1
200 OK
{
  "id": "object1",
  "content": "my content."
}


Implementations

A file system based implementation can be found in package org.eclipse.smila.objectstore.filesystem.

Back to the top