org.apache.flume.tools
Class TimestampRoundDownUtil

java.lang.Object
  extended by org.apache.flume.tools.TimestampRoundDownUtil

public class TimestampRoundDownUtil
extends Object


Constructor Summary
TimestampRoundDownUtil()
           
 
Method Summary
static long roundDownTimeStampHours(long timestamp, int roundDownHours)
           
static long roundDownTimeStampMinutes(long timestamp, int roundDownMins)
           
static long roundDownTimeStampSeconds(long timestamp, int roundDownSec)
           
 
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.
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-2015 Apache Software Foundation. All Rights Reserved.