Use a Scanner instead of a get....
2009/7/31 <[email protected]>
> 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:
> [email protected]
> @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 <[email protected]>
>
> > 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.
>
> ---------------------------------------------------------------------------
>
>
>
>