Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Yelp/mrjob
/ functions
Functions
4,468 in github.com/Yelp/mrjob
⨍
Functions
4,468
◇
Types & classes
673
↳
Endpoints
1
↓ 443 callers
Method
make_runner
(self)
tests/test_emr.py:1457
↓ 409 callers
Method
sandbox
Redirect stdin, stdout, and stderr for automated testing. You can set stdin, stdout, and stderr to file objects. By default, they'll
mrjob/job.py:1597
↓ 388 callers
Method
get
(self)
tests/mock_boto3/s3.py:282
↓ 380 callers
Method
join
Join *paths* onto *path* (which may be a URI)
mrjob/fs/base.py:97
↓ 306 callers
Method
run
Entry point for running job from the command-line. This is also the entry point when a mapper or reducer is run by Hadoop Streaming.
mrjob/job.py:602
↓ 299 callers
Method
start
Add the given patcher to this test case's cleanup actions, then start it, and return the mock it returns. Example: mock_turtle = self
tests/sandbox.py:110
↓ 175 callers
Function
open
(*args, **kwargs)
mrjob/util.py:158
↓ 171 callers
Method
make_pooled_cluster
(self, normalized_instance_hours=None, **kwargs)
tests/test_emr_pooling.py:2222
↓ 171 callers
Method
makefile
(self, path, contents=b'', executable=False)
tests/sandbox.py:157
↓ 165 callers
Function
utc
(*args)
tests/tools/emr/test_audit_usage.py:39
↓ 129 callers
Method
cat_output
Stream the job's output, as a stream of ``bytes``. If there are multiple output files, there will be an empty bytestring (``b''``) bet
mrjob/runner.py:512
↓ 106 callers
Method
write
(self, key, value)
tests/mr_two_step_hadoop_format_job.py:44
↓ 98 callers
Method
exists
(self)
tests/mock_google/storage.py:80
↓ 92 callers
Method
ls
Recursively list all files in the given path. We don't return directories for compatibility with S3 (which has no concept of them)
mrjob/fs/base.py:75
↓ 84 callers
Method
add
Add a path. If *path* hasn't been added before, assign it a name. If *path* is a URI don't add it; just return the URI.
mrjob/setup.py:314
↓ 84 callers
Method
assertJoins
(self, cluster_id, job_args, job_class=MRTwoStepJob)
tests/test_emr_pooling.py:169
↓ 80 callers
Method
parse_output
Parse the final output of this MRJob (as a stream of byte chunks) into a stream of ``(key, value)``.
mrjob/job.py:1293
↓ 74 callers
Method
make_runner
create a dummy job, and call make_runner() on it. Use this in a with block: with self.make_runner() as runner: ...
tests/mock_boto3/case.py:198
↓ 70 callers
Method
assertDoesNotJoin
(self, cluster_id, job_args, job_class=MRTwoStepJob)
tests/test_emr_pooling.py:174
↓ 57 callers
Method
add_mock_s3_data
Update self.mock_s3_fs with a map from bucket name to key name to data.
tests/mock_boto3/case.py:89
↓ 56 callers
Function
_validate_param
Check that the param *name* is found in *params*, and if *type* is set, validate that it has the proper type. *type* may also be a tuple (mul
tests/mock_boto3/emr.py:1748
↓ 50 callers
Method
_fleet_config
( self, role='MASTER', instance_types=None, weighted_capacities=None, ebs_
tests/test_emr_pooling.py:114
↓ 50 callers
Method
_runner_kwargs
If we're building an inline or Spark runner, include mrjob_cls in kwargs.
mrjob/job.py:720
↓ 48 callers
Function
to_lines
Take in data as a sequence of bytes, and yield it, one line at a time. Only breaks lines on ``\\n`` (not ``\\r``), and does not add a trailin
mrjob/util.py:256
↓ 48 callers
Method
uri
Get the URI for the given path. If *path* is a URI, just return it.
mrjob/setup.py:332
↓ 45 callers
Method
add_passthru_arg
Function to create options which both the job runner and the job itself respect (we use this for protocols, for example). Use it like
mrjob/job.py:1181
↓ 44 callers
Method
_describe_cluster
(self)
mrjob/emr.py:2852
↓ 44 callers
Method
get_cluster_id
Get the ID of the cluster our job is running on, or ``None``.
mrjob/emr.py:2388
↓ 41 callers
Method
makedirs
(self, path)
tests/sandbox.py:151
↓ 40 callers
Method
read
(self, *args, **kwargs)
tests/test_util.py:292
↓ 39 callers
Function
is_uri
r"""Return True if *uri* is a URI and contains ``://`` (we only care about URIs that can describe files)
mrjob/parse.py:36
↓ 39 callers
Method
make_emr_client
Create a :py:mod:`boto3` EMR client. :return: a :py:class:`botocore.client.EMR` wrapped in a :py:class:`mrjob.retry.RetryWrap
mrjob/emr.py:2829
↓ 38 callers
Function
_error
(msg=None)
mrjob/cmd.py:33
↓ 38 callers
Method
_test_instance_groups
Run a job with the given option dictionary, and check for for instance, number, and optional bid price for each instance role. Specif
tests/test_emr.py:923
↓ 36 callers
Method
_ig_with_ebs_config
Build an instance group request with the given list of EBS device configs. Optionally turn on EBS optimization and specify a different
tests/test_emr_pooling.py:869
↓ 36 callers
Method
_spark_submit_args
Build a list of extra args to the spark-submit binary for the given spark or spark_script step.
mrjob/bin.py:915
↓ 35 callers
Function
cmd_line
build a command line that works in a shell.
mrjob/util.py:49
↓ 35 callers
Method
launch
Launch a job but don't wait for it to finish.
tests/mock_boto3/case.py:211
↓ 33 callers
Method
make_runner
(self, *args)
tests/test_runner.py:977
↓ 33 callers
Function
parse_setup_cmd
Parse a setup/bootstrap command, finding and pulling out Hadoop Distributed Cache-style paths ("hash paths"). :param string cmd: shell comman
mrjob/setup.py:76
↓ 32 callers
Function
_validate_param_type
Raise ParamValidationError if *value* isn't an instance of *type*.
tests/mock_boto3/emr.py:1766
↓ 32 callers
Method
make_persistent_cluster
(self)
mrjob/emr.py:2367
↓ 32 callers
Method
setUp
(self)
tests/test_emr.py:1450
↓ 31 callers
Method
run_and_get_cluster
(self, *args)
tests/mock_boto3/case.py:216
↓ 29 callers
Method
_get_local_tmp_dir
Create a tmp directory on the local filesystem that will be cleaned up by self.cleanup()
mrjob/runner.py:724
↓ 29 callers
Method
path_to_uri
Get a map from path to URI for all paths that were added, so we can figure out which files we need to upload.
mrjob/setup.py:343
↓ 28 callers
Function
_boto3_now
Get a ``datetime`` that's compatible with :py:mod:`boto3`. These are always UTC time, with time zone ``dateutil.tz.tzutc()``.
mrjob/aws.py:270
↓ 28 callers
Method
description
Return a dictionary representation of this step. See :ref:`steps-format` for examples.
mrjob/step.py:408
↓ 27 callers
Method
_cat_file
Yield the contents of the file at *path* as a series of ``bytes``, not necessarily respecting line boundaries.
mrjob/fs/base.py:85
↓ 27 callers
Function
_load_yaml_with_clear_tag
Like yaml.safe_load(), but everything with a !clear tag before it will be wrapped in ClearedValue().
mrjob/conf.py:126
↓ 27 callers
Method
name
Get the name for a path previously added to this :py:class:`WorkingDirManager`, assigning one as needed. This is primarily for gettin
mrjob/setup.py:418
↓ 27 callers
Function
name_uniquely
Come up with a unique name for *path*. :param names_taken: a dictionary or set of names not to use. :param proposed_name: name to use if it i
mrjob/setup.py:239
↓ 26 callers
Function
combine_values
Return the last value in *values* that is not ``None``. The default combiner; good for simple values (booleans, strings, numbers).
mrjob/conf.py:378
↓ 26 callers
Function
mrjob_conf_patcher
(substitute_conf=EMPTY_MRJOB_CONF)
tests/sandbox.py:66
↓ 25 callers
Function
_fix_clear_tags
Recursively resolve :py:class:`ClearedValue` wrappers so that ``ClearedValue(...)`` can only wrap values in dicts (and in the top-level value
mrjob/conf.py:156
↓ 25 callers
Method
_get_steps
Returns ``self._steps``.
mrjob/runner.py:777
↓ 25 callers
Method
_test_explicit
(self, m=False, c=False, r=False, **kwargs)
tests/test_step.py:136
↓ 25 callers
Method
mkdir
Create the given dir and its subdirs (if they don't already exist). On cloud filesystems (e.g. S3), also create the corresponding buck
mrjob/fs/base.py:111
↓ 25 callers
Method
name_to_path
Get a map from name (in the setup directory) to path for all known files/archives, so we can build :option:`-file` and :option:`-archi
mrjob/setup.py:470
↓ 25 callers
Function
run_job
Run a MRJob and return its output as a dictionary.
tests/job.py:20
↓ 25 callers
Function
to_unicode
Convert ``bytes`` to unicode. Use this if you need to ``print()`` or log bytes of an unknown encoding, or to parse strings out of bytes of un
mrjob/py2.py:161
↓ 24 callers
Method
_dest_in_wd_mirror
Return the URI of where to upload *path* so it can appear in the working dir as *name*, or ``None`` if it doesn't need to be uploaded.
mrjob/runner.py:1188
↓ 24 callers
Method
_find_hadoop_streaming_jar
Search for the hadoop streaming jar. See :py:meth:`_hadoop_streaming_jar_dirs` for where we search.
mrjob/hadoop.py:234
↓ 24 callers
Function
dump_mrjob_conf
Write out configuration options to a file. Useful if you don't want to bother to figure out YAML. *conf* should look something like this:
mrjob/conf.py:346
↓ 24 callers
Function
version_gte
Return ``True`` if version >= *cmp_version_str*.
mrjob/compat.py:725
↓ 23 callers
Method
_harness_job
( self, job_class, input_bytes=b'', input_paths=(), runner_alias='inline', compression
tests/spark/test_harness.py:134
↓ 23 callers
Function
combine_dicts
Combine zero or more dictionaries. Values from dicts later in the list take precedence over values earlier in the list. If you pass in ``None
mrjob/conf.py:435
↓ 23 callers
Method
put_gcs_multi
(self, gcs_uri_to_data_map)
tests/mock_google/case.py:170
↓ 23 callers
Method
write
(self, key, value)
mrjob/protocol.py:418
↓ 22 callers
Method
_get_step
Helper for run_* methods
mrjob/job.py:738
↓ 21 callers
Function
_attempt_to_lock_cluster
Attempt to lock the given pooled cluster using EMR tags. You may optionally include *cluster* (a cluster description) and *when_cluster_descr
mrjob/pool.py:589
↓ 21 callers
Function
_boto3_paginate
Yield results from a paginatable API client call. *what* is the name of the field the holds the list of items in each page (e.g. ``'InstanceG
mrjob/aws.py:281
↓ 21 callers
Method
_hadoop_args_for_step
Build a list of extra arguments to the hadoop binary. This handles *cmdenv*, *hadoop_extra_args*, *hadoop_input_format*, *hadoop_outp
mrjob/bin.py:265
↓ 21 callers
Method
add_fs
Add a filesystem. :param fs: a :py:class:~mrjob.fs.base.Filesystem to forward calls to. :param name string: Name of this filesystem.
mrjob/fs/composite.py:63
↓ 20 callers
Method
_find_cluster
Find a cluster that can host this runner. Prefer clusters with more compute units. Break ties by choosing cluster with longest idle time.
mrjob/emr.py:2636
↓ 20 callers
Method
ids_of_terminated_clusters
(self)
tests/tools/emr/test_terminate_idle_clusters.py:330
↓ 20 callers
Method
make_mock_file
(self, name, contents='contents')
tests/fs/test_hadoop.py:64
↓ 19 callers
Method
error
(msg)
mrjob/job.py:131
↓ 19 callers
Method
get_image_version
Get the version of the AMI that our cluster is running, or ``None``.
mrjob/emr.py:2860
↓ 19 callers
Method
increment_counter
Increment a counter in Hadoop streaming by printing to stderr. :type group: str :param group: counter group :type counter: st
mrjob/job.py:547
↓ 19 callers
Function
safeeval
Like eval, but with nearly everything in the environment blanked out, so that it's difficult to cause mischief. *globals* and *locals* are op
mrjob/util.py:134
↓ 18 callers
Function
_ValidationException
(operation_name, message)
tests/mock_boto3/emr.py:1792
↓ 18 callers
Method
_image_version_gte
Check if the requested image version is greater than or equal to *version*. If the *release_label* opt is set, look at that instead.
mrjob/emr.py:576
↓ 18 callers
Function
_list_all_steps
Get steps for the runner's cluster as a list (in forward order)
tests/test_emr.py:140
↓ 18 callers
Method
get_new_lines
(self)
tests/test_dataproc.py:1328
↓ 18 callers
Method
get_output_dir
Find the directory containing the job output. If the job hasn't run yet, returns None
mrjob/runner.py:692
↓ 18 callers
Function
map_version
Allows you to look up something by version (e.g. which jobconf variable to use, specifying only the versions where that value changed. *versi
mrjob/compat.py:623
↓ 17 callers
Method
_cmdenv
(self)
mrjob/emr.py:3097
↓ 17 callers
Method
_dir_archive_path
Assign a path for the archive of *dir_path* but don't actually create anything.
mrjob/runner.py:992
↓ 17 callers
Method
_get_cluster
(self, cluster_id)
mrjob/dataproc.py:1187
↓ 17 callers
Method
_test_instance_groups
Run a job with the given option dictionary, and check for for instance, number, and optional bid price for each instance role. Specif
tests/test_dataproc.py:740
↓ 17 callers
Method
add_mock_emr_cluster
(self, cluster)
tests/mock_boto3/case.py:122
↓ 17 callers
Method
cat
cat all files matching **path_glob**, decompressing if necessary This yields bytes, which don't necessarily correspond to lines (see
mrjob/fs/base.py:54
↓ 17 callers
Method
get_hadoop_bin
Find the hadoop binary. A list: binary followed by arguments.
mrjob/hadoop.py:212
↓ 17 callers
Method
make_master_file
(self, path, contents)
tests/fs/test_ssh.py:61
↓ 16 callers
Method
_num_steps
Get the number of steps (calls :py:meth:`get_steps`).
mrjob/runner.py:840
↓ 16 callers
Method
_read_logs
If this is false, we shouldn't attempt to list or cat logs.
mrjob/logs/mixin.py:290
↓ 16 callers
Method
assertCantEncode
(self, protocol, key, value)
tests/test_protocol.py:109
↓ 16 callers
Method
du
Get the total size of files matching ``path_glob`` Corresponds roughly to: ``hadoop fs -du path_glob``
mrjob/fs/base.py:68
↓ 16 callers
Method
maybe_terminate_quietly
(self, stdout=None, **kwargs)
tests/tools/emr/test_terminate_idle_clusters.py:338
next →
1–100 of 4,468, ranked by callers