public class SuidService extends Object
This service looks up the datasource named SuidRWDS and
fetches suid blocks from it.
NOTE: Currently, only MySql is supported.
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_REQUEST_BLOCKS |
| Constructor and Description |
|---|
SuidService() |
| Modifier and Type | Method and Description |
|---|---|
void |
init(int shard)
Initializes this SuidService based on the given
shard. |
Suid[] |
nextBlocks(int count)
Gets the next
count ID blocks. |
public static final int MAX_REQUEST_BLOCKS
public void init(int shard)
shard.
This method only has any effect if the `suid` table is still empty.
If there are no records in the suid table yet, this method will
insert the first record with the given shard. Any subsequent calls
to this method will detect that there is a record already and do nothing.
shard - The shard ID when used in clusters. Must be in the range 0 .. 3.public Suid[] nextBlocks(int count)
count ID blocks.
Parameter count must be in the range 1 .. 8. If count is less than
1, it is set to 1. If count is greater than 8, it is
set to 8.
count - The number of blocks to get. Is forced to be in range 1 .. 8.Suids.Copyright © 2015. All rights reserved.