Enum GranularityType
- java.lang.Object
-
- java.lang.Enum<GranularityType>
-
- org.apache.druid.java.util.common.granularity.GranularityType
-
- All Implemented Interfaces:
Serializable,Comparable<GranularityType>
public enum GranularityType extends Enum<GranularityType>
Only to create a mapping of the granularity and all the supported file patterns namely: default, lowerDefault and hive. NOTE: When a new granularity type is added to following type, DO remember document it here: docs/querying/granularities.md#simple-granularities
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALLDAYEIGHT_HOURFIFTEEN_MINUTEFIVE_MINUTEHOURMINUTEMONTHNONEQUARTERSECONDSIX_HOURTEN_MINUTETHIRTY_MINUTEWEEKYEAR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GranularityTypefromPeriod(org.joda.time.Period period)Note: This is only an estimate based on the values in period.org.joda.time.DateTimegetDateTime(Integer[] vals)StringgetDefaultFormat()GranularitygetDefaultGranularity()StringgetHiveFormat()StringgetLowerDefaultFormat()static booleanisStandard(Granularity granularity)For a select subset of granularites, users can specify them directly as string.static GranularityTypevalueOf(String name)Returns the enum constant of this type with the specified name.static GranularityType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SECOND
public static final GranularityType SECOND
-
MINUTE
public static final GranularityType MINUTE
-
FIVE_MINUTE
public static final GranularityType FIVE_MINUTE
-
TEN_MINUTE
public static final GranularityType TEN_MINUTE
-
FIFTEEN_MINUTE
public static final GranularityType FIFTEEN_MINUTE
-
THIRTY_MINUTE
public static final GranularityType THIRTY_MINUTE
-
HOUR
public static final GranularityType HOUR
-
SIX_HOUR
public static final GranularityType SIX_HOUR
-
EIGHT_HOUR
public static final GranularityType EIGHT_HOUR
-
DAY
public static final GranularityType DAY
-
WEEK
public static final GranularityType WEEK
-
MONTH
public static final GranularityType MONTH
-
QUARTER
public static final GranularityType QUARTER
-
YEAR
public static final GranularityType YEAR
-
ALL
public static final GranularityType ALL
-
NONE
public static final GranularityType NONE
-
-
Method Detail
-
values
public static GranularityType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GranularityType c : GranularityType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GranularityType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getDefaultGranularity
public Granularity getDefaultGranularity()
-
getDateTime
public org.joda.time.DateTime getDateTime(Integer[] vals)
-
isStandard
public static boolean isStandard(Granularity granularity)
For a select subset of granularites, users can specify them directly as string. These are "predefined granularities" or "standard" granularities. For all others, the users will have to use "Duration" or "Period" type granularities
-
fromPeriod
public static GranularityType fromPeriod(org.joda.time.Period period)
Note: This is only an estimate based on the values in period. This will not work for complicated periods that represent say 1 year 1 day
-
getHiveFormat
public String getHiveFormat()
-
getLowerDefaultFormat
public String getLowerDefaultFormat()
-
getDefaultFormat
public String getDefaultFormat()
-
-