UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
want VMs to be located close to each other for low network latency
between the VMs. No placement policy will be generated when collocation
is UNSPECIFIED.
UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
want VMs to be located close to each other for low network latency
between the VMs. No placement policy will be generated when collocation
is UNSPECIFIED.
When specified, causes the job to fail if more than max_distance logical
switches are required between VMs. Batch uses the most compact possible
placement of VMs even when max_distance is not specified. An explicit
max_distance makes that level of compactness a strict requirement.
Not yet implemented
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Interface AllocationPolicy.PlacementPolicyOrBuilder (0.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.16.0 (latest)](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder)\n- [0.15.0](/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder)\n- [0.14.1](/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.batch.v1.AllocationPolicy.PlacementPolicyOrBuilder) \n\n public static interface AllocationPolicy.PlacementPolicyOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getCollocation()\n\n public abstract String getCollocation()\n\nUNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you\nwant VMs to be located close to each other for low network latency\nbetween the VMs. No placement policy will be generated when collocation\nis UNSPECIFIED.\n\n`string collocation = 1;`\n\n### getCollocationBytes()\n\n public abstract ByteString getCollocationBytes()\n\nUNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you\nwant VMs to be located close to each other for low network latency\nbetween the VMs. No placement policy will be generated when collocation\nis UNSPECIFIED.\n\n`string collocation = 1;`\n\n### getMaxDistance()\n\n public abstract long getMaxDistance()\n\nWhen specified, causes the job to fail if more than max_distance logical\nswitches are required between VMs. Batch uses the most compact possible\nplacement of VMs even when max_distance is not specified. An explicit\nmax_distance makes that level of compactness a strict requirement.\nNot yet implemented\n\n`int64 max_distance = 2;`"]]