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

How to use
getTier
method
in
alluxio.wire.TieredIdentity

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

origin: Alluxio/alluxio

/**
 * @param other a tiered identity to compare to
 * @return whether the top tier of this tiered identity matches the top tier of other
 */
public boolean topTiersMatch(TieredIdentity other) {
 return mTiers.get(0).equals(other.getTier(0));
}
origin: Alluxio/alluxio

String value = null;
if (scriptIdentity != null) {
 LocalityTier scriptTier = scriptIdentity.getTier(i);
 Preconditions.checkState(scriptTier.getTierName().equals(tierName));
 value = scriptTier.getValue();
origin: Alluxio/alluxio

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())) {
 dataSourceType = BlockInStreamSource.LOCAL;
origin: Alluxio/alluxio

@Test
public void chooseClosestTierAvoidEviction() throws Exception {
 List<BlockWorkerInfo> workers = new ArrayList<>();
 workers.add(worker(Constants.GB, Constants.MB, "node2", "rack3"));
 workers.add(worker(Constants.GB, 0, "node3", "rack2"));
 workers.add(worker(Constants.GB, 0, "node4", "rack3"));
 FileWriteLocationPolicy policy;
 WorkerNetAddress chosen;
 // local rack with enough availability
 policy = new LocalFirstAvoidEvictionPolicy(
   TieredIdentityFactory.fromString("node=node2,rack=rack3", mConf), mConf);
 chosen = policy.getWorkerForNextBlock(workers, Constants.GB);
 assertEquals("node4", chosen.getTieredIdentity().getTier(0).getValue());
}
origin: Alluxio/alluxio

@Test
public void chooseClosestTier() throws Exception {
 List<BlockWorkerInfo> workers = new ArrayList<>();
 workers.add(worker(Constants.GB, "node2", "rack3"));
 workers.add(worker(Constants.GB, "node3", "rack2"));
 workers.add(worker(Constants.GB, "node4", "rack3"));
 LocalFirstPolicy policy;
 WorkerNetAddress chosen;
 // local rack
 policy = LocalFirstPolicy.create(TieredIdentityFactory.fromString("node=node1,rack=rack2",
   sConf), sConf.getBoolean(PropertyKey.LOCALITY_COMPARE_NODE_IP));
 chosen = policy.getWorkerForNextBlock(workers, Constants.GB);
 assertEquals("rack2", chosen.getTieredIdentity().getTier(1).getValue());
 // local node
 policy = LocalFirstPolicy.create(TieredIdentityFactory.fromString("node=node4,rack=rack3",
   sConf),
   sConf.getBoolean(PropertyKey.LOCALITY_COMPARE_NODE_IP));
 chosen = policy.getWorkerForNextBlock(workers, Constants.GB);
 assertEquals("node4", chosen.getTieredIdentity().getTier(0).getValue());
}
origin: org.alluxio/alluxio-core-common

/**
 * @param other a tiered identity to compare to
 * @return whether the top tier of this tiered identity matches the top tier of other
 */
public boolean topTiersMatch(TieredIdentity other) {
 return mTiers.get(0).equals(other.getTier(0));
}
origin: org.alluxio/alluxio-core-common

String value = null;
if (scriptIdentity != null) {
 LocalityTier scriptTier = scriptIdentity.getTier(i);
 Preconditions.checkState(scriptTier.getTierName().equals(tierName));
 value = scriptTier.getValue();
alluxio.wireTieredIdentitygetTier

Popular methods of TieredIdentity

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (Timer)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best IntelliJ plugins
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