use of com.baidu.hugegraph.entity.schema.ConflictDetail in project incubator-hugegraph-toolchain by apache.
the class EdgeLabelService method checkConflict.
public ConflictDetail checkConflict(ConflictCheckEntity entity, int connId, boolean compareEachOther) {
ConflictDetail detail = new ConflictDetail(SchemaType.EDGE_LABEL);
if (CollectionUtils.isEmpty(entity.getElEntities())) {
return detail;
}
Map<String, EdgeLabelEntity> originElEntities = new HashMap<>();
for (EdgeLabelEntity e : this.list(connId)) {
originElEntities.put(e.getName(), e);
}
this.pkService.checkConflict(entity.getPkEntities(), detail, connId, compareEachOther);
this.piService.checkConflict(entity.getPiEntities(), detail, connId, compareEachOther);
this.vlService.checkConflict(entity.getVlEntities(), detail, connId, compareEachOther);
for (EdgeLabelEntity elEntity : entity.getElEntities()) {
// Firstly check if any properties are conflicted
if (detail.anyPropertyKeyConflict(elEntity.getPropNames())) {
detail.add(elEntity, ConflictStatus.DEP_CONFLICT);
continue;
}
// Then check if any property indexes are conflicted
if (detail.anyPropertyIndexConflict(elEntity.getIndexProps())) {
detail.add(elEntity, ConflictStatus.DEP_CONFLICT);
continue;
}
// Then determine if source/target vertex labels are conflicted
if (detail.anyVertexLabelConflict(elEntity.getLinkLabels())) {
detail.add(elEntity, ConflictStatus.DEP_CONFLICT);
continue;
}
// Then check conflict of edge label itself
EdgeLabelEntity originElEntity = originElEntities.get(elEntity.getName());
ConflictStatus status = SchemaEntity.compare(elEntity, originElEntity);
detail.add(elEntity, status);
}
if (compareEachOther) {
compareWithEachOther(detail, SchemaType.EDGE_LABEL);
}
return detail;
}
use of com.baidu.hugegraph.entity.schema.ConflictDetail in project incubator-hugegraph-toolchain by apache.
the class VertexLabelService method checkConflict.
public ConflictDetail checkConflict(ConflictCheckEntity entity, int connId, boolean compareEachOther) {
ConflictDetail detail = new ConflictDetail(SchemaType.VERTEX_LABEL);
if (CollectionUtils.isEmpty(entity.getVlEntities())) {
return detail;
}
this.pkService.checkConflict(entity.getPkEntities(), detail, connId, compareEachOther);
this.piService.checkConflict(entity.getPiEntities(), detail, connId, compareEachOther);
this.checkConflict(entity.getVlEntities(), detail, connId, compareEachOther);
return detail;
}
use of com.baidu.hugegraph.entity.schema.ConflictDetail in project incubator-hugegraph-toolchain by apache.
the class PropertyKeyService method checkConflict.
public ConflictDetail checkConflict(ConflictCheckEntity entity, int connId, boolean compareEachOther) {
ConflictDetail detail = new ConflictDetail(SchemaType.PROPERTY_KEY);
if (CollectionUtils.isEmpty(entity.getPkEntities())) {
return detail;
}
this.checkConflict(entity.getPkEntities(), detail, connId, compareEachOther);
return detail;
}
Aggregations