提交 0fa282e3 编写于 作者: F Frankie Wu

remove bee-engine dependency

上级 a11e65db
......@@ -3,31 +3,31 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.5.2.10</version>
<version>0.6.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-consumer</artifactId>
<name>CAT Consumer</name>
<dependencies>
<dependency>
<groupId>com.dianping.bee</groupId>
<artifactId>bee-engine</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.dianping.cat</groupId>
<artifactId>cat-hadoop</artifactId>
</dependency>
<dependency>
<groupId>org.unidal.framework</groupId>
<artifactId>test-framework</artifactId>
<version>2.0.2</version>
<scope>test</scope>
<artifactId>dal-jdbc</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>com.alibaba.cobar</groupId>
<artifactId>cobar-server</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.unidal.framework</groupId>
<artifactId>dal-jdbc</artifactId>
<version>2.0.1</version>
<artifactId>test-framework</artifactId>
<version>2.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
......@@ -37,7 +37,6 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.20</version>
<scope>runtime</scope>
</dependency>
</dependencies>
......
......@@ -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());
......
......@@ -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
......
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<String> m_tables = new ArrayList<String>(3);
public List<String> 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);
}
}
}
}
......@@ -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<TopReport> implements L
@Inject
private ReportDao m_reportDao;
@Inject
private TaskDao m_taskDao;
private TransactionAnalyzer m_transactionAnalyzer;
private ProblemAnalyzer m_problemAnalyzer;
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.5.2.10</version>
<version>0.6.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-core</artifactId>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.5.2.10</version>
<version>0.6.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-hadoop</artifactId>
......@@ -14,16 +14,6 @@
<groupId>com.dianping.cat</groupId>
<artifactId>cat-core</artifactId>
</dependency>
<dependency>
<groupId>org.unidal.framework</groupId>
<artifactId>dal-jdbc</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
......@@ -47,11 +37,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
......
......@@ -3,7 +3,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.5.2.10</version>
<version>0.6.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-home</artifactId>
......@@ -59,10 +59,14 @@
<artifactId>WebResServer</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.unidal.framework</groupId>
<artifactId>web-framework</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
......@@ -79,7 +83,6 @@
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1</artifactId>
<version>6.1.14</version>
<scope>provided</scope>
</dependency>
<dependency>
......@@ -95,25 +98,18 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.14</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.unidal.framework</groupId>
<artifactId>web-framework</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.unidal.framework</groupId>
<artifactId>test-framework</artifactId>
<scope>${test-framework.scope}</scope>
<version>2.0.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
......@@ -202,49 +198,10 @@
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<downloadSources>true</downloadSources>
<ajdtVersion>none</ajdtVersion>
<additionalConfig>
<file>
<name>.settings/org.eclipse.jdt.core.prefs</name>
<content><![CDATA[org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.compliance=1.6org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.compliance=1.6org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.compliance=1.6]]><![CDATA[org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.compliance=1.6]]></content>
</file>
</additionalConfig>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<properties>
<packaging>war</packaging>
<env>alpha</env>
<test-framework.scope>test</test-framework.scope>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
</properties>
</project>
......
<?xml version="1.0" encoding="utf-8"?>
<wizard package="com.dianping.cat">
<webapp package="com.dianping.cat" webres="true" plugin-management="true">
<webapp package="com.dianping.cat" webres="true" plugin-management="false">
<module name="report" path="r">
<page name="home" title="Home" default="true">
<description>Home Page</description>
......
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.5.2.10</version>
<version>0.6.0-SNAPSHOT</version>
<name>arch-cat</name>
<description>Central Application Tracking</description>
<packaging>pom</packaging>
......@@ -46,6 +46,12 @@
<artifactId>jetty-util</artifactId>
<version>6.1.14</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-api-2.1</artifactId>
<version>6.1.14</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1</artifactId>
......@@ -101,11 +107,7 @@
<includes>
<include>**/AllTests.java</include>
</includes>
<!--
<debugForkedProcess>-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-Xnoagent -Djava.compiler=NONE</debugForkedProcess>
-->
<!-- <debugForkedProcess>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE</debugForkedProcess> -->
</configuration>
<dependencies>
<dependency>
......@@ -120,7 +122,7 @@
<version>2.8</version>
<configuration>
<downloadSources>true</downloadSources>
<ajdtVersion>none</ajdtVersion>
<ajdtVersion>none</ajdtVersion>
<additionalConfig>
<file>
<name>.settings/org.eclipse.jdt.core.prefs</name>
......@@ -161,12 +163,6 @@ org.eclipse.jdt.core.compiler.compliance=1.6
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>dianping.repo</id>
<url>http://192.168.8.45:8080/artifactory/dianping-releases</url>
</repository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
</properties>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册