|
@@ -65,8 +65,8 @@ public class TestReplicationPolicy extends TestCase {
|
|
|
}
|
|
|
for(int i=0; i<NUM_OF_DATANODES; i++) {
|
|
|
dataNodes[i].updateHeartbeat(
|
|
|
- 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE,
|
|
|
- 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0);
|
|
|
+ 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0L,
|
|
|
+ 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -80,8 +80,8 @@ public class TestReplicationPolicy extends TestCase {
|
|
|
*/
|
|
|
public void testChooseTarget1() throws Exception {
|
|
|
dataNodes[0].updateHeartbeat(
|
|
|
- 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE,
|
|
|
- FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 4); // overloaded
|
|
|
+ 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0L,
|
|
|
+ FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 4); // overloaded
|
|
|
|
|
|
DatanodeDescriptor[] targets;
|
|
|
targets = replicator.chooseTarget(
|
|
@@ -115,8 +115,8 @@ public class TestReplicationPolicy extends TestCase {
|
|
|
assertFalse(cluster.isOnSameRack(targets[0], targets[3]));
|
|
|
|
|
|
dataNodes[0].updateHeartbeat(
|
|
|
- 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE,
|
|
|
- FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0);
|
|
|
+ 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0L,
|
|
|
+ FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -186,8 +186,8 @@ public class TestReplicationPolicy extends TestCase {
|
|
|
public void testChooseTarget3() throws Exception {
|
|
|
// make data node 0 to be not qualified to choose
|
|
|
dataNodes[0].updateHeartbeat(
|
|
|
- 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE,
|
|
|
- (FSConstants.MIN_BLOCKS_FOR_WRITE-1)*BLOCK_SIZE, 0); // no space
|
|
|
+ 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0L,
|
|
|
+ (FSConstants.MIN_BLOCKS_FOR_WRITE-1)*BLOCK_SIZE, 0); // no space
|
|
|
|
|
|
DatanodeDescriptor[] targets;
|
|
|
targets = replicator.chooseTarget(
|
|
@@ -224,8 +224,8 @@ public class TestReplicationPolicy extends TestCase {
|
|
|
assertFalse(cluster.isOnSameRack(targets[1], targets[3]));
|
|
|
|
|
|
dataNodes[0].updateHeartbeat(
|
|
|
- 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE,
|
|
|
- FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0);
|
|
|
+ 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0L,
|
|
|
+ FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -240,8 +240,8 @@ public class TestReplicationPolicy extends TestCase {
|
|
|
// make data node 0 & 1 to be not qualified to choose: not enough disk space
|
|
|
for(int i=0; i<2; i++) {
|
|
|
dataNodes[i].updateHeartbeat(
|
|
|
- 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE,
|
|
|
- (FSConstants.MIN_BLOCKS_FOR_WRITE-1)*BLOCK_SIZE, 0);
|
|
|
+ 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0L,
|
|
|
+ (FSConstants.MIN_BLOCKS_FOR_WRITE-1)*BLOCK_SIZE, 0);
|
|
|
}
|
|
|
|
|
|
DatanodeDescriptor[] targets;
|
|
@@ -272,8 +272,8 @@ public class TestReplicationPolicy extends TestCase {
|
|
|
|
|
|
for(int i=0; i<2; i++) {
|
|
|
dataNodes[i].updateHeartbeat(
|
|
|
- 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE,
|
|
|
- FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0);
|
|
|
+ 2*FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0L,
|
|
|
+ FSConstants.MIN_BLOCKS_FOR_WRITE*BLOCK_SIZE, 0);
|
|
|
}
|
|
|
}
|
|
|
/**
|