From b99757c0b3c06277a49eff41b8760bcbba757c5a Mon Sep 17 00:00:00 2001 From: Sungkwan Kim Date: Wed, 17 Dec 2014 20:36:48 +0900 Subject: [PATCH] convert comments in English --- .../ContextClassLoaderExecuteTemplate.java | 8 ++-- .../pinpoint/bootstrap/PinpointBootStrap.java | 37 ++++++++++--------- .../config/ProfilableClassFilter.java | 2 +- .../bootstrap/config/ProfilerConfig.java | 15 ++++---- .../bootstrap/context/RecordableTrace.java | 2 + .../collector/AgentStatDataCollector.java | 2 +- .../MapStatisticsCallerDataCollector.java | 2 +- .../collector/ResponseTimeDataCollector.java | 2 +- .../applicationmap/ApplicationMapBuilder.java | 1 - 9 files changed, 38 insertions(+), 33 deletions(-) diff --git a/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/ContextClassLoaderExecuteTemplate.java b/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/ContextClassLoaderExecuteTemplate.java index 6cde20ccf..cfcd1a6b0 100644 --- a/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/ContextClassLoaderExecuteTemplate.java +++ b/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/ContextClassLoaderExecuteTemplate.java @@ -3,7 +3,8 @@ package com.navercorp.pinpoint.bootstrap; import java.util.concurrent.Callable; /** - * contextClassLoader에 별도의 classLoader를 세팅하고 실행하는 template + * This template is used for changing the current thread's classloader to assigned one and execute callable. + * * @author emeroad */ public class ContextClassLoaderExecuteTemplate { @@ -24,8 +25,9 @@ public class ContextClassLoaderExecuteTemplate { try { return callable.call(); } finally { - // null일 경우도 다시 원복하는게 맞음. - // getContextClassLoader 호출시 에러가 발생하였을 경우 여기서 호출당하지 않으므로 이부분에서 원복하는게 맞음. + // even though the before classloader is null, rollback is needed. + // if an exception occurs before callable.call(), the call flow can't reach here. + // so rollback here is right. currentThread.setContextClassLoader(before); } } catch (BootStrapException ex){ diff --git a/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/PinpointBootStrap.java b/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/PinpointBootStrap.java index d482118aa..aacf99cc0 100644 --- a/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/PinpointBootStrap.java +++ b/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/PinpointBootStrap.java @@ -38,8 +38,9 @@ public class PinpointBootStrap { } final boolean duplicated = checkDuplicateLoadState(); if (duplicated) { - // 중복 케이스는 내가 처리하면 안됨. 아래와 같은 코드는 없어야 한다. - //loadStateChange(BOOT_STRAP_LOAD_STATE_ERROR); + // Don't handle the duplicated state. Don't use it as bellow. + + //changeLoadState(BOOT_STRAP_LOAD_STATE_ERROR); logPinpointAgentLoadFail(); return; } @@ -47,56 +48,56 @@ public class PinpointBootStrap { ClassPathResolver classPathResolver = new ClassPathResolver(); boolean agentJarNotFound = classPathResolver.findAgentJar(); if (!agentJarNotFound) { - // TODO 이거 변경해야 함. + // TODO must modify this logger.severe("pinpoint-bootstrap-x.x.x.jar not found."); - loadStateChange(BOOT_STRAP_LOAD_STATE_ERROR); + changeLoadState(BOOT_STRAP_LOAD_STATE_ERROR); logPinpointAgentLoadFail(); return; } if (!isValidId("pinpoint.agentId", PinpointConstants.AGENT_NAME_MAX_LEN)) { - loadStateChange(BOOT_STRAP_LOAD_STATE_ERROR); + changeLoadState(BOOT_STRAP_LOAD_STATE_ERROR); logPinpointAgentLoadFail(); return; } if (!isValidId("pinpoint.applicationName", PinpointConstants.APPLICATION_NAME_MAX_LEN)) { - loadStateChange(BOOT_STRAP_LOAD_STATE_ERROR); + changeLoadState(BOOT_STRAP_LOAD_STATE_ERROR); logPinpointAgentLoadFail(); return; } String configPath = getConfigPath(classPathResolver); if (configPath == null ) { - loadStateChange(BOOT_STRAP_LOAD_STATE_ERROR); - // 설정파일을 못찾으므로 종료. + changeLoadState(BOOT_STRAP_LOAD_STATE_ERROR); logPinpointAgentLoadFail(); return; } - // 로그가 저장될 위치를 시스템 properties로 저장한다. + + // set the path of log file as a system property saveLogFilePath(classPathResolver); try { - // 설정파일 로드 이게 bootstrap에 있어야 되나는게 맞나? + // Is it right to load the configuration in the bootstrap? ProfilerConfig profilerConfig = ProfilerConfig.load(configPath); - // 이게 로드할 lib List임. + // this is the library list that must be loaded List libUrlList = resolveLib(classPathResolver); AgentClassLoader agentClassLoader = new AgentClassLoader(libUrlList.toArray(new URL[libUrlList.size()])); agentClassLoader.setBootClass(BOOT_CLASS); logger.info("pinpoint agent start."); agentClassLoader.boot(classPathResolver.getAgentDirPath(), agentArgs, instrumentation, profilerConfig); logger.info("pinpoint agent start success."); - loadStateChange(BOOT_STRAP_LOAD_STATE_COMPLETE); + changeLoadState(BOOT_STRAP_LOAD_STATE_COMPLETE); } catch (Exception e) { + // unexpected exception that did not be checked above logger.log(Level.SEVERE, ProductInfo.CAMEL_NAME + " start fail. Caused:" + e.getMessage(), e); - // 위에서 리턴하는거에서 세는게 이 - loadStateChange(BOOT_STRAP_LOAD_STATE_ERROR); + changeLoadState(BOOT_STRAP_LOAD_STATE_ERROR); logPinpointAgentLoadFail(); } } - private static void loadStateChange(String loadState) { + private static void changeLoadState(String loadState) { System.setProperty(BOOT_STRAP_LOAD_STATE, loadState); } @@ -111,7 +112,7 @@ public class PinpointBootStrap { private static boolean checkDuplicateLoadState() { final String exist = System.getProperty(BOOT_STRAP_LOAD_STATE); if (exist == null) { - loadStateChange(BOOT_STRAP_LOAD_STATE_LOADING); + changeLoadState(BOOT_STRAP_LOAD_STATE_LOADING); } else { if (logger.isLoggable(Level.SEVERE)) { logger.severe("pinpoint-bootstrap already started. skip agent loading. loadState:" + exist); @@ -128,7 +129,7 @@ public class PinpointBootStrap { logger.severe("-D" + propertyName + " is null. value:null"); return false; } - // 문자열 앞뒤에 공백은 허용되지 않음. + // blanks not permitted around value value = value.trim(); if (value.isEmpty()) { logger.severe("-D" + propertyName + " is empty. value:''"); @@ -182,7 +183,7 @@ public class PinpointBootStrap { private static List resolveLib(ClassPathResolver classPathResolver) { - // 절대경로만 처리되지 않나함. 상대 경로(./../agentlib/lib등)일 경우의 처리가 있어야 될것 같음. + // this method may handle only absolute path, need to handle relative path (./..agentlib/lib) String agentJarFullPath = classPathResolver.getAgentJarFullPath(); String agentLibPath = classPathResolver.getAgentLibPath(); List urlList = classPathResolver.resolveLib(); diff --git a/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/config/ProfilableClassFilter.java b/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/config/ProfilableClassFilter.java index df094ca79..eda0c2593 100644 --- a/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/config/ProfilableClassFilter.java +++ b/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/config/ProfilableClassFilter.java @@ -27,7 +27,7 @@ public class ProfilableClassFilter implements Filter { } /** - * TODO remove this. 테스트 장비에서 call stack view가 잘 보이는지 테스트 하려고 추가함. + * TODO remove this. Added this method to test the "call stack view" on a test server * * @param className * @return diff --git a/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/config/ProfilerConfig.java b/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/config/ProfilerConfig.java index 3041e8702..7c033f99b 100644 --- a/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/config/ProfilerConfig.java +++ b/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/config/ProfilerConfig.java @@ -558,7 +558,7 @@ public class ProfilerConfig { // fortest void readPropertyValues() { - // TODO : use Properties defaultvalue instead of using temp variable. + // TODO : use Properties's defaultvalue instead of using temp variable. final ValueResolver placeHolderResolver = new PlaceHolderResolver(); this.profileEnable = readBoolean("profiler.enable", true); @@ -673,7 +673,7 @@ public class ProfilerConfig { this.nbaseArcPipeline = readBoolean("profiler.nbase_arc.pipeline", true); // - // FIXME 임시용, line game netty configuration + // FIXME For temporary, netty configuration of Line Game // this.lineGameNettyParamDumpSize = readInt("profiler.line.game.netty.param.dumpsize", 512); this.lineGameNettyEntityDumpSize = readInt("profiler.line.game.netty.entity.dumpsize", 512); @@ -690,7 +690,7 @@ public class ProfilerConfig { this.samplingEnable = readBoolean("profiler.sampling.enable", true); this.samplingRate = readInt("profiler.sampling.rate", 1); - // 샘플링 + io 조절 bufferSize 결정 + // configuration for sampling and IO buffer this.ioBufferingEnable = readBoolean("profiler.io.buffering.enable", true); // 버퍼 사이즈는 여기에 있는것은 문제가 있는것도 같음. 설정 조정의 필요성이 있음. this.ioBufferingBufferSize = readInt("profiler.io.buffering.buffersize", 20); @@ -703,10 +703,11 @@ public class ProfilerConfig { // service type this.applicationServerType = readServiceType("profiler.applicationservertype"); - // profile package include - // TODO 제거, 서비스 적용에 call stack view가 잘 보이는지 테스트하려고 추가함. - // 수집 데이터 크기 문제로 실 서비스에서는 사용 안함. - // 나중에 필요에 따라 정규식으로 바꿔도 되고... + + // TODO have to remove + // profile package include to test "call stack view". + // this config must not be used in service environment because the size of profiling information get heavy. + // We need change configuration to regular expression. final String profileableClass = readString("profiler.include", ""); if (!profileableClass.isEmpty()) { this.profilableClassFilter = new ProfilableClassFilter(profileableClass); diff --git a/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/context/RecordableTrace.java b/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/context/RecordableTrace.java index 40408086d..df1822437 100644 --- a/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/context/RecordableTrace.java +++ b/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/context/RecordableTrace.java @@ -68,6 +68,8 @@ public interface RecordableTrace { * 이 데이터는 서버맵에서 WAS끼리 호출관계를 알아낼 떄 필요하다. * * @param host host 값은 WAS를 호출한 URL상의 host를 가져와야 한다. + * + * WAS_A -> WAS_B */ void recordAcceptorHost(String host); diff --git a/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/AgentStatDataCollector.java b/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/AgentStatDataCollector.java index fe4b25096..d3c18c6d6 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/AgentStatDataCollector.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/AgentStatDataCollector.java @@ -22,7 +22,7 @@ public class AgentStatDataCollector extends DataCollector { private final ApplicationIndexDao applicationIndexDao; private final long timeSlotEndTime; private final long slotInterval; - private final AtomicBoolean init =new AtomicBoolean(false);// 동시에 checker들이 동작 되면 동시성 고려가 필요함 + private final AtomicBoolean init =new AtomicBoolean(false); // need to consider the concurrency situation when checkers start simultaneously. private final Map agentHeapUsageRate = new HashMap(); private final Map agentGcCount = new HashMap(); diff --git a/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/MapStatisticsCallerDataCollector.java b/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/MapStatisticsCallerDataCollector.java index 6d7f323d6..52aae1cdb 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/MapStatisticsCallerDataCollector.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/MapStatisticsCallerDataCollector.java @@ -24,7 +24,7 @@ public class MapStatisticsCallerDataCollector extends DataCollector { private long timeSlotEndTime; private long slotInterval; private Map calleStatMap = new HashMap(); - private final AtomicBoolean init =new AtomicBoolean(false);// 동시에 checker들이 동작 되면 동시성 고려가 필요함 + private final AtomicBoolean init =new AtomicBoolean(false); // need to consider the concurrency situation when checkers start simultaneously. public MapStatisticsCallerDataCollector(DataCollectorCategory category, Application application, MapStatisticsCallerDao mapStatisticsCallerDao, long timeSlotEndTime, long slotInterval) { super(category); diff --git a/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/ResponseTimeDataCollector.java b/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/ResponseTimeDataCollector.java index d511caaab..ce0084828 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/ResponseTimeDataCollector.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/alarm/collector/ResponseTimeDataCollector.java @@ -20,7 +20,7 @@ public class ResponseTimeDataCollector extends DataCollector { private final MapResponseDao responseDao; private final long timeSlotEndTime; private final long slotInterval; - private final AtomicBoolean init =new AtomicBoolean(false);// 동시에 checker들이 동작 되면 동시성 고려가 필요함 + private final AtomicBoolean init =new AtomicBoolean(false); // need to consider the concurrency situation when checkers start simultaneously. private long slowCount = 0; private long errorCount = 0; diff --git a/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ApplicationMapBuilder.java b/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ApplicationMapBuilder.java index 117054c52..b7ab7f8f8 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ApplicationMapBuilder.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/ApplicationMapBuilder.java @@ -48,7 +48,6 @@ public class ApplicationMapBuilder { appendNodeResponseTime(nodeList, linkList, nodeHistogramDataSource); - // agentInfo를 넣는다. appendAgentInfo(nodeList, linkDataDuplexMap, agentInfoService); final ApplicationMap map = new ApplicationMap(range, nodeList, linkList);