作者:深碍是碍u不是爱 | 来源:互联网 | 2023-09-04 09:26
本文整理了Java中org.apache.gobblin.metrics.GobblinMetrics.getCustomTagsFromState()方法的一些代码示
本文整理了Java中org.apache.gobblin.metrics.GobblinMetrics.getCustomTagsFromState()
方法的一些代码示例,展示了GobblinMetrics.getCustomTagsFromState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GobblinMetrics.getCustomTagsFromState()
方法的具体详情如下:
包路径:org.apache.gobblin.metrics.GobblinMetrics
类名称:GobblinMetrics
方法名:getCustomTagsFromState
[英]Parse custom org.apache.gobblin.metrics.Tags from property #METRICS_STATE_CUSTOM_TAGSin the input org.apache.gobblin.configuration.State.
[中]解析自定义组织。阿帕奇。戈布林。韵律学。输入组织中属性#度量(度量)状态(自定义)标记中的标记。阿帕奇。戈布林。配置状态
代码示例
代码示例来源:origin: apache/incubator-gobblin
@Test
public void testCustomTags() {
Properties testProperties = new Properties();
Tag expectedPropertyTag = new Tag<>("key1", "value1");
GobblinMetrics.addCustomTagToProperties(testProperties, expectedPropertyTag);
State testState = new State(testProperties);
List> tags = GobblinMetrics.getCustomTagsFromState(testState);
Assert.assertEquals(Iterables.getFirst(tags, null), expectedPropertyTag);
Tag expectedStateTag = new Tag<>("key2", "value2");
GobblinMetrics.addCustomTagToState(testState, expectedStateTag);
tags = GobblinMetrics.getCustomTagsFromState(testState);
Assert.assertTrue(tags.containsAll(ImmutableList.of(expectedPropertyTag, expectedStateTag)));
}
代码示例来源:origin: apache/incubator-gobblin
/**
* Build a new {@link CopyDataPublisher} from {@link State}. The constructor expects the following to be set in the
* {@link State},
*
* - {@link ConfigurationKeys#WRITER_OUTPUT_DIR}
* - {@link ConfigurationKeys#WRITER_FILE_SYSTEM_URI}
*
*
*/
public CopyDataPublisher(State state) throws IOException {
super(state);
// Extract LineageInfo from state
if (state instanceof SourceState) {
lineageInfo = LineageInfo.getLineageInfo(((SourceState) state).getBroker());
} else if (state instanceof WorkUnitState) {
lineageInfo = LineageInfo.getLineageInfo(((WorkUnitState) state).getTaskBrokerNullable());
} else {
lineageInfo = Optional.absent();
}
String uri = this.state.getProp(ConfigurationKeys.WRITER_FILE_SYSTEM_URI, ConfigurationKeys.LOCAL_FS_URI);
this.fs = FileSystem.get(URI.create(uri), WriterUtils.getFsConfiguration(state));
FileAwareInputStreamDataWriterBuilder.setJobSpecificOutputPaths(state);
this.writerOutputDir = new Path(state.getProp(ConfigurationKeys.WRITER_OUTPUT_DIR));
MetricContext metricCOntext=
Instrumented.getMetricContext(state, CopyDataPublisher.class, GobblinMetrics.getCustomTagsFromState(state));
this.eventSubmitter = new EventSubmitter.Builder(metricContext, "org.apache.gobblin.copy.CopyDataPublisher").build();
this.recoveryHelper = new RecoveryHelper(this.fs, state);
this.recoveryHelper.purgeOldPersistedFile();
}
代码示例来源:origin: apache/incubator-gobblin
public HiveMetaStoreBasedRegister(State state, Optional metastoreURI) throws IOException {
super(state);
this.optimizedChecks = state.getPropAsBoolean(this.OPTIMIZED_CHECK_ENABLED, true);
GenericObjectPoolConfig cOnfig= new GenericObjectPoolConfig();
config.setMaxTotal(this.props.getNumThreads());
config.setMaxIdle(this.props.getNumThreads());
this.clientPool = HiveMetastoreClientPool.get(this.props.getProperties(), metastoreURI);
this.metricCOntext=
GobblinMetricsRegistry.getInstance().getMetricContext(state, HiveMetaStoreBasedRegister.class, GobblinMetrics.getCustomTagsFromState(state));
this.eventSubmitter = new EventSubmitter.Builder(this.metricContext, "org.apache.gobblin.hive.HiveMetaStoreBasedRegister").build();
}
代码示例来源:origin: org.apache.gobblin/gobblin-data-management
/**
* Build a new {@link CopyDataPublisher} from {@link State}. The constructor expects the following to be set in the
* {@link State},
*
* - {@link ConfigurationKeys#WRITER_OUTPUT_DIR}
* - {@link ConfigurationKeys#WRITER_FILE_SYSTEM_URI}
*
*
*/
public CopyDataPublisher(State state) throws IOException {
super(state);
// Extract LineageInfo from state
if (state instanceof SourceState) {
lineageInfo = LineageInfo.getLineageInfo(((SourceState) state).getBroker());
} else if (state instanceof WorkUnitState) {
lineageInfo = LineageInfo.getLineageInfo(((WorkUnitState) state).getTaskBrokerNullable());
} else {
lineageInfo = Optional.absent();
}
String uri = this.state.getProp(ConfigurationKeys.WRITER_FILE_SYSTEM_URI, ConfigurationKeys.LOCAL_FS_URI);
this.fs = FileSystem.get(URI.create(uri), WriterUtils.getFsConfiguration(state));
FileAwareInputStreamDataWriterBuilder.setJobSpecificOutputPaths(state);
this.writerOutputDir = new Path(state.getProp(ConfigurationKeys.WRITER_OUTPUT_DIR));
MetricContext metricCOntext=
Instrumented.getMetricContext(state, CopyDataPublisher.class, GobblinMetrics.getCustomTagsFromState(state));
this.eventSubmitter = new EventSubmitter.Builder(metricContext, "org.apache.gobblin.copy.CopyDataPublisher").build();
this.recoveryHelper = new RecoveryHelper(this.fs, state);
this.recoveryHelper.purgeOldPersistedFile();
}
代码示例来源:origin: org.apache.gobblin/gobblin-hive-registration
public HiveMetaStoreBasedRegister(State state, Optional metastoreURI) throws IOException {
super(state);
this.optimizedChecks = state.getPropAsBoolean(this.OPTIMIZED_CHECK_ENABLED, true);
GenericObjectPoolConfig cOnfig= new GenericObjectPoolConfig();
config.setMaxTotal(this.props.getNumThreads());
config.setMaxIdle(this.props.getNumThreads());
this.clientPool = HiveMetastoreClientPool.get(this.props.getProperties(), metastoreURI);
this.metricCOntext=
GobblinMetricsRegistry.getInstance().getMetricContext(state, HiveMetaStoreBasedRegister.class, GobblinMetrics.getCustomTagsFromState(state));
this.eventSubmitter = new EventSubmitter.Builder(this.metricContext, "org.apache.gobblin.hive.HiveMetaStoreBasedRegister").build();
}