hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Daniel Cryans (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HBASE-5095) HBase Table Input BUG
Date Tue, 03 Jan 2012 19:36:42 GMT

     [ https://issues.apache.org/jira/browse/HBASE-5095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jean-Daniel Cryans resolved HBASE-5095.
---------------------------------------

    Resolution: Invalid

The qualifier can't be null, use an empty byte array (or convert an empty string) instead.
                
> HBase Table Input BUG
> ---------------------
>
>                 Key: HBASE-5095
>                 URL: https://issues.apache.org/jira/browse/HBASE-5095
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.20.6
>         Environment: Red Hat Enterprise Linux Server release 5.4
>            Reporter: LuiYip
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> When I put one row into Hbase Table, it throws IOException.(NullPointerException). I
could make sure that I have add values into the Row. But when it runs at table.put(row). The
exception comes out.
> Here is part of my code.
> public HbaseInterface() {
>         HBaseConfiguration config = new HBaseConfiguration();
>         try {
>             config.set("hbase.zookeeper.quorum", "127.0.0.1");
>             config.set("hbase.zookeeper.property.clientPort", "2222");
>             table = new HTable(config, urlstable);
>         } catch (Exception ex) {
>             if (LOGGER.isErrorEnabled()) {
>                 LOGGER.error("error", ex);
>             }
>         }
>     }
> public boolean put(String url, String category) {
>         
>         Put row = new Put(Bytes.toBytes(url));
>         row.add(Bytes.toBytes(lifetime), null, Bytes.toBytes("99999"));
>         row.add(Bytes.toBytes(categories), null, Bytes.toBytes(category));
>         row.add(Bytes.toBytes(digest), null, Bytes.toBytes(m_encry.encrypt(url)));
>         try {
>             table.put(row);
>         } catch (Exception ex) {
>             if (LOGGER.isErrorEnabled()) {
>                 LOGGER.error("hbase put error :", ex);
>             }
>             return false;
>         }
>         return true;
>     }
> This is the table description.
> {NAME => 'urls', FAMILIES => [{NAME => 'categories', COMPRESSION => 'N true
   
>  ONE', VERSIONS => '3', TTL => '2147483647', BLOCKSIZE => '65536', IN_M    
    
>  EMORY => 'false', BLOCKCACHE => 'true'}, {NAME => 'digest', COMPRESSIO    
    
>  N => 'NONE', VERSIONS => '3', TTL => '2147483647', BLOCKSIZE => '65536 
       
>  ', IN_MEMORY => 'false', BLOCKCACHE => 'true'}, {NAME => 'lifetime', C    
    
>  OMPRESSION => 'NONE', VERSIONS => '3', TTL => '2147483647', BLOCKSIZE     
    
>  => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}]}   

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message