HADOOP-18625. Fix method name of RPC.Builder#setnumReaders (#5301)

Changes method name of RPC.Builder#setnumReaders to setNumReaders()

The original method is still there, just marked deprecated.
It is the one which should be used when working with older branches.

Contributed by Haiyang Hu
This commit is contained in:
huhaiyang 2023-02-09 21:28:34 +08:00 committed by Steve Loughran
parent b6680907f9
commit de08baded6
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
3 changed files with 17 additions and 3 deletions

View File

@ -896,15 +896,29 @@ public class RPC {
this.numHandlers = numHandlers;
return this;
}
/**
* @return Default: -1.
* @param numReaders input numReaders.
* @deprecated call {@link #setNumReaders(int value)} instead.
*/
@Deprecated
public Builder setnumReaders(int numReaders) {
this.numReaders = numReaders;
return this;
}
/**
* Set the number of reader threads.
*
* @return this builder.
* @param value input numReaders.
* @since HADOOP-18625.
*/
public Builder setNumReaders(int value) {
this.numReaders = value;
return this;
}
/**
* @return Default: -1.

View File

@ -380,7 +380,7 @@ public class TestRPC extends TestRpcBase {
assertEquals(confReaders, server.getNumReaders());
server = newServerBuilder(conf)
.setNumHandlers(1).setnumReaders(3).setQueueSizePerHandler(200)
.setNumHandlers(1).setNumReaders(3).setQueueSizePerHandler(200)
.setVerbose(false).build();
assertEquals(3, server.getNumReaders());

View File

@ -298,7 +298,7 @@ public class RouterRpcServer extends AbstractService implements ClientProtocol,
.setBindAddress(confRpcAddress.getHostName())
.setPort(confRpcAddress.getPort())
.setNumHandlers(handlerCount)
.setnumReaders(readerCount)
.setNumReaders(readerCount)
.setQueueSizePerHandler(handlerQueueSize)
.setVerbose(false)
.setSecretManager(this.securityManager.getSecretManager())