Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # user >> Table and Family

Copy link to this message
Table and Family
Hi, all,

My understandings about HBase table and its family are as follows.

1) Each table can consist of multiple families;

2) When retrieving with SingleColumnValueFilter, if the family is
specified, other families contained in the same table are not

Are these claims right? But I got a problem which conflicts with the
above understandings.

In the following code, even though no any data in the family of
ContrivedNeighborStructure.NODE_NEIGHBOR_IN_GROUP_BASICS_FAMILY, the
for-loop runs many times if other families has the column of

Is that normal in HBase? If so, I think it is not a good design. No
column overlaps must exist among the families of the same table?
Otherwise, retrieving the table must cause waste of scanning loops?

Thanks so much!

Best wishes,

        SingleColumnValueFilter dcKeyFilter = new
CompareFilter.CompareOp.EQUAL, new SubstringComparator(dcKey));
        Scan scan = new Scan();

        String qualifier;
        String hostNodeKey = SocialRole.NO_NODE_KEY;
        String groupKey = SocialGroup.NO_GROUP_KEY;
        int timingScale = TimingScale.NO_TIMING_SCALE;
        String key;
            ResultScanner scanner = this.neighborTable.getScanner(scan);
            for (Result result : scanner)
                for (KeyValue kv : result.raw())
                    qualifier = Bytes.toString(kv.getQualifier());
                        hostNodeKey = Bytes.toString(kv.getValue());
                    else if
                        groupKey = Bytes.toString(kv.getValue());
                    else if
                        timingScale = Bytes.toInt(kv.getValue());
                if (!hostNodeKey.equals(SocialRole.NO_NODE_KEY) &&
!groupKey.equals(SocialGroup.NO_GROUP_KEY) && timingScale !TimingScale.NO_TIMING_SCALE)
                    key = Tools.GetKeyOfNode(hostNodeKey, groupKey,
                    if (!neighborMap.containsKey(key))
                        neighborMap.put(key, new
NodeNeighborInGroup(hostNodeKey, groupKey, timingScale));
                hostNodeKey = SocialRole.NO_NODE_KEY;
                groupKey = SocialGroup.NO_GROUP_KEY;
                timingScale = TimingScale.NO_TIMING_SCALE;
        catch (IOException e)
Stas Maksimov 2013-08-12, 16:31
Anoop John 2013-08-14, 05:21