I'm trying to put a directory structure into a tree in order to be able to quickly find children of a given path.
It works, but consumes too much memory.
private RadixTree<FileEntry> tree = new ConcurrentRadixTree<>(new DefaultCharArrayNodeFactory());
final public static class FileEntry {
private String path;
private long size;
}
Then
tree.getKeysStartingWith("/tmp/test")
get's me what I want.
However, how can I make the "tmp" or "test" the smallest node name instead of "t" or "te" etc?
I will never query the tree for partial matches (e.g. "/tmp/te").
I am hoping to reduce memory usage this way.