Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2A9D2DF83 for ; Thu, 20 Sep 2012 12:41:05 +0000 (UTC) Received: (qmail 92542 invoked by uid 500); 20 Sep 2012 12:41:03 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 92502 invoked by uid 500); 20 Sep 2012 12:41:03 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 92481 invoked by uid 99); 20 Sep 2012 12:41:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2012 12:41:02 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.212.169] (HELO mail-wi0-f169.google.com) (209.85.212.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2012 12:40:55 +0000 Received: by wibhm2 with SMTP id hm2so596651wib.2 for ; Thu, 20 Sep 2012 05:40:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=6NEVFMbyEB+ZF8xSRYKkB5W3plg1ZqeR5SOmRrut4AQ=; b=ClpU2Cf1NIMMyFJIeC9anUMd6prnyKXp0E/LXhsuiZ6XoW8pwOKsEquFiElCTs3KnN ClS1zsl+y5NKvMOoRE+E+YHkv2K1n1/t5t8wEuGjxrquDePIyVFUiPZWCdOT2FEN+OQa Xwa8SeXUjbx8hVMj4X8XHBY2E0EZRkE9r/p9wxcyhKVCzo47GfNIsiQIxK50z5Fzt0lj Tj8PEFDLYzBuFXadAITbNj1jBc9u/LkyTZQBGYQO7fd+YYDJt02M9wpTTMUZAaJK7ARR Oma9Z+jH8JDxGszu1NtEvtiC9PX75+gJstbdg3Me5YQ6LaYYwNmnDlJ0sJI293KR4wIe Mgbg== MIME-Version: 1.0 Received: by 10.216.88.145 with SMTP id a17mr1158281wef.0.1348144834882; Thu, 20 Sep 2012 05:40:34 -0700 (PDT) Received: by 10.194.28.6 with HTTP; Thu, 20 Sep 2012 05:40:34 -0700 (PDT) In-Reply-To: References: Date: Thu, 20 Sep 2012 08:40:34 -0400 Message-ID: Subject: Re: Nested Entity Implementation? From: Jason Huang To: user@hbase.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnDNr+xdtpPc36UQwnpNhS4CABoVgkxKBIDtBIOg9azPpagU9y47YLpmo7OBx7d2K+3CE2x I see. Thanks for bringing the utility class to my attention. Jason On Thu, Sep 20, 2012 at 2:32 AM, anil gupta wrote: > Hi Jason, > > AFAIK, you need to write custom serialization and deserialization code for > this kind of stuff. For any primitive data type and some others like > BigDecimal, HBase has a utility class named as > org.apache.hadoop.hbase.util.Bytes. You might take advantage of this class > in your code if you can. > > HTH, > Anil > > On Wed, Sep 19, 2012 at 10:11 AM, Jason Huang wrote: > >> I think I should clarify my question - is there any existing tool to >> help convert these type of nested entities to byte arrays so I can >> easily write them to the column, or do I need to write my own >> serialization/deserialization? >> >> thanks! >> >> Jason >> >> On Wed, Sep 19, 2012 at 12:53 PM, Jason Huang >> wrote: >> > Hello, >> > >> > I am designing a HBase table for user activity and I want to use a >> > nested entity to store the login information as following: >> > >> > (1) Define a column qualifier named "user login" use this as a nested >> entity; >> > >> > (2) This nested entity will have the following attributes: >> > total # of login >> > time of log in #1 >> > time of log in #2 >> > .... >> > time of last log in >> > >> > (3) Each attributes in the step above (except for the total # of >> > login) will be another nested entity, which will include the following >> > attributes: >> > time of log out >> > user log in IP >> > browser used >> > ...... >> > >> > My question is - is there any handy API that will allow us to write >> > these type of nested entity to the column in the table? I looked at >> > the HTable.put method but that appears to only accept a byte code as >> > input value. We could implement the nested entity to a class with >> > attributes and nested objects but I am not sure how to write these >> > data to the table. I tried to search online but couldn't find any >> > good post talking about how to implement a nested entity (there are >> > some posts out there talking about using this type of design, though). >> > >> > Thanks! >> > >> > Jason >> > > > > -- > Thanks & Regards, > Anil Gupta