Cerebrum

Here you can find more technical information about Cerebrum itself or its components. This page is also a draft, a place to take notes about ideas and questions that arise. You can find some questions that were not answered yet.

Monitoring is also part of Cerebrum. However, everything related to the Monitoring component can be seen in its own page.

Metadata

The schema of the metadata is the following:

  • -record(file, {id, hash, size, [{node, state}]}).

Where:

  • id = file id
  • hash = checksum of the file
  • size = size of the file (bytes)
  • node = storage node
  • state = {online, offline, todelete}

Common queries:

  • Get the record given an ID
  • Get the records that are stored on a given node.

Public API

GET

The client API should call this method to know where a file is stored.

Format:

http://<cerebrum>/cGET?id=<fileid>

Parameters and return value:

  • Parameters: {id}
  • Return: {id, hash, size, [node1, node2, node3]}

Example:

http://cerebrum/cGET?id=123456

PUT

The client API should call this method to know where to put a file.

Format:

http://<cerebrum>/cPUT?hash=<hash>&size=<size>

Parameters and return value:

  • Parameters: {hash, size}
  • Return: {id, [node1, node2, node3]}

Example:

http://cerebrum/cPUT?hash=749b772032659c62b866a7ea7253a87d&size=2345345

DEL

The client should call this method in order to delete a file. If one of the storage nodes is offline, the file will be marked as "todelete" in the state field of the record.

Format:

http://<cerebrum>/cDEL?id=<fileid>

Parameters and return value:

  • Parameters: {id}
  • Return: {ok}

Example:

http://cerebrum/cDEL?id=123456

XML Schema For cPUT and cGET

Attached below you can find the xml schemas for the responses to cPUT and cGET.

Attachments