이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Hot Rod C++ Client Guide
Configure and use Hot Rod C++ clients
Abstract
Red Hat Data Grid 링크 복사링크가 클립보드에 복사되었습니다!
Data Grid is a high-performance, distributed in-memory data store.
- Schemaless data structure
- Flexibility to store different objects as key-value pairs.
- Grid-based data storage
- Designed to distribute and replicate data across clusters.
- Elastic scaling
- Dynamically adjust the number of nodes to meet demand without service disruption.
- Data interoperability
- Store, retrieve, and query data in the grid from different endpoints.
Data Grid documentation 링크 복사링크가 클립보드에 복사되었습니다!
Documentation for Data Grid is available on the Red Hat customer portal.
Data Grid downloads 링크 복사링크가 클립보드에 복사되었습니다!
Access the Data Grid Software Downloads on the Red Hat customer portal.
You must have a Red Hat account to access and download Data Grid software.
Making open source more inclusive 링크 복사링크가 클립보드에 복사되었습니다!
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Chapter 1. Installing the Hot Rod C++ client 링크 복사링크가 클립보드에 복사되었습니다!
Install the Hot Rod C++ client on your host system as a dynamic library.
1.1. C++ compiler requirements 링크 복사링크가 클립보드에 복사되었습니다!
| Operating system | Required compiler |
|---|---|
| Red Hat Enterprise Linux (RHEL) 8 | C++ 11 compiler (GCC 8.5.0) |
| RHEL 9 | C++ 11 compiler (GCC 11.3.1) |
| Microsoft Windows 7 x64 | C++ 11 compiler (Visual Studio 14 2015 Win64, Microsoft Visual C++ 2013 Redistributable Package for the x64 platform) |
1.2. Installing Hot Rod C++ clients on Red Hat Enterprise Linux (RHEL) 링크 복사링크가 클립보드에 복사되었습니다!
Data Grid provides an RPM distribution of the Hot Rod C++ client for RHEL.
Procedure
Enable the repository for the Hot Rod C++ client on RHEL.
Expand RHEL version Repository RHEL 8
jb-datagrid-8.4-for-rhel-8-x86_64-rpmsRHEL 9
jb-datagrid-8.4-for-rhel-9-x86_64-rpmsInstall the Hot Rod C++ client.
yum install jdg-cpp-client
# yum install jdg-cpp-clientCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.3. Installing Hot Rod C++ clients on Microsoft Windows 링크 복사링크가 클립보드에 복사되었습니다!
Data Grid provides an archived version of the Hot Rod C++ client for installation on Windows.
Procedure
- Download the ZIP archive for the Hot Rod C++ client from the Data Grid Software Downloads.
- Extract the ZIP archive to your file system.
Chapter 2. Compiling Protobuf Schema 링크 복사링크가 클립보드에 복사되었습니다!
Data Grid uses the ProtoStream API to store data as Protobuf-encoded entries.
Protobuf is a language-neutral format that allows clients to create and retrieve entries in remote caches using both Hot Rod and REST endpoints.
2.1. Compiling Protobuf schema on Red Hat Enterprise Linux (RHEL) 링크 복사링크가 클립보드에 복사되었습니다!
Compile Protobuf schema, .proto files, into C++ header and source files to describe your data to Data Grid.
Prerequisites
Install the Protobuf library and
protobuf-develpackage.yum install protobuf yum install protobuf-devel
# yum install protobuf # yum install protobuf-develCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
Set the
LD_LIBRARY_PATHenvironment variable, if it is not already set.export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/lib64
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/lib64Copy to Clipboard Copied! Toggle word wrap Toggle overflow Compile Protobuf schema for the Hot Rod C++ client as required.
/bin/protoc --cpp_out dllexport_decl=HR_PROTO_EXPORT:/path/to/output/ $FILE
# /bin/protoc --cpp_out dllexport_decl=HR_PROTO_EXPORT:/path/to/output/ $FILECopy to Clipboard Copied! Toggle word wrap Toggle overflow HR_PROTO_EXPORTis a macro that the Hot Rod C++ client expands when it compiles the Protobuf schema.- Register your Protobuf schema with Data Grid if you plan to use queries.
2.2. Compiling Protobuf schema on Microsoft Windows 링크 복사링크가 클립보드에 복사되었습니다!
Compile Protobuf schema, .proto files, into C++ header and source files to describe your data to Data Grid.
Procedure
- Open a command prompt to the installation directory for the Hot Rod C++ client.
Compile Protobuf schema for the Hot Rod C++ client as required.
bin\protoc --cpp_out dllexport_decl=HR_PROTO_EXPORT:path\to\output\ $FILE
bin\protoc --cpp_out dllexport_decl=HR_PROTO_EXPORT:path\to\output\ $FILECopy to Clipboard Copied! Toggle word wrap Toggle overflow HR_PROTO_EXPORTis a macro that the Hot Rod C++ client expands when it compiles the Protobuf schema.- Register your Protobuf schema with Data Grid if you plan to use queries.
Chapter 3. Configuring the Hot Rod C++ client 링크 복사링크가 클립보드에 복사되었습니다!
Hot Rod C++ clients interact with remote Data Grid clusters via the RemoteCache API.
3.1. Configuration and Remote Cache Manager APIs 링크 복사링크가 클립보드에 복사되었습니다!
Use the ConfigurationBuilder API to configure Hot Rod C++ client connections and the RemoteCacheManager API to obtain and configure remote caches.
Configuration builder
Cross-site replication
ConfigurationBuilder builder;
builder.addServer().host("127.0.0.1").port(11222);
// Configure a remote cluster and node when using cross-site replication.
builder.addCluster("NYC").addClusterNode("192.0.2.0", 11322);
ConfigurationBuilder builder;
builder.addServer().host("127.0.0.1").port(11222);
// Configure a remote cluster and node when using cross-site replication.
builder.addCluster("NYC").addClusterNode("192.0.2.0", 11322);
Near caching
ConfigurationBuilder builder;
builder.addServer().host("127.0.0.1").port(11222);
// Enable near-caching for the client.
builder.nearCache().mode(NearCacheMode::INVALIDATED).maxEntries(4);
ConfigurationBuilder builder;
builder.addServer().host("127.0.0.1").port(11222);
// Enable near-caching for the client.
builder.nearCache().mode(NearCacheMode::INVALIDATED).maxEntries(4);