hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stack <st...@duboce.net>
Subject Re: Reading table sequentially...
Date Tue, 12 Jan 2010 17:36:48 GMT
See below:

On Tue, Jan 12, 2010 at 9:12 AM, Something Something <
mailinglists19@gmail.com> wrote:
>
>            NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long,
> byte[]>>> map = result.getMap();
>

Above returns a map keyed by families:
http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#getMap%28%29




>            for (Map.Entry<byte[], NavigableMap<byte[], NavigableMap<Long,
> byte[]>>> entry : map.entrySet()) {
>            byte[] key = entry.getKey();
>

This is family name, not key.



>            *LOG.info("key = " + Bytes.toString(key));*
>            NavigableMap<byte[], NavigableMap<Long, byte[]>> value =
> entry.getValue();
>

This is a map keyed by column qualifiers.



>              for (Entry<byte[], NavigableMap<Long, byte[]>> entry1 :
> value.entrySet()) {
>                  byte[] key1 = entry1.getKey();
>                  *LOG.info("key1 = " + Bytes.toString(key1));*
>


This is the family qualifier.



>                  NavigableMap<byte[], NavigableMap<Long, byte[]>> value1
=
> entry.getValue();
>


I do not think you intended to do this.  I think you meant entry1, not
'entry' and map type should be NavigableMap<Long, byte[]> rather than above.

St.Ack



>                  for (Entry<byte[], NavigableMap<Long, byte[]>> entry2 :
> value1.entrySet()) {
>                      String key2 = Bytes.toString(entry2.getKey());
>                      *LOG.info("key2 = " + key2);*
>
>                  }
>              }
>            }
>        }
>

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