Hazelcast offers a specification-compliant JCache implementation. The Hazelcast JCache implementation is 100% TCK (Technology Compatibility Kit) compliant and therefore passes all specification requirements. You can create and configure JCache using the Cache custom resource.
Configure a cache resource
You can use any of the following configuration options in the Cache resource. For more information, see the API reference.
| Field | Description |
|---|---|
|
Name of the cache that you’re creating. If empty, the custom resource (CR) name is used. |
|
The name of the Hazelcast resource. |
|
Count of synchronous backups. |
|
Count of asynchronous backups. |
|
Fully qualified class name of the cache key type. |
|
Fully qualified class name of the cache value type. |
|
When enabled, the cache data will be persisted. |
|
Format options for storing the data in cache. |
Example configuration
The following Cache custom resource creates a cache configuration for the Hazelcast custom resource that is defined in the hazelcastResourceName field.
apiVersion: hazelcast.com/v1alpha1
kind: Cache
metadata:
name: cache-sample
spec:
hazelcastResourceName: hazelcast
backupCount: 1
asyncBackupCount: 0
inMemoryFormat: NATIVE
keyType: java.lang.Object
valueType: java.lang.Object
persistenceEnabled: false
After creating the Cache resource, you can check its status:
kubectl get cache cache-sample -o wide
NAME STATUS HAZELCAST-RESOURCE MESSAGE
cache-sample Success hazelcast