HDFS-8665. Fix replication check in DFSTestUtils#waitForReplication.
(cherry picked from commit ff0e5e572f
)
This commit is contained in:
parent
31fd7a51d8
commit
ba406b723d
|
@ -336,6 +336,8 @@ Release 2.8.0 - UNRELEASED
|
||||||
HDFS-8640. Make reserved RBW space visible through JMX. (kanaka kumar
|
HDFS-8640. Make reserved RBW space visible through JMX. (kanaka kumar
|
||||||
avvaru via Arpit Agarwal)
|
avvaru via Arpit Agarwal)
|
||||||
|
|
||||||
|
HDFS-8665. Fix replication check in DFSTestUtils#waitForReplication. (wang)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than
|
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than
|
||||||
|
|
|
@ -549,7 +549,14 @@ public class DFSTestUtil {
|
||||||
public Boolean get() {
|
public Boolean get() {
|
||||||
try {
|
try {
|
||||||
FileStatus stat = dfs.getFileStatus(file);
|
FileStatus stat = dfs.getFileStatus(file);
|
||||||
return replication == stat.getReplication();
|
BlockLocation[] locs = dfs.getFileBlockLocations(stat, 0, stat
|
||||||
|
.getLen());
|
||||||
|
for (BlockLocation loc : locs) {
|
||||||
|
if (replication != loc.getHosts().length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.info("getFileStatus on path " + file + " failed!", e);
|
LOG.info("getFileStatus on path " + file + " failed!", e);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue