Tabnine Logo
TieredIdentity.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
alluxio.wire.TieredIdentity

Best Java code snippets using alluxio.wire.TieredIdentity.equals (Showing top 2 results out of 315)

origin: Alluxio/alluxio

@Override
@Nullable
public WorkerNetAddress getWorkerForNextBlock(Iterable<BlockWorkerInfo> workerInfoList,
  long blockSizeBytes) {
 List<BlockWorkerInfo> shuffledWorkers = Lists.newArrayList(workerInfoList);
 Collections.shuffle(shuffledWorkers);
 // Workers must have enough capacity to hold the block.
 List<BlockWorkerInfo> candidateWorkers = shuffledWorkers.stream()
   .filter(worker -> worker.getCapacityBytes() >= blockSizeBytes)
   .collect(Collectors.toList());
 // Try finding a worker based on nearest tiered identity.
 List<TieredIdentity> identities = candidateWorkers.stream()
   .map(worker -> worker.getNetAddress().getTieredIdentity())
   .filter(Objects::nonNull)
   .collect(Collectors.toList());
 Optional<TieredIdentity> nearest = TieredIdentityUtils.nearest(mTieredIdentity, identities,
   mCompareNodeIps);
 if (!nearest.isPresent()) {
  return null;
 }
 // Map back to the worker with the nearest tiered identity.
 return candidateWorkers.stream()
   .filter(worker -> worker.getNetAddress().getTieredIdentity().equals(nearest.get()))
   .map(worker -> worker.getNetAddress())
   .findFirst().orElse(null);
}
origin: Alluxio/alluxio

if (nearest.isPresent()) {
 dataSource = locations.stream().map(BlockLocation::getWorkerAddress)
   .filter(addr -> addr.getTieredIdentity().equals(nearest.get())).findFirst().get();
 if (mTieredIdentity.getTier(0).getTierName().equals(Constants.LOCALITY_NODE)
   && mTieredIdentity.topTiersMatch(nearest.get())) {
alluxio.wireTieredIdentityequals

Popular methods of TieredIdentity

  • <init>
  • getTier
  • getTiers
  • fromThrift
  • toString
  • toThrift
  • topTiersMatch

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • getExternalFilesDir (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JButton (javax.swing)
  • JComboBox (javax.swing)
  • Top plugins for WebStorm
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