hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LuiYip (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-5095) HBase Table Input BUG
Date Mon, 26 Dec 2011 10:54:31 GMT
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


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