org.apache.flume.tools

## Class TimestampRoundDownUtil

- java.lang.Object
- - org.apache.flume.tools.TimestampRoundDownUtil

-     @InterfaceAudience.Private
      @InterfaceStability.Evolving
      public class TimestampRoundDownUtil
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimestampRoundDownUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static long` | `roundDownTimeStampHours(long timestamp, int roundDownHours)`
    `static long` | `roundDownTimeStampHours(long timestamp, int roundDownHours, TimeZone timeZone)`
    `static long` | `roundDownTimeStampMinutes(long timestamp, int roundDownMins)`
    `static long` | `roundDownTimeStampMinutes(long timestamp, int roundDownMins, TimeZone timeZone)`
    `static long` | `roundDownTimeStampSeconds(long timestamp, int roundDownSec)`
    `static long` | `roundDownTimeStampSeconds(long timestamp, int roundDownSec, TimeZone timeZone)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TimestampRoundDownUtil

          public TimestampRoundDownUtil()

  - ### Method Detail

    - #### roundDownTimeStampSeconds

          public static long roundDownTimeStampSeconds(long timestamp,
                                       int roundDownSec)
                                                throws IllegalStateException

      Parameters:
        `timestamp` - - The time stamp to be rounded down. For parsing the `timestamp` the system default timezone will be used.
        `roundDownSec` - - The `timestamp` is rounded down to the largest multiple of `roundDownSec` seconds less than or equal to `timestamp.` Should be between 0 and 60.
      Returns:
        - Rounded down timestamp
      Throws:
        `IllegalStateException`
      See Also:
        `roundDownTimeStampSeconds(long, int, TimeZone)`

    - #### roundDownTimeStampSeconds

          public static long roundDownTimeStampSeconds(long timestamp,
                                       int roundDownSec,
                                       TimeZone timeZone)
                                                throws IllegalStateException

      Parameters:
        `timestamp` - - The time stamp to be rounded down.
        `roundDownSec` - - The `timestamp` is rounded down to the largest multiple of `roundDownSec` seconds less than or equal to `timestamp.` Should be between 0 and 60.
        `timeZone` - - The timezone to use for parsing the `timestamp`.
      Returns:
        - Rounded down timestamp
      Throws:
        `IllegalStateException`

    - #### roundDownTimeStampMinutes

          public static long roundDownTimeStampMinutes(long timestamp,
                                       int roundDownMins)
                                                throws IllegalStateException

      Parameters:
        `timestamp` - - The time stamp to be rounded down. For parsing the `timestamp` the system default timezone will be used.
        `roundDownMins` - - The `timestamp` is rounded down to the largest multiple of `roundDownMins` minutes less than or equal to `timestamp.` Should be between 0 and 60.
      Returns:
        - Rounded down timestamp
      Throws:
        `IllegalStateException`
      See Also:
        `roundDownTimeStampMinutes(long, int, TimeZone)`

    - #### roundDownTimeStampMinutes

          public static long roundDownTimeStampMinutes(long timestamp,
                                       int roundDownMins,
                                       TimeZone timeZone)
                                                throws IllegalStateException

      Parameters:
        `timestamp` - - The time stamp to be rounded down.
        `roundDownMins` - - The `timestamp` is rounded down to the largest multiple of `roundDownMins` minutes less than or equal to `timestamp.` Should be between 0 and 60.
        `timeZone` - - The timezone to use for parsing the `timestamp`. If `null` the system default will be used.
      Returns:
        - Rounded down timestamp
      Throws:
        `IllegalStateException`

    - #### roundDownTimeStampHours

          public static long roundDownTimeStampHours(long timestamp,
                                     int roundDownHours)
                                              throws IllegalStateException

      Parameters:
        `timestamp` - - The time stamp to be rounded down. For parsing the `timestamp` the system default timezone will be used.
        `roundDownHours` - - The `timestamp` is rounded down to the largest multiple of `roundDownHours` hours less than or equal to `timestamp.` Should be between 0 and 24.
      Returns:
        - Rounded down timestamp
      Throws:
        `IllegalStateException`
      See Also:
        `roundDownTimeStampHours(long, int, TimeZone)`

    - #### roundDownTimeStampHours

          public static long roundDownTimeStampHours(long timestamp,
                                     int roundDownHours,
                                     TimeZone timeZone)
                                              throws IllegalStateException

      Parameters:
        `timestamp` - - The time stamp to be rounded down.
        `roundDownHours` - - The `timestamp` is rounded down to the largest multiple of `roundDownHours` hours less than or equal to `timestamp.` Should be between 0 and 24.
        `timeZone` - - The timezone to use for parsing the `timestamp`. If `null` the system default will be used.
      Returns:
        - Rounded down timestamp
      Throws:
        `IllegalStateException`

Copyright © 2009-2016 Apache Software Foundation. All Rights Reserved.