Examples of StorageNode


Examples of com.nirvanix.sdk.transport.StorageNode

    .executeCommand( APICommands.GET_STORAGE_NODE_EXTENDED, parms,
         accountLogin );
 
  Element node = root.getFirstChildElement( "GetStorageNode" );
 
  return new StorageNode( node );
    }
View Full Code Here

Examples of com.nirvanix.sdk.transport.StorageNode

     
      boolean retry = false;
      long totalThisFile = 0;
      int retrycount = 0;
     
      StorageNode uploadNode = getStorageNode( _parentSession
        .getAccountLogin( ), Integer.MAX_VALUE, _destinationPath,
                 true );
     
      String uploadHost = uploadNode.getHost( );
      String uploadToken = uploadNode.getUploadToken( );
     
      while ( true )
      {
    try
    {
View Full Code Here

Examples of org.rhq.core.domain.cloud.StorageNode

            public void execute() throws Exception {
                // verify that all storage nodes objects are actually parsed.
                final Set<String> nodeAddresses = new HashSet<String>(storageNodeCount);

                final String prefix = "storage_node";
                StorageNode lastOne = null, firstOne = null;
                for (int i = 0; i < storageNodeCount; i++) {
                    String address = prefix + String.format(" %03d", i + 1) + ".domain.com";
                    StorageNode node = StorageNodeFactory.newInstance();
                    node.setAddress(address);
                    node.setOperationMode(StorageNode.OperationMode.NORMAL);
                    node.setCqlPort(9142 + i);
                    if (i == 0) {
                        firstOne = node;
                    } else if (i == storageNodeCount - 1) {
                        lastOne = node;
                    }
View Full Code Here

Examples of org.rhq.core.domain.cloud.StorageNode

                + "       OR r.resourceType.name = 'RHQ Storage Node'" //
                + " ORDER BY r.id DESC");
            doomed = q.getResultList();
            for (Object removeMe : doomed) {
                Resource res = em.getReference(Resource.class, ((Resource) removeMe).getId());
                StorageNode storageNode = findStorageNode(res);
                if (storageNode != null) {
                    storageNode.setResource(null);
                }
                for (Iterator<CreateResourceHistory> historyIterator = res.getCreateChildResourceRequests().iterator(); historyIterator
                    .hasNext();) {
                    CreateResourceHistory history = historyIterator.next();
                    historyIterator.remove();
View Full Code Here

Examples of org.rhq.core.domain.cloud.StorageNode

    public void testStorageNodeAckFailedOperation() throws Exception {
        executeInTransaction(new TransactionCallback() {

            @Override
            public void execute() throws Exception {
                StorageNode node = StorageNodeFactory.newInstance();
                final String address = TEST_PREFIX + "foo.com";
                node.setAddress(address);
                node.setOperationMode(StorageNode.OperationMode.ANNOUNCE);
                node.setCqlPort(9142);
                node.setErrorMessage("It is broken");
                em.persist(node);
                em.flush();               
                assertEquals("The cluster status should be DOWN", StorageNode.Status.DOWN, node.getStatus());
               
                // we need to do this to obtain the new id
                StorageNodeCriteria criteria = new StorageNodeCriteria();
                criteria.addFilterAddress(address);
                StorageNode node2 = nodeManager.findStorageNodeByAddress(address);
               
                nodeManager.ackFailedOperation(subjectManager.getOverlord(), node2.getId());
               
                criteria = new StorageNodeCriteria();
                criteria.addFilterAddress(address);
                StorageNode node3 = nodeManager.findStorageNodeByAddress(address);
               
                assertEquals("The error message should not affect the equals method", node, node2);
                assertEquals("The error message should not affect the equals method", node2, node3);
                assertEquals("The cluster status should be JOINING", StorageNode.Status.JOINING, node3.getStatus());
                assertNull("The error message should be clean now", node3.getErrorMessage());
            }
           
        });
    }
View Full Code Here

Examples of org.rhq.core.domain.cloud.StorageNode

    private void createStorageNodes() {
        String[] nodes = System.getProperty("rhq.storage.nodes").split(",");
        String cqlPort = System.getProperty("rhq.storage.cql-port");
        for (String node : nodes) {
            StorageNode storageNode = new StorageNode();
            storageNode.setAddress(node);
            storageNode.setCqlPort(Integer.parseInt(cqlPort));
            storageNode.setOperationMode(StorageNode.OperationMode.NORMAL);
            storageNode.setVersion(StrippedDownStartupBean.RHQ_VERSION);
            entityManager.persist(storageNode);
        }
    }
View Full Code Here

Examples of org.rhq.core.domain.cloud.StorageNode

    @Override
    public List<Integer> findNotAcknowledgedStorageNodeAlertsCounts(List<Integer> storageNodeIds) throws RuntimeException {
        try {
            List<Integer> unackAlertCounts = new ArrayList<Integer>(storageNodeIds.size());
            for (int storageNodeId : storageNodeIds) {
                StorageNode node = new StorageNode();
                node.setId(storageNodeId);
                int num = storageNodeManager.findNotAcknowledgedStorageNodeAlerts(getSessionSubject(), node).size();
                unackAlertCounts.add(num);
            }
            assert storageNodeIds.size() == unackAlertCounts.size();
            return unackAlertCounts;
View Full Code Here

Examples of org.rhq.core.domain.cloud.StorageNode

            public int compare(StorageNode left, StorageNode right) {
                return left.getAddress().compareTo(right.getAddress());
            }
        });
        for (String address : storageNodeAddresses) {
            StorageNode node = new StorageNode();
            node.setAddress(address);
            node.setCqlPort(cqlPort);
            parsedNodes.add(node);
        }

        return parsedNodes;
    }
View Full Code Here

Examples of org.rhq.core.domain.cloud.StorageNode

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void logError(String address, String error, Exception e) {
        try {
            StorageNode newStorageNode = findStorageNodeByAddress(address);
            newStorageNode.setErrorMessage(error + " Check the server log for details. Root cause: "
                + ThrowableUtil.getRootCause(e).getMessage());
        } catch (Exception e1) {
            log.error("Failed to log error against storage node", e);
        }
    }
View Full Code Here

Examples of org.rhq.core.domain.cloud.StorageNode

        }
    }

    private void logError(ResourceOperationHistory operationHistory, String msg, Exception e) {
        log.error(msg, e);
        StorageNode storageNode = findStorageNode(operationHistory.getResource());
        storageNodeOperationsHandler.logError(storageNode.getAddress(), msg, e);
    }
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.