public class RolePredicates extends Object
Predicates for matching Cluster.Instances with certain cluster roles.| Constructor and Description |
|---|
RolePredicates() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.common.base.Predicate<Cluster.Instance> |
allRolesIn(Set<String> roles) |
static com.google.common.base.Predicate<Cluster.Instance> |
anyRoleIn(Set<String> roles) |
static com.google.common.base.Predicate<Cluster.Instance> |
onlyRolesIn(Set<String> roles) |
static com.google.common.base.Predicate<Cluster.Instance> |
role(String role) |
static com.google.common.base.Predicate<Cluster.Instance> |
withIds(Set<String> ids) |
static com.google.common.base.Predicate<Cluster.Instance> |
withIds(String... ids) |
public static com.google.common.base.Predicate<Cluster.Instance> role(String role)
role - Predicate that matches Cluster.Instances whose roles
include role.public static com.google.common.base.Predicate<Cluster.Instance> onlyRolesIn(Set<String> roles)
roles - Predicate that matches Cluster.Instances whose roles
are exactly the same as those in roles.public static com.google.common.base.Predicate<Cluster.Instance> allRolesIn(Set<String> roles)
roles - Predicate that matches Cluster.Instances whose roles
contain all of roles.public static com.google.common.base.Predicate<Cluster.Instance> anyRoleIn(Set<String> roles)
roles - Predicate that matches Cluster.Instances whose roles
contain at least one of roles.public static com.google.common.base.Predicate<Cluster.Instance> withIds(String... ids)
ids - list of instance idsPredicate that matches Cluster.Instance whose id is
found in the IDs listpublic static com.google.common.base.Predicate<Cluster.Instance> withIds(Set<String> ids)
ids - list of instance idsPredicate that matches Cluster.Instance whose id is
found in the IDs listCopyright © 2010–2016 Cloudera. All rights reserved.