Read instances from new instance path, with fallback to the old
@@ -339,7 +339,8 @@ public class CuratorDb {
}
public Optional<Instance> readInstance(ApplicationId application) {
- return readSlime(applicationPath(application)).map(instanceSerializer::fromSlime);
+ return readSlime(instancePath(application)).or(() -> readSlime(applicationPath(application)))
+ .map(instanceSerializer::fromSlime);
}
public List<Instance> readInstances() {
@@ -351,7 +352,10 @@ public class CuratorDb {
}
private Stream<ApplicationId> readInstanceIds() {
- return curator.getChildren(applicationRoot).stream()
+ return Stream.concat(curator.getChildren(applicationRoot).stream()
+ .filter(id -> id.split(":").length == 3),
+ curator.getChildren(instanceRoot).stream())
+ .distinct()
.map(ApplicationId::fromSerializedForm);
}
