提交 48b33626 编写于 作者: Y You Yong

modify the remeteId

上级 66be725b
......@@ -84,7 +84,7 @@ public class RemoteIdChannelManager extends ContainerHolder implements Initializ
public void initialize() throws InitializationException {
ServerConfigManager configManager = lookup(ServerConfigManager.class);
m_baseDir = configManager.getHdfsLocalBaseDir("dump");
m_baseDir = configManager.getHdfsLocalBaseDir("remote");
}
private RemoteIdChannel makeChannel(String key, String path, long startTime) throws IOException {
......
......@@ -65,7 +65,7 @@ public class RemoteIdUploader implements Initializable, LogEnabled {
m_localMode = m_configManager.isLocalMode();
if (!m_localMode) {
m_baseDir = m_configManager.getHdfsLocalBaseDir("dump");
m_baseDir = m_configManager.getHdfsLocalBaseDir("remote");
}
}
......@@ -125,7 +125,7 @@ public class RemoteIdUploader implements Initializable, LogEnabled {
private FSDataOutputStream makeHdfsOutputStream(String path) throws IOException {
StringBuilder baseDir = new StringBuilder(32);
FileSystem fs = m_fileSystemManager.getFileSystem("dump", baseDir);
FileSystem fs = m_fileSystemManager.getFileSystem("remote", baseDir);
Path file = new Path(baseDir.toString(), path);
FSDataOutputStream out = fs.create(file);
return out;
......@@ -147,7 +147,7 @@ public class RemoteIdUploader implements Initializable, LogEnabled {
root.addData("file", file);
root.setStatus(Message.SUCCESS);
Transaction t = cat.newTransaction("Task", "UploadDump");
Transaction t = cat.newTransaction("Task", "UploadRemoteIds");
t.addData("file", path);
......
......@@ -202,14 +202,13 @@ public class ServerConfigManager implements Initializable, LogEnabled {
m_logger.warn("CAT server is running in LOCAL mode! No HDFS or MySQL will be accessed!");
}
Threads.forGroup("Cat").start(new ServerConfigReloader(configFile));
//Threads.forGroup("Cat").start(new ServerConfigReloader(configFile));
}
public boolean isLocalMode() {
if (m_config != null) {
return m_config.isLocalMode();
} else {
System.out.println("Config is Null!!!->>>>>>>>>>>>>>>>>>>>>>>>>>>>");
return true;
}
}
......
......@@ -98,7 +98,7 @@ public class DisplayMatrix {
return (int) (o2.getSqlAvg() * 100 - o1.getSqlAvg() * 100);
}
if (m_sort.equalsIgnoreCase("SqlAvgTotalTime")) {
return o2.getSqlTime() - o1.getCacheMin();
return o2.getSqlTime() - o1.getSqlTime();
}
if (m_sort.equalsIgnoreCase("SqlTimePercent")) {
return (int) (o2.getSqlTimePercent() * 100 - o1.getSqlTimePercent() * 100);
......@@ -113,7 +113,7 @@ public class DisplayMatrix {
return (int) (o2.getCacheAvg() * 100 - o1.getCacheAvg() * 100);
}
if (m_sort.equalsIgnoreCase("CacheAvgTotalTime")) {
return o2.getCacheTime() - o1.getCacheMin();
return o2.getCacheTime() - o1.getCacheTime();
}
if (m_sort.equalsIgnoreCase("CacheTimePercent")) {
return (int) (o2.getCacheTimePercent() * 100 - o1.getCacheTimePercent() * 100);
......@@ -181,7 +181,9 @@ public class DisplayMatrix {
if (matrix.getCount() > 0) {
m_cacheAvg = (double) ratio.getTotalCount() / (double) matrix.getCount();
}
m_cacheTime = (int) (ratio.getTotalTime() / 1000);
if (m_cacheAvg > 0) {
m_cacheTime = (int) ((double)ratio.getTotalTime() / 1000 / m_cacheAvg / m_count);
}
if (matrix.getTotalTime() > 0) {
m_cacheTimePercent = (double) ratio.getTotalTime() / (double) (matrix.getTotalTime());
}
......@@ -194,7 +196,9 @@ public class DisplayMatrix {
if (matrix.getCount() > 0) {
m_sqlAvg = (double) ratio.getTotalCount() / (double) matrix.getCount();
}
m_sqlTime = (int) (ratio.getTotalTime() / 1000);
if (m_sqlAvg > 0) {
m_sqlTime = (int) ((double)ratio.getTotalTime() / 1000 / m_sqlAvg / m_count);
}
if (matrix.getTotalTime() > 0) {
m_sqlTimePercent = (double) ratio.getTotalTime() / (double) (matrix.getTotalTime());
}
......@@ -207,7 +211,9 @@ public class DisplayMatrix {
if (matrix.getCount() > 0) {
m_callAvg = (double) ratio.getTotalCount() / (double) matrix.getCount();
}
m_callTime = (int) (ratio.getTotalTime() / 1000);
if (m_callAvg > 0) {
m_callTime = (int) ((double)ratio.getTotalTime() / 1000 / m_callAvg / m_count);
}
if (matrix.getTotalTime() > 0) {
m_callTimePercent = (double) ratio.getTotalTime() / (double) (matrix.getTotalTime());
}
......
......@@ -31,7 +31,6 @@ public abstract class BaseHistoricalModelService<T> extends ModelServiceWithCalS
ServerConfigManager manager = lookup(ServerConfigManager.class);
m_localMode = manager.isLocalMode();
System.out.println(this.getClass().getName() + ">>>>>>>>>>>>>>>>Local Mode :" +m_localMode);
}
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册