Package com.linkedin.venice.grpc
Class GrpcUtils
java.lang.Object
com.linkedin.venice.grpc.GrpcUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.grpc.StatusaccessResultToGrpcStatus(AccessResult accessResult) static io.grpc.ChannelCredentialsbuildChannelCredentials(SSLFactory sslFactory) static X509CertificateextractGrpcClientCert(io.grpc.ServerCall<?, ?> call) static KeyManager[]getKeyManagers(SSLFactory sslFactory) static TrustManager[]getTrustManagers(SSLFactory sslFactory) static com.google.protobuf.ByteStringtoByteString(io.netty.buffer.ByteBuf buf) Copies readable bytes from aByteBufinto aByteString.static com.google.protobuf.ByteStringtoByteStringNoCopy(byte[] bytes) Wraps a byte array into aByteStringwithout copying.
-
Constructor Details
-
GrpcUtils
public GrpcUtils()
-
-
Method Details
-
getKeyManagers
public static KeyManager[] getKeyManagers(SSLFactory sslFactory) throws UnrecoverableKeyException, CertificateException, KeyStoreException, IOException, NoSuchAlgorithmException -
getTrustManagers
public static TrustManager[] getTrustManagers(SSLFactory sslFactory) throws CertificateException, KeyStoreException, IOException, NoSuchAlgorithmException -
accessResultToGrpcStatus
-
extractGrpcClientCert
public static X509Certificate extractGrpcClientCert(io.grpc.ServerCall<?, ?> call) throws SSLPeerUnverifiedException- Throws:
SSLPeerUnverifiedException
-
toByteStringNoCopy
public static com.google.protobuf.ByteString toByteStringNoCopy(byte[] bytes) Wraps a byte array into aByteStringwithout copying. The returnedByteStringdirectly aliases the provided array, so the caller must not modify the array after calling this method. Violating this contract can cause silent data corruption in serialized gRPC payloads.If the caller cannot guarantee immutability of the input array, use
ByteString.copyFrom(byte[])instead. -
toByteString
public static com.google.protobuf.ByteString toByteString(io.netty.buffer.ByteBuf buf) Copies readable bytes from aByteBufinto aByteString. -
buildChannelCredentials
-