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

Method compressScope

core/src/main/java/io/questdb/log/LogFactory.java:428–454  ·  view source on GitHub ↗

Converts fully qualified class name into an abbreviated form: com.questdb.mp.Sequence -> c.n.m.Sequence @param key typically class name @param builder used for producing the resulting form @return abbreviated form of key

(CharSequence key, StringSink builder)

Source from the content-addressed store, hash-verified

426 * @return abbreviated form of key
427 */
428 private static CharSequence compressScope(CharSequence key, StringSink builder) {
429 builder.clear();
430 char c = 0;
431 boolean pick = true;
432 int z = 0;
433 for (int i = 0, n = key.length(); i < n; i++) {
434 char a = key.charAt(i);
435 if (a == '.') {
436 if (!pick) {
437 builder.put(c).put('.');
438 pick = true;
439 }
440 } else if (pick) {
441 c = a;
442 z = i;
443 pick = false;
444 }
445 }
446
447 for (; z < key.length(); z++) {
448 builder.put(key.charAt(z));
449 }
450
451 builder.put(' ');
452
453 return builder.toString();
454 }
455
456 @SuppressWarnings("rawtypes")
457 private static LogWriterConfig createWriter(final Properties properties, String writerName) {

Callers 3

createMethod · 0.95
createLoggerMethod · 0.95

Calls 5

clearMethod · 0.65
lengthMethod · 0.65
putMethod · 0.65
toStringMethod · 0.65
charAtMethod · 0.45

Tested by

no test coverage detected