code: public static byte[] buildRollupQualifier(final long timestamp,
                                              final int basetime,
                                              final short flags,
                                              final int aggregator_id,
                                              final RollupInterval interval) {
      final byte[] qualifier = new byte[3];
  
      final int time_seconds = (int) ((timestamp & Const.SECOND_MASK) != 0 ?
              timestamp / 1000 : timestamp);
  
      // we shouldn't have a divide by 0 here as the rollup config validator makes
      // sure the interval is positive
      int offset = (time_seconds - basetime) / interval.getIntervalSeconds();
      if (offset >= interval.getIntervals()) {
        throw new IllegalArgumentException("Offset of " + offset + " was greater "
            + "than the configured intervals " + interval.getIntervals());
      }
     
      // shift the offset over 4 bits then apply the flag
      offset = offset << Const.FLAG_BITS;
      offset = offset | flags;
      qualifier[0] = (byte) aggregator_id;
      System.arraycopy(Bytes.fromShort((short) offset), 0, qualifier, 1, 2);
  
      return qualifier;
    }
docs: Builds a rollup column qualifier, prepending the appender as a string
  then the offeset on 2 bytes for the interval after a colon with the last
  four bits reserved for the length and type flags. I.e.
  {@code <agg>:<offset(flag)>
  n  :  2 bytes }
  @param timestamp The data point timestamp
  @param basetime The base timestamp to calculate the offset from
  @param flags The length and type (float || int) flags for the value
  @param aggregator_id The numeric ID of the aggregator the value maps to.
  @param interval The RollupInterval object with data about the interval
  @return An n byte array to use as the qualifier
  @throws IllegalArgumentException if the aggregator is null or empty or the
  timestamp is too far from the base time to fit within the interval.