You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Dingding Ye <ye...@gmail.com> on 2008/09/19 12:02:32 UTC

[patch] alter table operation and also related changes in REST interface

Hi, guys.

I can find the link to create an issue on JIRA and even can't login.
Don't know why, :(

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'.


The patch is attached.


Best regards.

sishen

Re: [patch] alter table operation and also related changes in REST interface

Posted by Dingding Ye <ye...@gmail.com>.
Thanks,  J-D.  It works now.  Hardly to find the link before.

On Fri, Sep 19, 2008 at 7:23 PM, Jean-Daniel Cryans <jd...@apache.org> wrote:
> You tried here?
>
> https://issues.apache.org/jira/secure/Dashboard.jspa
>
> J-D
>
> On Fri, Sep 19, 2008 at 6:02 AM, Dingding Ye <ye...@gmail.com> wrote:
>
>> Hi, guys.
>>
>> I can find the link to create an issue on JIRA and even can't login.
>> Don't know why, :(
>>
>> 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'.
>>
>>
>> The patch is attached.
>>
>>
>> Best regards.
>>
>> sishen
>>
>

Re: [patch] alter table operation and also related changes in REST interface

Posted by Jean-Daniel Cryans <jd...@apache.org>.
You tried here?

https://issues.apache.org/jira/secure/Dashboard.jspa

J-D

On Fri, Sep 19, 2008 at 6:02 AM, Dingding Ye <ye...@gmail.com> wrote:

> Hi, guys.
>
> I can find the link to create an issue on JIRA and even can't login.
> Don't know why, :(
>
> 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'.
>
>
> The patch is attached.
>
>
> Best regards.
>
> sishen
>