private EventSubmitter buildEventSubmitter() { return new EventSubmitter.Builder(this.gobblinMetrics.get().getMetricContext(), GobblinYarnEventConstants.EVENT_NAMESPACE) .build(); }
? gobblinMetrics.get().getMetricContext().childBuilder(klazz.getCanonicalName() + "." + randomId) : MetricContext.builder(klazz.getCanonicalName() + "." + randomId); return builder.addTags(generatedTags).addTags(tags).build();
? gobblinMetrics.get().getMetricContext().childBuilder(klazz.getCanonicalName() + "." + randomId) : MetricContext.builder(klazz.getCanonicalName() + "." + randomId); return builder.addTags(generatedTags).addTags(tags).build();
@Test public void testInstrumented() { GobblinMetrics gobblinMetrics = GobblinMetrics.get("parent.context"); State state = new State(); state.setProp(ConfigurationKeys.METRICS_ENABLED_KEY, Boolean.toString(true)); state.setProp(Instrumented.METRIC_CONTEXT_NAME_KEY, gobblinMetrics.getName()); Instrumented instrumented = new Instrumented(state, InstrumentedExtractor.class); Assert.assertNotNull(instrumented.getMetricContext()); Assert.assertTrue(instrumented.getMetricContext().getParent().isPresent()); Assert.assertEquals(instrumented.getMetricContext().getParent().get(), gobblinMetrics.getMetricContext()); Map<String, ?> tags = instrumented.getMetricContext().getTagMap(); Map<String, String> expectedTags = new HashMap<>(); expectedTags.put("construct", Constructs.EXTRACTOR.toString()); expectedTags.put("class", InstrumentedExtractor.class.getCanonicalName()); expectedTags.put(MetricContext.METRIC_CONTEXT_ID_TAG_NAME, tags.get(MetricContext.METRIC_CONTEXT_ID_TAG_NAME).toString()); expectedTags.put(MetricContext.METRIC_CONTEXT_NAME_TAG_NAME, tags.get(MetricContext.METRIC_CONTEXT_NAME_TAG_NAME).toString()); Assert.assertEquals(tags.size(), expectedTags.size()); for (Map.Entry<String, ?> tag : tags.entrySet()) { Assert.assertTrue(expectedTags.containsKey(tag.getKey())); Assert.assertEquals(expectedTags.get(tag.getKey()), tag.getValue().toString()); } }
.get(getForkMetricsName(taskContext.getTaskMetrics(), this.taskState, index), taskContext.getTaskMetrics().getMetricContext(), getForkMetricsTags(this.taskState, index)); this.closer.register(forkMetrics.getMetricContext()); Instrumented.setMetricContextName(this.taskState, forkMetrics.getMetricContext().getName());
public MRCompactor(Properties props, List<? extends Tag<?>> tags, Optional<CompactorListener> compactorListener) throws IOException { this.state = new State(); this.state.addAll(props); this.initilizeTime = getCurrentTime(); this.tags = tags; this.conf = HadoopUtils.getConfFromState(this.state); this.tmpOutputDir = getTmpOutputDir(); this.fs = getFileSystem(); this.datasets = getDatasetsFinder().findDistinctDatasets(); this.jobExecutor = createJobExecutor(); this.jobRunnables = Maps.newConcurrentMap(); this.closer = Closer.create(); this.stopwatch = Stopwatch.createStarted(); this.gobblinMetrics = initializeMetrics(); this.eventSubmitter = new EventSubmitter.Builder( GobblinMetrics.get(this.state.getProp(ConfigurationKeys.JOB_NAME_KEY)).getMetricContext(), MRCompactor.COMPACTION_TRACKING_EVENTS_NAMESPACE).build(); this.compactorListener = compactorListener; this.dataVerifTimeoutMinutes = getDataVerifTimeoutMinutes(); this.compactionTimeoutMinutes = getCompactionTimeoutMinutes(); this.shouldVerifDataCompl = shouldVerifyDataCompleteness(); this.compactionCompleteListener = getCompactionCompleteListener(); this.verifier = this.shouldVerifDataCompl ? Optional.of(this.closer.register(new DataCompletenessVerifier(this.state))) : Optional.<DataCompletenessVerifier> absent(); this.shouldPublishDataIfCannotVerifyCompl = shouldPublishDataIfCannotVerifyCompl(); }
GobblinMetrics.get(this.dataset.jobProps().getProp(ConfigurationKeys.JOB_NAME_KEY)).getMetricContext(), MRCompactor.COMPACTION_TRACKING_EVENTS_NAMESPACE).build();
private EventSubmitter buildEventSubmitter() { return new EventSubmitter.Builder(this.gobblinMetrics.get().getMetricContext(), GobblinYarnEventConstants.EVENT_NAMESPACE) .build(); }
? gobblinMetrics.get().getMetricContext().childBuilder(klazz.getCanonicalName() + "." + randomId) : MetricContext.builder(klazz.getCanonicalName() + "." + randomId); return builder.addTags(generatedTags).addTags(tags).build();
? gobblinMetrics.get().getMetricContext().childBuilder(klazz.getCanonicalName() + "." + randomId) : MetricContext.builder(klazz.getCanonicalName() + "." + randomId); return builder.addTags(generatedTags).addTags(tags).build();
.get(getForkMetricsName(taskContext.getTaskMetrics(), this.taskState, index), taskContext.getTaskMetrics().getMetricContext(), getForkMetricsTags(this.taskState, index)); this.closer.register(forkMetrics.getMetricContext()); Instrumented.setMetricContextName(this.taskState, forkMetrics.getMetricContext().getName());
public MRCompactor(Properties props, List<? extends Tag<?>> tags, Optional<CompactorListener> compactorListener) throws IOException { this.state = new State(); this.state.addAll(props); this.initilizeTime = getCurrentTime(); this.tags = tags; this.conf = HadoopUtils.getConfFromState(this.state); this.tmpOutputDir = getTmpOutputDir(); this.fs = getFileSystem(); this.datasets = getDatasetsFinder().findDistinctDatasets(); this.jobExecutor = createJobExecutor(); this.jobRunnables = Maps.newConcurrentMap(); this.closer = Closer.create(); this.stopwatch = Stopwatch.createStarted(); this.gobblinMetrics = initializeMetrics(); this.eventSubmitter = new EventSubmitter.Builder( GobblinMetrics.get(this.state.getProp(ConfigurationKeys.JOB_NAME_KEY)).getMetricContext(), MRCompactor.COMPACTION_TRACKING_EVENTS_NAMESPACE).build(); this.compactorListener = compactorListener; this.dataVerifTimeoutMinutes = getDataVerifTimeoutMinutes(); this.compactionTimeoutMinutes = getCompactionTimeoutMinutes(); this.shouldVerifDataCompl = shouldVerifyDataCompleteness(); this.compactionCompleteListener = getCompactionCompleteListener(); this.verifier = this.shouldVerifDataCompl ? Optional.of(this.closer.register(new DataCompletenessVerifier(this.state))) : Optional.<DataCompletenessVerifier> absent(); this.shouldPublishDataIfCannotVerifyCompl = shouldPublishDataIfCannotVerifyCompl(); }
GobblinMetrics.get(this.dataset.jobProps().getProp(ConfigurationKeys.JOB_NAME_KEY)).getMetricContext(), MRCompactor.COMPACTION_TRACKING_EVENTS_NAMESPACE).build();