@Test public void testInitializeAtGLUSTERFSCluster() throws AmbariException { ClusterImpl cluster = createMock(ClusterImpl.class); Service service = createMock(Service.class); expect(cluster.getClusterId()).andReturn(1L); expect(cluster.getCurrentStackVersion()).andReturn(new StackId("HDP", "2.0.6")); expect(cluster.getService("GLUSTERFS")).andReturn(service); expect(cluster.getService("HDFS")).andReturn(null); expect(cluster.getService("YARN")).andReturn(null); replay(cluster); RoleCommandOrder rco = roleCommandOrderProvider.getRoleCommandOrder(cluster); Map<RoleCommandPair, Set<RoleCommandPair>> deps = rco.getDependencies(); assertTrue("Dependencies are loaded after initialization", deps.size() > 0); verify(cluster); assertFalse(dependenciesContainBlockedRole(deps, Role.DATANODE)); assertFalse(dependenciesContainBlockedRole(deps, Role.NAMENODE)); assertFalse(dependenciesContainBlockedRole(deps, Role.SECONDARY_NAMENODE)); assertFalse(dependenciesContainBlockedRole(deps, Role.JOURNALNODE)); assertFalse(dependenciesContainBlockedRole(deps, Role.NAMENODE_SERVICE_CHECK)); assertFalse(dependenciesContainBlockedRole(deps, Role.HDFS_SERVICE_CHECK)); assertFalse(dependenciesContainBlockedRole(deps, Role.HDFS_CLIENT)); assertFalse(dependenciesContainBlockerRole(deps, Role.SECONDARY_NAMENODE)); assertFalse(dependenciesContainBlockerRole(deps, Role.JOURNALNODE)); assertFalse(dependenciesContainBlockerRole(deps, Role.NAMENODE_SERVICE_CHECK)); assertFalse(dependenciesContainBlockerRole(deps, Role.HDFS_SERVICE_CHECK)); assertFalse(dependenciesContainBlockerRole(deps, Role.HDFS_CLIENT)); assertTrue(dependenciesContainBlockerRole(deps, Role.PEERSTATUS)); }
public Map<RoleCommandPair, Set<RoleCommandPair>> getDependencies() { return dependencies; }
RoleCommandOrder implements Cloneable { public Map<RoleCommandPair, Set<RoleCommandPair>> getDependencies() { return dependencies; } }
RoleCommandOrder implements Cloneable { public Map<RoleCommandPair, Set<RoleCommandPair>> getDependencies() { return dependencies; }  }
RoleCommandOrder implements Cloneable { public Map<RoleCommandPair, Set<RoleCommandPair>> getDependencies() { return dependencies; }  @SuppressWarnings("unchecked") void initialize(Cluster cluster, LinkedHashSet<String> sectionKeys); int order(RoleGraphNode rgn1, RoleGraphNode rgn2); Set<Service> getTransitiveServices(Service service, RoleCommand cmd); int compareDeps(RoleCommandOrder rco); LinkedHashSet<String> getSectionKeys(); Map<RoleCommandPair, Set<RoleCommandPair>> getDependencies(); @Override Object clone(); }
RoleCommandOrder implements Cloneable { public Map<RoleCommandPair, Set<RoleCommandPair>> getDependencies() { return dependencies; }  @SuppressWarnings("unchecked") void initialize(Cluster cluster, LinkedHashSet<String> sectionKeys); int order(RoleGraphNode rgn1, RoleGraphNode rgn2); Set<Service> getTransitiveServices(Service service, RoleCommand cmd); int compareDeps(RoleCommandOrder rco); LinkedHashSet<String> getSectionKeys(); Map<RoleCommandPair, Set<RoleCommandPair>> getDependencies(); @Override Object clone(); final static String GLUSTERFS_DEPS_KEY; final static String NO_GLUSTERFS_DEPS_KEY; final static String NAMENODE_HA_DEPS_KEY; final static String RESOURCEMANAGER_HA_DEPS_KEY; final static String COMMENT_STR; }