You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/01/10 04:29:26 UTC

[GitHub] [incubator-shardingsphere] cherrylzhao opened a new issue #3922: Optimize model of ColumnMetaData

cherrylzhao opened a new issue #3922: Optimize model of  ColumnMetaData 
URL: https://github.com/apache/incubator-shardingsphere/issues/3922
 
 
   currently our ColumnMetaData defined in this way
   ```
   public class ColumnMetaData {
       
       private final String name;
       
       private final String dataType;
       
       private final boolean primaryKey;
   
       private final boolean notNull;
   
       private final boolean autoIncrement;
   }
   ```
   
   but `Sharding-Proxy` need entire meta to support database protocol, so we get others from underlying resultSetMetaData in this way
   ```
       columnLabel = resultSetMetaData.getColumnLabel(columnIndex);
       columnName = resultSetMetaData.getColumnName(columnIndex);
       columnLength = resultSetMetaData.getColumnDisplaySize(columnIndex);
       columnType = resultSetMetaData.getColumnType(columnIndex);
       decimals = resultSetMetaData.getScale(columnIndex);
       signed = resultSetMetaData.isSigned(columnIndex);
       notNull = resultSetMetaData.isNullable(columnIndex) == ResultSetMetaData.columnNoNulls;
       autoIncrement = resultSetMetaData.isAutoIncrement(columnIndex);
   ```
   
   consider about  enhancing metadata like this
   1. adding these missing meta field into `ColumnMetaData`, only maintain it in `TableMetaDataLoader` 
   2. for `sharding-proxy` should provide a way to get logicTableName of ResultSetMetaData Column
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] cherrylzhao commented on issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
cherrylzhao commented on issue #3922: Optimize model of  ColumnMetaData 
URL: https://github.com/apache/incubator-shardingsphere/issues/3922#issuecomment-574492222
 
 
   I have sent a mail to dev mailing list [
   [DISCUSS] Optimize model of ColumnMetaData](https://lists.apache.org/thread.html/r17a6755569a787f34b917cd06a49895365d50c72f7c3ae6704044c76%40%3Cdev.shardingsphere.apache.org%3E)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] cherrylzhao commented on issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
cherrylzhao commented on issue #3922: Optimize model of  ColumnMetaData 
URL: https://github.com/apache/incubator-shardingsphere/issues/3922#issuecomment-573490288
 
 
   I think we can discussing migrating to zookeeper in another issue, leverage the watcher of zookeeper is a better choice.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] kimmking commented on issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #3922: Optimize model of  ColumnMetaData 
URL: https://github.com/apache/incubator-shardingsphere/issues/3922#issuecomment-613236790
 
 
   @dongzl @SteNicholas We already persist metadata to zk now.
   And another question just like this first thread post by @cherrylzhao , add other fields to metadata center is neccesary or not? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [shardingsphere] kimmking closed issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
kimmking closed issue #3922:
URL: https://github.com/apache/shardingsphere/issues/3922


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-shardingsphere] dongzl edited a comment on issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
dongzl edited a comment on issue #3922: Optimize model of  ColumnMetaData 
URL: https://github.com/apache/incubator-shardingsphere/issues/3922#issuecomment-573489521
 
 
   Hi @cherrylzhao , If Database exists a lot of table, does put MetaData into Zookeeper is a good idea?
   
   We can use Zookeeper as a listener, if one node change MetaData, the Zookeeper notice the other node to reload the MetaData, does this is a good idea?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] dongzl commented on issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
dongzl commented on issue #3922: Optimize model of  ColumnMetaData 
URL: https://github.com/apache/incubator-shardingsphere/issues/3922#issuecomment-572981828
 
 
   This has another question should be considered.
   
   If only use `Master-Slave` mode, no sharding, ShardingSphere doesn't load table metadata, The `QueryHeader` how to get the metadata.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [shardingsphere] cherrylzhao edited a comment on issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
cherrylzhao edited a comment on issue #3922:
URL: https://github.com/apache/shardingsphere/issues/3922#issuecomment-573486212






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-shardingsphere] dongzl commented on issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
dongzl commented on issue #3922: Optimize model of  ColumnMetaData 
URL: https://github.com/apache/incubator-shardingsphere/issues/3922#issuecomment-573489521
 
 
   If Database exists a lot of table, does put MetaData into Zookeeper is a good idea?
   
   We can use Zookeeper as a listener, if one node change MetaData, the Zookeeper notice the other node to reload the MetaData, does this is a good idea?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] cherrylzhao commented on issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
cherrylzhao commented on issue #3922: Optimize model of  ColumnMetaData 
URL: https://github.com/apache/incubator-shardingsphere/issues/3922#issuecomment-573486212
 
 
   agree with @SteNicholas metadata should be a infrastructure service for ShardingSphere, we should provide a uniform interface for initialization, read, refreshing instead of distinguish with whether sharding or not. it seems that it will be a big refactor for sharding-jdbc & sharding-proxy.
   assume that task list is as below
   - [ ] investigate the usage of current metadata, clarify the function list of metadata (SQLParse, Route,Rewrite etc)
   - [ ] design a MetaData Model & MetaData Sevice, at first only consider about storing in memory
   - [ ] then consider about migrating to zookeeper or other registration
   
   @terrymanu is it ok for that

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] SteNicholas commented on issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #3922: Optimize model of  ColumnMetaData 
URL: https://github.com/apache/incubator-shardingsphere/issues/3922#issuecomment-573092225
 
 
   @cherrylzhao In my opinion, `ColumnMetaData` should add these meta fields, because these meta fields are related to column metadata. And, about 'Master-Slave' mode, DDL operation should refresh the `ColumnMetaData`, which maybe store in Zookeeper.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] SteNicholas commented on issue #3922: Optimize model of ColumnMetaData

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #3922: Optimize model of  ColumnMetaData 
URL: https://github.com/apache/incubator-shardingsphere/issues/3922#issuecomment-574157270
 
 
   > agree with @SteNicholas metadata should be a infrastructure service for ShardingSphere, we should provide a uniform interface for initialization, read, refreshing instead of distinguish with whether sharding or not. it seems that it will be a big refactor for sharding-jdbc & sharding-proxy.
   > assume that task list is as below
   > 
   > * [ ]  investigate the usage of current metadata, clarify the function list of metadata (SQLParse, Route,Rewrite etc)
   > * [ ]  design a MetaData Model & MetaData Sevice, at first only consider about storing in memory
   > * [ ]  then consider about migrating to zookeeper or other registration
   > 
   > @terrymanu is it ok for that
   
   @cherrylzhao Could u please send dev email group for discussion of this problem?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services