use of org.datatransferproject.launcher.metrics.ServiceAwareMetricRecorder in project data-transfer-project by google.
the class WorkerModule method getExporter.
@Provides
@Singleton
Exporter getExporter(ImmutableList<TransferExtension> transferExtensions) {
TransferExtension extension = findTransferExtension(transferExtensions, JobMetadata.getExportService());
DelegatingExtensionContext serviceSpecificContext = new DelegatingExtensionContext(context);
serviceSpecificContext.registerOverrideService(MetricRecorder.class, new ServiceAwareMetricRecorder(extension.getServiceId(), context.getService(DtpInternalMetricRecorder.class)));
serviceSpecificContext.registerOverrideService(TransferServiceConfig.class, getTransferServiceConfig(extension));
extension.initialize(serviceSpecificContext);
return extension.getExporter(JobMetadata.getDataType());
}
use of org.datatransferproject.launcher.metrics.ServiceAwareMetricRecorder in project data-transfer-project by google.
the class WorkerModule method getImporter.
@Provides
@Singleton
Importer getImporter(ImmutableList<TransferExtension> transferExtensions) {
TransferExtension extension = findTransferExtension(transferExtensions, JobMetadata.getImportService());
DelegatingExtensionContext serviceSpecificContext = new DelegatingExtensionContext(context);
serviceSpecificContext.registerOverrideService(MetricRecorder.class, new ServiceAwareMetricRecorder(extension.getServiceId(), context.getService(DtpInternalMetricRecorder.class)));
serviceSpecificContext.registerOverrideService(TransferServiceConfig.class, getTransferServiceConfig(extension));
extension.initialize(serviceSpecificContext);
return extension.getImporter(JobMetadata.getDataType());
}
Aggregations