0

Why are there no WEEKLY RollCycles defined? Is there some reason they should not be used?

Andrew
  • 1,031
  • 10
  • 24

2 Answers2

0

When chronicle queue appends a message to a queue it gives each message a unique index, this index is made up from a 64bit number, the high bits of this 64 bit number are used to define the cycle ( in the case of daily rolling, which day ) and the low bits are used to define the message sequence within that day. It is possible to create a weekly roll cycle, however, when using a weekly roll cycle the maximum number of messages that you could write in any week would approximately be about the same as the number of messages that you can write in a day with daily rolling. [ this is, of course, depending on how many of the higher bits you devoted to the cycle number ]. I believe if you wanted to you could create your own custom roll cycle which did weekly rolling, but at the time the RollCycle was created daily rolling was deemed sufficient.

Rob Austin
  • 620
  • 3
  • 5
  • If I want just a single queue file per week can I dedicate 1 (or zero?) bits to the cycle and write 2^63 entries per week in the queue? Or if I want 52 weeks of weekly queue files would I need 6 bits for cycles leaving max 2^58 entries per weekly file? – Andrew Aug 13 '19 at 21:05
0

I suggest you don't allocate just 1 bit to the cycle if you are doing weekly rolling because after a couple of weeks it will stop working. But yes if you did this you could write 2^63 messages per week. Your second option of "6 bits and up to 2^58 entries per week", I feel makes more sense. Having said this you are still going to have to work out what you will do at the end of the year when you have used all the cycles.

Rob Austin
  • 620
  • 3
  • 5
  • What's the benefit of rolling the files at all? Is it so the file system does not have to deal with ungainly large files? – Andrew Aug 23 '19 at 23:10