I am either missing something or have hit a bug and would love if someone
could help me determine which it is. I am trying to specify start/end
instances for a month's worth of hourly data in a coordinator.xml file.
Perhaps there is a better way of doing this, but what I was attempting was:

  <input-events>
    <data-in name="requests" dataset="request-logs">
      <start-instance>${coord:offset(-1, 'MONTH')}</start-instance>
      <end-instance>${coord:offset(-1, 'HOUR')}</end-instance>
    </data-in>
  </input-events>

Where nominal time for an action would be midnight of the first of the next
month. When submitting this, I get the error:

start-instance should be equal or earlier than the end-instance

That doesn't seem right. Looking at the code where the error is generated,
this doesn't look right, either:

                if (funcType == OFFSET) {
                     TimeUnit startU = TimeUnit.valueOf(startRestArg);
                     TimeUnit endU = TimeUnit.valueOf(endRestArg);
                     if (startU.getCalendarUnit() * startIndex >
endU.getCalendarUnit() * endIndex) {
                         throw new CommandException(ErrorCode.E1010,
                                 " start-instance should be equal or
earlier than the end-instance \n"
                                         + XmlUtils.prettyPrint(event));
                     }
                     ...
                }

IIUC, the ints returned by startU/endU.getCalendarUnit() have no relation
to the magnitude of the unit, so scaling them by startIndex/endIndex is
meaningless. Just after this block, the actual dates are resolved. At that
point, it could be determined easily whether one instance came before
another.

Have I missed something? Does anyone have any suggestions for another
method of grabbing a month's worth of hourly data?

Thanks in advance for whatever help you can provide,

- J.

-- 
J. McConnell
Founder, Übermensch Consulting

Reply via email to