private void publishMetadata(DatasetId dataset, SystemMetadata metadata) { if (metadata != null && !metadata.isEmpty()) { SystemMetadataWriter metadataWriter = new DelegateSystemMetadataWriter(metadataPublisher, dataset, metadata); metadataWriter.write(); } } }
private void publishMetadata(DatasetId dataset, SystemMetadata metadata) { if (metadata != null && !metadata.isEmpty()) { SystemMetadataWriter metadataWriter = new DelegateSystemMetadataWriter(metadataStore, dataset, metadata); metadataWriter.write(); } } }
@Override public void process(ApplicationWithPrograms input) throws Exception { // add system metadata for apps ApplicationId appId = input.getApplicationId(); ApplicationSpecification appSpec = input.getSpecification(); // only update creation time if this is a new app Map<String, String> properties = metadataStore.getProperties(MetadataScope.SYSTEM, appId.toMetadataEntity()); SystemMetadataWriter appSystemMetadataWriter = new AppSystemMetadataWriter(metadataStore, appId, appSpec, !properties.isEmpty()); appSystemMetadataWriter.write(); // add system metadata for programs writeProgramSystemMetadata(appId, ProgramType.FLOW, appSpec.getFlows().values()); writeProgramSystemMetadata(appId, ProgramType.MAPREDUCE, appSpec.getMapReduce().values()); writeProgramSystemMetadata(appId, ProgramType.SERVICE, appSpec.getServices().values()); writeProgramSystemMetadata(appId, ProgramType.SPARK, appSpec.getSpark().values()); writeProgramSystemMetadata(appId, ProgramType.WORKER, appSpec.getWorkers().values()); writeProgramSystemMetadata(appId, ProgramType.WORKFLOW, appSpec.getWorkflows().values()); // Emit input to the next stage emit(input); }
systemMetadataWriter.write();