IBP_ALLOCATE

Allocates storage on the host depot using the specified resource, rid. The allocated area has a maximum possible size of size bytes, and storage attributes, defined by reliability and type.

Protocol

Client Sends version IBP_ALLOCATE rid reliability type duration size timeout \n
Server Responds status readCap writeCap manageCap \n

Parameters

reliability IBP_SOFT | IBP_HARD

Determines how reliable the allocated storage area will be. The current version of IBP supports two levels of reliability:

  • IBP_HARD which guarantees the existence of the allocated storage area until it is removed due to lack of readers as explained above.
  • IBP_SOFT which declares the allocated area to be volatile, in the sense that the corresponding IBP server can reclaim storage allocated to this area whenever site administration and/or IBP server policy mandates such move. Stable storage is never reclaimed by IBP server as long as at least one client has read access to that storage.
type IBP_BYTEARRAY | IBP_BUFFER | IBP_FIFO | IBP_CIRQ

Determines the type of storage allocated. The current version of IBP supports four types of storage:

  • IBP_BYTEARRAY which treats the allocated area as a flat bytearray. This will have the following implications on future accesses to that storage area:
    • Only the amount of available data will be returned if there are not enough data to satisfy the read request at the time the request is received by the IBP server.
    • Requests to write (append) to the allocated area will be denied if it leads to the total size of the storage area exceeding the maximum allowable size specified in size.
    • A maximum of one write operation can be actively writing to the storage area at any given time; other write requests received by the server are queued pending completion of the running write process.
    • No limit is imposed on the number of simultaneous read accesses to the storage area. In addition, due to the use of append-only semantics for write operations, a write operation can be simultaneously active with any number of read operations to the same storage area.
  • IBP_FIFO which causes the allocated storage area to be treated as a FIFO queue, with the following implications:
    • Read data is removed from storage area once read.
    • Read requests will be blocked if not enough un-read data is available in the storage area. In addition, no upper limit is placed on the size of data in read requests.
    • Write requests will be blocked if there is not enough space in the storage area to complete the write operation. In addition, there is no upper limit on the size of data involved in a write operation to the storage area.
    • Blocked operations will be un-blocked only when there is more data to read (blocked read operation) or available space to write (blocked write operations)
    • A maximum of one write operation and one read operation can be simultaneously active at any given time. Further requests are blocked pending completion of running operations.
  • IBP_CIRQ which causes the allocated storage area to be treated as a Circular Queue, with the following implications:
    • Read data is removed from storage area once read.
    • Read requests will be blocked if not enough un-read data is available in the storage area. In addition, no upper limit is placed on the size of data in read requests.
    • Write requests will NOT be blocked if there is not enough space in the storage area to complete the write operation, but will overwrite the beginning of the queue. In addition, there is no upper limit the size of data involved in a write operation to the storage area.
    • Blocked operations will be un-blocked only when there is more data to read (blocked read operation).
    • A maximum of one write operation and one read operation can be simultaneously active at any given time. Further requests are blocked pending completion of running operations.
  • IBP_BUFFER which causes the allocated storage area to be treated as a restricted access flat storage area, with the following properties:
    • Only one process can be actively accessing the storage area for read and/or write operation at any given time. Other requests are blocked pending completion of the one that has access to the storage area at any given time.
    • All write operations start at the beginning of the storage area, overwriting any data that had been stored there previously (even if it had not been read).
    • The amount of data available to area doperation at any given time is the amount that had been stored by the last write call.
duration
Specifies the time at which the allocated storage area will be automatically purged from the pool of storage areas managed by the server. Time is specified in seconds since the epoch (as returned by UNIX’s time(2) function) - I don’t think is correct. I think the time is in seconds from the creation date. - Alan. A value of −1 indicates permanent status for the allocated storage area (it’ll be only purged when no more clients have read access to it, otherwise it will be kept alive according to the reliability property, see IBP_MANAGE call for detail).
size
Size of the allocation in bytes
L-Store Documentation