private Set<String> expandToKeepSet(List<String> toKeep) {
// Add all listed ZNodes as well as all of their ancestors
Set<String> keepSet = new HashSet<String>();
for (String pathStr : toKeep) {
ZkGenericPath path = ZkGenericPath.parse("/", pathStr);
Iterator<ZkGenericPath> lineageIter = path.lineageIterator();
while(lineageIter.hasNext()) {
keepSet.add(lineageIter.next().toString());
}
}
return keepSet;