org.apache.flume.tools
Class TimestampRoundDownUtil
java.lang.Object
org.apache.flume.tools.TimestampRoundDownUtil
public class TimestampRoundDownUtil
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TimestampRoundDownUtil
public TimestampRoundDownUtil()
roundDownTimeStampSeconds
public static long roundDownTimeStampSeconds(long timestamp,
int roundDownSec)
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.
- 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.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
roundDownTimeStampHours
public static long roundDownTimeStampHours(long timestamp,
int roundDownHours)
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.
- Returns:
- - Rounded down timestamp
- Throws:
IllegalStateException
Copyright © 2009-2012 Apache Software Foundation. All Rights Reserved.