public enum RollCycles extends Enum<RollCycles> implements RollCycle
| Enum Constant and Description |
|---|
FAST_DAILY
0xffffffff entries per day, indexing every 256th entry, leave as 4K and 256 for historical reasons.
|
FAST_HOURLY
0xffffffff entries per hour, indexing every 256th entry, leave as 4K and 256 for historical reasons.
|
FIVE_MINUTELY
0x40000000 entries per 5 minutes, indexing every 256th entry
|
FOUR_HOURLY
0xffffffff entries per four hours, indexing every 256th entry
|
HALF_HOURLY
0x40000000 entries per half hour, indexing every 256th entry
|
SIX_HOURLY
0xffffffff entries per six hours, indexing every 256th entry
|
TEN_MINUTELY
0x40000000 entries per 10 minutes, indexing every 256th entry
|
TWENTY_MINUTELY
0x40000000 entries per 20 minutes, indexing every 256th entry
|
TWO_HOURLY
0xffffffff entries per 2 hours, indexing every 256th entry
|
WEEKLY
0xffffffff entries per week, indexing every 256th entry, leave as 4K and 256 for historical reasons.
|
| Modifier and Type | Field and Description |
|---|---|
static RollCycles |
DEFAULT |
MAX_INDEX_COUNT| Modifier and Type | Method and Description |
|---|---|
static Iterable<RollCycle> |
all() |
int |
defaultEpoch() |
int |
defaultIndexCount() |
int |
defaultIndexSpacing()
Returns the space between excerpts that are explicitly indexed.
|
String |
format()
Returns the format that is to be applied when file names are calculated for a new roll cycle.
|
int |
lengthInMillis()
Returns the length in milliseconds (i.e.
|
long |
maxMessagesPerCycle() |
int |
toCycle(long index)
Returns the cycle for the given
index. |
long |
toIndex(int cycle,
long sequenceNumber)
Returns the index for the provided
cycle and sequenceNumber. |
long |
toSequenceNumber(long index)
Returns the sequence number for the provided
index. |
static RollCycles |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RollCycles[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RollCycles FIVE_MINUTELY
public static final RollCycles TEN_MINUTELY
public static final RollCycles TWENTY_MINUTELY
public static final RollCycles HALF_HOURLY
public static final RollCycles FAST_HOURLY
public static final RollCycles TWO_HOURLY
public static final RollCycles FOUR_HOURLY
public static final RollCycles SIX_HOURLY
public static final RollCycles FAST_DAILY
public static final RollCycles WEEKLY
public static final RollCycles DEFAULT
public static RollCycles[] values()
for (RollCycles c : RollCycles.values()) System.out.println(c);
public static RollCycles valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic long maxMessagesPerCycle()
maxMessagesPerCycle in interface RollCyclepublic String format()
RollCycleFor example, the following formats can be returned:
cycle1 < cycle2,
the same relation must be kept for their string representations.public int lengthInMillis()
RollCycleFor example, the following lengths can be returned:
lengthInMillis in interface RollCyclepublic int defaultEpoch()
defaultEpoch in interface RollCyclepublic int defaultIndexCount()
defaultIndexCount in interface RollCyclepublic int defaultIndexSpacing()
RollCycleA higher number means higher sequential write performance but slower random access read. The sequential read performance is not affected by this property.
For example, the following default index spacing can be returned:
defaultIndexSpacing in interface RollCyclepublic long toIndex(int cycle,
long sequenceNumber)
RollCyclecycle and sequenceNumber.
An index is made up of cycle shifted left + sequenceNumber. sequenceNumber starts at 0 for each new cycle.
DAILY cycle has cycleShift=32 and sequenceMask=0xFFFFFFFF so the top 32 bits are for cycle and bottom
32 bits are for sequence. This means you can only store 2^32 entries per day.
HUGE_DAILY has shift=48 and mask=0xFFFFFFFFFFFF thus allowing 2^48 entries per day.
public long toSequenceNumber(long index)
RollCycleindex.
An index comprises both a cycle and a sequence number but the way the index is composed of said properties may vary. This method
decomposes the provided index and extracts the sequence number.
toSequenceNumber in interface RollCycleindex - to use to extract the sequence numberindexpublic int toCycle(long index)
RollCycleindex.
An index comprises both a cycle and a sequence number but the way the index is composed of said properties may vary. This method
decomposes the provided index and extracts the cycle.
Copyright © 2024. All rights reserved.