You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@accumulo.apache.org by BlackJack76 <ju...@gmail.com> on 2014/04/26 16:15:05 UTC

Custom TabletBalancer

I am attempting to write a custom TabletBalancer.  

When I create a table I create 26 splits (one for each letter of the
alphabet) which results in 26 tablets.  I have 13 tablet servers so I want
to statically assign the tablets so that 2 tablets are on each tablet
server.  After they are created, I don't want them to move around.

Anyway, if the table exists when I start Accumulo I see that getAssignments
is called with all the unassigned tablets.  Here is the method I am speaking
of: 

http://accumulo.apache.org/1.5/apidocs/org/apache/accumulo/server/master/balancer/TabletBalancer.html#getAssignments%28java.util.SortedMap,%20java.util.Map,%20java.util.Map%29

However, if I create the table and split it after Accumulo is already
running then I see that getAssignments is called but the size of the
unassigned map is always 0.  This seems to conflict with the comments in the
API that state "This method is called whenever the master finds tablets that
are unassigned".

Maybe there is an easier way to statically assign the tablets.  Any
recommendations or comments are welcome.



--
View this message in context: http://apache-accumulo.1065345.n5.nabble.com/Custom-TabletBalancer-tp9425.html
Sent from the Users mailing list archive at Nabble.com.

Re: Custom TabletBalancer

Posted by David Medinets <da...@gmail.com>.
Writing a blog entry about your TabletBalancer would be nice, if you can
share it. You could get the coveted first post on the new Accumulo blog if
you hurry.


On Sat, Apr 26, 2014 at 11:18 AM, BlackJack76 <ju...@gmail.com> wrote:

> Follow up to myself....
>
> I was previously using my custom TabletBalancer as the
> master.tablet.balancer.  However, when I use the TableLoadBalancer as the
> master.tablet.balancer and use my custom balancer in table.balancer then
> everything makes more sense.  getAssignments now never seems to be called
> when the unassigned map size is 0.
>
> The problem I have now is that when I create the table then getAssignments
> is called with one tablet.  Next, I perform the splits (which splits it
> into
> 32 tablets).  getAssignments is never called for these splits so I don't
> have a chance to assign the tablets to a particular tablet server.
>
> Again, if anyone has any thoughts please let me know.  Thanks in advance!
>
>
>
> --
> View this message in context:
> http://apache-accumulo.1065345.n5.nabble.com/Custom-TabletBalancer-tp9425p9426.html
> Sent from the Users mailing list archive at Nabble.com.
>

Re: Custom TabletBalancer

Posted by Eric Newton <er...@gmail.com>.
An instance of TabletBalancer has two basic modes: assignment and balancing.

Assignment is done when a tablet is offline, typically at start-up or
recovery.

Balancing is done periodically.  If you want to move tablets around after
they are hosted, you will need to override the balance method.

-Eric



On Sat, Apr 26, 2014 at 11:18 AM, BlackJack76 <ju...@gmail.com> wrote:

> Follow up to myself....
>
> I was previously using my custom TabletBalancer as the
> master.tablet.balancer.  However, when I use the TableLoadBalancer as the
> master.tablet.balancer and use my custom balancer in table.balancer then
> everything makes more sense.  getAssignments now never seems to be called
> when the unassigned map size is 0.
>
> The problem I have now is that when I create the table then getAssignments
> is called with one tablet.  Next, I perform the splits (which splits it
> into
> 32 tablets).  getAssignments is never called for these splits so I don't
> have a chance to assign the tablets to a particular tablet server.
>
> Again, if anyone has any thoughts please let me know.  Thanks in advance!
>
>
>
> --
> View this message in context:
> http://apache-accumulo.1065345.n5.nabble.com/Custom-TabletBalancer-tp9425p9426.html
> Sent from the Users mailing list archive at Nabble.com.
>

Re: Custom TabletBalancer

Posted by BlackJack76 <ju...@gmail.com>.
Follow up to myself....

I was previously using my custom TabletBalancer as the
master.tablet.balancer.  However, when I use the TableLoadBalancer as the
master.tablet.balancer and use my custom balancer in table.balancer then
everything makes more sense.  getAssignments now never seems to be called
when the unassigned map size is 0.

The problem I have now is that when I create the table then getAssignments
is called with one tablet.  Next, I perform the splits (which splits it into
32 tablets).  getAssignments is never called for these splits so I don't
have a chance to assign the tablets to a particular tablet server.

Again, if anyone has any thoughts please let me know.  Thanks in advance!



--
View this message in context: http://apache-accumulo.1065345.n5.nabble.com/Custom-TabletBalancer-tp9425p9426.html
Sent from the Users mailing list archive at Nabble.com.