Tabnine Logo
BlockPlacementPolicyDefault.useDelHint
Code IndexAdd Tabnine to your IDE (free)

How to use
useDelHint
method
in
org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault

Best Java code snippets using org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault.useDelHint (Showing top 6 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

@Override
boolean useDelHint(DatanodeStorageInfo delHint,
  DatanodeStorageInfo added, List<DatanodeStorageInfo> moreThanOne,
  Collection<DatanodeStorageInfo> exactlyOne,
  List<StorageType> excessTypes) {
 if (!super.useDelHint(delHint, added, moreThanOne, exactlyOne,
   excessTypes)) {
  // If BlockPlacementPolicyDefault doesn't allow useDelHint, there is no
  // point checking with upgrade domain policy.
  return false;
 }
 return isMovableBasedOnUpgradeDomain(combine(moreThanOne, exactlyOne),
   delHint, added);
}
origin: org.apache.hadoop/hadoop-hdfs

if (firstOne && useDelHint(delNodeHintStorage, addedNodeStorage,
  moreThanOne, exactlyOne, excessTypes)) {
 cur = delNodeHintStorage;
origin: ch.cern.hadoop/hadoop-hdfs

if (useDelHint(firstOne, delNodeHintStorage, addedNodeStorage,
  moreThanOne, excessTypes)) {
 cur = delNodeHintStorage;
origin: io.prestosql.hadoop/hadoop-apache

if (useDelHint(firstOne, delNodeHintStorage, addedNodeStorage,
  moreThanOne, excessTypes)) {
 cur = delNodeHintStorage;
origin: ch.cern.hadoop/hadoop-hdfs

@Test
public void testUseDelHint() throws Exception {
 List<StorageType> excessTypes = new ArrayList<StorageType>();
 excessTypes.add(StorageType.ARCHIVE);
 // only consider delHint for the first case
 assertFalse(BlockPlacementPolicyDefault.useDelHint(false, null, null, null,
   null));
 // no delHint
 assertFalse(BlockPlacementPolicyDefault.useDelHint(true, null, null, null,
   null));
 // delHint storage type is not an excess type
 assertFalse(BlockPlacementPolicyDefault.useDelHint(true, storages[0], null,
   null, excessTypes));
 // check if removing delHint reduces the number of racks
 List<DatanodeStorageInfo> chosenNodes = new ArrayList<DatanodeStorageInfo>();
 chosenNodes.add(storages[0]);
 chosenNodes.add(storages[2]);
 excessTypes.add(StorageType.DEFAULT);
 assertTrue(BlockPlacementPolicyDefault.useDelHint(true, storages[0], null,
   chosenNodes, excessTypes));
 // the added node adds a new rack
 assertTrue(BlockPlacementPolicyDefault.useDelHint(true, storages[3],
   storages[5], chosenNodes, excessTypes));
 // removing delHint reduces the number of racks;
 assertFalse(BlockPlacementPolicyDefault.useDelHint(true, storages[3],
   storages[0], chosenNodes, excessTypes));
 assertFalse(BlockPlacementPolicyDefault.useDelHint(true, storages[3], null,
   chosenNodes, excessTypes));
}
origin: ch.cern.hadoop/hadoop-hdfs

@Test
public void testUseDelHint() {
 DatanodeStorageInfo delHint = new DatanodeStorageInfo(
   DFSTestUtil.getLocalDatanodeDescriptor(), new DatanodeStorage("id"));
 List<DatanodeStorageInfo> moreThan1Racks = Arrays.asList(delHint);
 List<StorageType> excessTypes = new ArrayList<StorageType>();
 excessTypes.add(StorageType.DEFAULT);
 Assert.assertTrue(BlockPlacementPolicyDefault.useDelHint(true, delHint,
   null, moreThan1Racks, excessTypes));
 excessTypes.remove(0);
 excessTypes.add(StorageType.SSD);
 Assert.assertFalse(BlockPlacementPolicyDefault.useDelHint(true, delHint,
   null, moreThan1Racks, excessTypes));
}

org.apache.hadoop.hdfs.server.blockmanagementBlockPlacementPolicyDefaultuseDelHint

Javadoc

Check if we can use delHint.

Popular methods of BlockPlacementPolicyDefault

  • chooseReplicaToDelete
    Decide whether deleting the specified replica of the block still makes the block conform to the conf
  • chooseTarget
  • addToExcludedNodes
    Add localMachine and related nodes to excludedNodes for next replica choosing. In sub class, we can
  • adjustSetsWithChosenReplica
  • chooseDataNode
    Choose a datanode from the given scope with specified storage type.
  • chooseFromNextRack
  • chooseLocalRack
    Choose one node from the rack that localMachine is on. if no such node is available, choose one node
  • chooseLocalStorage
    Choose localMachine as the target. if localMachine is not available, choose a node on the same rack
  • chooseRandom
    Randomly choose numOfReplicas targets from the given scope.
  • chooseRemoteRack
    Choose numOfReplicas nodes from the racks that localMachine is NOT on. if not enough nodes are avail
  • getMaxNodesPerRack
    Calculate the maximum number of replicas to allocate per rack. It also limits the total number of re
  • getPipeline
    Return a pipeline of nodes. The pipeline is formed finding a shortest path that starts from the writ
  • getMaxNodesPerRack,
  • getPipeline,
  • getRequiredStorageTypes,
  • initialize,
  • logNodeIsNotChosen,
  • pickupReplicaSet,
  • splitNodesWithRack,
  • addIfIsGoodTarget,
  • isGoodTarget

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • 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