Java Code Examples for org.apache.ratis.rpc.SupportedRpcType#valueOfIgnoreCase()

The following examples show how to use org.apache.ratis.rpc.SupportedRpcType#valueOfIgnoreCase() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XceiverServerRatis.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
private RpcType setRpcType(RaftProperties properties) {
  final String rpcType = conf.get(
      OzoneConfigKeys.DFS_CONTAINER_RATIS_RPC_TYPE_KEY,
      OzoneConfigKeys.DFS_CONTAINER_RATIS_RPC_TYPE_DEFAULT);
  final RpcType rpc = SupportedRpcType.valueOfIgnoreCase(rpcType);
  RaftConfigKeys.Rpc.setType(properties, rpc);
  return rpc;
}
 
Example 2
Source File: XceiverClientRatis.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
public static XceiverClientRatis newXceiverClientRatis(
    org.apache.hadoop.hdds.scm.pipeline.Pipeline pipeline,
    ConfigurationSource ozoneConf, X509Certificate caCert) {
  final String rpcType = ozoneConf
      .get(ScmConfigKeys.DFS_CONTAINER_RATIS_RPC_TYPE_KEY,
          ScmConfigKeys.DFS_CONTAINER_RATIS_RPC_TYPE_DEFAULT);
  final RetryPolicy retryPolicy = RatisHelper.createRetryPolicy(ozoneConf);
  final GrpcTlsConfig tlsConfig = RatisHelper.createTlsClientConfig(new
      SecurityConfig(ozoneConf), caCert);
  return new XceiverClientRatis(pipeline,
      SupportedRpcType.valueOfIgnoreCase(rpcType),
      retryPolicy, tlsConfig, ozoneConf);
}
 
Example 3
Source File: RatisHelper.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
private static RpcType getRpcType(ConfigurationSource conf) {
  return SupportedRpcType.valueOfIgnoreCase(conf.get(
      ScmConfigKeys.DFS_CONTAINER_RATIS_RPC_TYPE_KEY,
      ScmConfigKeys.DFS_CONTAINER_RATIS_RPC_TYPE_DEFAULT));
}