Skip to content

Instantly share code, notes, and snippets.

@iliapolo
Created May 5, 2015 09:25
Show Gist options
  • Save iliapolo/3337299ce89db0f95087 to your computer and use it in GitHub Desktop.
Save iliapolo/3337299ce89db0f95087 to your computer and use it in GitHub Desktop.
Rebalancing an elastic space
Admin admin = new AdminFactory().addGroup("elip-xap").createAdmin();
GridServiceManager gsm = admin.getGridServiceManagers().waitForAtLeastOne();
ElasticSpaceDeployment deployment = new ElasticSpaceDeployment("mySpace");
// deploy a 3,1 cluster.
// this should be default use just 2 containers
deployment.memoryCapacityPerContainer(768, MemoryUnit.MEGABYTES);
deployment.maxMemoryCapacity(4608, MemoryUnit.MEGABYTES);
gsm.deploy(deployment);
// scale to 3 containers (3 machines - each with 2GB)
admin.getProcessingUnits().waitFor("mySpace").scale(new ManualCapacityScaleConfigurer().
memoryCapacity(2304, MemoryUnit.MEGABYTES).create());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment