hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ninad Raut <hbase.user.ni...@gmail.com>
Subject Re: HBase schema design
Date Fri, 31 Jul 2009 08:56:10 GMT
Use a Scanner instead of a get....

2009/7/31 <y_823910@tsmc.com>

> As to your suggestion, how do I complete following codes?
> or any better codes would be great!
>
> HTable table = new HTable(config, "user");
> Get g = new Get(Bytes.toBytes("U1"));
> Result r = table.get(g);
>
> for loop---     //I don't know how many articles the user have.
>   byte [] t = r.getValue(Bytes.toBytes("chapter"), Bytes.toBytes("?"));
> //t1
>   byte [] c = r.getValue(Bytes.toBytes("chapter"), Bytes.toBytes("?"));
> //c1
>   byte [] d = r.getValue(Bytes.toBytes("chapter"), Bytes.toBytes("?"));
> //d1
> end loop---
>
> Thank you very much
>
> Fleming
> 宏明
>
>
>
>
>                      Ninad Raut
>                      <hbase.user.ninad        To:
> hbase-user@hadoop.apache.org
>                      @gmail.com>              cc:      (bcc:
> Y_823910/TSMC)
>                                               Subject: Re: HBase schema
> design
>                      2009/07/31 11:48
>                      AM
>                      Please respond to
>                      hbase-user
>
>
>
>
>
>
> create user as your row key. then create a columnFamily called chapter. For
> each column entry store a json string which will contain  title,content and
> creation date. Using google's gson marsheller to convert your POJO object
> to
> JSON string.
>  U1  chapter:{t1,c1,d1},chapter:{t2,c2,d2}... etc...
> let me know if it helps.
>
> 2009/7/31 <y_823910@tsmc.com>
>
> > Hi there,
> >
> > If I want to save my user's articles, I want to know how to create HBase
> > schema.
> >
> > key value   title      content     create_date
> > U1           t1          c1             d1
> > U1           t2          c2             d2
> > U1           t3          c3             d3
> >
> > After the user sign in,I want to show the user's(U1) article
> > title(t1,t2,t3)
> > Sorry, I am not familiar with Column-Oriented design. I really want to
> know
> > the
> > correct way to design HBase schema.
> > Any suggestion would be appreciated!
> >
> > Fleming
> > 宏明
> >
> >
> ---------------------------------------------------------------------------
> >                                                         TSMC PROPERTY
> >  This email communication (and any attachments) is proprietary
> information
> >  for the sole use of its
> >  intended recipient. Any unauthorized review, use or distribution by
> anyone
> >  other than the intended
> >  recipient is strictly prohibited.  If you are not the intended
> recipient,
> >  please notify the sender by
> >  replying to this email, and then delete this email and any copies of it
> >  immediately. Thank you.
> >
> >
> ---------------------------------------------------------------------------
> >
> >
> >
> >
>
>
>
>
>
>  ---------------------------------------------------------------------------
>                                                          TSMC PROPERTY
>  This email communication (and any attachments) is proprietary information
>  for the sole use of its
>  intended recipient. Any unauthorized review, use or distribution by anyone
>  other than the intended
>  recipient is strictly prohibited.  If you are not the intended recipient,
>  please notify the sender by
>  replying to this email, and then delete this email and any copies of it
>  immediately. Thank you.
>
>  ---------------------------------------------------------------------------
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message