Search in sources :

Example 1 with ProgramSystemMetadataWriter

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();
    }
}
Also used : ProgramSpecification(co.cask.cdap.api.ProgramSpecification) DatasetSystemMetadataWriter(co.cask.cdap.data2.metadata.system.DatasetSystemMetadataWriter) ProgramSystemMetadataWriter(co.cask.cdap.data2.metadata.system.ProgramSystemMetadataWriter) ViewSystemMetadataWriter(co.cask.cdap.data2.metadata.system.ViewSystemMetadataWriter) SystemMetadataWriter(co.cask.cdap.data2.metadata.system.SystemMetadataWriter) AppSystemMetadataWriter(co.cask.cdap.data2.metadata.system.AppSystemMetadataWriter) ArtifactSystemMetadataWriter(co.cask.cdap.data2.metadata.system.ArtifactSystemMetadataWriter) StreamSystemMetadataWriter(co.cask.cdap.data2.metadata.system.StreamSystemMetadataWriter) ProgramId(co.cask.cdap.proto.id.ProgramId) ProgramSystemMetadataWriter(co.cask.cdap.data2.metadata.system.ProgramSystemMetadataWriter)

Example 2 with ProgramSystemMetadataWriter

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();
    }
}
Also used : ProgramSpecification(co.cask.cdap.api.ProgramSpecification) ProgramId(co.cask.cdap.proto.id.ProgramId) ProgramSystemMetadataWriter(co.cask.cdap.data2.metadata.system.ProgramSystemMetadataWriter)

Example 3 with ProgramSystemMetadataWriter

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());
    }
}
Also used : ProgramSpecification(io.cdap.cdap.api.ProgramSpecification) ProgramId(io.cdap.cdap.proto.id.ProgramId) ProgramSystemMetadataWriter(io.cdap.cdap.data2.metadata.system.ProgramSystemMetadataWriter)

Aggregations

ProgramSpecification (co.cask.cdap.api.ProgramSpecification)2 ProgramSystemMetadataWriter (co.cask.cdap.data2.metadata.system.ProgramSystemMetadataWriter)2 ProgramId (co.cask.cdap.proto.id.ProgramId)2 AppSystemMetadataWriter (co.cask.cdap.data2.metadata.system.AppSystemMetadataWriter)1 ArtifactSystemMetadataWriter (co.cask.cdap.data2.metadata.system.ArtifactSystemMetadataWriter)1 DatasetSystemMetadataWriter (co.cask.cdap.data2.metadata.system.DatasetSystemMetadataWriter)1 StreamSystemMetadataWriter (co.cask.cdap.data2.metadata.system.StreamSystemMetadataWriter)1 SystemMetadataWriter (co.cask.cdap.data2.metadata.system.SystemMetadataWriter)1 ViewSystemMetadataWriter (co.cask.cdap.data2.metadata.system.ViewSystemMetadataWriter)1 ProgramSpecification (io.cdap.cdap.api.ProgramSpecification)1 ProgramSystemMetadataWriter (io.cdap.cdap.data2.metadata.system.ProgramSystemMetadataWriter)1 ProgramId (io.cdap.cdap.proto.id.ProgramId)1