Codota Logo
ClusterSpec$Group.from
Code IndexAdd Codota to your IDE (free)

How to use
from
method
in
com.yahoo.config.provision.ClusterSpec$Group

Best Java code snippets using com.yahoo.config.provision.ClusterSpec$Group.from (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: com.yahoo.vespa/node-repository

/** Move nodes from unwanted groups to wanted groups to avoid lingering groups consisting of retired nodes */
private void moveToActiveGroup(List<Node> surplusNodes, int wantedGroups, Optional<ClusterSpec.Group> targetGroup) {
  for (ListIterator<Node> i = surplusNodes.listIterator(); i.hasNext(); ) {
    Node node = i.next();
    ClusterMembership membership = node.allocation().get().membership();
    ClusterSpec cluster = membership.cluster();
    if (cluster.group().get().index() >= wantedGroups) {
      ClusterSpec.Group newGroup = targetGroup.orElse(ClusterSpec.Group.from(0));
      ClusterMembership newGroupMembership = membership.with(cluster.with(Optional.of(newGroup)));
      i.set(node.with(node.allocation().get().with(newGroupMembership)));
    }
  }
}
origin: com.yahoo.vespa/config-provisioning

private ClusterMembership(String stringValue, Version vespaVersion) {
  String[] components = stringValue.split("/");
  if (components.length < 4 || components.length > 7)
    throw new RuntimeException("Could not parse '" + stringValue + "' to a cluster membership. " +
                  "Expected 'clusterType/clusterId/groupId/index[/retired][/exclusive][/rotationId,...]'");
  boolean exclusive = false;
  Set<RotationName> rotations = Collections.emptySet();
  if (components.length > 4) {
    for (int i = 4; i < components.length; i++) {
      String component = components[i];
      switch (component) {
        case "exclusive": exclusive = true; break;
        case "retired": retired = true; break;
        default: rotations = rotationsFrom(component); break;
      }
    }
  }
  this.cluster = ClusterSpec.from(ClusterSpec.Type.valueOf(components[0]), ClusterSpec.Id.from(components[1]),
                  ClusterSpec.Group.from(Integer.valueOf(components[2])), vespaVersion, exclusive,
                  rotations);
  this.index = Integer.parseInt(components[3]);
  this.stringValue = toStringValue();
}
origin: com.yahoo.vespa/config-model

allocation.addAll(allocateHostGroup(cluster.with(Optional.of(ClusterSpec.Group.from(0))),
                  flavor,
                  capacity,
  allocation.addAll(allocateHostGroup(cluster.with(Optional.of(ClusterSpec.Group.from(i))),
                    flavor,
                    capacity / groups,
origin: com.yahoo.vespa/node-repository

/**
 * Ensure sufficient nodes are reserved or active for the given application and cluster
 *
 * @return the list of nodes this cluster will have allocated if activated
 */
 // Note: This operation may make persisted changes to the set of reserved and inactive nodes,
 // but it may not change the set of active nodes, as the active nodes must stay in sync with the
 // active config model which is changed on activate
public List<Node> prepare(ApplicationId application, ClusterSpec cluster, NodeSpec requestedNodes, int wantedGroups) {
  List<Node> surplusNodes = findNodesInRemovableGroups(application, cluster, wantedGroups);
  MutableInteger highestIndex = new MutableInteger(findHighestIndex(application, cluster));
  List<Node> acceptedNodes = new ArrayList<>();
  for (int groupIndex = 0; groupIndex < wantedGroups; groupIndex++) {
    ClusterSpec clusterGroup = cluster.with(Optional.of(ClusterSpec.Group.from(groupIndex)));
    List<Node> accepted = groupPreparer.prepare(application, clusterGroup,
                          requestedNodes.fraction(wantedGroups), surplusNodes,
                          highestIndex, spareCount);
    replace(acceptedNodes, accepted);
  }
  moveToActiveGroup(surplusNodes, wantedGroups, cluster.group());
  replace(acceptedNodes, retire(surplusNodes));
  return acceptedNodes;
}
com.yahoo.config.provisionClusterSpec$Groupfrom

Popular methods of ClusterSpec$Group

  • index
  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now