View source: R/motusReserveKeys.R
motusReserveKeys | R Documentation |
This function returns the first key value in a block of N consecutive key values for the specified table. These key values are atomically reserved, and guaranteed not to collide with key values for any other receiver, provided every process updating the database uses this function. This permits multiple processes to be pushing data to motus (via populating the transfer tables) at the same time.
motusReserveKeys(table, n, maxKeyTable = "maxKeys")
table |
name of the table in which to reserve keys. |
n |
number of consecutive keys to reserve. If negative, the
keys are reserved in descending order, starting at the smallest
(i.e. most negative) available value. For a given table, keys
should always be reserved with |
maxKeyTable |
name of the table in which maximum key values are recorded; this must have (at least) these fields:
Default: "maxKeys" |
the first key value in the block. For positive n
, this
is the lowest key value in the block. For negative n
, this is
the highest key value. i.e. in both cases, keys are allocated in order
from closest to 0 to farther from 0.
this function uses the table maxKeys to track the maximum (magnitude of a) key in any table of interest. The implementation is cooperative: all keys in any table this function is used for must be obtained by using this function.
John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm
## return the first key in a block of 200 reserved in the batches table
motusReserveKeys("batches", 200)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.