K
- the key type that this segment size is compatible withpublic final class SegmentSize<K extends BlueKey>
extends java.lang.Object
BlueCollection
.
HashMap
. Values are stored in a segment based on the value's grouping number.
If only one value is in a segment then looking up that value by key is constant time. If there are a lot of values in the segment
then looking up those values will be slower. However, it is important to limit the number of segments so that you don't end up
using too many i-nodes (files and directories). Large segment sizes will result in more values being stored in each segment.
This will result in slower lookup times, slower write speeds, faster retrieval of large amounts of data, and less usage of
i-nodes.
TimeKey
and TimeFrameKey
- Segment sizes are an amount of time for these key types. If you
picked TIME_1_HOUR as your segment size then all values that fall within a certain hour will be grouped in the same
segment and a new segment will be created for every hour that contains values. Based on the number of values you
store per hour you can figure out how fast you will be using i-nodes and how many values will be stored per segment.
IntegerKey
and LongKey
- Segment sizes represent how many ids would be stored in each segment. If
you use an auto incremented long as the id of a LONG_256 segment sized collection then you'd end up with 256 values in
each segment. Lookup time would still be pretty fast and you would only be using the necessary i-nodes. If you want to
store a very large number of values you could consider larger segment sizes.
UUIDKey
and StringKey
- Segment sizes represent how many hash values would be stored in each
segment for these key types. If the hashCode method of these was perfect then you'd create a new segment every time
you insert a value until the max number of segments and i-nodes is reached. From that point segments would fill up
but no additional i-nodes would be used. It is important to pick a segment size that is not going to overuse i-nodes
but that still gives you the lookup speed that you need as your collection grows. In the future we might support a
better mechanism for increasing segment size as the collection grows instead of committing to one size.
Modifier and Type | Field and Description |
---|---|
static SegmentSize<IntegerKey> |
INT_128
128 values per segment
|
static SegmentSize<IntegerKey> |
INT_1K
1K values per segment
|
static SegmentSize<IntegerKey> |
INT_256
256 values per segment
|
static SegmentSize<IntegerKey> |
INT_512
512 values per segment
|
static SegmentSize<LongKey> |
LONG_128
128 values per segment
|
static SegmentSize<LongKey> |
LONG_1K
1K values per segment
|
static SegmentSize<LongKey> |
LONG_256
256 values per segment
|
static SegmentSize<LongKey> |
LONG_512
512 values per segment
|
static SegmentSize<StringKey> |
STRING_16M
16M hash codes per segment.
|
static SegmentSize<StringKey> |
STRING_1M
1M hash codes per segment.
|
static SegmentSize<StringKey> |
STRING_256K
256K hash codes per segment.
|
static SegmentSize<StringKey> |
STRING_2M
2M hash codes per segment.
|
static SegmentSize<StringKey> |
STRING_32M
32M hash codes per segment.
|
static SegmentSize<StringKey> |
STRING_4M
4M hash codes per segment.
|
static SegmentSize<StringKey> |
STRING_512K
512K hash codes per segment.
|
static SegmentSize<StringKey> |
STRING_8M
8M hash codes per segment.
|
static SegmentSize<TimeKey> |
TIME_1_DAY
All values in each day time interval will be grouped together in a segment
|
static SegmentSize<TimeKey> |
TIME_1_HOUR
All values in each hour time interval will be grouped together in a segment
|
static SegmentSize<TimeKey> |
TIME_1_MONTH
All values in each 30 day time interval will be grouped together in a segment
|
static SegmentSize<TimeKey> |
TIME_12_HOURS
All values in each 12 hour time interval will be grouped together in a segment
|
static SegmentSize<TimeKey> |
TIME_15_DAYS
All values in each 15 day time interval will be grouped together in a segment
|
static SegmentSize<TimeKey> |
TIME_2_HOURS
All values in each 2 hour time interval will be grouped together in a segment
|
static SegmentSize<TimeKey> |
TIME_3_MONTHS
All values in each 90 day time interval will be grouped together in a segment
|
static SegmentSize<TimeKey> |
TIME_5_DAYS
All values in each 5 day time interval will be grouped together in a segment
|
static SegmentSize<TimeKey> |
TIME_6_HOURS
All values in each 6 hour time interval will be grouped together in a segment
|
static SegmentSize<TimeKey> |
TIME_6_MONTHS
All values in each 180 day time interval will be grouped together in a segment
|
static SegmentSize<TimeFrameKey> |
TIME_FRAME_1_DAY
All values in each day time interval will be grouped together in a segment
|
static SegmentSize<TimeFrameKey> |
TIME_FRAME_1_HOUR
All values in each hour time interval will be grouped together in a segment
|
static SegmentSize<TimeFrameKey> |
TIME_FRAME_1_MONTH
All values in each 30 day time interval will be grouped together in a segment
|
static SegmentSize<TimeFrameKey> |
TIME_FRAME_12_HOURS
All values in each 12 hour time interval will be grouped together in a segment
|
static SegmentSize<TimeFrameKey> |
TIME_FRAME_15_DAYS
All values in each 15 day time interval will be grouped together in a segment
|
static SegmentSize<TimeFrameKey> |
TIME_FRAME_2_HOURS
All values in each 2 hour time interval will be grouped together in a segment
|
static SegmentSize<TimeFrameKey> |
TIME_FRAME_3_MONTHS
All values in each 90 day time interval will be grouped together in a segment
|
static SegmentSize<TimeFrameKey> |
TIME_FRAME_5_DAYS
All values in each 5 day time interval will be grouped together in a segment
|
static SegmentSize<TimeFrameKey> |
TIME_FRAME_6_HOURS
All values in each 6 hour time interval will be grouped together in a segment
|
static SegmentSize<TimeFrameKey> |
TIME_FRAME_6_MONTHS
All values in each 180 day time interval will be grouped together in a segment
|
static SegmentSize<UUIDKey> |
UUID_16M
16M hash codes per segment.
|
static SegmentSize<UUIDKey> |
UUID_1M
1M hash codes per segment.
|
static SegmentSize<UUIDKey> |
UUID_256K
256K hash codes per segment.
|
static SegmentSize<UUIDKey> |
UUID_2M
2M hash codes per segment.
|
static SegmentSize<UUIDKey> |
UUID_32M
32M hash codes per segment.
|
static SegmentSize<UUIDKey> |
UUID_4M
4M hash codes per segment.
|
static SegmentSize<UUIDKey> |
UUID_512K
512K hash codes per segment.
|
static SegmentSize<UUIDKey> |
UUID_8M
8M hash codes per segment.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
public static final SegmentSize<TimeKey> TIME_1_HOUR
public static final SegmentSize<TimeKey> TIME_2_HOURS
public static final SegmentSize<TimeKey> TIME_6_HOURS
public static final SegmentSize<TimeKey> TIME_12_HOURS
public static final SegmentSize<TimeKey> TIME_1_DAY
public static final SegmentSize<TimeKey> TIME_5_DAYS
public static final SegmentSize<TimeKey> TIME_15_DAYS
public static final SegmentSize<TimeKey> TIME_1_MONTH
public static final SegmentSize<TimeKey> TIME_3_MONTHS
public static final SegmentSize<TimeKey> TIME_6_MONTHS
public static final SegmentSize<TimeFrameKey> TIME_FRAME_1_HOUR
public static final SegmentSize<TimeFrameKey> TIME_FRAME_2_HOURS
public static final SegmentSize<TimeFrameKey> TIME_FRAME_6_HOURS
public static final SegmentSize<TimeFrameKey> TIME_FRAME_12_HOURS
public static final SegmentSize<TimeFrameKey> TIME_FRAME_1_DAY
public static final SegmentSize<TimeFrameKey> TIME_FRAME_5_DAYS
public static final SegmentSize<TimeFrameKey> TIME_FRAME_15_DAYS
public static final SegmentSize<TimeFrameKey> TIME_FRAME_1_MONTH
public static final SegmentSize<TimeFrameKey> TIME_FRAME_3_MONTHS
public static final SegmentSize<TimeFrameKey> TIME_FRAME_6_MONTHS
public static final SegmentSize<IntegerKey> INT_128
public static final SegmentSize<IntegerKey> INT_256
public static final SegmentSize<IntegerKey> INT_512
public static final SegmentSize<IntegerKey> INT_1K
public static final SegmentSize<LongKey> LONG_128
public static final SegmentSize<LongKey> LONG_256
public static final SegmentSize<LongKey> LONG_512
public static final SegmentSize<LongKey> LONG_1K
public static final SegmentSize<UUIDKey> UUID_256K
public static final SegmentSize<UUIDKey> UUID_512K
public static final SegmentSize<UUIDKey> UUID_1M
public static final SegmentSize<UUIDKey> UUID_2M
public static final SegmentSize<UUIDKey> UUID_4M
public static final SegmentSize<UUIDKey> UUID_8M
public static final SegmentSize<UUIDKey> UUID_16M
public static final SegmentSize<UUIDKey> UUID_32M
public static final SegmentSize<StringKey> STRING_256K
public static final SegmentSize<StringKey> STRING_512K
public static final SegmentSize<StringKey> STRING_1M
public static final SegmentSize<StringKey> STRING_2M
public static final SegmentSize<StringKey> STRING_4M
public static final SegmentSize<StringKey> STRING_8M
public static final SegmentSize<StringKey> STRING_16M
public static final SegmentSize<StringKey> STRING_32M