HDFS-6627. Merging change r1608940 from trunk to branch-2.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1608948 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris Nauroth 2014-07-08 20:31:14 +00:00
parent a919e86452
commit 18a54c1e16
2 changed files with 5 additions and 2 deletions

View File

@ -15,6 +15,9 @@ Release 2.6.0 - UNRELEASED
HDFS-6638. Shorten test run time with a smaller retry timeout setting. HDFS-6638. Shorten test run time with a smaller retry timeout setting.
(Liang Xie via cnauroth) (Liang Xie via cnauroth)
HDFS-6627. Rename DataNode#checkWriteAccess to checkReadAccess.
(Liang Xie via cnauroth)
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES

View File

@ -2306,11 +2306,11 @@ public class DataNode extends Configured
@Override // ClientDataNodeProtocol @Override // ClientDataNodeProtocol
public long getReplicaVisibleLength(final ExtendedBlock block) throws IOException { public long getReplicaVisibleLength(final ExtendedBlock block) throws IOException {
checkWriteAccess(block); checkReadAccess(block);
return data.getReplicaVisibleLength(block); return data.getReplicaVisibleLength(block);
} }
private void checkWriteAccess(final ExtendedBlock block) throws IOException { private void checkReadAccess(final ExtendedBlock block) throws IOException {
if (isBlockTokenEnabled) { if (isBlockTokenEnabled) {
Set<TokenIdentifier> tokenIds = UserGroupInformation.getCurrentUser() Set<TokenIdentifier> tokenIds = UserGroupInformation.getCurrentUser()
.getTokenIdentifiers(); .getTokenIdentifiers();