Package alluxio.util
Class TieredIdentityUtils
- java.lang.Object
-
- alluxio.util.TieredIdentityUtils
-
@ThreadSafe public final class TieredIdentityUtils extends java.lang.Object
Utility functions for working with tiered identity.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
matches(TieredIdentity.LocalityTier tier, TieredIdentity.LocalityTier otherTier, boolean resolveIpAddress)
Locality comparison for wire type locality tiers, two locality tiers matches if both name and values are equal, or for the "node" tier, if the node names resolve to the same IP address.static java.util.Optional<TieredIdentity>
nearest(TieredIdentity tieredIdentity, java.util.List<TieredIdentity> identities, AlluxioConfiguration conf)
-
-
-
Method Detail
-
matches
public static boolean matches(TieredIdentity.LocalityTier tier, TieredIdentity.LocalityTier otherTier, boolean resolveIpAddress)
Locality comparison for wire type locality tiers, two locality tiers matches if both name and values are equal, or for the "node" tier, if the node names resolve to the same IP address.- Parameters:
tier
- a wire type locality tierotherTier
- a wire type locality tier to compare toresolveIpAddress
- whether or not to resolve hostnames to IP addresses for node locality- Returns:
- true if the wire type locality tier matches the given tier
-
nearest
public static java.util.Optional<TieredIdentity> nearest(TieredIdentity tieredIdentity, java.util.List<TieredIdentity> identities, AlluxioConfiguration conf)
- Parameters:
tieredIdentity
- the tiered identityidentities
- the tiered identities to compare toconf
- Alluxio configuration- Returns:
- the identity closest to this one. If none of the identities match, the first identity is returned
-
-