Skip to content

Commit 56bed26

Browse files
authored
Merge branch 'apache:trunk' into HDFS-17339
2 parents d83ac16 + f6fea5d commit 56bed26

File tree

67 files changed

+734
-185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+734
-185
lines changed

dev-support/docker/pkg-resolver/install-maven.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fi
4040

4141
if [ "$version_to_install" == "3.6.3" ]; then
4242
mkdir -p /opt/maven /tmp/maven &&
43-
curl -L -s -S https://dlcdn.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz \
43+
curl -L -s -S https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.tar.gz \
4444
-o /tmp/maven/apache-maven-3.6.3-bin.tar.gz &&
4545
tar xzf /tmp/maven/apache-maven-3.6.3-bin.tar.gz --strip-components 1 -C /opt/maven
4646
else
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
8686
}
8787

8888
private void handle(RpcDeniedReply deniedReply) {
89-
LOG.warn("Portmap mapping registration request was denied , " +
89+
LOG.warn("Portmap mapping registration request was denied , " +
9090
deniedReply);
9191
}
9292

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import org.apache.hadoop.oncrpc.security.Verifier;
2121

22-
/**
22+
/**
2323
* Represents RPC message MSG_ACCEPTED reply body. See RFC 1831 for details.
2424
* This response is sent to a request to indicate success of the request.
2525
*/
@@ -32,7 +32,7 @@ public enum AcceptState {
3232
PROC_UNAVAIL, /* program can't support procedure */
3333
GARBAGE_ARGS, /* procedure can't decode params */
3434
SYSTEM_ERR; /* e.g. memory allocation failure */
35-
35+
3636
public static AcceptState fromValue(int value) {
3737
return values()[value];
3838
}
@@ -41,12 +41,12 @@ public int getValue() {
4141
return ordinal();
4242
}
4343
};
44-
45-
public static RpcAcceptedReply getAcceptInstance(int xid,
44+
45+
public static RpcAcceptedReply getAcceptInstance(int xid,
4646
Verifier verifier) {
4747
return getInstance(xid, AcceptState.SUCCESS, verifier);
4848
}
49-
49+
5050
public static RpcAcceptedReply getInstance(int xid, AcceptState state,
5151
Verifier verifier) {
5252
return new RpcAcceptedReply(xid, ReplyState.MSG_ACCEPTED, verifier,
@@ -70,7 +70,7 @@ public static RpcAcceptedReply read(int xid, ReplyState replyState, XDR xdr) {
7070
public AcceptState getAcceptState() {
7171
return acceptState;
7272
}
73-
73+
7474
@Override
7575
public XDR write(XDR xdr) {
7676
xdr.writeInt(xid);

hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/RpcCall.java renamed to hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcCall.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ public class RpcCall extends RpcMessage {
3131

3232
public static RpcCall read(XDR xdr) {
3333
return new RpcCall(xdr.readInt(), RpcMessage.Type.fromValue(xdr.readInt()),
34-
xdr.readInt(), xdr.readInt(), xdr.readInt(), xdr.readInt(),
34+
xdr.readInt(), xdr.readInt(), xdr.readInt(), xdr.readInt(),
3535
Credentials.readFlavorAndCredentials(xdr),
3636
Verifier.readFlavorAndVerifier(xdr));
3737
}
38-
38+
3939
public static RpcCall getInstance(int xid, int program, int version,
4040
int procedure, Credentials cred, Verifier verifier) {
4141
return new RpcCall(xid, RpcMessage.Type.RPC_CALL, 2, program, version,
4242
procedure, cred, verifier);
4343
}
44-
44+
4545
private final int rpcVersion;
4646
private final int program;
4747
private final int version;
@@ -64,14 +64,14 @@ protected RpcCall(int xid, RpcMessage.Type messageType, int rpcVersion,
6464
}
6565
validate();
6666
}
67-
67+
6868
private void validateRpcVersion() {
6969
if (rpcVersion != RPC_VERSION) {
7070
throw new IllegalArgumentException("RPC version is expected to be "
7171
+ RPC_VERSION + " but got " + rpcVersion);
7272
}
7373
}
74-
74+
7575
public void validate() {
7676
validateMessageType(RpcMessage.Type.RPC_CALL);
7777
validateRpcVersion();
@@ -95,15 +95,15 @@ public int getVersion() {
9595
public int getProcedure() {
9696
return procedure;
9797
}
98-
98+
9999
public Credentials getCredential() {
100100
return credentials;
101101
}
102102

103103
public Verifier getVerifier() {
104104
return verifier;
105105
}
106-
106+
107107
@Override
108108
public XDR write(XDR xdr) {
109109
xdr.writeInt(xid);
@@ -116,7 +116,7 @@ public XDR write(XDR xdr) {
116116
Verifier.writeFlavorAndVerifier(verifier, xdr);
117117
return xdr;
118118
}
119-
119+
120120
@Override
121121
public String toString() {
122122
return String.format("Xid:%d, messageType:%s, rpcVersion:%d, program:%d,"

hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/RpcCallCache.java renamed to hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcCallCache.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,34 @@
3939
* <br>
4040
* A request is identified by the client ID (address of the client) and
4141
* transaction ID (xid) from the Rpc call.
42-
*
42+
*
4343
*/
4444
public class RpcCallCache {
45-
45+
4646
public static class CacheEntry {
4747
private RpcResponse response; // null if no response has been sent
48-
48+
4949
public CacheEntry() {
5050
response = null;
5151
}
52-
52+
5353
public boolean isInProgress() {
5454
return response == null;
5555
}
56-
56+
5757
public boolean isCompleted() {
5858
return response != null;
5959
}
60-
60+
6161
public RpcResponse getResponse() {
6262
return response;
6363
}
64-
64+
6565
public void setResponse(RpcResponse response) {
6666
this.response = response;
6767
}
6868
}
69-
69+
7070
/**
7171
* Call that is used to track a client in the {@link RpcCallCache}
7272
*/
@@ -85,9 +85,9 @@ public ClientRequest(InetAddress clientId, int xid) {
8585

8686
@Override
8787
public int hashCode() {
88-
return xid + clientId.hashCode() * 31;
88+
return xid + clientId.hashCode() * 31;
8989
}
90-
90+
9191
@Override
9292
public boolean equals(Object obj) {
9393
if (this == obj) {
@@ -100,11 +100,11 @@ public boolean equals(Object obj) {
100100
return clientId.equals(other.clientId) && (xid == other.xid);
101101
}
102102
}
103-
103+
104104
private final String program;
105-
105+
106106
private final Map<ClientRequest, CacheEntry> map;
107-
107+
108108
public RpcCallCache(final String program, final int maxEntries) {
109109
if (maxEntries <= 0) {
110110
throw new IllegalArgumentException("Cache size is " + maxEntries
@@ -121,7 +121,7 @@ protected boolean removeEldestEntry(
121121
}
122122
};
123123
}
124-
124+
125125
/**
126126
* Return the program name.
127127
* @return RPC program name
@@ -144,7 +144,7 @@ public void callCompleted(InetAddress clientId, int xid, RpcResponse response) {
144144
}
145145
e.response = response;
146146
}
147-
147+
148148
/**
149149
* Check the cache for an entry. If it does not exist, add the request
150150
* as in progress.
@@ -164,16 +164,16 @@ public CacheEntry checkOrAddToCache(InetAddress clientId, int xid) {
164164
}
165165
return e;
166166
}
167-
167+
168168
/**
169169
* Return number of cached entries.
170170
* @return cache size
171171
*/
172172
public int size() {
173173
return map.size();
174174
}
175-
176-
/**
175+
176+
/**
177177
* Iterator to the cache entries.
178178
* @return iterator cache iterator
179179
*/
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import org.apache.hadoop.oncrpc.security.Verifier;
2121

22-
/**
22+
/**
2323
* Represents RPC message MSG_DENIED reply body. See RFC 1831 for details.
2424
* This response is sent to a request to indicate failure of the request.
2525
*/
@@ -55,15 +55,15 @@ public static RpcDeniedReply read(int xid, ReplyState replyState, XDR xdr) {
5555
public RejectState getRejectState() {
5656
return rejectState;
5757
}
58-
58+
5959
@Override
6060
public String toString() {
6161
return new StringBuffer().append("xid:").append(xid)
6262
.append(",messageType:").append(messageType).append("verifier_flavor:")
6363
.append(verifier.getFlavor()).append("rejectState:")
6464
.append(rejectState).toString();
6565
}
66-
66+
6767
@Override
6868
public XDR write(XDR xdr) {
6969
xdr.writeInt(xid);

hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/RpcMessage.java renamed to hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/oncrpc/RpcMessage.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public enum Type {
2626
// the order of the values below are significant.
2727
RPC_CALL,
2828
RPC_REPLY;
29-
29+
3030
public int getValue() {
3131
return ordinal();
3232
}
@@ -41,25 +41,25 @@ public static Type fromValue(int value) {
4141

4242
protected final int xid;
4343
protected final Type messageType;
44-
44+
4545
RpcMessage(int xid, Type messageType) {
4646
if (messageType != Type.RPC_CALL && messageType != Type.RPC_REPLY) {
4747
throw new IllegalArgumentException("Invalid message type " + messageType);
4848
}
4949
this.xid = xid;
5050
this.messageType = messageType;
5151
}
52-
52+
5353
public abstract XDR write(XDR xdr);
54-
54+
5555
public int getXid() {
5656
return xid;
5757
}
5858

5959
public Type getMessageType() {
6060
return messageType;
6161
}
62-
62+
6363
protected void validateMessageType(Type expected) {
6464
if (expected != messageType) {
6565
throw new IllegalArgumentException("Message type is expected to be "

0 commit comments

Comments
 (0)