Examples of ResourceNode


Examples of org.apache.oodt.cas.resource.structs.ResourceNode

        Vector queueNodes = (Vector) queues.get(queueName);
        for (int i = 0; i < queueNodes.size(); i++) {
            String nodeId = (String) queueNodes.get(i);
            int nodeLoad = -1;
            ResourceNode resNode = null;

            try {
                resNode = myMonitor.getNodeById(nodeId);
                nodeLoad = myMonitor.getLoad(resNode);
            } catch (MonitorException e) {
                LOG
                        .log(Level.WARNING, "Exception getting load on "
                                + "node: [" + resNode.getNodeId()
                                + "]: Message: " + e.getMessage());
                throw new SchedulerException(e.getMessage());
            }

            if (load <= nodeLoad) {
View Full Code Here

Examples of org.apache.oodt.cas.resource.structs.ResourceNode

        assertNotNull(resNodes);
        assertEquals(1, resNodes.size());
    }

    public void testGetNodeById() {
        ResourceNode node = null;

        try {
            node = assgnMon.getNodeById("localhost");
        } catch (MonitorException e) {
            fail(e.getMessage());
        }

        assertNotNull(node);
        assertEquals("localhost", node.getNodeId());
    }
View Full Code Here

Examples of org.apache.oodt.cas.resource.structs.ResourceNode

        assertNotNull(resNodes);

        boolean hasNode1 = false;

        for (Iterator i = resNodes.iterator(); i.hasNext();) {
            ResourceNode node = (ResourceNode) i.next();
            assertNotNull(node);
            if (node.getNodeId().equals("localhost")) {
                hasNode1 = true;
                assertEquals(node.getIpAddr().toExternalForm(),
                        "http://localhost:2001");
            }
            assertEquals(node.getCapacity(), 8);
        }

        assertTrue(hasNode1);
    }
View Full Code Here

Examples of org.apache.oodt.cas.resource.structs.ResourceNode

   public ResourceNode getNodeById(String nodeId) throws MonitorException {
      lastMethodCallDetails = new MethodCallDetails("getNodeById",
            Lists.newArrayList((Object) nodeId));
      try {
         return new ResourceNode(nodeId, new URL("http://localhost:9999"), 5);
      } catch (Exception e) {
         throw new MonitorException(e);
      }
   }
View Full Code Here

Examples of org.apache.oodt.cas.resource.structs.ResourceNode

        mockGmetad.remove();
    }

    public void testGetLoad() {
        try {
            ResourceNode resourceNode = new ResourceNode();
            resourceNode.setId("localhost");
            assertEquals(1, gangliaResourceMonitor.getLoad(resourceNode));
        } catch (Exception e) {
          e.printStackTrace();
            fail(e.getMessage());
        }
View Full Code Here

Examples of org.apache.oodt.cas.resource.structs.ResourceNode

      }
    }
   
    public void testGetNodeById(){
      try{
        ResourceNode node = gangliaResourceMonitor.getNodeById("localhost");
        assertNotNull(node);
        assertEquals("localhost", node.getNodeId());
        node = gangliaResourceMonitor.getNodeById("localhost2");
        assertNotNull(node);
        assertEquals("localhost2", node.getNodeId());
        node = gangliaResourceMonitor.getNodeById("remotenode");
        assertNotNull(node);
        assertEquals("remotenode", node.getNodeId());
      }
      catch(Exception e){
        e.printStackTrace();
        fail(e.getMessage());
      }
View Full Code Here

Examples of org.apache.oodt.cas.resource.structs.ResourceNode

      cmdLineUtility.run(("--url http://localhost:9000"
            + " --operation --addNode --capacity " + capacity + " --nodeId "
            + nodeId + " --ipAddr " + ipAddr).split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("addNode", methodCallDetails.getMethodName());
      ResourceNode actualNode = (ResourceNode) methodCallDetails.getArgs().get(0);
      ResourceNode expectedNode = new ResourceNode(nodeId, new URL(ipAddr), capacity);
      assertEquals(expectedNode.getIpAddr(), actualNode.getIpAddr());
      assertEquals(expectedNode.getCapacity(), actualNode.getCapacity());
      assertEquals(expectedNode.getNodeId(), actualNode.getNodeId());
   }
View Full Code Here

Examples of org.apache.oodt.cas.resource.structs.ResourceNode

  }

  private ResourceNode nodeFromMap(Map<String, String> map)
      throws MalformedURLException {
    if (map == null) return null;
    ResourceNode node = new ResourceNode();
    System.out.println("MAP IS "+map);
    System.out.println("Setting hostname to "+map.get(NAME));
    node.setId(map.get(NAME));
    node.setIpAddr(new URL("http://" + map.get(NAME) + ":" + DEFAULT_PORT));
    return node;
  }
View Full Code Here

Examples of org.apache.oodt.cas.resource.structs.ResourceNode

        assertNotNull(resNodes);
        assertEquals(1, resNodes.size());
    }

    public void testGetNodeById() {
        ResourceNode node = null;

        try {
            node = assgnMon.getNodeById("localhost");
        } catch (MonitorException e) {
            fail(e.getMessage());
        }

        assertNotNull(node);
        assertEquals("localhost", node.getNodeId());
    }
View Full Code Here

Examples of org.brixcms.jcr.wrapper.ResourceNode

                // save the node so brix assigns the correct jcr type to it
                getContainer().save();

                // populate node
                ResourceNode resource = (ResourceNode) getContainer().getSession().getItem(
                        node.getPath());
                model.setObject(new BrixNodeModel(resource));
                model.apply();

                getContainer().save();
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.