Apps Components Interfaces All Files Source Tree | source: tos.lib.TinyDB.DBBuffer.nc |
The DBBuffer interface provides a place for queries to output their results to or fetch results from.
Buffers can be in RAM or simply drain out to the network. In the case of RAM buffers, they have a fixed (preallocated) number of rows that are recycled according to some eviction policy. Radio buffers have a single logical row that is written out via a RadioQueue interface.
Author: | Sam Madden (madden@cs.berkeley.edu) |
Commands |
Returns: | the number of rows in the specified buffer |
Returns: | the number of used rows in the buffer |
Returns: | the schema of the results in the specified buffer |
Parameters: |
bufferId - (on return) An unused buffer id |
Returns: | the next unused buffer id (in bufferId), or err_OutOfMemory, if no mo buffers are available |
Parameters: |
name - The name of the buffer bufferId - (on return) The id of buffer name |
Returns: | err_InvalidIndex if no such buffer exists |
Events |
Commands - Details |
Note that this routine may return a QueryResult that contains pointers into DBBuffer-local data structures which will be deallocated as soon as pop() is called.
Returns: | err_NoMoreResults if no results are available |
Parameters: |
bufferId - The bufferId (returned from getBufferId) to look for field f in f - The name of the desired field id - (On return) The index of the specified field in bufferId, if the return code == err_NoError |
Returns: | err_NoError on no error, err_UnsupportedBuffer or err_InvalidIndex on failure |
Parameters: |
bufferId - The bufferId (returned from getBufferId) that this is a query result for qr - The query result (return from peek or getResult) to get the field from idx - The index of the field to retrieve resultBuf - The buffer to write the value of the field into |
Returns: | err_UnsupportedPolicy if the specified policy can't be applied |
err_ResultBufferBusy If other buffer requests are currently outstanding |
Parameters: |
qid - The query id to lookup bufferId - (on return) The id of the buffer corresponding to qid isSpecial - Is this a "special" (e.g. catalog buffer), or does it correspond to the results of an actual query |
Returns: | err_InvalidIndex if no such buffer exists |