This commit is contained in:
Fabio Sinibaldi 2022-12-06 16:46:12 +01:00
parent ec0b826313
commit de8ed2a811
1 changed files with 8 additions and 7 deletions

View File

@ -181,13 +181,14 @@ public class SDIMaterializerPlugin extends AbstractPlugin implements Materializa
log.debug("Found matching {} ",s); log.debug("Found matching {} ",s);
RegisteredFileSet registeredFileSet=Serialization.convert(wrapper.getByPath(s).get(0),RegisteredFileSet.class); RegisteredFileSet registeredFileSet=Serialization.convert(wrapper.getByPath(s).get(0),RegisteredFileSet.class);
List<Object> toKeep = new ArrayList<>(); List<Object> toKeep = new ArrayList<>();
for(Object matObj : registeredFileSet.getMaterializations()){ if(registeredFileSet.getMaterializations()!=null)
Materialization mat = Serialization.convert(matObj,Materialization.class); for(Object matObj : registeredFileSet.getMaterializations()){
if(mat.getType().equals(GCubeSDILayer.GCUBE_SDY_LAYER_TYPE)) { Materialization mat = Serialization.convert(matObj,Materialization.class);
log.debug("Deleting Layer {} ",mat); if(mat.getType().equals(GCubeSDILayer.GCUBE_SDY_LAYER_TYPE)) {
sdi.deleteLayer(Serialization.convert(matObj, GCubeSDILayer.class)); log.debug("Deleting Layer {} ",mat);
}else toKeep.add(matObj); sdi.deleteLayer(Serialization.convert(matObj, GCubeSDILayer.class));
} }else toKeep.add(matObj);
}
// Resetting remaining materializations // Resetting remaining materializations
registeredFileSet.put(RegisteredFileSet.MATERIALIZATIONS,toKeep); registeredFileSet.put(RegisteredFileSet.MATERIALIZATIONS,toKeep);
// Update FS in doc // Update FS in doc