Resizes the cluster's node count. Please note that only clusters that belong to a PRODUCTION
instance can be resized.

<p>Sample code:

<pre>{@code
Cluster cluster = client.resizeCluster("my-instance", "my-cluster", 30);
}</pre>
17089
@SuppressWarnings("WeakerAccess")
  public Cluster resizeCluster(String instanceId, String clusterId, int numServeNodes) {
    return ApiExceptions.callAndTranslateApiException(
        resizeClusterAsync(instanceId, clusterId, numServeNodes));
  }
486906
public void resize(int maxCacheSize) {
		setMaxCacheSize(maxCacheSize);
		for (FeatureCache cache : tableCache.values()) {
			cache.resize(maxCacheSize);
		}
	}
224037
public void setClusters(java.util.Collection<Cluster> clusters) {
        if (clusters == null) {
            this.clusters = null;
            return;
        }

        this.clusters = new java.util.ArrayList<Cluster>(clusters);
    }
343785
@Override
  protected final void increaseNewListSize() throws IOException {
    // register old situation
    int tmpOldSize = newKeyList.length;
    int tmpNewPosition = newPosition;
    // increase
    super.increaseNewListSize();
    // reconstruct
    T1[][] tmpNewFullValueList = newFullValueList;
    newFullValueList = operations.createMatrix1(newSize);
    newPosition = tmpNewPosition;
    System.arraycopy(tmpNewFullValueList, 0, newFullValueList, 0, tmpOldSize);
  }
598005
private void deployInstance(final InstanceContext instance, final CountingCompletionHandler<Void> counter) {
    // First we need to select a node from the component's deployment group
    // to which to deploy the component.
    // If the component doesn't specify a group then deploy to any node in the cluster.
    if (instance.component().group() != null) {
      cluster.getGroup(instance.component().group(), new Handler<AsyncResult<Group>>() {
        @Override
        public void handle(AsyncResult<Group> result) {
          if (result.failed()) {
            counter.fail(result.cause());
          } else {
            result.result().selectNode(instance.address(), new Handler<AsyncResult<Node>>() {
              @Override
              public void handle(AsyncResult<Node> result) {
                if (result.failed()) {
                  counter.fail(result.cause());
                } else {
                  deployInstance(result.result(), instance, counter);
                }
              }
            });
          }
        }
      });
    } else {
      cluster.selectNode(instance.address(), new Handler<AsyncResult<Node>>() {
        @Override
        public void handle(AsyncResult<Node> result) {
          if (result.failed()) {
            counter.fail(result.cause());
          } else {
            deployInstance(result.result(), instance, counter);
          }
        }
      });
    }
  }
1251262
protected void resizeTo(long newCapacity) {
        final long oldCapacity = capacity();
        final long oldAllocatedSize = HEADER_SIZE + oldCapacity * slotLength;
        final MemoryAllocator oldMalloc;
        final long oldAddress;
        if (auxMalloc != null) {
            final long size = size();
            oldAddress = move(baseAddress, oldCapacity, malloc, auxMalloc);
            oldMalloc = auxMalloc;
            auxAllocateAndAdjustFields(oldAddress, size, oldCapacity, newCapacity);
        } else {
            oldMalloc = malloc;
            oldAddress = baseAddress;
            allocateArrayAndAdjustFields(size(), newCapacity);
        }
        rehash(oldCapacity, oldAddress);
        oldMalloc.free(oldAddress - HEADER_SIZE, oldAllocatedSize);
    }
274780
function Cluster(mc) {
  this.markerClusterer_ = mc;
  this.map_ = mc.getMap();
  this.gridSize_ = mc.getGridSize();
  this.minClusterSize_ = mc.getMinimumClusterSize();
  this.averageCenter_ = mc.getAverageCenter();
  this.markers_ = [];
  this.center_ = null;
  this.bounds_ = null;
  this.clusterIcon_ = new ClusterIcon(this, mc.getStyles());
}
644797
private void doNodeLeft(final Node node) {
    tasks.runTask(new Handler<Task>() {
      @Override
      public void handle(final Task task) {
        if (currentContext != null) {
          log.info(String.format("%s - %s left the cluster. Reassigning components", NetworkManager.this, node.address()));
          deploymentNodes.keySet(new Handler<AsyncResult<Set<String>>>() {
            @Override
            public void handle(AsyncResult<Set<String>> result) {
              if (result.succeeded()) {
                final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(result.result().size());
                counter.setHandler(new Handler<AsyncResult<Void>>() {
                  @Override
                  public void handle(AsyncResult<Void> result) {
                    task.complete();
                  }
                });
  
                // If the instance was deployed on the node that left the cluster then
                // redeploy it on a new node.
                for (final String instanceAddress : result.result()) {
                  deploymentNodes.get(instanceAddress, new Handler<AsyncResult<String>>() {
                    @Override
                    public void handle(AsyncResult<String> result) {
                      if (result.succeeded() && result.result().equals(node.address())) {
                        // Look up the current instance context in the cluster.
                        data.get(instanceAddress, new Handler<AsyncResult<String>>() {
                          @Override
                          public void handle(AsyncResult<String> result) {
                            if (result.succeeded() && result.result() != null) {
                              deployInstance(Contexts.<InstanceContext>deserialize(new JsonObject(result.result())), counter);
                            } else {
                              counter.succeed();
                            }
                          }
                        });
                      } else {
                        counter.succeed();
                      }
                    }
                  });
                }
              }
            }
          });
        } else {
          task.complete();
        }
      }
    });
  }
506818
private void resize(final int ns) {
    final int size = BDDPrime.primeGTE(ns);
    this.table = new BDDCacheEntry[size];
    for (int n = 0; n < size; n++)
      this.table[n] = new BDDCacheEntry();
  }
74240
public void init(Cluster cluster, Map<String, Node> nodeIdToNode) {
        _cluster = cluster;
        _nodeIdToNode = nodeIdToNode;
    }
384115
private void resize(Object[] oldTable, int newSize)
    {
        int oldCapacity = oldTable.length;
        int end = oldCapacity - 1;
        Object last = arrayAt(oldTable, end);
        if (this.size() < ((end*3) >> 2) && last == RESIZE_SENTINEL)
        {
            return;
        }
        if (oldCapacity >= MAXIMUM_CAPACITY)
        {
            throw new RuntimeException("max capacity of map exceeded");
        }
        ResizeContainer resizeContainer = null;
        boolean ownResize = false;
        if (last == null || last == RESIZE_SENTINEL)
        {
            synchronized (oldTable) // allocating a new array is too expensive to make this an atomic operation
            {
                if (arrayAt(oldTable, end) == null)
                {
                    setArrayAt(oldTable, end, RESIZE_SENTINEL);
                    resizeContainer = new ResizeContainer(allocateTable(newSize), oldTable.length - 2);
                    setArrayAt(oldTable, end, resizeContainer);
                    ownResize = true;
                }
            }
        }
        if (ownResize)
        {
            this.transfer(oldTable, resizeContainer);

            Object[] src = this.table;
            while (!TABLE_UPDATER.compareAndSet(this, oldTable, resizeContainer.nextArray))
            {
                // we're in a double resize situation; we'll have to go help until it's our turn to set the table
                if (src != oldTable)
                {
                    this.helpWithResize(src);
                }
            }
        }
        else
        {
            this.helpWithResize(oldTable);
        }
    }
757955
private void putResize (K key, V value) {
		// Check for empty buckets.
		int hashCode = System.identityHashCode(key);
		int index1 = hashCode & mask;
		K key1 = keyTable[index1];
		if (key1 == null) {
			keyTable[index1] = key;
			valueTable[index1] = value;
			if (size++ >= threshold) resize(capacity << 1);
			return;
		}

		int index2 = hash2(hashCode);
		K key2 = keyTable[index2];
		if (key2 == null) {
			keyTable[index2] = key;
			valueTable[index2] = value;
			if (size++ >= threshold) resize(capacity << 1);
			return;
		}

		int index3 = hash3(hashCode);
		K key3 = keyTable[index3];
		if (key3 == null) {
			keyTable[index3] = key;
			valueTable[index3] = value;
			if (size++ >= threshold) resize(capacity << 1);
			return;
		}

		int index4 = -1;
		K key4 = null;
		if (bigTable) {
			index4 = hash4(hashCode);
			key4 = keyTable[index4];
			if (key4 == null) {
				keyTable[index4] = key;
				valueTable[index4] = value;
				if (size++ >= threshold) resize(capacity << 1);
				return;
			}
		}

		push(key, value, index1, key1, index2, key2, index3, key3, index4, key4);
	}
786170
public OvhInstanceDetail project_serviceName_instance_instanceId_resize_POST(String serviceName, String instanceId, String flavorId) throws IOException {
		String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/resize";
		StringBuilder sb = path(qPath, serviceName, instanceId);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "flavorId", flavorId);
		String resp = exec(qPath, "POST", sb.toString(), o);
		return convertTo(resp, OvhInstanceDetail.class);
	}
775304
@Deprecated
	public int count() {
		int count = (clusteringFeature != null) ? 1 : 0;
		for (ClusteringTreeNode child : children) {
			count += child.count();
		}
		return count;
	}
1031032
boolean setGroupCountSize(int count, int size)
    {
        if (count <= 0 || size <= 0) {
            return false;
        }
        m_groupcount_ = count;
        m_groupsize_ = size;
        return true;
    }
450024
protected void initalize(T input) {
		this.input = input;
		pixels.resize(input.width * input.height);
		initialSegments.reshape(input.width, input.height);

		// number of usable pixels that cluster centers can be placed in
		int numberOfUsable = (input.width-2*BORDER)*(input.height-2*BORDER);
		gridInterval = (int)Math.sqrt( numberOfUsable/(double)numberOfRegions);

		if( gridInterval <= 0 )
			throw new IllegalArgumentException("Too many regions for an image of this size");

		// See equation (1)
		adjustSpacial = m/gridInterval;
	}
433919
private Map<Integer, Integer> getNodeIdToPrimaryCount(Cluster cluster) {
        Map<Integer, Integer> nodeIdToPrimaryCount = Maps.newHashMap();
        for(Node node: cluster.getNodes()) {
            nodeIdToPrimaryCount.put(node.getId(), node.getPartitionIds().size());
        }

        return nodeIdToPrimaryCount;
    }