VespaModelUtil { public static boolean isStorage(ServiceCluster cluster) { return STORAGENODE_SERVICE_TYPE.equals(cluster.serviceType()); }  static boolean isClusterController(ServiceCluster cluster); static boolean isStorage(ServiceCluster cluster); static boolean isContent(ServiceCluster cluster); static List<HostName> getClusterControllerInstancesInOrder(ApplicationInstance application,
                                                                          ClusterId contentClusterId); static Set<ServiceCluster> getClusterControllerServiceClusters(ApplicationInstance application); static HostName getControllerHostName(ApplicationInstance application, ClusterId contentClusterId); static ClusterId getContentClusterName(ApplicationInstance application, HostName hostName); static int getStorageNodeIndex(ApplicationInstance application, HostName hostName); static Optional<ServiceInstance> getStorageNodeAtHost(ApplicationInstance application, 
                                                                        HostName hostName); static int getClusterControllerIndex(ConfigId configId); static int getStorageNodeIndex(ConfigId configId); static final ApplicationId TENANT_HOST_APPLICATION_ID; static final ClusterId ADMIN_CLUSTER_ID; static final ServiceType SLOBROK_SERVICE_TYPE; static final ServiceType CLUSTER_CONTROLLER_SERVICE_TYPE; static final ServiceType DISTRIBUTOR_SERVICE_TYPE; static final ServiceType SEARCHNODE_SERVICE_TYPE; static final ServiceType STORAGENODE_SERVICE_TYPE; static final ServiceType METRICS_PROXY_SERVICE_TYPE; }
@Test public void verifyStorageClusterIsRecognized() { ServiceCluster cluster = createServiceCluster(VespaModelUtil.STORAGENODE_SERVICE_TYPE); assertTrue(VespaModelUtil.isStorage(cluster)); cluster = createServiceCluster(VespaModelUtil.STORAGENODE_SERVICE_TYPE); assertTrue(VespaModelUtil.isStorage(cluster)); }
@Test public void verifyNonStorageClusterIsNotRecognized() { ServiceCluster cluster = createServiceCluster(new ServiceType("foo")); assertFalse(VespaModelUtil.isStorage(cluster)); }