Class YearSecondTimestamp

java.lang.Object
org.epics.archiverappliance.common.YearSecondTimestamp
All Implemented Interfaces:
Comparable<YearSecondTimestamp>

public class YearSecondTimestamp extends Object implements Comparable<YearSecondTimestamp>
This is a version of a timestamp that breaks down time into a short year, a signed int secondsintoyear and a signed int nanos This is the format that is used internally in the protocol buffers storage plugin. When storing files partitioned by years, the year is dropped from the event, saving two bytes of storage per event. When reconstructing such files, we determine the year from the file name and add it back in.
Author:
mshankar
  • Constructor Details

    • YearSecondTimestamp

      public YearSecondTimestamp(short year, int secondsintoyear, int nanos)
  • Method Details

    • getYear

      public short getYear()
    • setYear

      public void setYear(short year)
    • getSecondsintoyear

      public int getSecondsintoyear()
    • setSecondsintoyear

      public void setSecondsintoyear(int secondsintoyear)
    • getNano

      public int getNano()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setNanos

      public void setNanos(int nanos)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(YearSecondTimestamp other)
      Specified by:
      compareTo in interface Comparable<YearSecondTimestamp>