Skip to content

Commit

Permalink
[refactor](profile) Remove profile tree printer code (apache#41766)
Browse files Browse the repository at this point in the history
Code used to print profile as tree is deleted.
ProfileManager is moved to profile dir.
  • Loading branch information
zhiqiang-hhhh authored and zhiqiang-hhhh committed Nov 8, 2024
1 parent efc2ec5 commit 5ba2cfb
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 1,165 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.doris.common.Config;
import org.apache.doris.common.io.Text;
import org.apache.doris.common.util.DebugUtil;
import org.apache.doris.common.util.ProfileManager;
import org.apache.doris.common.util.RuntimeProfile;
import org.apache.doris.nereids.NereidsPlanner;
import org.apache.doris.nereids.trees.plans.AbstractPlan;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,16 @@
// specific language governing permissions and limitations
// under the License.

package org.apache.doris.common.util;
package org.apache.doris.common.profile;

import org.apache.doris.catalog.Env;
import org.apache.doris.common.AnalysisException;
import org.apache.doris.common.AuthenticationException;
import org.apache.doris.common.ClientPool;
import org.apache.doris.common.Config;
import org.apache.doris.common.DdlException;
import org.apache.doris.common.ThreadPoolManager;
import org.apache.doris.common.profile.ExecutionProfile;
import org.apache.doris.common.profile.MultiProfileTreeBuilder;
import org.apache.doris.common.profile.Profile;
import org.apache.doris.common.profile.ProfileTreeBuilder;
import org.apache.doris.common.profile.ProfileTreeNode;
import org.apache.doris.common.profile.SummaryProfile;
import org.apache.doris.common.util.DebugUtil;
import org.apache.doris.common.util.MasterDaemon;
import org.apache.doris.load.loadv2.LoadJob;
import org.apache.doris.nereids.stats.StatsErrorEstimator;
import org.apache.doris.qe.CoordInterface;
Expand Down Expand Up @@ -90,7 +85,6 @@ public ProfileElement(Profile profile) {

private final Profile profile;
public Map<String, String> infoStrings = Maps.newHashMap();
public MultiProfileTreeBuilder builder = null;
public String errMsg = "";

public StatsErrorEstimator statsErrorEstimator;
Expand Down Expand Up @@ -443,67 +437,6 @@ public void checkAuthByUserAndQueryId(String user, String queryId) throws Authen
}
}

public ProfileTreeNode getFragmentProfileTree(String queryID, String executionId) throws AnalysisException {
MultiProfileTreeBuilder builder;
readLock.lock();
try {
ProfileElement element = queryIdToProfileMap.get(queryID);
if (element == null || element.builder == null) {
throw new AnalysisException("failed to get fragment profile tree. err: "
+ (element == null ? "not found" : element.errMsg));
}
builder = element.builder;
} finally {
readLock.unlock();
}
return builder.getFragmentTreeRoot(executionId);
}

public ProfileTreeNode getInstanceProfileTree(String queryID, String executionId,
String fragmentId, String instanceId)
throws AnalysisException {
MultiProfileTreeBuilder builder;
readLock.lock();
try {
ProfileElement element = queryIdToProfileMap.get(queryID);
if (element == null || element.builder == null) {
throw new AnalysisException("failed to get instance profile tree. err: "
+ (element == null ? "not found" : element.errMsg));
}
builder = element.builder;
} finally {
readLock.unlock();
}

return builder.getInstanceTreeRoot(executionId, fragmentId, instanceId);
}

// Return the tasks info of the specified load job
// Columns: TaskId, ActiveTime
public List<List<String>> getLoadJobTaskList(String jobId) throws AnalysisException {
MultiProfileTreeBuilder builder = getMultiProfileTreeBuilder(jobId);
return builder.getSubTaskInfo();
}

public List<ProfileTreeBuilder.FragmentInstances> getFragmentsAndInstances(String queryId)
throws AnalysisException {
return getMultiProfileTreeBuilder(queryId).getFragmentInstances(queryId);
}

private MultiProfileTreeBuilder getMultiProfileTreeBuilder(String jobId) throws AnalysisException {
readLock.lock();
try {
ProfileElement element = queryIdToProfileMap.get(jobId);
if (element == null || element.builder == null) {
throw new AnalysisException("failed to get task ids. err: "
+ (element == null ? "not found" : element.errMsg));
}
return element.builder;
} finally {
readLock.unlock();
}
}

public String getQueryIdByTraceId(String traceId) {
readLock.lock();
try {
Expand Down
Loading

0 comments on commit 5ba2cfb

Please sign in to comment.