com.scalar.db.storage.rpc.GrpcUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalardb Show documentation
Show all versions of scalardb Show documentation
A universal transaction manager that achieves database-agnostic transactions and distributed transactions that span multiple databases
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();
}
}