Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ protected DatanodeStorageInfo chooseLocalOrFavoredStorage(
(DatanodeDescriptor) localOrFavoredNode;
// otherwise try local machine first
if (excludedNodes.add(localOrFavoredNode) // was not in the excluded list
&& isGoodDatanode(localDatanode, maxNodesPerRack, false,
&& isGoodDatanode(localDatanode, maxNodesPerRack, considerLoad,
results, avoidStaleNodes)) {
for (Iterator<Map.Entry<StorageType, Integer>> iter = storageTypes
.entrySet().iterator(); iter.hasNext(); ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void testConsiderLoadFactor() throws IOException {
BlockManagerTestUtil.getStorageReportsForDatanode(dataNodes[0]),
dataNodes[0].getCacheCapacity(),
dataNodes[0].getCacheUsed(),
5, 0, null);
15, 0, null);
dnManager.getHeartbeatManager().updateHeartbeat(dataNodes[1],
BlockManagerTestUtil.getStorageReportsForDatanode(dataNodes[1]),
dataNodes[1].getCacheCapacity(),
Expand All @@ -163,7 +163,7 @@ public void testConsiderLoadFactor() throws IOException {
BlockManagerTestUtil.getStorageReportsForDatanode(dataNodes[5]),
dataNodes[5].getCacheCapacity(),
dataNodes[5].getCacheUsed(),
15, 0, null);
5, 0, null);
//Add values in above heartbeats
double load = 5 + 10 + 15 + 10 + 15 + 5;
// Call chooseTarget()
Expand Down