[improve](proc) Show journal size in bdbje journal dir (#29314)
This commit is contained in:
@ -29,7 +29,7 @@ import com.google.common.collect.Lists;
|
||||
public class BdbjeJournalDataProcNode implements ProcNodeInterface {
|
||||
|
||||
public static final ImmutableList<String> TITLE_NAMES = new ImmutableList.Builder<String>()
|
||||
.add("JournalId").add("OpType").add("Data").build();
|
||||
.add("JournalId").add("OpType").add("Size").add("Data").build();
|
||||
|
||||
private String dbName;
|
||||
private Long journalId;
|
||||
@ -53,7 +53,8 @@ public class BdbjeJournalDataProcNode implements ProcNodeInterface {
|
||||
|
||||
short opCode = entity.entity == null ? -1 : entity.entity.getOpCode();
|
||||
String data = entity.entity == null ? entity.errMsg : entity.entity.getData().toString();
|
||||
result.addRow(Lists.newArrayList(entity.journalId.toString(), OperationType.getOpName(opCode), data));
|
||||
result.addRow(Lists.newArrayList(entity.journalId.toString(),
|
||||
OperationType.getOpName(opCode), entity.size.toString(), data));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -212,6 +212,7 @@ public class BDBDebugger {
|
||||
db.close();
|
||||
if (status == OperationStatus.SUCCESS) {
|
||||
byte[] retData = value.getData();
|
||||
entityWrapper.size = retData.length;
|
||||
DataInputStream in = new DataInputStream(new ByteArrayInputStream(retData));
|
||||
JournalEntity entity = new JournalEntity();
|
||||
try {
|
||||
@ -240,6 +241,7 @@ public class BDBDebugger {
|
||||
|
||||
public static class JournalEntityWrapper {
|
||||
public Long journalId;
|
||||
public Integer size;
|
||||
public JournalEntity entity;
|
||||
public String errMsg;
|
||||
|
||||
|
||||
@ -30,6 +30,7 @@ import org.apache.doris.catalog.Env;
|
||||
import org.apache.doris.catalog.TableIf;
|
||||
import org.apache.doris.cluster.ClusterNamespace;
|
||||
import org.apache.doris.common.AnalysisException;
|
||||
import org.apache.doris.common.Config;
|
||||
import org.apache.doris.common.DdlException;
|
||||
import org.apache.doris.common.ErrorCode;
|
||||
import org.apache.doris.common.NotImplementedException;
|
||||
@ -161,6 +162,9 @@ public abstract class ConnectProcessor {
|
||||
|
||||
protected void auditAfterExec(String origStmt, StatementBase parsedStmt,
|
||||
Data.PQueryStatistics statistics, boolean printFuzzyVariables) {
|
||||
if (Config.enable_bdbje_debug_mode) {
|
||||
return;
|
||||
}
|
||||
AuditLogHelper.logAuditLog(ctx, origStmt, parsedStmt, statistics, printFuzzyVariables);
|
||||
}
|
||||
|
||||
|
||||
@ -356,6 +356,10 @@ public class StmtExecutor {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Config.enable_bdbje_debug_mode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// this is a query stmt, but this non-master FE can not read, forward it to master
|
||||
if (isQuery() && !Env.getCurrentEnv().isMaster()
|
||||
&& !Env.getCurrentEnv().canRead()) {
|
||||
|
||||
Reference in New Issue
Block a user