Node name limitations in zookeeper - apache-zookeeper

Is there any documentation on the limitations on zookeeper node names? I can't find anything in official documentation regarding it. In particular, I want to know:
What characters are allowed?
Can I use any character from UTF-8 (like japanese characters)?
What is the maximum limit of characters/bytes (if any) for node name?

For 1, 2: Any unicode character can be used in a path subject to the following constraints:
The null character (\u0000) cannot be part of a path name. (This causes problems with the C binding.)
The following characters can't be used because they don't display well, or render in confusing ways: \u0001 - \u001F and \u007F - \u009F.
The following characters are not allowed: \ud800 - uF8FF, \uFFF0 - uFFFF.
The . character can be used as part of another name, but . and .. cannot alone be used to indicate a node along a path, because ZooKeeper doesn't use relative paths. The following would be invalid: /a/b/./c or /a/b/../c.
The token zookeeper is reserved.
PS: The source code: PathUtils.validatePath()
For 3: In fact, there is no limit on the length of name in ZK itself, but is is recommended not using too large name (e.g., ZK store entire data in memory for efficiency)

Related

What are allowed characters for a submodule name in registerModule?

registerModule() expects a submodule key as a third parameter.
I think it should probably not contain a space and only alphabetic characters (or alphanumeric?) and underscore ('_'), but I'm not really sure.
I could not find specific information for this.
The function makes use of \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase to generate the full module name combined of main module and sub module connected with an _
So you already guessed the right answer.
It's a bit complicated strange to answer!
Official API document does not provide exact information. I have worked around some extension which has multiple sub-module. I'm quite sure this not allow special character as you sub-module key.
eg. web_TestTestbe123 (mainModulename_subModuleKey)
I have noticed bellow characteristic for the key:
Key must be lowercase
No space allowed
Numerica value would be fine
Does this make sense?
I found this in the documentation just now:
Backend modules
1. The modkey is made up of alphanumeric characters only. It does not contain underscores and starts with a letter.
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/NamingConventions/Index.html

What exactly does 'Type Body Length' mean in Swiftlint?

We just added Swiftlint to our project and we want to follow all the rules but I'm not sure what's meant by 'type_body_length' warning. I'm not a native english speaker so I find it a bit confusing.
There is a rule for file length aswell so how do they differ? What falls under this definition?
type_body_length violation means that the class has too many lines in it. I dont think it counts extensions, comments or whitespace
Type name should only contain alphanumeric characters, start with an uppercase character and span between 3 and 40 characters in length.
The rules documentation linked here and above also gives examples of what would and wouldn't be accepted (Triggering & Non Triggering). - Edit suggested by #GoodSp33d, thanks

kubernetes label name 63 character limit

As explained at https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
labels name and value have limit of 63 characters. Does anyone know what drives this limit? I am not looking for code condition but the real reason behind choosing this value.
As Suresh Vishnoi wrote, it is a global restriction based on RFC-1123.
Here is a simple explanation of this restriction.
There is a commit in Kubernetes which provides the validation of labels' length.
Here is design documentation of the kubernetes. The following link provides detail information.
rfc1035/rfc1123 label (DNS_LABEL): An alphanumeric (a-z, and 0-9) string, with a maximum length of 63 characters, with the '-' character allowed anywhere except the first or last character, suitable for use as a hostname or segment in a domain name.
identifiers-and-names-in-kubernetes

Encoding issue while spring message source using in idea

I have resource bundle property file with following content:
OwnerImagesController.TerminalContentFormatIsNotAcceptable = \u0424\u0430\u0439\u043b \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442
In idea configuration following file looks like
To convert my file for resource bundle compatible state I direcly use native2ascii.exe application from jdk.
It is not comfortable.
Please help to facilitate my property file usage
According to the official documentation:
It is possible to encode non-ascii symbols using both upper- and
lower-case hex symbols (e.g. '\u00E3' vs '\u00e3'). Upper case is used
by default. To use lower case, set 'idea.native2ascii.lowercase'
property in the bin/idea.properties file to true.
Source:
https://www.jetbrains.com/idea/help/editing-resource-bundle.html
It seems to be better than editing vmoptions.
You can enable automatic conversion of non-ascii characters to appropriate escape sequences by checking Transparent native-to-ascii conversion in Settings/File Encodings (the section you show in the screenshot).
I also noticed that the the escape sequences in your snippet are lower case (i.e. \u043b instead of \u043B). IntelliJ converts them to uppercase by default. If you want to keep them lowercase to avoid unnecessary VCS changes, add following property to idea.vmoptions:
-Didea.native2ascii.lowercase=true

Limitation on length of bin name in citrusleaf

Is there a limitation on length of bin name in citrusleaf.
Is the default value 14 and can it be increased?
I am getting following error if the length of binName is more than 14 characters (using Java API)
null due to parameter error
This restrictions is enforced from server-side.
This is an artificial restriction to keep the memory & disk requirement in control.
Note that this is only for the bin name and not the bin value.
The wire protocol is a generic interface. So, it allows any length to be passed.
Different limits are followed for different names.
For e.g. namespace & set names should be <32 bytes
The bottom line is that you cannot use bin names longer than 14 characters using the current Citrusleaf version