All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.scalar.db.storage.rpc.GrpcUtils Maven / Gradle / Ivy

Go to download

A universal transaction manager that achieves database-agnostic transactions and distributed transactions that span multiple databases

There is a newer version: 3.14.0
Show newest version
package com.scalar.db.storage.rpc;

import io.grpc.ManagedChannel;
import io.grpc.netty.NettyChannelBuilder;

public final class GrpcUtils {

  private GrpcUtils() {}

  public static ManagedChannel createChannel(GrpcConfig config) {
    NettyChannelBuilder builder =
        NettyChannelBuilder.forAddress(config.getHost(), config.getPort()).usePlaintext();
    config.getMaxInboundMessageSize().ifPresent(builder::maxInboundMessageSize);
    config.getMaxInboundMetadataSize().ifPresent(builder::maxInboundMetadataSize);
    return builder.build();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy