eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject eagle git commit: [EAGLE-902] Add JDBC data storage dependency into eagle server module
Date Wed, 22 Feb 2017 07:56:02 GMT
Repository: eagle
Updated Branches:
  refs/heads/master c6866e5fb -> a7df69e3a


[EAGLE-902] Add JDBC data storage dependency into eagle server module

- add jdbc storage type dependency into eagle-service-base module
- port the fix for mysql table creation failure : [EAGLE-273](https://issues.apache.org/jira/browse/EAGLE-273)

Author: DadanielZ <dazhou@apache.org>

Closes #834 from DadanielZ/EAGLE-902.


Project: http://git-wip-us.apache.org/repos/asf/eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/eagle/commit/a7df69e3
Tree: http://git-wip-us.apache.org/repos/asf/eagle/tree/a7df69e3
Diff: http://git-wip-us.apache.org/repos/asf/eagle/diff/a7df69e3

Branch: refs/heads/master
Commit: a7df69e3ad19ec43f59a9592cf399cd86d6fa418
Parents: c6866e5
Author: DadanielZ <dazhou@apache.org>
Authored: Wed Feb 22 15:55:46 2017 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Wed Feb 22 15:55:46 2017 +0800

----------------------------------------------------------------------
 eagle-core/eagle-query/eagle-service-base/pom.xml    | 15 +++++++++++++++
 .../org/apache/eagle/storage/jdbc/JdbcConstants.java |  5 ++++-
 .../jdbc/schema/JdbcEntityDefinitionManager.java     |  2 +-
 .../storage/jdbc/schema/JdbcEntitySchemaManager.java |  6 +++---
 4 files changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/a7df69e3/eagle-core/eagle-query/eagle-service-base/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-service-base/pom.xml b/eagle-core/eagle-query/eagle-service-base/pom.xml
index d8e75d1..064ea16 100755
--- a/eagle-core/eagle-query/eagle-service-base/pom.xml
+++ b/eagle-core/eagle-query/eagle-service-base/pom.xml
@@ -85,6 +85,21 @@
         </dependency>
         <dependency>
             <groupId>org.apache.eagle</groupId>
+            <artifactId>eagle-storage-jdbc</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.mortbay.jetty</groupId>
+                    <artifactId>servlet-api-2.5</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
             <artifactId>eagle-embed-hbase</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/eagle/blob/a7df69e3/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/JdbcConstants.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/JdbcConstants.java
b/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/JdbcConstants.java
index 80009ee..edcc218 100644
--- a/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/JdbcConstants.java
+++ b/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/JdbcConstants.java
@@ -28,7 +28,10 @@ public class JdbcConstants {
     public static final String ROW_KEY_COLUMN_NAME = "uuid";
 
     public static final int DEFAULT_TYPE_FOR_COMPLEX_TYPE = Types.BLOB;
-    public static final int DEFAULT_VARCHAR_SIZE = 30000;
+
+    //MySQL Max Row Size: 21485
+    public static final int DEFAULT_FIELD_VARCHAR_SIZE =1000;
+    public static final int DEFAULT_TAG_VARCHAR_SIZE =254;
 
     // Eagle JDBC Storage Configuration
     public static final String EAGLE_DB_USERNAME = "storage.jdbc.username";

http://git-wip-us.apache.org/repos/asf/eagle/blob/a7df69e3/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntityDefinitionManager.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntityDefinitionManager.java
b/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntityDefinitionManager.java
index b98d881..d9b29aa 100644
--- a/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntityDefinitionManager.java
+++ b/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntityDefinitionManager.java
@@ -150,7 +150,7 @@ public class JdbcEntityDefinitionManager {
     // Initially bind basic java types with SQL types
     //================================================
     static {
-        registerJdbcType(String.class, Types.LONGVARCHAR);
+        registerJdbcType(String.class, Types.VARCHAR);
         registerJdbcType(Integer.class, Types.INTEGER);
         registerJdbcType(Double.class, Types.DOUBLE);
         registerJdbcType(Float.class, Types.FLOAT);

http://git-wip-us.apache.org/repos/asf/eagle/blob/a7df69e3/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntitySchemaManager.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntitySchemaManager.java
b/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntitySchemaManager.java
index 9e47ac3..ae3f3f3 100644
--- a/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntitySchemaManager.java
+++ b/eagle-core/eagle-query/eagle-storage-jdbc/src/main/java/org/apache/eagle/storage/jdbc/schema/JdbcEntitySchemaManager.java
@@ -156,7 +156,7 @@ public class JdbcEntitySchemaManager implements IJdbcEntityDDLManager
{
         tagColumn.setTypeCode(Types.VARCHAR);
         tagColumn.setJavaName(tagName);
 //        tagColumn.setScale(1024);
-        tagColumn.setSize(String.valueOf(JdbcConstants.DEFAULT_VARCHAR_SIZE));
+        tagColumn.setSize(String.valueOf(JdbcConstants.DEFAULT_FIELD_VARCHAR_SIZE));
         tagColumn.setDefaultValue(null);
         tagColumn.setDescription("eagle entity tag column for "+tagName);
         return tagColumn;
@@ -197,7 +197,7 @@ public class JdbcEntitySchemaManager implements IJdbcEntityDDLManager
{
 //            Index index = new UniqueIndex();
             for (String tag : entityDefinition.getInternal().getTags()) {
                 Column tagColumn = createTagColumn(tag);
-                tagColumn.setSize(String.valueOf(JdbcConstants.DEFAULT_VARCHAR_SIZE));
+                tagColumn.setSize(String.valueOf(JdbcConstants.DEFAULT_TAG_VARCHAR_SIZE));
                 table.addColumn(tagColumn);
 //                IndexColumn indexColumn = new IndexColumn();
 //                indexColumn.setName(tag);
@@ -215,7 +215,7 @@ public class JdbcEntitySchemaManager implements IJdbcEntityDDLManager
{
             fieldColumn.setJavaName(entry.getKey());
             Integer typeCode = entityDefinition.getJdbcColumnTypeCodeOrNull(entry.getKey());
             typeCode = typeCode == null? Types.VARCHAR:typeCode;
-            if(typeCode == Types.VARCHAR) fieldColumn.setSize(String.valueOf(JdbcConstants.DEFAULT_VARCHAR_SIZE));
+            if(typeCode == Types.VARCHAR) fieldColumn.setSize(String.valueOf(JdbcConstants.DEFAULT_FIELD_VARCHAR_SIZE));
             fieldColumn.setTypeCode(typeCode);
             fieldColumn.setDescription("eagle field column "+entry.getKey()+":"+entityDefinition.getColumnTypeOrNull(entry.getKey()));
             table.addColumn(fieldColumn);


Mime
View raw message