Search in sources :

Example 1 with CollapseType

use of io.cdap.cdap.proto.metadata.lineage.CollapseType in project cdap by caskdata.

the class LineageHTTPHandler method getCollapseTypes.

private static Set<CollapseType> getCollapseTypes(@Nullable List<String> collapse) throws BadRequestException {
    if (collapse == null) {
        return Collections.emptySet();
    }
    Set<CollapseType> collapseTypes = new HashSet<>();
    for (String c : collapse) {
        try {
            CollapseType type = CollapseType.valueOf(c.toUpperCase());
            collapseTypes.add(type);
        } catch (IllegalArgumentException e) {
            throw new BadRequestException(String.format("Invalid collapse type %s", c));
        }
    }
    return collapseTypes;
}
Also used : CollapseType(io.cdap.cdap.proto.metadata.lineage.CollapseType) BadRequestException(io.cdap.cdap.common.BadRequestException) HashSet(java.util.HashSet)

Aggregations

BadRequestException (io.cdap.cdap.common.BadRequestException)1 CollapseType (io.cdap.cdap.proto.metadata.lineage.CollapseType)1 HashSet (java.util.HashSet)1