Skip to content

Commit 21a1b1a

Browse files
committed
fix ut & checkstyle
1 parent c311ab6 commit 21a1b1a

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
@InterfaceStability.Stable
273273
public class ClientNamenodeProtocolTranslatorPB implements
274274
ProtocolMetaInterface, ClientProtocol, Closeable, ProtocolTranslator {
275-
final protected ClientNamenodeProtocolPB rpcProxy;
275+
final private ClientNamenodeProtocolPB rpcProxy;
276276

277277
protected static final GetServerDefaultsRequestProto VOID_GET_SERVER_DEFAULT_REQUEST =
278278
GetServerDefaultsRequestProto.newBuilder().build();

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/protocolPB/RouterClientProtocolTranslatorPB.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,9 @@
200200
import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenRequestProto;
201201
import org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto;
202202
import org.apache.hadoop.security.token.Token;
203-
204203
import org.apache.hadoop.thirdparty.protobuf.ByteString;
205-
206204
import org.apache.hadoop.util.Lists;
207205

208-
import static org.apache.hadoop.ha.proto.HAServiceProtocolProtos.HAServiceStateProto.ACTIVE;
209-
import static org.apache.hadoop.ha.proto.HAServiceProtocolProtos.HAServiceStateProto.INITIALIZING;
210-
import static org.apache.hadoop.ha.proto.HAServiceProtocolProtos.HAServiceStateProto.OBSERVER;
211-
import static org.apache.hadoop.hdfs.protocol.proto.HdfsServerProtos.NNHAStatusHeartbeatProto.State.STANDBY;
212206
import static org.apache.hadoop.hdfs.protocolPB.AsyncRpcProtocolPBUtil.asyncIpcClient;
213207

214208
/**
@@ -219,9 +213,11 @@
219213
@InterfaceAudience.Private
220214
@InterfaceStability.Stable
221215
public class RouterClientProtocolTranslatorPB extends ClientNamenodeProtocolTranslatorPB {
216+
private final ClientNamenodeProtocolPB rpcProxy;
222217

223218
public RouterClientProtocolTranslatorPB(ClientNamenodeProtocolPB proxy) {
224219
super(proxy);
220+
rpcProxy = proxy;
225221
}
226222

227223
@Override
@@ -1827,7 +1823,7 @@ public void removeErasureCodingPolicy(String ecPolicyName)
18271823
public void enableErasureCodingPolicy(String ecPolicyName)
18281824
throws IOException {
18291825
if (!Client.isAsynchronousMode()) {
1830-
super.removeErasureCodingPolicy(ecPolicyName);
1826+
super.enableErasureCodingPolicy(ecPolicyName);
18311827
return;
18321828
}
18331829
EnableErasureCodingPolicyRequestProto.Builder builder =
@@ -1843,7 +1839,7 @@ public void enableErasureCodingPolicy(String ecPolicyName)
18431839
public void disableErasureCodingPolicy(String ecPolicyName)
18441840
throws IOException {
18451841
if (!Client.isAsynchronousMode()) {
1846-
super.removeErasureCodingPolicy(ecPolicyName);
1842+
super.disableErasureCodingPolicy(ecPolicyName);
18471843
return;
18481844
}
18491845
DisableErasureCodingPolicyRequestProto.Builder builder =
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
*/
18+
19+
/**
20+
* This package contains the implementation of the Protocol Buffers
21+
* protocols related to HDFS Router.
22+
*/
23+
@InterfaceAudience.Private
24+
@InterfaceStability.Evolving
25+
26+
package org.apache.hadoop.hdfs.protocolPB;
27+
28+
import org.apache.hadoop.classification.InterfaceAudience;
29+
import org.apache.hadoop.classification.InterfaceStability;

0 commit comments

Comments
 (0)