1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/chaotic1988-Chronicle-Queue

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
timezone_rollover.adoc 1.8 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Peter Lawrwy Отправлено 10.11.2020 18:02 7b8e1d3

Timezone Queue Rollover (Enterprise Edition Feature)

In Chronicle Queue, the time at which queues are rolled over is based on the UTC time; Chronicle Queue uses System.currentTimeMillis().

The Timezone Rollover Enterprise feature extends Chronicle Queue’s ability to specify the time and periodicity of queue rollovers, to take account of the user’s location timezone, rather than UTC.

Note
This feature is only relevant to daily rollovers where RollCycle is one of: - SMALL_DAILY - DAILY - LARGE_DAILY - XLARGE_DAILY - HUGE_DAILY

Syntax

public SingleChronicleQueueBuilder<E> rollTime(@NotNull final LocalTime rollTime, final ZoneId zoneId) {
        this.cycleCalculator = new TimeZoneAwareCycleCalculator(zoneId);
        this.epoch = TimeUnit.SECONDS.toMillis(rollTime.toSecondOfDay());

        return this;
}
Note
rollTime() allows the rollover time of the cycle file to be controlled in both Chronicle Queue open-source and Chronicle QueueEnterprise Edition.
If this is used with in the open-source version, any zoneId other than UTC will be converted to UTC, and a warning message logged.

Examples

The following code extract is an instruction to use Europe/London as time zone, and rolls over queues at midnight regardless of offset to UTC.

.rollTime(LocalTime.of(0, 0), ZoneId.of("Europe/London"))

The following code extract is an instruction to use America/New_York as time zone, and rolls over queues at midnight regardless of offset to UTC.

.rollTime(LocalTime.of(17, 0), ZoneId.of("America/New_York"))

System time provider

To use this feature you must use the Chronicle distributed time provider, net.openhft.chronicle.core.time.SystemTimeProvider.


Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/chaotic1988-Chronicle-Queue.git
git@api.gitlife.ru:oschina-mirror/chaotic1988-Chronicle-Queue.git
oschina-mirror
chaotic1988-Chronicle-Queue
chaotic1988-Chronicle-Queue
master