Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistency in configuring VNET clusters #44

Open
thomasjungblut opened this issue Dec 1, 2015 · 0 comments
Open

Fix inconsistency in configuring VNET clusters #44

thomasjungblut opened this issue Dec 1, 2015 · 0 comments

Comments

@thomasjungblut
Copy link
Contributor

Right now the API exposes the following constructors for the client:

  • HBaseClient(ClusterCredentials credentials)
  • HBaseClient(int numRegionServers)
  • HBaseClient(ClusterCredentials credentials, IRetryPolicyFactory retryPolicyFactory, ILoadBalancer loadBalancer = null)

The first call is for gateway deployments (agnostic of OS), the second by default for vnet load balancing on Windows clusters.

For linux clusters and VNET you would need to pass a load balancer in the third constructor with the right hostnames created. Despite not beeing able to instantiate a retry factory (see #43), this is quite inconsistent (why are the credentials needed?) and not nice for a user to setup.

Let's add a builder that creates a new HBaseClient:

var client = HBaseClientBuilder
   .New()
   .OnLinux()
   .OnVNet(numNodes: 32, loadBalancer: new LoadBalancerRoundRobin())
   .WithRetryPolicy(new ExponentialRetryPolicy(...))
   .Create();

Which will configure 32 nodes on linux with a vnet and RR balancing.

For the gateway case:

var client = HBaseClientBuilder
   .New()
   .OnWindows()
   .WithClusterUri(new Uri(...))
   .WithCredentials(new ClusterCredentials(...))
   .WithRetryPolicy(new ExponentialRetryPolicy(...))
   .Create();

We also need to refactor all the stuff in between, it has become a big mess with url strings getting passed around and no real structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant