| 39 | | |
| | 40 | Flow for putting a file: |
| | 41 | * The API contacts the Cerebrum to find out what is the primary storage node that will store the file. The information sent by the API should contain: filename, size, etc. |
| | 42 | * Cerebrum will reply with a URL for the file storage upload. Cerebrum determines the location of the file based on availability and free storage space of each storage node. Cerebrum may contact storage node to validate upload and provide a replication trail; or the primary storage node may contact Cerebrum to ask for replication nodes and filesize. For the latter scenario, each node has a queue directory and all the uploaded files will be uploaded to that directory. There's a script that will run and check each file in the queue directory. For each file, it will contact Cerebrum and invoke a special method (REP) with the filename as an argument. Cerebrum will then reply with a set of locations for replication and the file size. It's up to the primary storage node to replicate the file when the file size in the queue directory is the same as the value returned by the Cerebrum. |
| | 43 | * The API sends the file to the primary storage node. |
| | 44 | * ... |