Add a partition to the node provided

@param node The node to which we'll add the partition
@param donatedPartition The partition to add
@return The new node with the new partition
513202
public static Node addPartitionToNode(final Node node, Integer donatedPartition) {
        return UpdateClusterUtils.addPartitionsToNode(node, Sets.newHashSet(donatedPartition));
    }
123429
public boolean addGrant(
      ClusterNode node, String sessionId, ResourceRequestInfo req) {
    synchronized (node) {
      if (node.deleted) {
        return false;
      }
      if (!node.checkForGrant(Utilities.getUnitResourceRequest(
        req.getType()), resourceLimit)) {
        return false;
      }

      node.addGrant(sessionId, req);
      loadManager.incrementLoad(req.getType());
      hostsToSessions.get(node).add(sessionId);
      if (!node.checkForGrant(Utilities.getUnitResourceRequest(
        req.getType()), resourceLimit)) {
        RunnableIndices r = typeToIndices.get(req.getType());
        r.deleteRunnable(node);
      }
    }
    return true;
  }
988730
def add_node(self, node, weight=1):
        
        self._nodes.add(node)
        self._weights[node] = weight
        self._hashring = dict()
        self._sorted_keys = []

        self._build_circle()
1132296
@Override
	public void createPartition(ObjectPath tablePath, CatalogPartitionSpec partitionSpec, CatalogPartition partition, boolean ignoreIfExists)
		throws TableNotExistException, TableNotPartitionedException, PartitionSpecInvalidException, PartitionAlreadyExistsException, CatalogException {

		validatePartitionSpec(tablePath, partitionSpec);

		if (partitionExists(tablePath, partitionSpec)) {
			if (!ignoreIfExists) {
				throw new PartitionAlreadyExistsException(catalogName, tablePath, partitionSpec);
			}
		} else {
			partitions.get(tablePath).put(partitionSpec, partition.copy());
		}
	}
488667
static Partition createRangePartitionWithSubPartition(
            SqlgGraph sqlgGraph,
            AbstractLabel abstractLabel,
            String name,
            String from,
            String to,
            PartitionType partitionType,
            String partitionExpression) {

        Preconditions.checkArgument(!abstractLabel.getSchema().isSqlgSchema(), "createRangePartitionWithSubPartition may not be called for \"%s\"", Topology.SQLG_SCHEMA);
        Preconditions.checkState(abstractLabel.isRangePartition());
        Partition partition = new Partition(sqlgGraph, abstractLabel, name, from, to, partitionType, partitionExpression);
        partition.createRangePartitionOnDb();
        if (abstractLabel instanceof VertexLabel) {
            TopologyManager.addVertexLabelPartition(
                    sqlgGraph,
                    abstractLabel.getSchema().getName(),
                    abstractLabel.getName(),
                    name,
                    from,
                    to,
                    partitionType,
                    partitionExpression);
        } else {
            TopologyManager.addEdgeLabelPartition(sqlgGraph, abstractLabel, name, from, to, partitionType, partitionExpression);
        }
        partition.committed = false;
        return partition;
    }
611743
protected void addNodeToItsParent(CmsAppCategoryNode node) {

        String parentId = node.getCategory().getParentId();
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(parentId)) {
            parentId = null;
        }
        CmsAppCategoryNode parentNode = m_nodes.get(parentId);
        if (parentNode == null) {
            LOG.error(
                "Missing parent [" + node.getCategory().getParentId() + "] for [" + node.getCategory().getId() + "]");
        } else {
            parentNode.addChild(node);
        }
    }
538671
public void addChild(final DiffNode node)
	{
		if (node == this)
		{
			throw new IllegalArgumentException("Detected attempt to add a node to itself. " +
					"This would cause inifite loops and must never happen.");
		}
		else if (node.isRootNode())
		{
			throw new IllegalArgumentException("Detected attempt to add root node as child. " +
					"This is not allowed and must be a mistake.");
		}
		else if (node.getParentNode() != null && node.getParentNode() != this)
		{
			throw new IllegalArgumentException("Detected attempt to add child node that is already the " +
					"child of another node. Adding nodes multiple times is not allowed, since it could " +
					"cause infinite loops.");
		}
		if (node.getParentNode() == null)
		{
			node.setParentNode(this);
		}
		children.put(node.getElementSelector(), node);
		if (state == State.UNTOUCHED && node.hasChanges())
		{
			state = State.CHANGED;
		}
	}
1249459
public void addNode(final @Nonnull Node node) throws IOException {
        Node oldNode = nodes.get(node.getNodeName());
        if (node != oldNode) {
            // TODO we should not need to lock the queue for adding nodes but until we have a way to update the
            // computer list for just the new node
            Queue.withLock(new Runnable() {
                @Override
                public void run() {
                    nodes.put(node.getNodeName(), node);
                    jenkins.updateComputerList();
                    jenkins.trimLabels();
                }
            });
            // TODO there is a theoretical race whereby the node instance is updated/removed after lock release
            try {
                persistNode(node);
            } catch (IOException | RuntimeException e) {
                // JENKINS-50599: If persisting the node throws an exception, we need to remove the node from
                // memory before propagating the exception.
                Queue.withLock(new Runnable() {
                    @Override
                    public void run() {
                        nodes.compute(node.getNodeName(), (ignoredNodeName, ignoredNode) -> oldNode);
                        jenkins.updateComputerList();
                        jenkins.trimLabels();
                    }
                });
                throw e;
            }
            NodeListener.fireOnCreated(node);
        }
    }
391694
public MultipartBuilder addPart(NetworkRequest part) {
        if (part == null) {
            throw new NullPointerException("part == null");
        }
        parts.add(part);
        return this;
    }
1250114
private OperationPair createSetBidOperation(ProductPartitionNode node) {
    Preconditions.checkNotNull(node.getProductPartitionId(),
        "Node for SET operation has no partition ID: %s", node);
    Preconditions.checkArgument(node.getProductPartitionId().longValue() >= 0L,
        "Node for SET operation has a negative partition ID: %s", node);
    AdGroupCriterionOperation setOp = new AdGroupCriterionOperation();
    setOp.setOperator(Operator.SET);
    setOp.setOperand(ProductPartitionNodeAdapter.createCriterionForSetBiddableUnit(node, adGroupId,
        getBiddingStrategyConfiguration()));

    return new OperationPair(node, setOp);
  }
1253747
private static Partition createListSubPartition(SqlgGraph sqlgGraph, Partition parentPartition, String name, String in) {
        Preconditions.checkArgument(!parentPartition.getAbstractLabel().getSchema().isSqlgSchema(), "createPartition may not be called for \"%s\"", Topology.SQLG_SCHEMA);
        Partition partition = new Partition(sqlgGraph, parentPartition, name, in, PartitionType.NONE, null);
        partition.createListPartitionOnDb();
        TopologyManager.addSubPartition(sqlgGraph, partition);
        partition.committed = false;
        return partition;
    }
359042
public void add(T node) {
		for (int i = 0; i < numberOfReplicas; i++) {
			circle.put(hashFunc.hash(node.toString() + i), node);
		}
	}
1006306
public void addElementToPartition(Partition<CaptureSearchResult> element,
			Partition<Partition<CaptureSearchResult>> partition) {
		partition.add(element);
		partition.addTotal(element.getTotal());
		if(element.isContainsClosest()) {
			partition.setContainsClosest(true);
		}
	}
885600
public void add(N node) {
        if (! node.added) {
            nodes.add(node);
            node.added = true;
        }
    }
1361485
protected UploadPartRequest newUploadPartRequest(PartCreationEvent event,
            final File part) {
        final UploadPartRequest reqUploadPart = new UploadPartRequest()
            .withBucketName(req.getBucketName())
            .withFile(part)
            .withKey(req.getKey())
            .withPartNumber(event.getPartNumber())
            .withPartSize(part.length())
            .withLastPart(event.isLastPart())
            .withUploadId(uploadId)
            .withObjectMetadata(req.getUploadPartMetadata())
            ;
        return reqUploadPart;
    }
626963
public Node<T> add(T element) {
		Node<T> node = new Node<>(this, element);
		nodes.add(node);
		return node;
	}
974648
public void setPartitions(java.util.Collection<Partition> partitions) {
        if (partitions == null) {
            this.partitions = null;
            return;
        }

        this.partitions = new java.util.ArrayList<Partition>(partitions);
    }