RPC.Builder (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.ipc, class: RPC, class: Builder

Package org.apache.hadoop.ipc

# Class RPC.Builder

java.lang.Object
org.apache.hadoop.ipc.RPC.Builder

Enclosing class:
  RPC

public static class RPC.Builder extends Object
Class to construct instances of RPC server with specific options.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder(Configuration conf)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `RPC.Server`
  `build()`
  `RPC.Builder`
  `setAlignmentContext(AlignmentContext alignmentContext)`
  `RPC.Builder`
  `setBindAddress(String bindAddress)`
  `RPC.Builder`
  `setInstance(Object instance)`
  `RPC.Builder`
  `setNumHandlers(int numHandlers)`
  `RPC.Builder`
  `setnumReaders(int numReaders)`
  Deprecated.
  call `setNumReaders(int value)` instead.
  `RPC.Builder`
  `setNumReaders(int value)`
  Set the number of reader threads.
  `RPC.Builder`
  `setPort(int port)`
  `RPC.Builder`
  `setPortRangeConfig(String portRangeConfig)`
  `RPC.Builder`
  `setProtocol(Class<?> protocol)`
  `RPC.Builder`
  `setQueueSizePerHandler(int queueSizePerHandler)`
  `RPC.Builder`
  `setSecretManager(SecretManager<? extends TokenIdentifier> secretManager)`
  `RPC.Builder`
  `setVerbose(boolean verbose)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder(Configuration conf)

- ## Method Details

  - ### setProtocol

    public RPC.Builder setProtocol(Class<?> protocol)
    Parameters:
      `protocol` - input protocol.
    Returns:
      Mandatory field.

  - ### setInstance

    public RPC.Builder setInstance(Object instance)
    Parameters:
      `instance` - input instance.
    Returns:
      Mandatory field.

  - ### setBindAddress

    public RPC.Builder setBindAddress(String bindAddress)
    Parameters:
      `bindAddress` - input bindAddress.
    Returns:
      Default: 0.0.0.0.

  - ### setPort

    public RPC.Builder setPort(int port)
    Parameters:
      `port` - input port.
    Returns:
      Default: 0.

  - ### setNumHandlers

    public RPC.Builder setNumHandlers(int numHandlers)
    Parameters:
      `numHandlers` - input numHandlers.
    Returns:
      Default: 1.

  - ### setnumReaders

    @Deprecated public RPC.Builder setnumReaders(int numReaders)
    Deprecated.
    call `setNumReaders(int value)` instead.
    Parameters:
      `numReaders` - input numReaders.
    Returns:
      Default: -1.

  - ### setNumReaders

    public RPC.Builder setNumReaders(int value)
    Set the number of reader threads.
    Parameters:
      `value` - input numReaders.
    Returns:
      this builder.
    Since:
      HADOOP-18625.

  - ### setQueueSizePerHandler

    public RPC.Builder setQueueSizePerHandler(int queueSizePerHandler)
    Parameters:
      `queueSizePerHandler` - input queueSizePerHandler.
    Returns:
      Default: -1.

  - ### setVerbose

    public RPC.Builder setVerbose(boolean verbose)
    Parameters:
      `verbose` - input verbose.
    Returns:
      Default: false.

  - ### setSecretManager

    public RPC.Builder setSecretManager(SecretManager<? extends TokenIdentifier> secretManager)
    Parameters:
      `secretManager` - input secretManager.
    Returns:
      Default: null.

  - ### setPortRangeConfig

    public RPC.Builder setPortRangeConfig(String portRangeConfig)
    Parameters:
      `portRangeConfig` - input portRangeConfig.
    Returns:
      Default: null.

  - ### setAlignmentContext

    public RPC.Builder setAlignmentContext(AlignmentContext alignmentContext)
    Parameters:
      `alignmentContext` - input alignmentContext.
    Returns:
      Default: null.

  - ### build

    public RPC.Server build() throws IOException, HadoopIllegalArgumentException
    Returns:
      Build the RPC Server.
    Throws:
      `IOException` - on error
      `HadoopIllegalArgumentException` - when mandatory fields are not set