|
|
-
retrieving HRegion's in AssignmentManager
Ted Yu 2011-03-14, 20:38
Hi, How should I retrieve HRegion's in AssignmentManager ?
I see HRegion.getRegionInfo() but there is no counterpart.
Thanks
-
Re: retrieving HRegion's in AssignmentManager
Stack 2011-03-14, 20:52
There won't be HRegions in the Master context (The master doesn't carry HRegions). There will only be pointers; i.e. the HRegionInfo. St.Ack On Mon, Mar 14, 2011 at 1:38 PM, Ted Yu <[EMAIL PROTECTED]> wrote: > Hi, > How should I retrieve HRegion's in AssignmentManager ? > > I see HRegion.getRegionInfo() but there is no counterpart. > > Thanks >
-
Re: retrieving HRegion's in AssignmentManager
Ted Yu 2011-03-14, 20:55
This is related to HBASE-3507 The request count in HRegion should be visible to master so that load balancer can make use of this information.
On Mon, Mar 14, 2011 at 1:52 PM, Stack <[EMAIL PROTECTED]> wrote:
> There won't be HRegions in the Master context (The master doesn't > carry HRegions). There will only be pointers; i.e. the HRegionInfo. > St.Ack > > > On Mon, Mar 14, 2011 at 1:38 PM, Ted Yu <[EMAIL PROTECTED]> wrote: > > Hi, > > How should I retrieve HRegion's in AssignmentManager ? > > > > I see HRegion.getRegionInfo() but there is no counterpart. > > > > Thanks > > >
-
Re: retrieving HRegion's in AssignmentManager
Ted Yu 2011-03-14, 21:43
If we keep current relationship, one approach would be to add the request count to HRegionInfo
On Mon, Mar 14, 2011 at 1:55 PM, Ted Yu <[EMAIL PROTECTED]> wrote:
> This is related to HBASE-3507 > The request count in HRegion should be visible to master so that load > balancer can make use of this information. > > > On Mon, Mar 14, 2011 at 1:52 PM, Stack <[EMAIL PROTECTED]> wrote: > >> There won't be HRegions in the Master context (The master doesn't >> carry HRegions). There will only be pointers; i.e. the HRegionInfo. >> St.Ack >> >> >> On Mon, Mar 14, 2011 at 1:38 PM, Ted Yu <[EMAIL PROTECTED]> wrote: >> > Hi, >> > How should I retrieve HRegion's in AssignmentManager ? >> > >> > I see HRegion.getRegionInfo() but there is no counterpart. >> > >> > Thanks >> > >> > >
-
Re: retrieving HRegion's in AssignmentManager
Stack 2011-03-14, 21:49
On Mon, Mar 14, 2011 at 2:43 PM, Ted Yu <[EMAIL PROTECTED]> wrote: > If we keep current relationship, one approach would be to add the request > count to HRegionInfo >
No.
Let the request stuff stay out in the HServerLoad class rather than bring this into the HSI.
Can you get HServerLoad from AM?
St.Ack
-
Re: retrieving HRegion's in AssignmentManager
Ted Yu 2011-03-14, 22:15
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.
Regards
On Mon, Mar 14, 2011 at 2:49 PM, Stack <[EMAIL PROTECTED]> wrote:
> On Mon, Mar 14, 2011 at 2:43 PM, Ted Yu <[EMAIL PROTECTED]> wrote: > > If we keep current relationship, one approach would be to add the request > > count to HRegionInfo > > > > No. > > Let the request stuff stay out in the HServerLoad class rather than > bring this into the HSI. > > Can you get HServerLoad from AM? > > St.Ack >
-
Re: retrieving HRegion's in AssignmentManager
Stack 2011-03-14, 22:48
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
-
Re: retrieving HRegion's in AssignmentManager
Ted Yu 2011-03-14, 23:01
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 >
-
Re: retrieving HRegion's in AssignmentManager
Ted Yu 2011-03-15, 01:19
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 >> > >
-
RE: retrieving HRegion's in AssignmentManager
Jonathan Gray 2011-03-15, 03:14
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 > >> > > > >
-
Re: retrieving HRegion's in AssignmentManager
Ted Yu 2011-03-15, 03:36
I will use the following: private Map<byte[], RegionLoad> regionLoad = new TreeMap<byte[], RegionLoad>(Bytes.BYTES_COMPARATOR);
Thanks for the reminder, Jonathan.
On Mon, Mar 14, 2011 at 8:14 PM, Jonathan Gray <[EMAIL PROTECTED]> wrote:
> 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 > > >> > > > > > > >
|
|