Example #1
0
        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");
            }
            }
        }
Example #2
0
 public virtual void ClearPreemptedResources()
 {
     preemptedResources.SetMemory(0);
     preemptedResources.SetVirtualCores(0);
 }