use of io.cdap.cdap.data2.metadata.system.ProgramSystemMetadataWriter in project cdap by caskdata.
the class ExistingEntitySystemMetadataWriter method writeSystemMetadataForPrograms.
private void writeSystemMetadataForPrograms(ApplicationId app, ProgramType programType, Collection<? extends ProgramSpecification> programSpecs) {
for (ProgramSpecification programSpec : programSpecs) {
ProgramId programId = app.program(programType, programSpec.getName());
SystemMetadataWriter writer = new ProgramSystemMetadataWriter(metadataStore, programId, programSpec, true);
writer.write();
}
}
use of io.cdap.cdap.data2.metadata.system.ProgramSystemMetadataWriter in project cdap by caskdata.
the class SystemMetadataWriterStage method writeProgramSystemMetadata.
private void writeProgramSystemMetadata(ApplicationId appId, ProgramType programType, Iterable<? extends ProgramSpecification> specs) {
for (ProgramSpecification spec : specs) {
ProgramId programId = appId.program(programType, spec.getName());
Map<String, String> properties = metadataStore.getProperties(MetadataScope.SYSTEM, programId);
ProgramSystemMetadataWriter writer = new ProgramSystemMetadataWriter(metadataStore, programId, spec, !properties.isEmpty());
writer.write();
}
}
use of io.cdap.cdap.data2.metadata.system.ProgramSystemMetadataWriter in project cdap by caskdata.
the class MetadataWriterStage method collectProgramSystemMetadata.
private void collectProgramSystemMetadata(ApplicationId appId, ProgramType programType, Iterable<? extends ProgramSpecification> specs, List<MetadataMutation> mutations) {
for (ProgramSpecification spec : specs) {
ProgramId programId = appId.program(programType, spec.getName());
mutations.add(new ProgramSystemMetadataWriter(metadataServiceClient, programId, spec, creationTime).getMetadataMutation());
}
}
Aggregations