Skip to content

Commit fac9676

Browse files
authored
Merge branch 'apache:trunk' into YARN-11326
2 parents d15542a + e45451f commit fac9676

File tree

23 files changed

+820
-32
lines changed

23 files changed

+820
-32
lines changed

hadoop-common-project/hadoop-auth/pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,8 @@
110110
<groupId>org.bouncycastle</groupId>
111111
<artifactId>bcprov-jdk15on</artifactId>
112112
</exclusion>
113-
<!-- HACK. Transitive dependency for nimbus-jose-jwt. Needed for
114-
packaging. Please re-check this version when updating
115-
nimbus-jose-jwt. Please read HADOOP-14903 for more details.
116-
-->
117-
<exclusion>
118-
<groupId>net.minidev</groupId>
119-
<artifactId>json-smart</artifactId>
120-
</exclusion>
121113
</exclusions>
122114
</dependency>
123-
<dependency>
124-
<groupId>net.minidev</groupId>
125-
<artifactId>json-smart</artifactId>
126-
</dependency>
127115
<dependency>
128116
<groupId>org.apache.zookeeper</groupId>
129117
<artifactId>zookeeper</artifactId>

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,6 +2147,19 @@ FsServerDefaults decodeResponse(Map<?, ?> json) throws IOException {
21472147
}.run();
21482148
}
21492149

2150+
@Override
2151+
public Path getLinkTarget(Path f) throws IOException {
2152+
statistics.incrementReadOps(1);
2153+
storageStatistics.incrementOpCounter(OpType.GET_LINK_TARGET);
2154+
final HttpOpParam.Op op = GetOpParam.Op.GETLINKTARGET;
2155+
return new FsPathResponseRunner<Path>(op, f) {
2156+
@Override
2157+
Path decodeResponse(Map<?, ?> json) {
2158+
return new Path((String) json.get(Path.class.getSimpleName()));
2159+
}
2160+
}.run();
2161+
}
2162+
21502163
@VisibleForTesting
21512164
InetSocketAddress[] getResolvedNNAddr() {
21522165
return nnAddrs;

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/resources/GetOpParam.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public enum Op implements HttpOpParam.Op {
6464
GETSNAPSHOTDIFF(false, HttpURLConnection.HTTP_OK),
6565
GETSNAPSHOTDIFFLISTING(false, HttpURLConnection.HTTP_OK),
6666
GETSNAPSHOTTABLEDIRECTORYLIST(false, HttpURLConnection.HTTP_OK),
67+
GETLINKTARGET(false, HttpURLConnection.HTTP_OK),
6768
GETSNAPSHOTLIST(false, HttpURLConnection.HTTP_OK);
6869

6970
final boolean redirect;

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MountTableResolver.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -678,11 +678,16 @@ private List<MountTable> getTreeValues(final String path, boolean reverse) {
678678
* @return Size of the cache.
679679
* @throws IOException If the cache is not initialized.
680680
*/
681-
protected long getCacheSize() throws IOException{
682-
if (this.locationCache != null) {
683-
return this.locationCache.size();
681+
protected long getCacheSize() throws IOException {
682+
this.readLock.lock();
683+
try {
684+
if (this.locationCache != null) {
685+
return this.locationCache.size();
686+
}
687+
throw new IOException("localCache is null");
688+
} finally {
689+
this.readLock.unlock();
684690
}
685-
throw new IOException("localCache is null");
686691
}
687692

688693
@VisibleForTesting

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ protected Response get(
385385
case GETXATTRS:
386386
case LISTXATTRS:
387387
case CHECKACCESS:
388+
case GETLINKTARGET:
388389
{
389390
return super.get(ugi, delegation, username, doAsUser, fullpath, op,
390391
offset, length, renewer, bufferSize, xattrNames, xattrEncoding,

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/driver/StateStoreDriver.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import java.net.InetAddress;
2121
import java.util.Collection;
2222

23+
import org.apache.hadoop.classification.InterfaceAudience;
24+
import org.apache.hadoop.classification.InterfaceStability;
2325
import org.apache.hadoop.conf.Configuration;
2426
import org.apache.hadoop.hdfs.server.federation.metrics.StateStoreMetrics;
2527
import org.apache.hadoop.hdfs.server.federation.store.StateStoreService;
@@ -35,6 +37,8 @@
3537
* provider. Driver implementations will extend this class and implement some of
3638
* the default methods.
3739
*/
40+
@InterfaceAudience.Public
41+
@InterfaceStability.Evolving
3842
public abstract class StateStoreDriver implements StateStoreRecordOperations {
3943

4044
private static final Logger LOG =

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/driver/impl/StateStoreBaseImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import java.util.ArrayList;
2424
import java.util.List;
2525

26+
import org.apache.hadoop.classification.InterfaceAudience;
27+
import org.apache.hadoop.classification.InterfaceStability;
2628
import org.apache.hadoop.hdfs.server.federation.store.StateStoreUtils;
2729
import org.apache.hadoop.hdfs.server.federation.store.driver.StateStoreDriver;
2830
import org.apache.hadoop.hdfs.server.federation.store.records.BaseRecord;
@@ -39,6 +41,8 @@
3941
* optimization, such as custom get/put/remove queries, depending on the
4042
* capabilities of the data store.
4143
*/
44+
@InterfaceAudience.Public
45+
@InterfaceStability.Evolving
4246
public abstract class StateStoreBaseImpl extends StateStoreDriver {
4347

4448
@Override

0 commit comments

Comments
 (0)