[ 
https://issues.apache.org/jira/browse/HDFS-13245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16468918#comment-16468918
 ] 

Yiran Wu commented on HDFS-13245:
---------------------------------

Thanks [~linyiqun] for review.
{quote}For the setting 
dfs.federation.router.store.sql.auto.create.schema.enabled, not so sure if I 
understanding correctly. Would you add more description for this? But from my 
perspective, this setting seems no needed.
{quote}
This configuration means that the StateStore checks the table structure at 
initialization and creates it if it is missing.
 E.g : When the router starts, if the table structure is incomplete, it can be 
automatically created.

*TestStateStore.java*
I want to add a more focused test to verify each StateStore. Instead of running 
each specific unit test. If it is not necessary, I will delete it.

*MockStateStoreSQLImpl.java*
 This mock class only for MSSQLServer , because H2 not support auto create 
tables SQL. This mock class initialize with the following SQL:
{code:java}
"CREATE TABLE %s ("
          + " id varchar(256) NOT NULL,"
          + " data varchar(8000) NOT NULL,"
          + " PRIMARY KEY (id));"
{code}
If we use the standard MSSQL will report the following error:
{code:java}
 org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "IF[*] NOT EXISTS 
(SELECT * FROM SYS.TABLES WHERE NAME = 'MountTable' AND SCHEMA_ID = 
SCHEMA_ID('dbo')) CREATE TABLE MOUNTTABLE ( ID VARCHAR(256) NOT NULL, DATA 
VARCHAR(8000) NOT NULL, PRIMARY KEY (ID)); "; expected "INSERT, {"; SQL 
statement:
 IF NOT EXISTS (SELECT * FROM sys.tables where name = 'MountTable' AND 
schema_id = SCHEMA_ID('dbo')) CREATE TABLE MountTable ( id varchar(256) NOT 
NULL, data varchar(8000) NOT NULL, PRIMARY KEY (id)); [42001-192]
 at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
 at org.h2.message.DbException.getSyntaxError(DbException.java:205)
 at org.h2.command.Parser.getSyntaxError(Parser.java:537)
 at org.h2.command.Parser.parsePrepared(Parser.java:522)
{code}

> RBF: State store DBMS implementation
> ------------------------------------
>
>                 Key: HDFS-13245
>                 URL: https://issues.apache.org/jira/browse/HDFS-13245
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs
>            Reporter: maobaolong
>            Assignee: Yiran Wu
>            Priority: Major
>         Attachments: HDFS-13245.001.patch, HDFS-13245.002.patch, 
> HDFS-13245.003.patch, HDFS-13245.004.patch, HDFS-13245.005.patch, 
> HDFS-13245.006.patch, HDFS-13245.007.patch, HDFS-13245.008.patch, 
> HDFS-13245.009.patch, HDFS-13245.010.patch
>
>
> Add a DBMS implementation for the State Store.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to