Skip to content

Commit 46d0f1f

Browse files
committed
More Javadocs
Signed-off-by: Atri Sharma <atri.jiit@gmail.com>
1 parent af6a5c4 commit 46d0f1f

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

modules/ingest-common/src/main/java/org/opensearch/ingest/common/TemporalRoutingProcessor.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@ public final class TemporalRoutingProcessor extends AbstractProcessor {
5454
* Supported temporal granularities
5555
*/
5656
public enum Granularity {
57+
/** Hour granularity for hourly bucketing */
5758
HOUR(ChronoUnit.HOURS),
59+
/** Day granularity for daily bucketing */
5860
DAY(ChronoUnit.DAYS),
61+
/** Week granularity for weekly bucketing (ISO week) */
5962
WEEK(ChronoUnit.WEEKS),
63+
/** Month granularity for monthly bucketing */
6064
MONTH(ChronoUnit.MONTHS);
6165

6266
private final ChronoUnit chronoUnit;
@@ -65,10 +69,20 @@ public enum Granularity {
6569
this.chronoUnit = chronoUnit;
6670
}
6771

72+
/**
73+
* Gets the ChronoUnit associated with this granularity
74+
* @return the ChronoUnit
75+
*/
6876
public ChronoUnit getChronoUnit() {
6977
return chronoUnit;
7078
}
7179

80+
/**
81+
* Parses a string value to a Granularity enum
82+
* @param value the string representation of the granularity
83+
* @return the corresponding Granularity enum value
84+
* @throws IllegalArgumentException if the value is not valid
85+
*/
7286
public static Granularity fromString(String value) {
7387
try {
7488
return valueOf(value.toUpperCase(Locale.ROOT));

modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/TemporalRoutingSearchProcessor.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ public class TemporalRoutingSearchProcessor extends AbstractProcessor implements
6161
* Supported temporal granularities
6262
*/
6363
public enum Granularity {
64+
/** Hour granularity for hourly bucketing */
6465
HOUR(ChronoUnit.HOURS),
66+
/** Day granularity for daily bucketing */
6567
DAY(ChronoUnit.DAYS),
68+
/** Week granularity for weekly bucketing (ISO week) */
6669
WEEK(ChronoUnit.WEEKS),
70+
/** Month granularity for monthly bucketing */
6771
MONTH(ChronoUnit.MONTHS);
6872

6973
private final ChronoUnit chronoUnit;
@@ -72,10 +76,20 @@ public enum Granularity {
7276
this.chronoUnit = chronoUnit;
7377
}
7478

79+
/**
80+
* Gets the ChronoUnit associated with this granularity
81+
* @return the ChronoUnit
82+
*/
7583
public ChronoUnit getChronoUnit() {
7684
return chronoUnit;
7785
}
7886

87+
/**
88+
* Parses a string value to a Granularity enum
89+
* @param value the string representation of the granularity
90+
* @return the corresponding Granularity enum value
91+
* @throws IllegalArgumentException if the value is not valid
92+
*/
7993
public static Granularity fromString(String value) {
8094
try {
8195
return valueOf(value.toUpperCase(Locale.ROOT));

0 commit comments

Comments
 (0)