Skip to content

Commit d679d17

Browse files
committed
Move HoodieMetricsCloudWatchConfig to hudi-client-common
1 parent 246ecf7 commit d679d17

3 files changed

Lines changed: 25 additions & 24 deletions

File tree

hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import org.apache.hudi.common.util.ReflectionUtils;
4949
import org.apache.hudi.common.util.StringUtils;
5050
import org.apache.hudi.common.util.ValidationUtils;
51+
import org.apache.hudi.config.metrics.HoodieMetricsCloudWatchConfig;
5152
import org.apache.hudi.config.metrics.HoodieMetricsConfig;
5253
import org.apache.hudi.config.metrics.HoodieMetricsDatadogConfig;
5354
import org.apache.hudi.config.metrics.HoodieMetricsGraphiteConfig;

hudi-aws/src/main/java/org/apache/hudi/config/HoodieMetricsCloudWatchConfig.java renamed to hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/metrics/HoodieMetricsCloudWatchConfig.java

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
* "License"); you may not use this file except in compliance
88
* with the License. You may obtain a copy of the License at
99
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
10+
* http://www.apache.org/licenses/LICENSE-2.0
1111
*
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
1718
*/
1819

19-
package org.apache.hudi.config;
20+
package org.apache.hudi.config.metrics;
2021

2122
import org.apache.hudi.common.config.ConfigClassProperty;
2223
import org.apache.hudi.common.config.ConfigGroups;
@@ -36,22 +37,22 @@ public class HoodieMetricsCloudWatchConfig extends HoodieConfig {
3637
public static final String CLOUDWATCH_PREFIX = "hoodie.metrics.cloudwatch";
3738

3839
public static final ConfigProperty<Integer> REPORT_PERIOD_SECONDS = ConfigProperty
39-
.key(CLOUDWATCH_PREFIX + ".report.period.seconds")
40-
.defaultValue(60)
41-
.sinceVersion("0.10.0")
42-
.withDocumentation("Reporting interval in seconds");
40+
.key(CLOUDWATCH_PREFIX + ".report.period.seconds")
41+
.defaultValue(60)
42+
.sinceVersion("0.10.0")
43+
.withDocumentation("Reporting interval in seconds");
4344

4445
public static final ConfigProperty<String> METRIC_PREFIX = ConfigProperty
45-
.key(CLOUDWATCH_PREFIX + ".metric.prefix")
46-
.defaultValue("")
47-
.sinceVersion("0.10.0")
48-
.withDocumentation("Metric prefix of reporter");
46+
.key(CLOUDWATCH_PREFIX + ".metric.prefix")
47+
.defaultValue("")
48+
.sinceVersion("0.10.0")
49+
.withDocumentation("Metric prefix of reporter");
4950

5051
public static final ConfigProperty<String> METRIC_NAMESPACE = ConfigProperty
51-
.key(CLOUDWATCH_PREFIX + ".namespace")
52-
.defaultValue("Hudi")
53-
.sinceVersion("0.10.0")
54-
.withDocumentation("Namespace of reporter");
52+
.key(CLOUDWATCH_PREFIX + ".namespace")
53+
.defaultValue("Hudi")
54+
.sinceVersion("0.10.0")
55+
.withDocumentation("Namespace of reporter");
5556
/*
5657
Amazon CloudWatch allows a maximum of 20 metrics per request. Choosing this as the default maximum.
5758
Reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html
@@ -66,13 +67,13 @@ public HoodieMetricsCloudWatchConfig() {
6667
super();
6768
}
6869

69-
public static HoodieMetricsCloudWatchConfig.Builder newBuilder() {
70-
return new HoodieMetricsCloudWatchConfig.Builder();
70+
static Builder newBuilder() {
71+
return new Builder();
7172
}
7273

73-
public static class Builder {
74+
static class Builder {
7475

75-
private HoodieMetricsCloudWatchConfig hoodieMetricsCloudWatchConfig = new HoodieMetricsCloudWatchConfig();
76+
private final HoodieMetricsCloudWatchConfig hoodieMetricsCloudWatchConfig = new HoodieMetricsCloudWatchConfig();
7677

7778
public HoodieMetricsCloudWatchConfig.Builder fromProperties(Properties props) {
7879
this.hoodieMetricsCloudWatchConfig.getProps().putAll(props);

hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/metrics/HoodieMetricsConfig.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.apache.hudi.common.config.HoodieConfig;
2525
import org.apache.hudi.common.table.HoodieTableConfig;
2626
import org.apache.hudi.common.util.Option;
27-
import org.apache.hudi.config.HoodieMetricsCloudWatchConfig;
2827
import org.apache.hudi.metrics.MetricsReporterType;
2928

3029
import javax.annotation.concurrent.Immutable;

0 commit comments

Comments
 (0)