Tabnine Logo
ClusterSpec$Type.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
com.yahoo.config.provision.ClusterSpec$Type

Best Java code snippets using com.yahoo.config.provision.ClusterSpec$Type.equals (Showing top 7 results out of 315)

origin: com.yahoo.vespa/config-model

private int totalAllocatedTo(ClusterSpec cluster) {
  int count = 0;
  for (Map.Entry<ClusterSpec, List<HostSpec>> allocation : allocations.entrySet()) {
    if ( ! allocation.getKey().type().equals(cluster.type())) continue;
    if ( ! allocation.getKey().id().equals(cluster.id())) continue;
    count += allocation.getValue().size();
  }
  return count;
}
origin: com.yahoo.vespa/config-provisioning

@Override
public boolean equals(Object o) {
  if (o == this) return true;
  if ( ! (o instanceof ClusterSpec)) return false;
  ClusterSpec other = (ClusterSpec)o;
  if ( ! other.type.equals(this.type)) return false;
  if ( ! other.id.equals(this.id)) return false;
  if ( ! other.groupId.equals(this.groupId)) return false;
  if ( ! other.vespaVersion.equals(this.vespaVersion)) return false;
  return true;
}
origin: com.yahoo.vespa/node-repository

/**
 * Returns a list of the nodes which are
 * in groups with index number above or equal the group count
 */
private List<Node> findNodesInRemovableGroups(ApplicationId application, ClusterSpec requestedCluster, int wantedGroups) {
  List<Node> surplusNodes = new ArrayList<>(0);
  for (Node node : nodeRepository.getNodes(application, Node.State.active)) {
    ClusterSpec nodeCluster = node.allocation().get().membership().cluster();
    if ( ! nodeCluster.id().equals(requestedCluster.id())) continue;
    if ( ! nodeCluster.type().equals(requestedCluster.type())) continue;
    if (nodeCluster.group().get().index() >= wantedGroups)
      surplusNodes.add(node);
  }
  return surplusNodes;
}

origin: com.yahoo.vespa/node-repository

private static int compareForRelocation(Node a, Node b) {
  // Choose smallest node
  int capacity = ResourceCapacity.of(a).compare(ResourceCapacity.of(b));
  if (capacity != 0) return capacity;
  // Choose unallocated over allocated (this case is when we have ready docker nodes)
  if (!a.allocation().isPresent() && b.allocation().isPresent()) return -1;
  if (a.allocation().isPresent() && !b.allocation().isPresent()) return 1;
  // Choose container over content nodes
  if (a.allocation().isPresent() && b.allocation().isPresent()) {
    if (a.allocation().get().membership().cluster().type().equals(ClusterSpec.Type.container) &&
        !b.allocation().get().membership().cluster().type().equals(ClusterSpec.Type.container))
      return -1;
    if (!a.allocation().get().membership().cluster().type().equals(ClusterSpec.Type.container) &&
        b.allocation().get().membership().cluster().type().equals(ClusterSpec.Type.container))
      return 1;
  }
  // To get a stable algorithm - choose lexicographical from hostname
  return a.hostname().compareTo(b.hostname());
}
origin: com.yahoo.vespa/node-repository

/**
 * Returns the highest index number of all active and failed nodes in this cluster, or -1 if there are no nodes.
 * We include failed nodes to avoid reusing the index of the failed node in the case where the failed node is the
 * node with the highest index.
 */
private int findHighestIndex(ApplicationId application, ClusterSpec cluster) {
  int highestIndex = -1;
  for (Node node : nodeRepository.getNodes(application,
                       Node.State.active, Node.State.inactive, Node.State.parked, Node.State.failed)) {
    ClusterSpec nodeCluster = node.allocation().get().membership().cluster();
    if ( ! nodeCluster.id().equals(cluster.id())) continue;
    if ( ! nodeCluster.type().equals(cluster.type())) continue;
    highestIndex = Math.max(node.allocation().get().membership().index(), highestIndex);
  }
  return highestIndex;
}
origin: com.yahoo.vespa/config-provisioning

/** Returns whether this is equal, disregarding the group value and wanted Vespa version */
public boolean equalsIgnoringGroupAndVespaVersion(Object o) {
  if (o == this) return true;
  if ( ! (o instanceof ClusterSpec)) return false;
  ClusterSpec other = (ClusterSpec)o;
  if ( ! other.type.equals(this.type)) return false;
  if ( ! other.id.equals(this.id)) return false;
  return true;
}
origin: com.yahoo.vespa/node-repository

/** Returns the subset of nodes assigned to the given cluster type */
public NodeList type(ClusterSpec.Type type) {
  return filter(node -> node.allocation().get().membership().cluster().type().equals(type));
}
com.yahoo.config.provisionClusterSpec$Typeequals

Popular methods of ClusterSpec$Type

  • name
  • compareTo
  • hashCode
  • valueOf

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSupportFragmentManager (FragmentActivity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JOptionPane (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now