The maximum number of bytes of disk the job will require to run.
771598
def disk(self):
        
        if self._disk is not None:
            return self._disk
        elif self._config is not None:
            return self._config.defaultDisk
        else:
            raise AttributeError("Default value for 'disk' cannot be determined")
570446
public static void jobTotalNumOfTransactions(JavaSparkContext sc, Configuration hadoopConf, String inputFile, String outputFile) {
    // read bitcoin data from HDFS
    JavaPairRDD<BytesWritable, BitcoinBlock> bitcoinBlocksRDD = sc.newAPIHadoopFile(inputFile, BitcoinBlockFileInputFormat.class, BytesWritable.class, BitcoinBlock.class,hadoopConf);
    // extract the no transactions / block (map)
    JavaPairRDD<String, Long> noOfTransactionPair = bitcoinBlocksRDD.mapToPair(new PairFunction<Tuple2<BytesWritable,BitcoinBlock>, String, Long>() {
	@Override
	public Tuple2<String, Long> call(Tuple2<BytesWritable,BitcoinBlock> tupleBlock) {
		return mapNoOfTransaction(tupleBlock._2());
	}
    });
   // combine the results from all blocks
   JavaPairRDD<String, Long> totalCount = noOfTransactionPair.reduceByKey(new Function2<Long, Long, Long>() {
	@Override	
	public Long call(Long a, Long b) { 
		return reduceSumUpTransactions(a,b);
	}
   });
    // write results to HDFS
    totalCount.repartition(1).saveAsTextFile(outputFile);
    }
1278465
def filesize(self):
        
        if self.from_stdin:
            return None
        if not self._filesize:
            self._calculate_bounds()
        return self._filesize
1211109
def allocate(self):
        """"""
        disk_path = self.provider_image

        self._hypervisor = libvirt.open(
            self.configuration.get('hypervisor', 'vbox:///session'))

        self._domain = domain_create(self._hypervisor, self.identifier,
                                     self.configuration['domain'], disk_path)
305344
def generate_scsi_chs
      disk_size = File.stat(@previous_deliverables.disk).size

      if disk_size < 1073741824
        h = 64
        s = 32
      else
        if disk_size < 2147483648
          h = 128
          s = 32
        else
          h = 255
          s = 63
        end
      end

      c = disk_size / (h*s*512)
      total_sectors = disk_size / 512

      [c.to_i, h.to_i, s.to_i, total_sectors.to_i]
    end
228882
def max_send_data_size(self):
        
        with self.lock:
            if self.device is None:
                raise IOError(errno.ENODEV, os.strerror(errno.ENODEV))
            else:
                return self.device.get_max_send_data_size(self.target)
36158
private boolean incSlotLimit(JobInfo info, TaskType type, LimitType limit) {
    switch (limit) {
      case MIN:
        if (type == TaskType.MAP) {
          if (info.minMaps < runnableTasks(info, type)) {
            info.minMaps += 1;
            return true;
          }
        } else {
          if (info.minReduces < runnableTasks(info, type)) {
            info.minReduces += 1;
            return true;
          }
        }
        return false;
      case MAX:
        if (type == TaskType.MAP) {
          if (info.maxMaps < runnableTasks(info, type)) {
            info.maxMaps += 1;
            return true;
          }
        } else {
          if (info.maxReduces < runnableTasks(info, type)) {
            info.maxReduces += 1;
            return true;
          }
        }
        return false;
    }
    // Never come here
    return false;
  }
304807
def _spill(self):
        
        global MemoryBytesSpilled, DiskBytesSpilled
        path = self._get_spill_dir(self.spills)
        if not os.path.exists(path):
            os.makedirs(path)

        used_memory = get_used_memory()
        if not self.pdata:
            # The data has not been partitioned, it will iterator the
            # dataset once, write them into different files, has no
            # additional memory. It only called when the memory goes
            # above limit at the first time.

            # open all the files for writing
            streams = [open(os.path.join(path, str(i)), 'wb')
                       for i in range(self.partitions)]

            for k, v in self.data.items():
                h = self._partition(k)
                # put one item in batch, make it compatible with load_stream
                # it will increase the memory if dump them in batch
                self.serializer.dump_stream([(k, v)], streams[h])

            for s in streams:
                DiskBytesSpilled += s.tell()
                s.close()

            self.data.clear()
            self.pdata.extend([{} for i in range(self.partitions)])

        else:
            for i in range(self.partitions):
                p = os.path.join(path, str(i))
                with open(p, "wb") as f:
                    # dump items in batch
                    self.serializer.dump_stream(iter(self.pdata[i].items()), f)
                self.pdata[i].clear()
                DiskBytesSpilled += os.path.getsize(p)

        self.spills += 1
        gc.collect()  # release the memory as much as possible
        MemoryBytesSpilled += max(used_memory - get_used_memory(), 0) << 20
1316343
def sys_maxfd():
    
    maxfd = None
    try:
        maxfd = int(resource.getrlimit(resource.RLIMIT_NOFILE)[0])
        if maxfd == resource.RLIM_INFINITY:                                                     # pragma: no cover
            maxfd = None
    except: pass
    if maxfd is None:
        maxfd = sys_maxfd.fallback_maxfd
    return maxfd
560494
private int calculateSize(JobID jobId, ArchivedExecutionGraph serializableExecutionGraph) {
		final File archivedExecutionGraphFile = getExecutionGraphFile(jobId);

		if (archivedExecutionGraphFile.exists()) {
			return Math.toIntExact(archivedExecutionGraphFile.length());
		} else {
			LOG.debug("Could not find archived execution graph file for {}. Estimating the size instead.", jobId);
			return serializableExecutionGraph.getAllVertices().size() * 1000 +
				serializableExecutionGraph.getAccumulatorsSerialized().size() * 1000;
		}
	}
5531
function validateMaxFileSize(pluginDir) {
  return (maxBytes, filePath) => {
    try {
      const stat = fs.statSync(path.join(pluginDir, filePath));
      return stat.size <= maxBytes;
    } catch (e) {
      return false;
    }
  };
}
24059
def container_fs_limit_bytes(self, metric, scraper_config):
        
        pct_m_name = scraper_config['namespace'] + '.filesystem.usage_pct'
        if metric.type not in METRIC_TYPES:
            self.log.error("Metric type %s unsupported for metric %s" % (metric.type, metric.name))
            return
        self._process_limit_metric('', metric, self.fs_usage_bytes, scraper_config, pct_m_name)
409439
def write_quota(outbytes: int, outfn: Path) -> Union[None, int]:
    
    if not outfn:
        return None

    anch = Path(outfn).resolve().anchor
    freeout = shutil.disk_usage(anch).free

    if freeout < 10 * outbytes:
        raise IOError(f'out of disk space on {anch}.'
                      '{freeout/1e9} GB free, wanting to write {outbytes/1e9} GB.')

    return freeout
1104668
private static function determineMaximumUploadSize() {
		$postMaxSize = self::parseIniSize(
			\ini_get('post_max_size')
		);

		if ($postMaxSize <= 0) {
			$postMaxSize = \PHP_INT_MAX;
		}

		$memoryLimit = self::parseIniSize(
			\ini_get('memory_limit')
		);

		if ($memoryLimit === -1) {
			$memoryLimit = \PHP_INT_MAX;
		}

		return \min(
			self::parseIniSize(
				\ini_get('upload_max_filesize')
			),
			$postMaxSize,
			$memoryLimit
		);
	}
263836
private int computeRateLimit(State state) {
    String jobLauncherType = state.getProp(ConfigurationKeys.JOB_LAUNCHER_TYPE_KEY, "LOCAL");
    int parallelism = 1;
    if (LOCAL_JOB_LAUNCHER_TYPE.equals(jobLauncherType)) {
      parallelism = state.getPropAsInt(ConfigurationKeys.TASK_EXECUTOR_THREADPOOL_SIZE_KEY,
                                       ConfigurationKeys.DEFAULT_TASK_EXECUTOR_THREADPOOL_SIZE);
    } else {
      parallelism = state.getPropAsInt(ConfigurationKeys.MR_JOB_MAX_MAPPERS_KEY,
                                       ConfigurationKeys.DEFAULT_MR_JOB_MAX_MAPPERS);
    }
    parallelism = Math.min(parallelism, state.getPropAsInt(ConfigurationKeys.SOURCE_MAX_NUMBER_OF_PARTITIONS,
                                                           ConfigurationKeys.DEFAULT_MAX_NUMBER_OF_PARTITIONS));
    parallelism = Math.max(parallelism, 1);
    int rateLimit = state.getPropAsInt(WRITER_LIMIT_RATE_LIMIT_KEY) / parallelism;
    rateLimit = Math.max(rateLimit, 1);
    return rateLimit;
  }
425336
def _EnforceProcessMemoryLimit(self, memory_limit):
    
    # Resource is not supported on Windows.
    if resource:
      if memory_limit is None:
        memory_limit = 4 * 1024 * 1024 * 1024
      elif memory_limit == 0:
        memory_limit = resource.RLIM_INFINITY

      resource.setrlimit(resource.RLIMIT_DATA, (memory_limit, memory_limit))
1205672
public void ensureSize(int maxPartitionOrder) {
        if (capacityByOrder >= maxPartitionOrder) return;
        parameters = new int[(1 << maxPartitionOrder)];
        rawBits = new int[(1 << maxPartitionOrder)]; 
        capacityByOrder = maxPartitionOrder;
    }