ScalarDB Cluster gRPC API Guide
This document describes the ScalarDB Cluster gRPC API.
You need to have a license key (trial license or commercial license) to use ScalarDB Cluster. If you don't have a license key, please contact us.
ScalarDB Cluster provides a Java API that uses the gRPC API internally. If you use Java or a JVM language, you can use the Java API instead of the ScalarDB Cluster gRPC API directly. For details about the Java API, see Developer Guide for ScalarDB Cluster with the Java API.
For details about the services and messages for the ScalarDB Cluster gRPC API, see the definitions in the scalardb-cluster.proto
file. For ScalarDB Cluster users who have a commercial license, please contact us if you need the scalardb-cluster.proto
file.
ScalarDB Cluster gRPC API is composed of the following services:
scalardb.cluster.rpc.v1.DistributedTransaction
: Provides a distributed transaction capability for ScalarDB Cluster.scalardb.cluster.rpc.v1.TwoPhaseCommitTransaction
: Provides a two-phase commit transaction capability for ScalarDB Cluster.scalardb.cluster.rpc.v1.DistributedTransactionAdmin
: Provides comprehensive administrative operations.
The following sections describe how to use each service.
Overview of error handling in ScalarDB Cluster gRPC API
Before describing how to use each service, this section explains how error handling works in ScalarDB Cluster gRPC API.
ScalarDB Cluster gRPC API employs Richer error model for error handling.
This model enables servers to return and enables clients to consume additional error details expressed as one or more protobuf messages.
ScalarDB Cluster gRPC API uses google.rpc.ErrorInfo
, which is one of the standard set of error message types, and puts additional error details in ErrorInfo
fields.
ErrorInfo
has the following fields:
reason
: A string that provides a short description of the error. The following sections describe the possible values ofreason
in each service.domain
: A string that indicates the error's origin. In ScalarDB Cluster gRPC API, this string is always set tocom.scalar.db.cluster
.metadata
: A map of metadata for the specific error. In ScalarDB Cluster gRPC API, a transaction ID with thetransactionId
key in the map is put if the error is related to a transaction.
If you encounter an error, you can retrieve ErrorInfo
from google.rpc.Status
in the gRPC response, but the method for doing so depends on the programming language.
Please refer to the appropriate documentation to understand how to get ErrorInfo
in your specific programming language.