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

New java unique values plugin #2617

Open
wants to merge 5 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@dmoisej
Copy link
Contributor

commented Apr 10, 2019

It is template for the new Java plugin, which saves unique values to the mounted endpoint.

@markus2330

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

I do not understand what "saves unique values to the mounted endpoint" mean. Can you please elaborate on the functionality?

@dmoisej

This comment has been minimized.

Copy link
Contributor Author

commented Apr 14, 2019

Let's imagine, that we have for instance some mount point like: "user/test".

The purpose is, that under user/test there can be no such key-value and key1-value1 pairs, that
key != key1 and value=value1.

I wanted to look more into the JNI right now but I will try to implement for this plugin something in the nearest time.

@markus2330

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

Ok, so this should be a validation plugin that makes values constant (unique is misleading). This makes sense and currently does not exist.

I suppose it could work like this:

kdb mount a.cfg /tests const
kdb setmeta /tests/a default 80
kdb setmeta /tests/a restrict/write  1  # make constant
kdb get /tests/a   # always returns 80
#> 80
kdb set /tests/a 80    # set always fails
@dmoisej

This comment has been minimized.

Copy link
Contributor Author

commented Apr 14, 2019

Thank you very much for help. I understood the purpose and will implement this const functionality.

@kodebach

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

If I understood both of your comments correctly, I think you described two completely different, but equally valid plugins.

@markus2330 You described a plugin that creates constants. This is a good idea, but probably should be part of the spec plugin.
@dmoisej Described a plugin that ensures no two different keys contain the same value. This would be useful for arrays that are used with set semantics.

@markus2330

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

Yes, you are right within arrays the uniqueness property might be useful. @kodebach Thank you for pointing that out.

@dmoisej Did you have a concrete scenario where you needed this?

If not, I would recommend to implement a plugin that implements the restrict/* properties as already specified in doc/METADATA.ini (const is actually equivalent to restrict/write, so we should use this as metadata and not introduce a new one. I updated the example above.). Btw. the restrict/* properties are actually already implemented in the Web-UI (it is not only an idea), so the documentation of them is not up-to-date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.