diff options
Diffstat (limited to 'configserver/src/main/java/com/yahoo')
3 files changed, 10 insertions, 15 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java index b38d90d470f..6c4ef469be6 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java @@ -9,7 +9,6 @@ import com.yahoo.config.application.api.DeployLogger; import com.yahoo.config.model.application.provider.DeployData; import com.yahoo.config.model.application.provider.FilesApplicationPackage; import com.yahoo.config.provision.ApplicationId; -import com.yahoo.config.provision.NodeFlavors; import com.yahoo.config.provision.TenantName; import com.yahoo.io.IOUtils; import com.yahoo.path.Path; @@ -653,9 +652,8 @@ public class SessionRepository { private SessionZooKeeperClient createSessionZooKeeperClient(long sessionId) { String serverId = componentRegistry.getConfigserverConfig().serverId(); - Optional<NodeFlavors> nodeFlavors = componentRegistry.getZone().nodeFlavors(); Path sessionPath = getSessionPath(sessionId); - return new SessionZooKeeperClient(curator, componentRegistry.getConfigCurator(), sessionPath, serverId, nodeFlavors); + return new SessionZooKeeperClient(curator, componentRegistry.getConfigCurator(), sessionPath, serverId); } private File getAndValidateExistingSessionAppDir(long sessionId) { diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java index 27440b3765b..cf1e07788ff 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java @@ -51,24 +51,21 @@ public class SessionZooKeeperClient { private final Path sessionPath; private final Path sessionStatusPath; private final String serverId; // hostname - private final Optional<NodeFlavors> nodeFlavors; // Only for testing // TODO: Remove, use the constructor below public SessionZooKeeperClient(Curator curator, Path sessionPath) { - this(curator, ConfigCurator.create(curator), sessionPath, "1", Optional.empty()); + this(curator, ConfigCurator.create(curator), sessionPath, "1"); } public SessionZooKeeperClient(Curator curator, ConfigCurator configCurator, Path sessionPath, - String serverId, - Optional<NodeFlavors> nodeFlavors) { + String serverId) { this.curator = curator; this.configCurator = configCurator; this.sessionPath = sessionPath; this.serverId = serverId; - this.nodeFlavors = nodeFlavors; this.sessionStatusPath = sessionPath.append(ConfigCurator.SESSIONSTATE_ZK_SUBPATH); } @@ -135,7 +132,7 @@ public class SessionZooKeeperClient { } public ApplicationPackage loadApplicationPackage() { - return new ZKApplicationPackage(configCurator, sessionPath, nodeFlavors); + return new ZKApplicationPackage(configCurator, sessionPath); } public ConfigDefinitionRepo getUserConfigDefinitions() { diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java b/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java index 11cec9efd95..397e76679b8 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java @@ -52,17 +52,17 @@ public class ZKApplicationPackage implements ApplicationPackage { public static final String allocatedHostsNode = "allocatedHosts"; private final ApplicationMetaData metaData; - public ZKApplicationPackage(ConfigCurator zk, Path sessionPath, Optional<NodeFlavors> nodeFlavors) { + public ZKApplicationPackage(ConfigCurator zk, Path sessionPath) { verifyAppPath(zk, sessionPath); zkApplication = new ZKApplication(zk, sessionPath); metaData = readMetaDataFromLiveApp(zkApplication); importFileRegistries(); - allocatedHosts = importAllocatedHosts(nodeFlavors); + allocatedHosts = importAllocatedHosts(); } - private Optional<AllocatedHosts> importAllocatedHosts(Optional<NodeFlavors> nodeFlavors) { + private Optional<AllocatedHosts> importAllocatedHosts() { if ( ! zkApplication.exists(ZKApplicationPackage.allocatedHostsNode)) return Optional.empty(); - return Optional.of(readAllocatedHosts(nodeFlavors)); + return Optional.of(readAllocatedHosts()); } /** @@ -70,9 +70,9 @@ public class ZKApplicationPackage implements ApplicationPackage { * * @return the allocated hosts at this node or empty if there is no data at this path */ - private AllocatedHosts readAllocatedHosts(Optional<NodeFlavors> nodeFlavors) { + private AllocatedHosts readAllocatedHosts() { try { - return AllocatedHostsSerializer.fromJson(zkApplication.getBytes(ZKApplicationPackage.allocatedHostsNode), nodeFlavors); + return AllocatedHostsSerializer.fromJson(zkApplication.getBytes(ZKApplicationPackage.allocatedHostsNode)); } catch (Exception e) { throw new RuntimeException("Unable to read allocated hosts", e); } |