All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vesoft.nebula.driver.graph.data.PlanInfoNode Maven / Gradle / Ivy

The newest version!
package com.vesoft.nebula.driver.graph.data;

import com.google.common.base.Charsets;
import com.vesoft.nebula.proto.graph.PlanInfo;
import java.io.Serializable;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

public class PlanInfoNode implements Serializable {
    private PlanInfo planInfo;

    // the id of the plan node
    private String id;

    // the name of the plan node
    private String name;
    // the description of plan node, such as the grouping key of aggregation operation,
    // aggregation function
    private String details;

    // the cpu time consumption of the operation, timeMs = consumeMs+produceMs+finishMs
    private double timeMs;

    // the size of rows output by the operation
    private long rows;
    // the peak memory consumption of the operator
    private double memoryKib;
    // the blocking time when the operator is running
    private double blockedMs;

    // the time that the operator waits to be scheduled
    private double queuedMs;
    // the time that the operator consumes the input data
    private double consumeMs;
    // the time that the operator generate the output data
    private double produceMs;
    // the time that the operator cost in the completion phase
    private double finishMs;

    // the batch number generated by the operator
    private long batches;
    // the concurrency of the operator
    private long concurrency;
    // other statistical information
    private String otherStatsJson;

    // the children plan info nodes.
    private List children;

    private final Charset charset = Charsets.UTF_8;

    protected PlanInfoNode(PlanInfo planInfo) {
        this.planInfo = planInfo;
        this.id = planInfo.getId().toString(charset);
        this.name = planInfo.getName().toString(charset);
        this.details = planInfo.getDetails().toString(charset);
        this.timeMs = planInfo.getTimeMs();
        this.rows = planInfo.getRows();
        this.memoryKib = planInfo.getMemoryKib();
        this.blockedMs = planInfo.getBlockedMs();
        this.queuedMs = planInfo.getQueuedMs();
        this.consumeMs = planInfo.getConsumeMs();
        this.produceMs = planInfo.getProduceMs();
        this.finishMs = planInfo.getFinishMs();
        this.batches = planInfo.getBatches();
        this.concurrency = planInfo.getConcurrency();
        this.otherStatsJson = planInfo.getOtherStatsJson().toString(charset);
        List planNodes = new ArrayList<>();
        for (PlanInfo plan : planInfo.getChildrenList()) {
            planNodes.add(new PlanInfoNode(plan));
        }
        this.children = planNodes;
    }

    public String getPlanId() {
        return id;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getDetails() {
        return details;
    }

    public double getTimeMs() {
        return timeMs;
    }

    public long getRows() {
        return rows;
    }

    public double getMemoryKib() {
        return memoryKib;
    }

    public double getBlockedMs() {
        return blockedMs;
    }

    public List getChildren() {
        return children;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy