Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
d559839e
C
cat
项目概览
梦中观雨
/
cat
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d559839e
编写于
8月 23, 2012
作者:
F
Frankie Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make desc <table> work
上级
7614b225
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
22 deletion
+23
-22
bee-engine/src/main/java/com/dianping/bee/engine/build/ComponentsConfigurator.java
...com/dianping/bee/engine/build/ComponentsConfigurator.java
+3
-2
bee-engine/src/main/java/com/dianping/bee/engine/spi/DatabaseProvider.java
...in/java/com/dianping/bee/engine/spi/DatabaseProvider.java
+0
-1
bee-engine/src/main/java/com/dianping/bee/engine/spi/internal/DefaultTableProviderManager.java
.../bee/engine/spi/internal/DefaultTableProviderManager.java
+1
-1
bee-engine/src/main/java/com/dianping/bee/server/SimpleDescHandler.java
.../main/java/com/dianping/bee/server/SimpleDescHandler.java
+7
-18
bee-engine/src/main/resources/META-INF/plexus/components.xml
bee-engine/src/main/resources/META-INF/plexus/components.xml
+12
-0
未找到文件。
bee-engine/src/main/java/com/dianping/bee/engine/build/ComponentsConfigurator.java
浏览文件 @
d559839e
...
...
@@ -53,11 +53,12 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
.
req
(
TableHelper
.
class
,
MultiTableStatement
.
class
,
RowFilter
.
class
));
all
.
add
(
C
(
SimpleShowHandler
.
class
));
all
.
add
(
C
(
SimpleDescHandler
.
class
));
all
.
add
(
C
(
SimpleDescHandler
.
class
)
//
.
req
(
TableProviderManager
.
class
));
all
.
add
(
C
(
SimpleSelectHandler
.
class
)
//
.
req
(
StatementManager
.
class
));
all
.
add
(
C
(
SimpleServerQueryHandler
.
class
).
is
(
PER_LOOKUP
)
//
.
req
(
SimpleSelectHandler
.
class
,
SimpleShowHandler
.
class
));
.
req
(
SimpleSelectHandler
.
class
,
SimpleShowHandler
.
class
,
SimpleDescHandler
.
class
));
return
all
;
}
...
...
bee-engine/src/main/java/com/dianping/bee/engine/spi/DatabaseProvider.java
浏览文件 @
d559839e
package
com.dianping.bee.engine.spi
;
public
interface
DatabaseProvider
{
public
String
getName
();
public
TableProvider
[]
getTables
();
...
...
bee-engine/src/main/java/com/dianping/bee/engine/spi/internal/DefaultTableProviderManager.java
浏览文件 @
d559839e
...
...
@@ -24,7 +24,7 @@ public class DefaultTableProviderManager implements TableProviderManager, Initia
@Override
public
TableProvider
getTableProvider
(
String
table
)
{
return
m_tables
.
get
(
table
);
return
m_tables
.
get
(
table
.
toUpperCase
()
);
}
@Override
...
...
bee-engine/src/main/java/com/dianping/bee/server/SimpleDescHandler.java
浏览文件 @
d559839e
...
...
@@ -16,8 +16,6 @@ package com.dianping.bee.server;
import
java.nio.ByteBuffer
;
import
org.codehaus.plexus.component.repository.exception.ComponentLookupException
;
import
com.alibaba.cobar.CobarServer
;
import
com.alibaba.cobar.ErrorCode
;
import
com.alibaba.cobar.Fields
;
...
...
@@ -29,15 +27,17 @@ import com.alibaba.cobar.protocol.mysql.ResultSetHeaderPacket;
import
com.alibaba.cobar.protocol.mysql.RowDataPacket
;
import
com.alibaba.cobar.server.ServerConnection
;
import
com.alibaba.cobar.util.StringUtil
;
import
com.dianping.bee.engine.spi.DatabaseProvider
;
import
com.dianping.bee.engine.spi.TableProvider
;
import
com.dianping.bee.engine.spi.TableProviderManager
;
import
com.dianping.bee.engine.spi.meta.ColumnMeta
;
import
com.site.lookup.
ContainerLoader
;
import
com.site.lookup.
annotation.Inject
;
/**
* @author <a href="mailto:yiming.liu@dianping.com">Yiming Liu</a>
*/
public
class
SimpleDescHandler
{
@Inject
private
TableProviderManager
m_manager
;
/**
* @param stmt
...
...
@@ -53,28 +53,17 @@ public class SimpleDescHandler {
c
.
writeErrMessage
(
ErrorCode
.
ER_NO_DB_ERROR
,
"No database selected"
);
return
;
}
SchemaConfig
schema
=
CobarServer
.
getInstance
().
getConfig
().
getSchemas
().
get
(
db
);
if
(
schema
==
null
)
{
c
.
writeErrMessage
(
ErrorCode
.
ER_BAD_DB_ERROR
,
"Unknown database '"
+
db
+
"'"
);
return
;
}
DatabaseProvider
provider
=
null
;
try
{
provider
=
ContainerLoader
.
getDefaultContainer
().
lookup
(
DatabaseProvider
.
class
,
db
);
}
catch
(
ComponentLookupException
e
)
{
c
.
writeErrMessage
(
ErrorCode
.
ER_BAD_DB_ERROR
,
"Can not load database '"
+
db
+
"'"
);
return
;
}
if
(
provider
==
null
)
{
c
.
writeErrMessage
(
ErrorCode
.
ER_BAD_DB_ERROR
,
"Can not load database '"
+
db
+
"'"
);
return
;
}
TableProvider
table
=
m_manager
.
getTableProvider
(
tableName
);
//FIXME: why abstractmethod exception
TableProvider
table
=
provider
.
getTable
(
tableName
);
if
(
table
==
null
)
{
c
.
writeErrMessage
(
ErrorCode
.
ER_BAD_TABLE_ERROR
,
"
Can not load
table '"
+
tableName
+
"'"
);
c
.
writeErrMessage
(
ErrorCode
.
ER_BAD_TABLE_ERROR
,
"
Unknown
table '"
+
tableName
+
"'"
);
return
;
}
...
...
bee-engine/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
d559839e
...
...
@@ -87,6 +87,15 @@
<role>
com.dianping.bee.server.SimpleShowHandler
</role>
<implementation>
com.dianping.bee.server.SimpleShowHandler
</implementation>
</component>
<component>
<role>
com.dianping.bee.server.SimpleDescHandler
</role>
<implementation>
com.dianping.bee.server.SimpleDescHandler
</implementation>
<requirements>
<requirement>
<role>
com.dianping.bee.engine.spi.TableProviderManager
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.bee.server.SimpleSelectHandler
</role>
<implementation>
com.dianping.bee.server.SimpleSelectHandler
</implementation>
...
...
@@ -107,6 +116,9 @@
<requirement>
<role>
com.dianping.bee.server.SimpleShowHandler
</role>
</requirement>
<requirement>
<role>
com.dianping.bee.server.SimpleDescHandler
</role>
</requirement>
</requirements>
</component>
</components>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录