Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # dev >> retrieving HRegion's in AssignmentManager


Copy link to this message
-
RE: retrieving HRegion's in AssignmentManager
You can't do a HashMap with a  byte[] as the Key, unfortunately.

You'll have to use a TreeMap (where you can specify a comparator), use a wrapping class, or you could even make it a HashSet or TreeSet with RegionLoad as the only type (and then write a comparator for RegionLoad which compares the regions).

> -----Original Message-----
> From: Ted Yu [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 14, 2011 6:20 PM
> To: [EMAIL PROTECTED]
> Subject: Re: retrieving HRegion's in AssignmentManager
>
> Correction:
>   private Map<byte[], RegionLoad> regionLoad = new HashMap<byte[],
> RegionLoad>();
>
>
> On Mon, Mar 14, 2011 at 4:01 PM, Ted Yu <[EMAIL PROTECTED]> wrote:
>
> > Since region name is the only key I can find in RegionLoad, I plan to
> > make the following change:
> >   private Map<String, RegionLoad> regionLoad = new HashMap<String,
> > RegionLoad>();
> >
> > Thanks St.Ack.
> >
> >
> > On Mon, Mar 14, 2011 at 3:48 PM, Stack <[EMAIL PROTECTED]> wrote:
> >
> >> On Mon, Mar 14, 2011 at 3:15 PM, Ted Yu <[EMAIL PROTECTED]> wrote:
> >> > The navigation is not straightfoward.
> >> > In HServerLoad:
> >> >  private ArrayList<RegionLoad> regionLoad = new
> >> > ArrayList<RegionLoad>(); Given region name, there is no quick way
> >> > of locating request count for
> >> the
> >> > region without changing data structure for regionLoad.
> >> >
> >>
> >> OK.
> >>
> >> Then it looks like you need to change the HSL internals IFF you need
> >> to access by region name.
> >>
> >> Good on you Ted,
> >> St.Ack
> >>
> >
> >
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB