You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "sishen (JIRA)" <ji...@apache.org> on 2008/09/19 13:28:44 UTC

[jira] Created: (HBASE-890) alter table operation and also related changes in REST interface

alter table operation and also related changes in REST interface
----------------------------------------------------------------

                 Key: HBASE-890
                 URL: https://issues.apache.org/jira/browse/HBASE-890
             Project: Hadoop HBase
          Issue Type: Improvement
          Components: rest, scripts
    Affects Versions: 0.19.0
            Reporter: sishen


I have made some changes to the alter operation on the hbase shell.
Now we can add, update, delete the column families. Also, make the
changes to the TableHandler in REST interface.

changes to the hbase shell:

> alter 'table', {NAME => 'cf', VERSIONS => 3}

This command will try to find the column family named 'cf' at first.
If has, it will modifyColumn, if not, add the column

> alter 'table', {NAME => 'cf', 'method' => 'delete'}

This command will delete the column family named 'cf'.

To achieve this goal,  i also add a method to the HBaseAdmin.java

public TableDescriptor getTableDescriptor(byte[] tableName);


changes to the TableHandler in REST interface.

> curl -X PUT -T - http://localhost:60050/api/tablename

<?xml version="1.0" encoding="UTF-8"?>
<table>
 <name>tables</name>
 <columnfamilies>
   <columnfamily>
     <name>cf1</name>
     <max-versions>2</max-versions>
     <compression>NONE</compression>
     <in-memory>false</in-memory>
     <block-cache>true</block-cache>
   </columnfamily>
 </columnfamilies>
</table>

It will check the column family 'cf1'. If exists, modifyColumn, if
not,  addColumn

> curl -X DELETE http://localhost:60050/api/tablename?column=cf1

It will deleteColumn 'cf1'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-890) alter table operation and also related changes in REST interface

Posted by "sishen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sishen updated HBASE-890:
-------------------------

    Attachment: 890.trunk.alter_table_v2.patch

Improve the features based on what stack suggested.

> alter table operation and also related changes in REST interface
> ----------------------------------------------------------------
>
>                 Key: HBASE-890
>                 URL: https://issues.apache.org/jira/browse/HBASE-890
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: rest, scripts
>    Affects Versions: 0.19.0
>            Reporter: sishen
>         Attachments: 890.trunk.alter_table.patch, 890.trunk.alter_table_v2.patch
>
>
> I have made some changes to the alter operation on the hbase shell.
> Now we can add, update, delete the column families. Also, make the
> changes to the TableHandler in REST interface.
> changes to the hbase shell:
> > alter 'table', {NAME => 'cf', VERSIONS => 3}
> This command will try to find the column family named 'cf' at first.
> If has, it will modifyColumn, if not, add the column
> > alter 'table', {NAME => 'cf', 'method' => 'delete'}
> This command will delete the column family named 'cf'.
> To achieve this goal,  i also add a method to the HBaseAdmin.java
> public TableDescriptor getTableDescriptor(byte[] tableName);
> changes to the TableHandler in REST interface.
> > curl -X PUT -T - http://localhost:60050/api/tablename
> <?xml version="1.0" encoding="UTF-8"?>
> <table>
>  <name>tables</name>
>  <columnfamilies>
>    <columnfamily>
>      <name>cf1</name>
>      <max-versions>2</max-versions>
>      <compression>NONE</compression>
>      <in-memory>false</in-memory>
>      <block-cache>true</block-cache>
>    </columnfamily>
>  </columnfamilies>
> </table>
> It will check the column family 'cf1'. If exists, modifyColumn, if
> not,  addColumn
> > curl -X DELETE http://localhost:60050/api/tablename?column=cf1
> It will deleteColumn 'cf1'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-890) alter table operation and also related changes in REST interface

Posted by "sishen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632783#action_12632783 ] 

sishen commented on HBASE-890:
------------------------------

What's the line length?  The command of operation in the shell?

For others, yeah, I will add the Constant and also the api usage in HBase.rb.

> alter table operation and also related changes in REST interface
> ----------------------------------------------------------------
>
>                 Key: HBASE-890
>                 URL: https://issues.apache.org/jira/browse/HBASE-890
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: rest, scripts
>    Affects Versions: 0.19.0
>            Reporter: sishen
>         Attachments: 890.trunk.alter_table.patch
>
>
> I have made some changes to the alter operation on the hbase shell.
> Now we can add, update, delete the column families. Also, make the
> changes to the TableHandler in REST interface.
> changes to the hbase shell:
> > alter 'table', {NAME => 'cf', VERSIONS => 3}
> This command will try to find the column family named 'cf' at first.
> If has, it will modifyColumn, if not, add the column
> > alter 'table', {NAME => 'cf', 'method' => 'delete'}
> This command will delete the column family named 'cf'.
> To achieve this goal,  i also add a method to the HBaseAdmin.java
> public TableDescriptor getTableDescriptor(byte[] tableName);
> changes to the TableHandler in REST interface.
> > curl -X PUT -T - http://localhost:60050/api/tablename
> <?xml version="1.0" encoding="UTF-8"?>
> <table>
>  <name>tables</name>
>  <columnfamilies>
>    <columnfamily>
>      <name>cf1</name>
>      <max-versions>2</max-versions>
>      <compression>NONE</compression>
>      <in-memory>false</in-memory>
>      <block-cache>true</block-cache>
>    </columnfamily>
>  </columnfamilies>
> </table>
> It will check the column family 'cf1'. If exists, modifyColumn, if
> not,  addColumn
> > curl -X DELETE http://localhost:60050/api/tablename?column=cf1
> It will deleteColumn 'cf1'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-890) alter table operation and also related changes in REST interface

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632740#action_12632740 ] 

stack commented on HBASE-890:
-----------------------------

Patch looks great Sishen.

Few things:

+ Line lengths should < 80 characters if you can help it.

+ Regards the following:
{code}
+      htd = @admin.getTableDescriptor(tableName.to_java_bytes)
+      method = args.delete("method")
+      if method == "delete"
{code}
... in the shell defines are by convention upper-cased so 'method' should be METHOD.  Can you add it as a define to the top of the HBase.rb along with the others.

+ Do you think we should make mention of this new addition to the alter command in the help?



> alter table operation and also related changes in REST interface
> ----------------------------------------------------------------
>
>                 Key: HBASE-890
>                 URL: https://issues.apache.org/jira/browse/HBASE-890
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: rest, scripts
>    Affects Versions: 0.19.0
>            Reporter: sishen
>         Attachments: 890.trunk.alter_table.patch
>
>
> I have made some changes to the alter operation on the hbase shell.
> Now we can add, update, delete the column families. Also, make the
> changes to the TableHandler in REST interface.
> changes to the hbase shell:
> > alter 'table', {NAME => 'cf', VERSIONS => 3}
> This command will try to find the column family named 'cf' at first.
> If has, it will modifyColumn, if not, add the column
> > alter 'table', {NAME => 'cf', 'method' => 'delete'}
> This command will delete the column family named 'cf'.
> To achieve this goal,  i also add a method to the HBaseAdmin.java
> public TableDescriptor getTableDescriptor(byte[] tableName);
> changes to the TableHandler in REST interface.
> > curl -X PUT -T - http://localhost:60050/api/tablename
> <?xml version="1.0" encoding="UTF-8"?>
> <table>
>  <name>tables</name>
>  <columnfamilies>
>    <columnfamily>
>      <name>cf1</name>
>      <max-versions>2</max-versions>
>      <compression>NONE</compression>
>      <in-memory>false</in-memory>
>      <block-cache>true</block-cache>
>    </columnfamily>
>  </columnfamilies>
> </table>
> It will check the column family 'cf1'. If exists, modifyColumn, if
> not,  addColumn
> > curl -X DELETE http://localhost:60050/api/tablename?column=cf1
> It will deleteColumn 'cf1'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-890) alter table operation and also related changes in REST interface

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-890:
------------------------

       Resolution: Fixed
    Fix Version/s: 0.19.0
           Status: Resolved  (was: Patch Available)

Applied to TRUNK.  Thanks for the patch Sishen.  Resolving.

> alter table operation and also related changes in REST interface
> ----------------------------------------------------------------
>
>                 Key: HBASE-890
>                 URL: https://issues.apache.org/jira/browse/HBASE-890
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: rest, scripts
>    Affects Versions: 0.19.0
>            Reporter: sishen
>             Fix For: 0.19.0
>
>         Attachments: 890.trunk.alter_table.patch, 890.trunk.alter_table_v2.patch
>
>
> I have made some changes to the alter operation on the hbase shell.
> Now we can add, update, delete the column families. Also, make the
> changes to the TableHandler in REST interface.
> changes to the hbase shell:
> > alter 'table', {NAME => 'cf', VERSIONS => 3}
> This command will try to find the column family named 'cf' at first.
> If has, it will modifyColumn, if not, add the column
> > alter 'table', {NAME => 'cf', 'method' => 'delete'}
> This command will delete the column family named 'cf'.
> To achieve this goal,  i also add a method to the HBaseAdmin.java
> public TableDescriptor getTableDescriptor(byte[] tableName);
> changes to the TableHandler in REST interface.
> > curl -X PUT -T - http://localhost:60050/api/tablename
> <?xml version="1.0" encoding="UTF-8"?>
> <table>
>  <name>tables</name>
>  <columnfamilies>
>    <columnfamily>
>      <name>cf1</name>
>      <max-versions>2</max-versions>
>      <compression>NONE</compression>
>      <in-memory>false</in-memory>
>      <block-cache>true</block-cache>
>    </columnfamily>
>  </columnfamilies>
> </table>
> It will check the column family 'cf1'. If exists, modifyColumn, if
> not,  addColumn
> > curl -X DELETE http://localhost:60050/api/tablename?column=cf1
> It will deleteColumn 'cf1'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-890) alter table operation and also related changes in REST interface

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632786#action_12632786 ] 

stack commented on HBASE-890:
-----------------------------

Source code in the hadoop projects usually wraps at 80 characters.  Your patch looked like it was adding lines whose length was > 80 characters.

> alter table operation and also related changes in REST interface
> ----------------------------------------------------------------
>
>                 Key: HBASE-890
>                 URL: https://issues.apache.org/jira/browse/HBASE-890
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: rest, scripts
>    Affects Versions: 0.19.0
>            Reporter: sishen
>         Attachments: 890.trunk.alter_table.patch
>
>
> I have made some changes to the alter operation on the hbase shell.
> Now we can add, update, delete the column families. Also, make the
> changes to the TableHandler in REST interface.
> changes to the hbase shell:
> > alter 'table', {NAME => 'cf', VERSIONS => 3}
> This command will try to find the column family named 'cf' at first.
> If has, it will modifyColumn, if not, add the column
> > alter 'table', {NAME => 'cf', 'method' => 'delete'}
> This command will delete the column family named 'cf'.
> To achieve this goal,  i also add a method to the HBaseAdmin.java
> public TableDescriptor getTableDescriptor(byte[] tableName);
> changes to the TableHandler in REST interface.
> > curl -X PUT -T - http://localhost:60050/api/tablename
> <?xml version="1.0" encoding="UTF-8"?>
> <table>
>  <name>tables</name>
>  <columnfamilies>
>    <columnfamily>
>      <name>cf1</name>
>      <max-versions>2</max-versions>
>      <compression>NONE</compression>
>      <in-memory>false</in-memory>
>      <block-cache>true</block-cache>
>    </columnfamily>
>  </columnfamilies>
> </table>
> It will check the column family 'cf1'. If exists, modifyColumn, if
> not,  addColumn
> > curl -X DELETE http://localhost:60050/api/tablename?column=cf1
> It will deleteColumn 'cf1'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-890) alter table operation and also related changes in REST interface

Posted by "sishen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sishen updated HBASE-890:
-------------------------

    Status: Patch Available  (was: Open)

patch available.

> alter table operation and also related changes in REST interface
> ----------------------------------------------------------------
>
>                 Key: HBASE-890
>                 URL: https://issues.apache.org/jira/browse/HBASE-890
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: rest, scripts
>    Affects Versions: 0.19.0
>            Reporter: sishen
>         Attachments: 890.trunk.alter_table.patch
>
>
> I have made some changes to the alter operation on the hbase shell.
> Now we can add, update, delete the column families. Also, make the
> changes to the TableHandler in REST interface.
> changes to the hbase shell:
> > alter 'table', {NAME => 'cf', VERSIONS => 3}
> This command will try to find the column family named 'cf' at first.
> If has, it will modifyColumn, if not, add the column
> > alter 'table', {NAME => 'cf', 'method' => 'delete'}
> This command will delete the column family named 'cf'.
> To achieve this goal,  i also add a method to the HBaseAdmin.java
> public TableDescriptor getTableDescriptor(byte[] tableName);
> changes to the TableHandler in REST interface.
> > curl -X PUT -T - http://localhost:60050/api/tablename
> <?xml version="1.0" encoding="UTF-8"?>
> <table>
>  <name>tables</name>
>  <columnfamilies>
>    <columnfamily>
>      <name>cf1</name>
>      <max-versions>2</max-versions>
>      <compression>NONE</compression>
>      <in-memory>false</in-memory>
>      <block-cache>true</block-cache>
>    </columnfamily>
>  </columnfamilies>
> </table>
> It will check the column family 'cf1'. If exists, modifyColumn, if
> not,  addColumn
> > curl -X DELETE http://localhost:60050/api/tablename?column=cf1
> It will deleteColumn 'cf1'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HBASE-890) alter table operation and also related changes in REST interface

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack reassigned HBASE-890:
---------------------------

    Assignee: sishen

> alter table operation and also related changes in REST interface
> ----------------------------------------------------------------
>
>                 Key: HBASE-890
>                 URL: https://issues.apache.org/jira/browse/HBASE-890
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: rest, scripts
>    Affects Versions: 0.19.0
>            Reporter: sishen
>            Assignee: sishen
>             Fix For: 0.19.0
>
>         Attachments: 890.trunk.alter_table.patch, 890.trunk.alter_table_v2.patch
>
>
> I have made some changes to the alter operation on the hbase shell.
> Now we can add, update, delete the column families. Also, make the
> changes to the TableHandler in REST interface.
> changes to the hbase shell:
> > alter 'table', {NAME => 'cf', VERSIONS => 3}
> This command will try to find the column family named 'cf' at first.
> If has, it will modifyColumn, if not, add the column
> > alter 'table', {NAME => 'cf', 'method' => 'delete'}
> This command will delete the column family named 'cf'.
> To achieve this goal,  i also add a method to the HBaseAdmin.java
> public TableDescriptor getTableDescriptor(byte[] tableName);
> changes to the TableHandler in REST interface.
> > curl -X PUT -T - http://localhost:60050/api/tablename
> <?xml version="1.0" encoding="UTF-8"?>
> <table>
>  <name>tables</name>
>  <columnfamilies>
>    <columnfamily>
>      <name>cf1</name>
>      <max-versions>2</max-versions>
>      <compression>NONE</compression>
>      <in-memory>false</in-memory>
>      <block-cache>true</block-cache>
>    </columnfamily>
>  </columnfamilies>
> </table>
> It will check the column family 'cf1'. If exists, modifyColumn, if
> not,  addColumn
> > curl -X DELETE http://localhost:60050/api/tablename?column=cf1
> It will deleteColumn 'cf1'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-890) alter table operation and also related changes in REST interface

Posted by "sishen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sishen updated HBASE-890:
-------------------------

    Attachment: 890.trunk.alter_table.patch

> alter table operation and also related changes in REST interface
> ----------------------------------------------------------------
>
>                 Key: HBASE-890
>                 URL: https://issues.apache.org/jira/browse/HBASE-890
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: rest, scripts
>    Affects Versions: 0.19.0
>            Reporter: sishen
>         Attachments: 890.trunk.alter_table.patch
>
>
> I have made some changes to the alter operation on the hbase shell.
> Now we can add, update, delete the column families. Also, make the
> changes to the TableHandler in REST interface.
> changes to the hbase shell:
> > alter 'table', {NAME => 'cf', VERSIONS => 3}
> This command will try to find the column family named 'cf' at first.
> If has, it will modifyColumn, if not, add the column
> > alter 'table', {NAME => 'cf', 'method' => 'delete'}
> This command will delete the column family named 'cf'.
> To achieve this goal,  i also add a method to the HBaseAdmin.java
> public TableDescriptor getTableDescriptor(byte[] tableName);
> changes to the TableHandler in REST interface.
> > curl -X PUT -T - http://localhost:60050/api/tablename
> <?xml version="1.0" encoding="UTF-8"?>
> <table>
>  <name>tables</name>
>  <columnfamilies>
>    <columnfamily>
>      <name>cf1</name>
>      <max-versions>2</max-versions>
>      <compression>NONE</compression>
>      <in-memory>false</in-memory>
>      <block-cache>true</block-cache>
>    </columnfamily>
>  </columnfamilies>
> </table>
> It will check the column family 'cf1'. If exists, modifyColumn, if
> not,  addColumn
> > curl -X DELETE http://localhost:60050/api/tablename?column=cf1
> It will deleteColumn 'cf1'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.