use of com.alibaba.maxgraph.compiler.tree.FoldTreeNode in project GraphScope by alibaba.
the class CostEstimate method estimateNetworkCost.
public double estimateNetworkCost(TreeNode node) {
if (node instanceof FoldTreeNode) {
return NET_DEFAULT_COST * NET_DEFAULT_SCALE_RATIO * NET_FOLD_RATIO;
} else if (node.getNodeType() == NodeType.AGGREGATE) {
return NET_DEFAULT_COST * NET_DEFAULT_SCALE_RATIO;
} else if (node instanceof PropertyNode) {
PropertyNode propertyNode = (PropertyNode) node;
Set<String> propNameList = propertyNode.getPropKeyList();
if (propNameList.size() <= 0) {
return NET_DEFAULT_COST * NET_DEFAULT_SCALE_RATIO * PROP_DEFAULT_COUNT;
} else {
return NET_DEFAULT_COST * NET_DEFAULT_SCALE_RATIO * propNameList.size();
}
} else if (node.getOutputValueType() instanceof VertexValueType) {
return NET_DEFAULT_COST;
} else {
return NET_DEFAULT_COST * NET_DEFAULT_SCALE_RATIO;
}
}
Aggregations