MCPcopy Index your code
hub / github.com/questdb/questdb / of

Method of

core/src/main/java/io/questdb/VolumeDefinitions.java:55–84  ·  view source on GitHub ↗
(@Nullable CharSequence definitions, @NotNull Path path, @NotNull String root)

Source from the content-addressed store, hash-verified

53 }
54
55 public VolumeDefinitions of(@Nullable CharSequence definitions, @NotNull Path path, @NotNull String root) throws ServerConfigurationException {
56 if (definitions != null) {
57 // 'any-case-alias' -> 'absolute path to volume' (quotes are optional)
58 aliasToVolumeRoot.clear();
59 limit = definitions.length();
60 lo = 0;
61 int separatorCount = 0;
62 String alias = null;
63 for (int i = 0; i < limit; i++) {
64 char c = definitions.charAt(i);
65 if (c == '-' && i + 1 < limit && definitions.charAt(i + 1) == '>') { // found arrow
66 if (alias != null) {
67 throw new ServerConfigurationException("invalid syntax, missing volume path at offset " + lo);
68 }
69 alias = Chars.toString(popToken(definitions, i, false));
70 lo = ++i + 1; // move over '>'
71 } else if (SEPARATOR == c) {
72 if (alias == null) {
73 throw new ServerConfigurationException("invalid syntax, missing alias at offset " + lo);
74 }
75 addVolumeDefinition(alias, popToken(definitions, i, false), path, root);
76 alias = null;
77 lo = i + 1;
78 separatorCount++;
79 }
80 }
81 finishVolumeDefinitions(alias, popToken(definitions, limit, true), path, root, separatorCount);
82 }
83 return this;
84 }
85
86 public @Nullable CharSequence resolveAlias(@NotNull CharSequence alias) {
87 return aliasToVolumeRoot.get(alias);

Callers

nothing calls this directly

Calls 7

toStringMethod · 0.95
popTokenMethod · 0.95
addVolumeDefinitionMethod · 0.95
clearMethod · 0.65
lengthMethod · 0.65
charAtMethod · 0.45

Tested by

no test coverage detected