Reference documentation and code samples for the Google Cloud Dataproc v1 API class NodeGroupAffinity.
Node Group Affinity for clusters using sole-tenant node groups.
The Dataproc NodeGroupAffinity resource is not related to the
Dataproc [NodeGroup][google.cloud.dataproc.v1.NodeGroup] resource.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eNodeGroupAffinity\u003c/code\u003e class in the Google Cloud Dataproc v1 API is 5.17.0, and there are several previous versions ranging from 5.16.0 down to 3.1.0, and it also include versions 4.0.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eNodeGroupAffinity\u003c/code\u003e is a class within the Google.Cloud.Dataproc.V1 namespace and is used for managing node group affinity in clusters with sole-tenant node groups, but is not directly related to the Dataproc NodeGroup resource.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eNodeGroupAffinity\u003c/code\u003e class implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing various functionalities such as deep cloning and buffer message handling.\u003c/p\u003e\n"],["\u003cp\u003eThe class has a public property \u003ccode\u003eNodeGroupUri\u003c/code\u003e which is a required string representing the URI of a sole-tenant node group resource, allowing for full URLs, partial URIs, or node group names.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eNodeGroupAffinity\u003c/code\u003e class provides two constructors, one default \u003ccode\u003eNodeGroupAffinity()\u003c/code\u003e and another \u003ccode\u003eNodeGroupAffinity(NodeGroupAffinity other)\u003c/code\u003e that allows the creation of a \u003ccode\u003eNodeGroupAffinity\u003c/code\u003e using another \u003ccode\u003eNodeGroupAffinity\u003c/code\u003e as the parameter.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Dataproc v1 API - Class NodeGroupAffinity (5.20.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.20.0 (latest)](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.19.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.19.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.18.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.18.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.17.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.17.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.16.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.16.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.15.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.15.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.14.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.14.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.13.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.13.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.12.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.12.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.11.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.11.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.10.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.10.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.9.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.9.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.8.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.8.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.7.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.7.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.6.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.6.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.5.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.5.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.4.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.4.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.3.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.3.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.2.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.2.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.1.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.1.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.0.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/4.0.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/3.4.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/3.3.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/3.2.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/3.1.0/Google.Cloud.Dataproc.V1.NodeGroupAffinity) \n\n public sealed class NodeGroupAffinity : IMessage\u003cNodeGroupAffinity\u003e, IEquatable\u003cNodeGroupAffinity\u003e, IDeepCloneable\u003cNodeGroupAffinity\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Dataproc v1 API class NodeGroupAffinity.\n\nNode Group Affinity for clusters using sole-tenant node groups.\n**The Dataproc `NodeGroupAffinity` resource is not related to the\nDataproc \\[NodeGroup\\]\\[google.cloud.dataproc.v1.NodeGroup\\] resource.** \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e NodeGroupAffinity \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[NodeGroupAffinity](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.NodeGroupAffinity), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[NodeGroupAffinity](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.NodeGroupAffinity), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[NodeGroupAffinity](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.NodeGroupAffinity), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Dataproc.V1](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Dataproc.V1.dll\n\nConstructors\n------------\n\n### NodeGroupAffinity()\n\n public NodeGroupAffinity()\n\n### NodeGroupAffinity(NodeGroupAffinity)\n\n public NodeGroupAffinity(NodeGroupAffinity other)\n\nProperties\n----------\n\n### NodeGroupUri\n\n public string NodeGroupUri { get; set; }\n\nRequired. The URI of a\nsole-tenant [node group\nresource](https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups)\nthat the cluster will be created on.\n\nA full URL, partial URI, or node group name are valid. Examples:\n\n- `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/nodeGroups/node-group-1`\n- `projects/[project_id]/zones/[zone]/nodeGroups/node-group-1`\n- `node-group-1`"]]