Search in sources :

Example 1 with SubjectsCompatibility

use of io.hops.hopsworks.persistence.entity.kafka.schemas.SubjectsCompatibility in project hopsworks by logicalclocks.

the class SubjectsCompatibilityFacade method updateSubjectCompatibility.

public void updateSubjectCompatibility(Project project, String subject, SchemaCompatibility sc) {
    SubjectsCompatibility subjectsCompatibility;
    Optional<SubjectsCompatibility> optional = findBySubject(project, subject);
    boolean newSubjectsCompatibility = false;
    if (!optional.isPresent()) {
        subjectsCompatibility = new SubjectsCompatibility(subject, project, sc);
        newSubjectsCompatibility = true;
    } else {
        subjectsCompatibility = optional.get();
    }
    subjectsCompatibility.setCompatibility(sc);
    if (newSubjectsCompatibility) {
        save(subjectsCompatibility);
    } else {
        update(subjectsCompatibility);
    }
    em.flush();
}
Also used : SubjectsCompatibility(io.hops.hopsworks.persistence.entity.kafka.schemas.SubjectsCompatibility)

Aggregations

SubjectsCompatibility (io.hops.hopsworks.persistence.entity.kafka.schemas.SubjectsCompatibility)1