Skip to content

Commit

Permalink
Move HoodieMetricsCloudWatchConfig to hudi-client-common
Browse files Browse the repository at this point in the history
  • Loading branch information
codope committed May 24, 2022
1 parent 246ecf7 commit d679d17
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.apache.hudi.common.util.ReflectionUtils;
import org.apache.hudi.common.util.StringUtils;
import org.apache.hudi.common.util.ValidationUtils;
import org.apache.hudi.config.metrics.HoodieMetricsCloudWatchConfig;
import org.apache.hudi.config.metrics.HoodieMetricsConfig;
import org.apache.hudi.config.metrics.HoodieMetricsDatadogConfig;
import org.apache.hudi.config.metrics.HoodieMetricsGraphiteConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.hudi.config;
package org.apache.hudi.config.metrics;

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

public static final ConfigProperty<Integer> REPORT_PERIOD_SECONDS = ConfigProperty
.key(CLOUDWATCH_PREFIX + ".report.period.seconds")
.defaultValue(60)
.sinceVersion("0.10.0")
.withDocumentation("Reporting interval in seconds");
.key(CLOUDWATCH_PREFIX + ".report.period.seconds")
.defaultValue(60)
.sinceVersion("0.10.0")
.withDocumentation("Reporting interval in seconds");

public static final ConfigProperty<String> METRIC_PREFIX = ConfigProperty
.key(CLOUDWATCH_PREFIX + ".metric.prefix")
.defaultValue("")
.sinceVersion("0.10.0")
.withDocumentation("Metric prefix of reporter");
.key(CLOUDWATCH_PREFIX + ".metric.prefix")
.defaultValue("")
.sinceVersion("0.10.0")
.withDocumentation("Metric prefix of reporter");

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

public static HoodieMetricsCloudWatchConfig.Builder newBuilder() {
return new HoodieMetricsCloudWatchConfig.Builder();
static Builder newBuilder() {
return new Builder();
}

public static class Builder {
static class Builder {

private HoodieMetricsCloudWatchConfig hoodieMetricsCloudWatchConfig = new HoodieMetricsCloudWatchConfig();
private final HoodieMetricsCloudWatchConfig hoodieMetricsCloudWatchConfig = new HoodieMetricsCloudWatchConfig();

public HoodieMetricsCloudWatchConfig.Builder fromProperties(Properties props) {
this.hoodieMetricsCloudWatchConfig.getProps().putAll(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.hudi.common.config.HoodieConfig;
import org.apache.hudi.common.table.HoodieTableConfig;
import org.apache.hudi.common.util.Option;
import org.apache.hudi.config.HoodieMetricsCloudWatchConfig;
import org.apache.hudi.metrics.MetricsReporterType;

import javax.annotation.concurrent.Immutable;
Expand Down

0 comments on commit d679d17

Please sign in to comment.