private static void SetResourceValue(int val, Org.Apache.Hadoop.Yarn.Api.Records.Resource resource, ResourceType type) { switch (type) { case ResourceType.Memory: { resource.SetMemory(val); break; } case ResourceType.Cpu: { resource.SetVirtualCores(val); break; } default: { throw new ArgumentException("Invalid resource"); } } }
public virtual void ClearPreemptedResources() { preemptedResources.SetMemory(0); preemptedResources.SetVirtualCores(0); }