diff --git a/cat-consumer/pom.xml b/cat-consumer/pom.xml
index edf4ccb3634a70bdc3e0fe6104c30cf463545994..cf441c8d8829f50ca1ac89ada4cc2a468b98f330 100644
--- a/cat-consumer/pom.xml
+++ b/cat-consumer/pom.xml
@@ -3,31 +3,31 @@
com.dianping.cat
parent
- 0.5.2.10
+ 0.6.0-SNAPSHOT
4.0.0
cat-consumer
CAT Consumer
-
- com.dianping.bee
- bee-engine
- 0.0.1-SNAPSHOT
-
com.dianping.cat
cat-hadoop
org.unidal.framework
- test-framework
- 2.0.2
- test
+ dal-jdbc
+ 2.0.1
+
+
+ com.alibaba.cobar
+ cobar-server
+ 1.3.0
org.unidal.framework
- dal-jdbc
- 2.0.1
+ test-framework
+ 2.0.2
+ test
com.google.code.gson
@@ -37,7 +37,6 @@
mysql
mysql-connector-java
- 5.1.20
runtime
diff --git a/cat-consumer/src/main/java/com/dianping/cat/consumer/build/ComponentsConfigurator.java b/cat-consumer/src/main/java/com/dianping/cat/consumer/build/ComponentsConfigurator.java
index fba4ff2c5afb0bf40cb86afbb21f7df894b5eb51..295f6c1f16ce6db8c4b5219cd00a08aa9caef298 100644
--- a/cat-consumer/src/main/java/com/dianping/cat/consumer/build/ComponentsConfigurator.java
+++ b/cat-consumer/src/main/java/com/dianping/cat/consumer/build/ComponentsConfigurator.java
@@ -100,12 +100,11 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
.req(BucketManager.class, ReportDao.class, TaskDao.class));
all.add(C(DumpAnalyzer.class).is(PER_LOOKUP) //
- .req(ServerConfigManager.class) //
- .req(DumpUploader.class)//
- .req(MessageBucketManager.class, LocalMessageBucketManager.ID).req(ServerStateManager.class));
+ .req(ServerConfigManager.class, DumpUploader.class, ServerStateManager.class) //
+ .req(MessageBucketManager.class, LocalMessageBucketManager.ID));
all.add(C(TopAnalyzer.class).is(PER_LOOKUP) //
- .req(BucketManager.class, ReportDao.class, TaskDao.class));
+ .req(BucketManager.class, ReportDao.class));
all.add(C(DumpUploader.class) //
.req(ServerConfigManager.class, FileSystemManager.class));
@@ -113,8 +112,8 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
all.add(C(Module.class, CatConsumerModule.ID, CatConsumerModule.class));
// database
- all.add(C(JdbcDataSourceConfigurationManager.class).config(
- E("datasourceFile").value("/data/appdatas/cat/datasources.xml")));
+ all.add(C(JdbcDataSourceConfigurationManager.class) //
+ .config(E("datasourceFile").value("/data/appdatas/cat/datasources.xml")));
all.addAll(new CatDatabaseConfigurator().defineComponents());
diff --git a/cat-consumer/src/main/java/com/dianping/cat/consumer/sql/SqlParseManager.java b/cat-consumer/src/main/java/com/dianping/cat/consumer/sql/SqlParseManager.java
index 00e8f33d7e6cf6e2374cb7e17e38e2ee2639b85f..e4b739b0aa0f767dba4bb744841b006963b6c27a 100644
--- a/cat-consumer/src/main/java/com/dianping/cat/consumer/sql/SqlParseManager.java
+++ b/cat-consumer/src/main/java/com/dianping/cat/consumer/sql/SqlParseManager.java
@@ -6,13 +6,13 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.unidal.dal.jdbc.DalException;
+import org.unidal.lookup.annotation.Inject;
+
import com.dainping.cat.consumer.dal.report.Sqltable;
import com.dainping.cat.consumer.dal.report.SqltableDao;
import com.dainping.cat.consumer.dal.report.SqltableEntity;
-import com.dianping.bee.engine.helper.SqlParsers;
import com.dianping.cat.Cat;
-import org.unidal.dal.jdbc.DalException;
-import org.unidal.lookup.annotation.Inject;
public class SqlParseManager {
@Inject
diff --git a/cat-consumer/src/main/java/com/dianping/cat/consumer/sql/SqlParsers.java b/cat-consumer/src/main/java/com/dianping/cat/consumer/sql/SqlParsers.java
new file mode 100644
index 0000000000000000000000000000000000000000..bcc8d66197f6e88f74e34c757d0f6de83b093036
--- /dev/null
+++ b/cat-consumer/src/main/java/com/dianping/cat/consumer/sql/SqlParsers.java
@@ -0,0 +1,91 @@
+package com.dianping.cat.consumer.sql;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.alibaba.cobar.parser.ast.expression.primary.Identifier;
+import com.alibaba.cobar.parser.ast.fragment.tableref.TableRefFactor;
+import com.alibaba.cobar.parser.ast.stmt.SQLStatement;
+import com.alibaba.cobar.parser.ast.stmt.dml.DMLDeleteStatement;
+import com.alibaba.cobar.parser.ast.stmt.dml.DMLInsertStatement;
+import com.alibaba.cobar.parser.recognizer.SQLParserDelegate;
+import com.alibaba.cobar.parser.visitor.EmptySQLASTVisitor;
+
+public class SqlParsers {
+ public static TableParser forTable() {
+ return new TableParser();
+ }
+
+ public static Escaper forEscape() {
+ return Escaper.INSTANCE;
+ }
+
+ public enum Escaper {
+ INSTANCE;
+
+ public String unescape(String str) {
+ if (str == null || str.length() < 2) {
+ return str;
+ }
+
+ int length = str.length();
+
+ if (str.charAt(0) == '`' && str.charAt(length - 1) == '`') {
+ return str.substring(1, length - 1);
+ } else if (str.charAt(0) == '\'' && str.charAt(length - 1) == '\'') {
+ return str.substring(1, length - 1);
+ } else {
+ return str;
+ }
+ }
+ }
+
+ public static class TableParser extends EmptySQLASTVisitor {
+ private List m_tables = new ArrayList(3);
+
+ public List parse(String sql) {
+ try {
+ SQLStatement statement = SQLParserDelegate.parse(sql);
+
+ statement.accept(this);
+ return m_tables;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public void visit(DMLDeleteStatement node) {
+ for (Identifier tableIdentifier : node.getTableNames()) {
+ String table = tableIdentifier.getIdText();
+
+ if (!m_tables.contains(table)) {
+ m_tables.add(table);
+ }
+ }
+
+ super.visit(node);
+ }
+
+ @Override
+ public void visit(DMLInsertStatement node) {
+ Identifier tableIdentifier = node.getTable();
+ String table = tableIdentifier.getIdText();
+
+ if (!m_tables.contains(table)) {
+ m_tables.add(table);
+ }
+
+ super.visit(node);
+ }
+
+ @Override
+ public void visit(TableRefFactor node) {
+ String table = node.getTable().getIdText();
+
+ if (!m_tables.contains(table)) {
+ m_tables.add(table);
+ }
+ }
+ }
+}
diff --git a/cat-consumer/src/main/java/com/dianping/cat/consumer/top/TopAnalyzer.java b/cat-consumer/src/main/java/com/dianping/cat/consumer/top/TopAnalyzer.java
index edf6f36ee1fc19e3c486d5e2018495574fd103c9..0ffaf6be20c61f933f5088a4c47353f0920b593c 100644
--- a/cat-consumer/src/main/java/com/dianping/cat/consumer/top/TopAnalyzer.java
+++ b/cat-consumer/src/main/java/com/dianping/cat/consumer/top/TopAnalyzer.java
@@ -12,7 +12,6 @@ import org.unidal.lookup.annotation.Inject;
import com.dainping.cat.consumer.dal.report.Report;
import com.dainping.cat.consumer.dal.report.ReportDao;
-import com.dainping.cat.consumer.dal.report.TaskDao;
import com.dianping.cat.Cat;
import com.dianping.cat.configuration.NetworkInterfaceManager;
import com.dianping.cat.consumer.problem.ProblemAnalyzer;
@@ -39,9 +38,6 @@ public class TopAnalyzer extends AbstractMessageAnalyzer implements L
@Inject
private ReportDao m_reportDao;
- @Inject
- private TaskDao m_taskDao;
-
private TransactionAnalyzer m_transactionAnalyzer;
private ProblemAnalyzer m_problemAnalyzer;
diff --git a/cat-core/pom.xml b/cat-core/pom.xml
index 8c23dd5640cacf7d0e006dd3f54bc4cef7bed454..135a714fb24587a20d6e3d5b4e8378f8e36a0f55 100644
--- a/cat-core/pom.xml
+++ b/cat-core/pom.xml
@@ -4,7 +4,7 @@
com.dianping.cat
parent
- 0.5.2.10
+ 0.6.0-SNAPSHOT
4.0.0
cat-core
diff --git a/cat-hadoop/pom.xml b/cat-hadoop/pom.xml
index 6aa3e73a4fa3f7c17f6b62c39eedd90c7742334a..7211a5b8dc9f08c330cf6dd21dc31f27d458acf9 100644
--- a/cat-hadoop/pom.xml
+++ b/cat-hadoop/pom.xml
@@ -4,7 +4,7 @@
com.dianping.cat
parent
- 0.5.2.10
+ 0.6.0-SNAPSHOT
4.0.0
cat-hadoop
@@ -14,16 +14,6 @@
com.dianping.cat
cat-core
-
- org.unidal.framework
- dal-jdbc
- 2.0.1
-
-
- mysql
- mysql-connector-java
- runtime
-
org.apache.hadoop
hadoop-core
@@ -47,11 +37,6 @@
-
- org.codehaus.jackson
- jackson-mapper-asl
- 1.9.4
-
junit
junit
diff --git a/cat-home/pom.xml b/cat-home/pom.xml
index e30315d0071bc1af358ad412c4a86fd4b281c0db..2a1f4d5527d89435182ebc7920cb4d536b021145 100755
--- a/cat-home/pom.xml
+++ b/cat-home/pom.xml
@@ -3,7 +3,7 @@
com.dianping.cat
parent
- 0.5.2.10
+ 0.6.0-SNAPSHOT
4.0.0
cat-home
@@ -59,10 +59,14 @@
WebResServer
1.2.0
+
+ org.unidal.framework
+ web-framework
+ 2.0.2
+
javax.servlet
servlet-api
- 2.5
provided
@@ -79,7 +83,6 @@
org.mortbay.jetty
jsp-2.1
- 6.1.14
provided
@@ -95,25 +98,18 @@
junit
junit
- 4.8.1
test
org.mortbay.jetty
jetty
- 6.1.14
test
-
- org.unidal.framework
- web-framework
- 2.0.2
-
org.unidal.framework
test-framework
- ${test-framework.scope}
2.0.2
+ test
@@ -202,49 +198,10 @@
-
-
-
- maven-compiler-plugin
- 2.3.2
-
- 1.6
- 1.6
-
-
-
- maven-eclipse-plugin
- 2.8
-
- true
- none
-
-
- .settings/org.eclipse.jdt.core.prefs
-
-
-
-
-
-
-
war
alpha
- test
utf-8
diff --git a/cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml b/cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
index 69ad14c9bb41d797c73cea2405a94b57ee2df7d1..efce60b77e8b92b02ba7c103e8ce4f1c83b92a8c 100755
--- a/cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
+++ b/cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
@@ -1,6 +1,6 @@
-
+
Home Page
diff --git a/pom.xml b/pom.xml
index e53e7413b372201f8b8adb1700794fea11d20dcf..19a408917957b4900c67d957badaae139b53e206 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
com.dianping.cat
parent
- 0.5.2.10
+ 0.6.0-SNAPSHOT
arch-cat
Central Application Tracking
pom
@@ -46,6 +46,12 @@
jetty-util
6.1.14
+
+ org.mortbay.jetty
+ jsp-api-2.1
+ 6.1.14
+ provided
+
org.mortbay.jetty
jsp-2.1
@@ -101,11 +107,7 @@
**/AllTests.java
-
+
@@ -120,7 +122,7 @@
2.8
true
- none
+ none
.settings/org.eclipse.jdt.core.prefs
@@ -161,12 +163,6 @@ org.eclipse.jdt.core.compiler.compliance=1.6
-
-
- dianping.repo
- http://192.168.8.45:8080/artifactory/dianping-releases
-
-
utf-8