use of com.yahoo.vespa.applicationmodel.ClusterId in project vespa by vespa-engine.
the class UnionMonitorManagerTest method nodeAdminOutsideContainer.
@Test
public void nodeAdminOutsideContainer() {
boolean inContainer = false;
// When nodeAdminInContainer is set, then only the node admin cluster should use health
testWith(inContainer, ZONE_APPLICATION_ID, NODE_ADMIN, CONTAINER, 0, 1);
testWith(inContainer, ApplicationId.fromSerializedForm("a:b:default"), NODE_ADMIN, CONTAINER, 1, 0);
testWith(inContainer, ZONE_APPLICATION_ID, new ClusterId("foo"), CONTAINER, 1, 0);
testWith(inContainer, ZONE_APPLICATION_ID, NODE_ADMIN, new ServiceType("foo"), 1, 0);
}
use of com.yahoo.vespa.applicationmodel.ClusterId in project vespa by vespa-engine.
the class ModelGenerator method toServiceClusterKey.
private ServiceClusterKey toServiceClusterKey(ServiceInfo serviceInfo) {
ClusterId clusterId = getClusterId(serviceInfo);
ServiceType serviceType = toServiceType(serviceInfo);
return new ServiceClusterKey(clusterId, serviceType);
}
use of com.yahoo.vespa.applicationmodel.ClusterId in project vespa by vespa-engine.
the class ClusterControllerClientFactoryMock method setAllDummyNodesAsUp.
public void setAllDummyNodesAsUp() {
for (ApplicationInstance app : DummyInstanceLookupService.getApplications()) {
Set<HostName> hosts = DummyInstanceLookupService.getContentHosts(app.reference());
for (HostName host : hosts) {
ClusterId clusterName = VespaModelUtil.getContentClusterName(app, host);
int storageNodeIndex = VespaModelUtil.getStorageNodeIndex(app, host);
String globalMapKey = clusterName.s() + storageNodeIndex;
nodes.put(globalMapKey, ClusterControllerNodeState.UP);
}
}
}
use of com.yahoo.vespa.applicationmodel.ClusterId in project vespa by vespa-engine.
the class ClusterControllerClientFactoryMock method isInMaintenance.
public boolean isInMaintenance(ApplicationInstance appInstance, HostName hostName) {
try {
ClusterId clusterName = VespaModelUtil.getContentClusterName(appInstance, hostName);
int storageNodeIndex = VespaModelUtil.getStorageNodeIndex(appInstance, hostName);
String globalMapKey = clusterName.s() + storageNodeIndex;
return nodes.getOrDefault(globalMapKey, ClusterControllerNodeState.UP) == ClusterControllerNodeState.MAINTENANCE;
} catch (Exception e) {
// Catch all - meant to catch cases where the node is not part of a storage cluster
return false;
}
}
use of com.yahoo.vespa.applicationmodel.ClusterId in project vespa by vespa-engine.
the class VespaModelUtilTest method testGetContentClusterName.
@Test
public void testGetContentClusterName() {
ClusterId contentClusterName = VespaModelUtil.getContentClusterName(application, distributor0.hostName());
assertThat(CONTENT_CLUSTER_ID).isEqualTo(contentClusterName);
}
Aggregations