Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring ringbuffer capacity through helm #351

Open
shahamit opened this issue Jun 9, 2023 · 5 comments
Open

Configuring ringbuffer capacity through helm #351

shahamit opened this issue Jun 9, 2023 · 5 comments

Comments

@shahamit
Copy link

shahamit commented Jun 9, 2023

We are deploying hazelcast cluster through helm charts. Our client code (java) creates ring buffers at runtime. The name of the ring buffer is dynamically determined.

How do I configure the capacity of the ring buffer? Is it possible to configure it at runtime? If not is there a default capacity that can be configured?

Thanks.

@semihbkgr
Copy link
Contributor

Hi @shahamit

You can configure the capacity of ring buffer at runtime. The question isn't directly related to Helm charts.

Here is an example of your use-case.

var ringBufferConfig = new RingbufferConfig();
ringBufferConfig.setName("ringbuff")
                .setCapacity(9000);
hz.getConfig().addRingBufferConfig(ringBufferConfig);
var ringBuffer = hz.getRingbuffer("ringbuff");

You can get more information about ring buffer and its configuration.
https://docs.hazelcast.com/hazelcast/5.3/data-structures/ringbuffer#ringbuffer-configuration-examples

@shahamit
Copy link
Author

We have two clients to hazelcast - one of them is the data producer and another the data consumer. I assume who ever executes the above code first would create the ring buffer instance with a given capacity.
This would mean we would have to configure the ring buffer capacity at both ends leaving room for human errors.

Is there a way to configure the default capacity of the ring buffer when creating the hazelcast instance so that any new ring buffers created are created with that capacity? Current its 10000.

@semihbkgr
Copy link
Contributor

semihbkgr commented Jun 12, 2023

There is no way to configure default values of any configuration. You can statically configure ringbuffers with their predefined names, or you can dynamically configure ringbuffers using client at runtime.

In Hazelcast config file, you can only configure ringbuffers by their specific names. To configure via Helm charts:

# Hazelcast properties
hazelcast:
  yaml:
    hazelcast:
      ringbuffer:
        rb:
          capacity: 2000

@shahamit
Copy link
Author

shahamit commented Jun 13, 2023 via email

@semihbkgr
Copy link
Contributor

semihbkgr commented Jun 16, 2023

You need to configure ringbuffer only once just before it is created.

If you have a guarantee that the ringbuffer is created in the producer side before the consumer tries to read data from it. Then you can configure it only in producer side and can use the ringbuffer in consumer side without configuration.

So, it is totally depends on your application design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants