Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public int find(String what, int start) {
return -1; // not found
} catch (CharacterCodingException e) {
// can't get here
e.printStackTrace();
LOG.warn("", e);
return -1;
}
}
Expand Down
6 changes: 3 additions & 3 deletions fe/fe-core/src/main/java/org/apache/doris/PaloFe.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static void start(String dorisHomeDir, String pidDir, String[] args, Star
Thread.sleep(2000);
}
} catch (Throwable e) {
e.printStackTrace();
LOG.warn("", e);
}
}

Expand Down Expand Up @@ -245,7 +245,7 @@ private static CommandLineOptions parseArgs(String[] args) {
try {
cmd = commandLineParser.parse(options, args);
} catch (final ParseException e) {
e.printStackTrace();
LOG.warn("", e);
System.err.println("Failed to parse command line. exit now");
System.exit(-1);
}
Expand Down Expand Up @@ -357,7 +357,7 @@ private static void checkCommandLineOptions(CommandLineOptions cmdLineOpts) {
System.out.println("Load image success. Image file " + cmdLineOpts.getImagePath() + " is valid");
} catch (Exception e) {
System.out.println("Load image failed. Image file " + cmdLineOpts.getImagePath() + " is invalid");
e.printStackTrace();
LOG.warn("", e);
} finally {
System.exit(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ public void analyze(Analyzer analyzer) throws UserException {
tableRef.setOnClause(expr.trySubstitute(mvSMap, analyzer, false));
}
} catch (Exception e) {
e.printStackTrace();
LOG.warn("", e);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ private void getClusterIdAndRole() throws IOException {
Thread.sleep(5000);
continue;
} catch (InterruptedException e) {
e.printStackTrace();
LOG.warn("", e);
System.exit(-1);
}
}
Expand Down Expand Up @@ -1362,7 +1362,7 @@ public void fixBugAfterMetadataReplayed(boolean waitCatalogReady) {
try {
Thread.sleep(10 * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
LOG.warn("", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
package org.apache.doris.clone;

import com.google.common.collect.Lists;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand All @@ -31,6 +33,7 @@
* A simple statistic of tablet checker and scheduler
*/
public class TabletSchedulerStat {
private static final Logger LOG = LogManager.getLogger(TabletSchedulerStat.class);

@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
Expand Down Expand Up @@ -132,7 +135,7 @@ private void snapshot() {
((AtomicLong) field.get(lastSnapshot)).set(((AtomicLong) field.get(this)).get());
}
} catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
LOG.warn("", e);
lastSnapshot = null;
}
}
Expand All @@ -157,7 +160,7 @@ public List<List<String>> getBrief() {
result.add(info);
}
} catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
LOG.warn("", e);
return Lists.newArrayList();
}
return result;
Expand All @@ -183,7 +186,7 @@ public String incrementalBrief() {
sb.append(current).append(" (+").append(current - last).append(")\n");
}
} catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
LOG.warn("", e);
return "";
}

Expand Down
2 changes: 1 addition & 1 deletion fe/fe-core/src/main/java/org/apache/doris/ha/BDBHA.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public boolean fencing() {
try {
Thread.sleep(2000);
} catch (InterruptedException e1) {
e1.printStackTrace();
LOG.warn("", e1);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import org.apache.doris.common.Log4jConfig;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.boot.logging.LogFile;
import org.springframework.boot.logging.LoggingInitializationContext;
Expand All @@ -34,7 +36,7 @@

@Component
public class ReadEnvironment implements ApplicationContextAware {

private static final Logger LOG = LogManager.getLogger(ReadEnvironment.class);
private ApplicationContext applicationContext;

@Override
Expand All @@ -59,7 +61,7 @@ public void reinitializeLoggingSystem() {
system.initialize(new LoggingInitializationContext(environment),
logConfig, logFile);
} catch (Exception ex) {
ex.printStackTrace();
LOG.warn("", ex);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -33,7 +35,7 @@
@RestController
@RequestMapping("/rest/v1")
public class ConfigController {

private static final Logger LOG = LogManager.getLogger(ConfigController.class);
private static final List<String> CONFIG_TABLE_HEADER = Lists.newArrayList("Name", "Value");

@RequestMapping(path = "/config/fe", method = RequestMethod.GET)
Expand All @@ -57,7 +59,7 @@ private void appendConfigureInfo(Map<String, Object> result) {
list.add(info);
}
} catch (Exception e) {
e.printStackTrace();
LOG.warn("", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import org.apache.doris.persist.Storage;
import org.apache.doris.system.Frontend;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -39,6 +41,7 @@
@RestController
@RequestMapping("/rest/v1")
public class HaController {
private static final Logger LOG = LogManager.getLogger(HaController.class);

@RequestMapping(path = "/ha", method = RequestMethod.GET)
public Object ha() {
Expand Down Expand Up @@ -145,7 +148,7 @@ private void appendImageInfo(Map<String, Object> result) {
result.put("CheckpointInfo", list);

} catch (IOException e) {
e.printStackTrace();
LOG.warn("", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ private void appendLogConf(Map<String, Map<String, String>> content) {
content.put("LogConfiguration", map);
} catch (IOException e) {
LOG.error(e);
e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.apache.doris.metric.SimpleCoreMetricVisitor;

import com.google.common.base.Strings;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -36,7 +38,7 @@
//fehost:port/metrics?type=core
@RestController
public class MetricsAction extends RestBaseController {

private static final Logger LOG = LogManager.getLogger(MetricsAction.class);
private static final String TYPE_PARAM = "type";

@RequestMapping(path = "/metrics")
Expand All @@ -58,7 +60,7 @@ public void execute(HttpServletRequest request, HttpServletResponse response) {
try {
response.getWriter().write(MetricRepo.getMetric(visitor));
} catch (IOException e) {
e.printStackTrace();
LOG.warn("", e);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ public void getFile(HttpServletRequest request, HttpServletResponse response, Ob
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
LOG.warn("", e);
}
}
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
LOG.warn("", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public void setup(File envHome, String selfNodeName, String selfNodeHostPort,
try {
Thread.sleep(5 * 1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
LOG.warn("", e1);
}
} else {
LOG.error("error to open replicated environment. will exit.", e);
Expand Down Expand Up @@ -341,7 +341,7 @@ public List<Long> getDatabaseNames() {
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
LOG.warn("", e1);
}
} catch (DatabaseException e) {
LOG.warn("catch an exception when calling getDatabaseNames", e);
Expand Down Expand Up @@ -420,7 +420,7 @@ public void openReplicatedEnvironment(File envHome) {
try {
Thread.sleep(5 * 1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
LOG.warn("", e1);
}
} else {
LOG.error("error to open replicated environment. will exit.", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public synchronized void write(short op, Writable writable) throws IOException {
try {
Thread.sleep(5 * 1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
LOG.warn("", e1);
}
}
}
Expand Down Expand Up @@ -230,7 +230,7 @@ public JournalEntity read(long journalId) {
try {
ret.readFields(in);
} catch (IOException e) {
e.printStackTrace();
LOG.warn("", e);
}
} else {
System.out.println("No record found for key '" + journalId + "'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import com.sleepycat.je.EnvironmentConfig;
import com.sleepycat.je.LockMode;
import com.sleepycat.je.OperationStatus;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;

Expand All @@ -44,7 +46,7 @@
import java.util.Map;

public class BDBTool {

private static final Logger LOG = LogManager.getLogger(BDBTool.class);
private String metaPath;
private BDBToolOptions options;

Expand All @@ -63,7 +65,7 @@ public boolean run() {
try {
env = new Environment(new File(metaPath), envConfig);
} catch (DatabaseException e) {
e.printStackTrace();
LOG.warn("", e);
System.err.println("Failed to open BDBJE env: " + Env.getCurrentEnv().getBdbDir() + ". exit");
return false;
}
Expand Down Expand Up @@ -129,7 +131,7 @@ public boolean run() {
}
}
} catch (Exception e) {
e.printStackTrace();
LOG.warn("", e);
System.err.println("Failed to run bdb tools");
return false;
}
Expand All @@ -152,7 +154,7 @@ private void getValueByKey(Database db, Long key)
try {
entity.readFields(in);
} catch (Exception e) {
e.printStackTrace();
LOG.warn("", e);
System.err.println("Fail to read journal entity for key: " + key + ". reason: " + e.getMessage());
System.exit(-1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@
import org.apache.doris.catalog.PrimitiveType;

import com.google.common.base.Strings;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;

// used for serialize memory data to byte stream of MySQL protocol
public class MysqlSerializer {
private static final Logger LOG = LogManager.getLogger(MysqlSerializer.class);
private ByteArrayOutputStream out;
private MysqlCapability capability;

Expand Down Expand Up @@ -134,7 +137,7 @@ public void writeLenEncodedString(String value) {
writeVInt(buf.length);
writeBytes(buf);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
LOG.warn("", e);
}
}

Expand All @@ -143,7 +146,7 @@ public void writeEofString(String value) {
byte[] buf = value.getBytes("UTF-8");
writeBytes(buf);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
LOG.warn("", e);
}
}

Expand All @@ -153,7 +156,7 @@ public void writeNulTerminateString(String value) {
writeBytes(buf);
writeByte((byte) 0);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
LOG.warn("", e);
}
}

Expand Down
Loading