Skip to content

Commit 89c6c34

Browse files
committed
fix javadoc
1 parent 77977dd commit 89c6c34

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,9 +1353,9 @@ Map<String, List<RemoteLocation>> getAllLocations(String path) throws IOExceptio
13531353
* Get all the locations of the path for {@link RouterClientProtocol#getContentSummary(String)}.
13541354
* For example, there are some mount points:
13551355
* <p>
1356-
* /a - &gt ns0 - &gt /a
1357-
* /a/b - &gt ns0 - &gt /a/b
1358-
* /a/b/c - &gt ns1 - &gt /a/b/c
1356+
* /a - [ns0 - /a]
1357+
* /a/b - [ns0 - /a/b]
1358+
* /a/b/c - [ns1 - /a/b/c]
13591359
* </p>
13601360
* When the path is '/a', the result of locations should be
13611361
* [RemoteLocation('/a', ns0, '/a'), RemoteLocation('/a/b/c', ns1, '/a/b/c')]

hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestRouterAsyncClientProtocol.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
118
package org.apache.hadoop.hdfs.server.federation.router.async;
219

320
import org.apache.hadoop.crypto.CryptoProtocolVersion;
@@ -9,6 +26,7 @@
926
import org.apache.hadoop.hdfs.protocol.DirectoryListing;
1027
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
1128
import org.apache.hadoop.hdfs.protocol.HdfsFileStatus;
29+
import org.apache.hadoop.hdfs.server.federation.resolver.RemoteLocation;
1230
import org.apache.hadoop.hdfs.server.federation.router.RouterClientProtocol;
1331
import org.apache.hadoop.io.EnumSetWritable;
1432
import org.apache.hadoop.util.Lists;
@@ -29,6 +47,7 @@
2947
import static org.apache.hadoop.hdfs.server.federation.router.async.utils.AsyncUtil.syncReturn;
3048
import static org.apache.hadoop.hdfs.server.namenode.AclTestHelpers.aclEntry;
3149
import static org.junit.Assert.assertEquals;
50+
import static org.junit.Assert.assertNotNull;
3251
import static org.junit.Assert.assertTrue;
3352

3453
/**
@@ -84,12 +103,19 @@ public void testClientProtocolRpc() throws Exception {
84103
asyncClientProtocol.create(testPath + "/testCreate.file",
85104
new FsPermission(ALL, ALL, ALL), "testAsyncClient",
86105
new EnumSetWritable<>(EnumSet.of(CreateFlag.CREATE)),
87-
false, (short) 1, 128 * 1024 * 1024L, new CryptoProtocolVersion[]{ENCRYPTION_ZONES},
106+
false, (short) 1, 128 * 1024 * 1024L,
107+
new CryptoProtocolVersion[]{ENCRYPTION_ZONES},
88108
null, null);
89109
hdfsFileStatus = syncReturn(HdfsFileStatus.class);
90110
assertTrue(hdfsFileStatus.isFile());
91111
assertEquals(128 * 1024 * 1024, hdfsFileStatus.getBlockSize());
92112

113+
asyncClientProtocol.getFileRemoteLocation(testPath);
114+
RemoteLocation remoteLocation = syncReturn(RemoteLocation.class);
115+
assertNotNull(remoteLocation);
116+
assertEquals(getNs0(), remoteLocation.getNameserviceId());
117+
assertEquals(testPath, remoteLocation.getSrc());
118+
93119
asyncClientProtocol.getListing(testPath, new byte[1], true);
94120
DirectoryListing directoryListing = syncReturn(DirectoryListing.class);
95121
assertEquals(1, directoryListing.getPartialListing().length);

0 commit comments

Comments
 (0)