Examples of ClusterKey


Examples of com.netflix.paas.cassandra.keys.ClusterKey

        }
       
        Set<String> foundKeyspaces      = Sets.newHashSet();
        Set<String> foundColumnFamilies = Sets.newHashSet();
       
        Cluster cluster = provider.acquireCluster(new ClusterKey(entity.getClusterName(), entity.getDiscoveryType()));
       
        boolean changed = false;
       
//        // Iterate found keyspaces
        try {
View Full Code Here

Examples of com.netflix.paas.cassandra.keys.ClusterKey

        Preconditions.checkNotNull(clusterName,      "Must specify cluster name for table "       + table.getTableName());
        Preconditions.checkNotNull(keyspaceName,     "Must specify keyspace name for table "      + table.getTableName());
        Preconditions.checkNotNull(columnFamilyName, "Must specify column family name for table " + table.getTableName());
        Preconditions.checkNotNull(discoveryType,    "Must specify discovery type for table "     + table.getTableName());
       
        Keyspace keyspace = clientProvider.acquireKeyspace(new KeyspaceKey(new ClusterKey(clusterName, discoveryType), keyspaceName));
       
        return new AstyanaxThriftDataTableResource(keyspace, columnFamilyName);
    }
View Full Code Here

Examples of com.netflix.paas.cassandra.keys.ClusterKey

    @Test
    @Ignore
    public void testReadData() throws Exception {
       
        KeyspaceClientProvider clientProvider = injector.getInstance(KeyspaceClientProvider.class);
        Keyspace keyspace = clientProvider.acquireKeyspace(new KeyspaceKey(new ClusterKey(LOCAL_DISCOVERY_TYPE, CLUSTER_NAME), KEYSPACE_NAME));
//       
//        // Create the keyspace and column family
//        keyspace.createKeyspace(new Properties());
//        Properties props = new Properties();
//        props.setProperty("name",                   CF_NAME);
View Full Code Here

Examples of de.bamberg.ha.api.cluster.ClusterKey

    String generatorName=entity.getClass().getName();
    String idAsString = generateNewId(generatorName);
   
    clusterEntityProcessor.setID(entity, idAsString);
   
    ClusterKey key=new ClusterKey(entity.getClass(),idAsString);
    map.put(key, entity);
    return entity;
   
  }
View Full Code Here

Examples of de.bamberg.ha.api.cluster.ClusterKey

   * @see de.bamberg.ha.cluster.ClusterManager#get(java.lang.String, java.lang.Class)
   */
  @Override
  public Object get(String id,Class entityClass) {
    String name=entityClass.getName();
    ClusterKey key=new ClusterKey(entityClass,id);
    Object entity=Hazelcast.getMap(name).get(key);
    if (entity instanceof ClusterKey) {
      entity=null;
    }
    return entity;
View Full Code Here

Examples of de.bamberg.ha.api.cluster.ClusterKey

   */
  @Override
  public void remove(Object entity) {
    String name=entity.getClass().getName();
    Object id=clusterEntityProcessor.getID(entity);
    ClusterKey key=new ClusterKey(entity.getClass(),id.toString() );
    Hazelcast.getMap(name).remove(key);
  }
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ClusterKey

            assert !AChildren.isEmpty() : "Expected Children for Node A";

            int AChildResourceTypeId = AChildren.get(0).getResourceType().getId();
            String AChildResourceKey = AChildren.get(0).getResourceKey();

            ClusterKey clusterKey = new ClusterKey(clusterGroup.getId(), AChildResourceTypeId, AChildResourceKey);
            assert clusterKey.getClusterGroupId() == clusterGroup.getId();
            assert clusterKey.getDepth() == 1;
            assert AChildResourceKey.equals(clusterKey.getHierarchy().get(0).getResourceKey());
            assert AChildResourceTypeId == clusterKey.getHierarchy().get(0).getResourceTypeId();
            assert AChildResourceTypeId == ClusterKey.getResourceType(clusterKey);
            assert ClusterKey.valueOf(clusterKey.toString()) != null;

            List<Resource> resources = clusterManager.getAutoClusterResources(subject, clusterKey);

            assert resources.size() == 2;
            assert resources.get(0).getId() != resources.get(1).getId();
            assert resources.get(0).getParentResource().getId() != resources.get(1).getParentResource().getId();
            assert resources.get(0).getParentResource().getId() == nodeA.getId()
                || resources.get(0).getParentResource().getId() == nodeB.getId();
            assert resources.get(1).getParentResource().getId() == nodeA.getId()
                || resources.get(1).getParentResource().getId() == nodeB.getId();

            assertNull(clusterManager.getAutoClusterBackingGroup(subject, clusterKey));

            ResourceGroup backingGroup = clusterManager.createAutoClusterBackingGroup(subject, clusterKey, true);
            assertNotNull(backingGroup);
            assertEquals(backingGroup.getClusterKey(), clusterKey.toString());
            assertEquals(backingGroup.getClusterResourceGroup(), clusterGroup);
            //Set<Resource> backingGroupResources = backingGroup.getExplicitResources();
            // explicitResources for backingGroup is lazy, so we need to hit resourceManager for the answer
            List<Resource> backingGroupResources = resourceManager.findExplicitResourcesByResourceGroup(subject,
                backingGroup, PageControl.getUnlimitedInstance());
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ClusterKey

            Resource AGrandChild = AGrandChildren.get(0);
            int AGrandChildResourceTypeId = AGrandChild.getResourceType().getId();
            String AGrandChildResourceKey = AGrandChild.getResourceKey();

            ClusterKey clusterKey = new ClusterKey(clusterGroup.getId(), AChildResourceTypeId, AChildResourceKey);
            clusterKey.addChildToHierarchy(AGrandChildResourceTypeId, AGrandChildResourceKey);
            assert clusterKey.getClusterGroupId() == clusterGroup.getId();
            assert clusterKey.getDepth() == 2;
            assert AChildResourceKey.equals(clusterKey.getHierarchy().get(0).getResourceKey());
            assert AChildResourceTypeId == clusterKey.getHierarchy().get(0).getResourceTypeId();
            assert AGrandChildResourceKey.equals(clusterKey.getHierarchy().get(1).getResourceKey());
            assert AGrandChildResourceTypeId == clusterKey.getHierarchy().get(1).getResourceTypeId();
            assert AGrandChildResourceTypeId == ClusterKey.getResourceType(clusterKey);
            assert ClusterKey.valueOf(clusterKey.toString()) != null;

            List<Resource> resources = clusterManager.getAutoClusterResources(subject, clusterKey);

            assert resources.size() == 2;
            assert resources.get(0).getId() != resources.get(1).getId();
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ClusterKey

        currentParentResourceGroupId = FacesContextUtility.getOptionalRequestParameter("contextParentGroupId");

        currentResourceGroup = null;

        if (clusterKeyString != null) {
            ClusterKey key = ClusterKey.valueOf(clusterKeyString);
            currentResourceGroup = clusterManager.createAutoClusterBackingGroup(subject, key, false);

        } else if (groupIdString != null) {
            int groupId = Integer.parseInt(groupIdString);
            currentResourceGroup = groupManager.getResourceGroupById(subject, groupId, null);
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ClusterKey

        for (Integer member : members) {
            memberNodes.add(ResourceTreeModelUIBean.load(member.intValue(), resources));
        }

        ResourceGroupTreeNode root = new ResourceGroupTreeNode(group, null);
        root.setClusterKey(new ClusterKey(group.getId()));
        root.addMembers(memberNodes);
        load(root, memberNodes);
        return root;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.