public class SuidService extends Object
This service looks up the default datasource and fetches suid blocks from it.
There must be a table present named `suid` with columns `block`
and `shard`. If records are present in this db, this service will generate
suid blocks using the same shard. If no records are present, this service will
insert the first record using 0 as the shard id.
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_REQUEST_BLOCKS
Max. number of suid blocks that may be requested in a single request.
|
| Constructor and Description |
|---|
SuidService() |
| Modifier and Type | Method and Description |
|---|---|
Suid |
next()
Fetches a single suid.
|
Suid[] |
nextBlocks(int count)
Gets the next
count ID blocks. |
public static final int MAX_REQUEST_BLOCKS
public Suid[] nextBlocks(int count)
count ID blocks.
Parameter count must be in the range 1 .. MAX_REQUEST_BLOCKS.
If count is less than 1, it is set to 1.
If count is greater than MAX_REQUEST_BLOCKS, it is set to MAX_REQUEST_BLOCKS.
count - The number of blocks to get. Is forced to be in range 1 .. 8.Suids.MAX_REQUEST_BLOCKSpublic Suid next()
This method fetches a single Suid from a server-side pool of one block.
As such, one in Suid.IDSIZE calls to this method will result in
queries to the database to fetch the next block.
null.Suid.IDSIZECopyright © 2016. All rights reserved.