/*
(non-Javadoc)

@see com.emc.ecs.nfsclient.nfs.NfsFile#mknod(com.emc.ecs.nfsclient.nfs.
NfsType, com.emc.ecs.nfsclient.nfs.NfsSetAttributes, long[])
514994
public NfsMknodResponse mknod(NfsType type, NfsSetAttributes attributes, long[] rdev) throws IOException {
        NfsMknodResponse response = getNfs().wrapped_sendMknod(makeMknodRequest(type, attributes, rdev));
        setFileHandle(response.getFileHandle());
        return response;
    }
401080
@Override
    public ModelNode toModelNode() throws CommandFormatException {
        ModelNode node = new ModelNode();
        ModelNode groupsNode = node.get(Util.CONCURRENT_GROUPS);
        for(SingleRolloutPlanGroup group : groups) {
            groupsNode.get(group.getGroupName()).set(group.toModelNode());
        }
        return node;
    }
232593
@Override
  ClientProtocol getNewNameNode(ClientProtocol rpcNamenode, Configuration conf)
      throws IOException {
    ClientProtocol namenode = DFSClient.createNamenode(rpcNamenode, conf);
    if (failoverClient == null) {
      failoverClient = new FailoverClientProtocol(namenode,
          failoverHandler);
    }
    failoverClient.setNameNode(namenode);
    return failoverClient;
  }
1079231
Long getLongAttribute(org.w3c.dom.Node attribute) throws InvalidInputException {
    String s = getStringAttribute(attribute);

    if (s == null) {
      return null;
    }

    try {
      return Long.parseLong(s);
    } catch (NumberFormatException e) {
      throw new InvalidInputException("Invalid input: " + attribute.getNodeName()
          + " must be a int64 value not \"" + s + "\"");
    }
  }
998577
public void renameNodesWithAttributeValue(String oldName, String newName, String attributeName, String attributeValue) {
		List<Node> nodes = getNodesFromTreeByName(oldName);
		Iterator i = nodes.iterator();
		while (i.hasNext()) {
			Node n = (Node) i.next();
			n.setName(newName);
		}
	}
817345
void removeFromInodeMap(List<INode> inodes) {
    if (inodes != null) {
      for (INode inode : inodes) {
        if (inode != null) {
          inodeMap.remove(inode);
        }
      }
    }
  }
1137561
@SuppressWarnings("checkstyle:cyclomaticcomplexity")
	protected void _createNode(DocumentRootNode parentNode, XtendTypeDeclaration modelElement) {
		//
		// The text region is set to the model element, not to the model element's name as in the
		// default implementation of createStructuralFeatureNode().
		// The text region computation is overridden in order to have a correct link to the editor.
		//
		final boolean isFeatureSet = modelElement.eIsSet(XtendPackage.Literals.XTEND_TYPE_DECLARATION__NAME);
		final EStructuralFeatureNode elementNode = new EStructuralFeatureNode(
				modelElement,
				XtendPackage.Literals.XTEND_TYPE_DECLARATION__NAME,
				parentNode,
				this.imageDispatcher.invoke(modelElement),
				this.textDispatcher.invoke(modelElement),
				modelElement.getMembers().isEmpty() || !isFeatureSet);
		final EObject primarySourceElement = this.associations.getPrimarySourceElement(modelElement);
		final ICompositeNode parserNode = NodeModelUtils.getNode(
				(primarySourceElement == null) ? modelElement : primarySourceElement);
		elementNode.setTextRegion(parserNode.getTextRegion());
		//
		boolean hasConstructor = false;
		if (!modelElement.getMembers().isEmpty()) {
			EObjectNode capacityUseNode = null;
			EObjectNode capacityRequirementNode = null;

			for (final EObject feature : modelElement.getMembers()) {
				if (feature instanceof SarlConstructor) {
					hasConstructor = true;
					createNode(elementNode, feature);
				} else if (feature instanceof SarlField) {
					final SarlField field = (SarlField) feature;
					createNode(elementNode, field);
					createAutomaticAccessors(elementNode, field);
				} else if (feature instanceof SarlAction
						|| feature instanceof SarlBehaviorUnit
						|| feature instanceof XtendTypeDeclaration) {
					createNode(elementNode, feature);
				} else if (feature instanceof SarlCapacityUses) {
					capacityUseNode = createCapacityUseNode(elementNode, (SarlCapacityUses) feature, capacityUseNode);
				} else if (feature instanceof SarlRequiredCapacity) {
					capacityRequirementNode = createRequiredCapacityNode(elementNode,
							(SarlRequiredCapacity) feature, capacityRequirementNode);
				}
			}
		}
		if (!hasConstructor && modelElement instanceof XtendClass) {
			createInheritedConstructors(elementNode, (XtendClass) modelElement);
		}
	}
1300024
public String getMemcachedNodeId() {
        final String nodeId = _nodeIds.get( _random.nextInt( _nodeIds.size() ) );
        return isNodeAvailable( nodeId ) ? nodeId : getAvailableNodeId( nodeId );
    }
801840
private String getFNSignatureFromIContext(INode node) {

        String ret = node.getNodeData().getName();
        List<INode> children = node.getChildrenList();
        if (children != null && children.size() > 0) {
            ret += "(";
            for (INode aChildren : children) {
                ret += getFNSignatureFromIContext(aChildren) + ",";
            }

            ret = ret.substring(0, ret.length() - 1);
            ret += ")";
        }
        return ret;

    }
149768
public void marshalling(Xdr xdr) {
        super.marshalling(xdr);
        xdr.putString(_name);
        xdr.putInt(_createMode.getValue());
        if (_createMode != NfsCreateMode.EXCLUSIVE) {
            _attributes.marshalling(xdr);
        } else {
            xdr.putByteArray(_verifier);
        }
    }
1147493
public static clusternode[] get(nitro_service service, Long nodeid[]) throws Exception{
		if (nodeid !=null && nodeid.length>0) {
			clusternode response[] = new clusternode[nodeid.length];
			clusternode obj[] = new clusternode[nodeid.length];
			for (int i=0;i<nodeid.length;i++) {
				obj[i] = new clusternode();
				obj[i].set_nodeid(nodeid[i]);
				response[i] = (clusternode) obj[i].get_resource(service);
			}
			return response;
		}
		return null;
	}
551694
@Override
    public FileNode mkfile() throws MkfileException {
    	try {
            Files.createFile(path);
		} catch (IOException e) {
			throw new MkfileException(this, e);
		}
        return this;
    }
773801
static InetSocketAddress getNameNodeAddress(Configuration conf,
                                                      String cname, String rpcKey, String cname2) {
    String fs = conf.get(cname);
    String fs1 = conf.get(rpcKey);
    String fs2 = conf.get(cname2);
    Configuration newconf = new Configuration(conf);
    newconf.set("fs.default.name", fs);
    if (fs1 != null) {
      newconf.set(DFS_NAMENODE_RPC_ADDRESS_KEY, fs1);
    }
    if (fs2 != null) {
      newconf.set("dfs.namenode.dn-address", fs2);
    }
    return DataNode.getNameNodeAddress(newconf);
  }
1189986
private void dfs(Node root) {
        root.setMarked(true);
        for (Edge e : root.getOutEdges()) {
            N n = e.getChild();
            if (!n.isMarked()) {
                dfs(n);
            }
        }
    }
1146090
public void setNodeType(int nodeType) {
        if (nodeType != Token.VAR
            && nodeType != Token.CONST
            && nodeType != Token.LET)
            throw new IllegalArgumentException("invalid node type");
        setType(nodeType);
    }
307480
public static Map<QName, String> getAttributes(Node n) {
        Map<QName, String> map = new LinkedHashMap<QName, String>();
        NamedNodeMap m = n.getAttributes();
        if (m != null) {
            final int len = m.getLength();
            for (int i = 0; i < len; i++) {
                Attr a = (Attr) m.item(i);
                map.put(getQName(a), a.getValue());
            }
        }
        return map;
    }
270324
private INodeFileUnderConstruction unprotectedAddFile(long inodeId, String path,
      PermissionStatus permissions, short replication, long modificationTime,
      long atime, long preferredBlockSize, String clientName,
      String clientMachine) {
    INodeFileUnderConstruction newNode = new INodeFileUnderConstruction(
        inodeId, permissions, replication, preferredBlockSize, modificationTime,
        clientName, clientMachine, null);
    try {
      newNode = addNode(path, newNode, 0, false);
    } catch (IOException e) {
      return null;
    }
    return newNode;
  }