Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discarding the master/slave language #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions boto/emr/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def modify_instance_groups(self, instance_group_ids, new_sizes):

def run_jobflow(self, name, log_uri=None, ec2_keyname=None,
availability_zone=None,
master_instance_type='m1.small',
slave_instance_type='m1.small', num_instances=1,
main_instance_type='m1.small',
subordinate_instance_type='m1.small', num_instances=1,
action_on_failure='TERMINATE_JOB_FLOW', keep_alive=False,
enable_debugging=False,
hadoop_version=None,
Expand All @@ -229,11 +229,11 @@ def run_jobflow(self, name, log_uri=None, ec2_keyname=None,
:type availability_zone: str
:param availability_zone: EC2 availability zone of the cluster

:type master_instance_type: str
:param master_instance_type: EC2 instance type of the master
:type main_instance_type: str
:param main_instance_type: EC2 instance type of the main

:type slave_instance_type: str
:param slave_instance_type: EC2 instance type of the slave nodes
:type subordinate_instance_type: str
:param subordinate_instance_type: EC2 instance type of the subordinate nodes

:type num_instances: int
:param num_instances: Number of instances in the Hadoop cluster
Expand Down Expand Up @@ -264,7 +264,7 @@ def run_jobflow(self, name, log_uri=None, ec2_keyname=None,
:param instance_groups: Optional list of instance groups to
use when creating this job.
NB: When provided, this argument supersedes num_instances
and master/slave_instance_type.
and main/subordinate_instance_type.

:type ami_version: str
:param ami_version: Amazon Machine Image (AMI) version to use
Expand Down Expand Up @@ -299,15 +299,15 @@ def run_jobflow(self, name, log_uri=None, ec2_keyname=None,
params.update(common_params)

# NB: according to the AWS API's error message, we must
# "configure instances either using instance count, master and
# slave instance type or instance groups but not both."
# "configure instances either using instance count, main and
# subordinate instance type or instance groups but not both."
#
# Thus we switch here on the truthiness of instance_groups.
if not instance_groups:
# Instance args (the common case)
instance_params = self._build_instance_count_and_type_args(
master_instance_type,
slave_instance_type,
main_instance_type,
subordinate_instance_type,
num_instances)
params.update(instance_params)
else:
Expand Down Expand Up @@ -443,15 +443,15 @@ def _build_instance_common_args(self, ec2_keyname, availability_zone,

return params

def _build_instance_count_and_type_args(self, master_instance_type,
slave_instance_type, num_instances):
def _build_instance_count_and_type_args(self, main_instance_type,
subordinate_instance_type, num_instances):
"""
Takes a master instance type (string), a slave instance type
Takes a main instance type (string), a subordinate instance type
(string), and a number of instances. Returns a comparable dict
for use in making a RunJobFlow request.
"""
params = {'Instances.MasterInstanceType': master_instance_type,
'Instances.SlaveInstanceType': slave_instance_type,
params = {'Instances.MainInstanceType': main_instance_type,
'Instances.SubordinateInstanceType': subordinate_instance_type,
'Instances.InstanceCount': num_instances}
return params

Expand Down
2 changes: 1 addition & 1 deletion boto/emr/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def __init__(self, name, mapper, reducer=None, combiner=None,
:type output: str
:param output: The output uri
:type jar: str
:param jar: The hadoop streaming jar. This can be either a local path on the master node, or an s3:// URI.
:param jar: The hadoop streaming jar. This can be either a local path on the main node, or an s3:// URI.
"""
self.name = name
self.mapper = mapper
Expand Down
2 changes: 1 addition & 1 deletion boto/pyami/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def load_boto(self):
if update.find(':') >= 0:
method, version = update.split(':')
else:
version = 'master'
version = 'main'
self.run('git checkout %s' % version, cwd=location)
else:
# first remove the symlink needed when running from subversion
Expand Down
34 changes: 17 additions & 17 deletions boto/rds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def create_dbinstance(self,
id,
allocated_storage,
instance_class,
master_username,
master_password,
main_username,
main_password,
port=3306,
engine='MySQL5.1',
db_name=None,
Expand All @@ -171,8 +171,8 @@ def create_dbinstance(self,
# security_groups should be db_security_groups according to API docs but has been left
# security_groups for backwards compatibility
#
# master_password should be master_user_password according to API docs but has been left
# master_password for backwards compatibility
# main_password should be main_user_password according to API docs but has been left
# main_password for backwards compatibility
#
# instance_class should be db_instance_class according to API docs but has been left
# instance_class for backwards compatibility
Expand Down Expand Up @@ -221,8 +221,8 @@ def create_dbinstance(self,
* sqlserver-ex
* sqlserver-web

:type master_username: str
:param master_username: Name of master user for the DBInstance.
:type main_username: str
:param main_username: Name of main user for the DBInstance.

* MySQL must be;
- 1--16 alphanumeric characters
Expand All @@ -239,8 +239,8 @@ def create_dbinstance(self,
- first character must be a letter
- cannot be a reserver SQL Server word

:type master_password: str
:param master_password: Password of master user for the DBInstance.
:type main_password: str
:param main_password: Password of main user for the DBInstance.

* MySQL must be 8--41 alphanumeric characters

Expand Down Expand Up @@ -368,8 +368,8 @@ def create_dbinstance(self,
# engine => Engine
# engine_version => EngineVersion
# license_model => LicenseModel
# master_username => MasterUsername
# master_user_password => MasterUserPassword
# main_username => MainUsername
# main_user_password => MainUserPassword
# multi_az => MultiAZ
# option_group_name => OptionGroupName
# port => Port
Expand All @@ -389,8 +389,8 @@ def create_dbinstance(self,
'Engine': engine,
'EngineVersion': engine_version,
'LicenseModel': license_model,
'MasterUsername': master_username,
'MasterUserPassword': master_password,
'MainUsername': main_username,
'MainUserPassword': main_password,
'MultiAZ': str(multi_az).lower() if multi_az else None,
'OptionGroupName': option_group_name,
'Port': port,
Expand Down Expand Up @@ -483,7 +483,7 @@ def create_dbinstance_read_replica(self, id, source_id,

def modify_dbinstance(self, id, param_group=None, security_groups=None,
preferred_maintenance_window=None,
master_password=None, allocated_storage=None,
main_password=None, allocated_storage=None,
instance_class=None,
backup_retention_period=None,
preferred_backup_window=None,
Expand All @@ -505,8 +505,8 @@ def modify_dbinstance(self, id, param_group=None, security_groups=None,
occur.
Default is Sun:05:00-Sun:09:00

:type master_password: str
:param master_password: Password of master user for the DBInstance.
:type main_password: str
:param main_password: Password of main user for the DBInstance.
Must be 4-15 alphanumeric characters.

:type allocated_storage: int
Expand Down Expand Up @@ -564,8 +564,8 @@ def modify_dbinstance(self, id, param_group=None, security_groups=None,
self.build_list_params(params, l, 'DBSecurityGroups.member')
if preferred_maintenance_window:
params['PreferredMaintenanceWindow'] = preferred_maintenance_window
if master_password:
params['MasterUserPassword'] = master_password
if main_password:
params['MainUserPassword'] = main_password
if allocated_storage:
params['AllocatedStorage'] = allocated_storage
if instance_class:
Expand Down
16 changes: 8 additions & 8 deletions boto/rds/dbinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DBInstance(object):
in status "available".
:ivar instance_class: Contains the name of the compute and memory
capacity class of the DB Instance.
:ivar master_username: The username that is set as master username
:ivar main_username: The username that is set as main username
at creation time.
:ivar parameter_group: Provides the list of DB Parameter Groups
applied to this DB Instance.
Expand Down Expand Up @@ -75,7 +75,7 @@ def __init__(self, connection=None, id=None):
self.allocated_storage = None
self.endpoint = None
self.instance_class = None
self.master_username = None
self.main_username = None
self.parameter_group = None
self.security_group = None
self.availability_zone = None
Expand Down Expand Up @@ -121,8 +121,8 @@ def endElement(self, name, value, connection):
self.allocated_storage = int(value)
elif name == 'DBInstanceClass':
self.instance_class = value
elif name == 'MasterUsername':
self.master_username = value
elif name == 'MainUsername':
self.main_username = value
elif name == 'Port':
if self._in_endpoint:
self._port = int(value)
Expand Down Expand Up @@ -212,7 +212,7 @@ def stop(self, skip_final_snapshot=False, final_snapshot_id=''):

def modify(self, param_group=None, security_groups=None,
preferred_maintenance_window=None,
master_password=None, allocated_storage=None,
main_password=None, allocated_storage=None,
instance_class=None,
backup_retention_period=None,
preferred_backup_window=None,
Expand All @@ -230,8 +230,8 @@ def modify(self, param_group=None, security_groups=None,
UTC) during which maintenance can occur. Default is
Sun:05:00-Sun:09:00

:type master_password: str
:param master_password: Password of master user for the DBInstance.
:type main_password: str
:param main_password: Password of main user for the DBInstance.
Must be 4-15 alphanumeric characters.

:type allocated_storage: int
Expand Down Expand Up @@ -278,7 +278,7 @@ def modify(self, param_group=None, security_groups=None,
param_group,
security_groups,
preferred_maintenance_window,
master_password,
main_password,
allocated_storage,
instance_class,
backup_retention_period,
Expand Down
10 changes: 5 additions & 5 deletions boto/rds/dbsnapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class DBSnapshot(object):
:ivar id: Specifies the identifier for the DB Snapshot (DBSnapshotIdentifier)
:ivar instance_create_time: Specifies the time (UTC) when the snapshot was taken
:ivar instance_id: Specifies the the DBInstanceIdentifier of the DB Instance this DB Snapshot was created from (DBInstanceIdentifier)
:ivar master_username: Provides the master username for the DB Instance
:ivar main_username: Provides the main username for the DB Instance
:ivar port: Specifies the port that the database engine was listening on at the time of the snapshot
:ivar snapshot_create_time: Provides the time (UTC) when the snapshot was taken
:ivar status: Specifies the status of this DB Snapshot. Possible values are [ available, backing-up, creating, deleted, deleting, failed, modifying, rebooting, resetting-master-credentials ]
:ivar status: Specifies the status of this DB Snapshot. Possible values are [ available, backing-up, creating, deleted, deleting, failed, modifying, rebooting, resetting-main-credentials ]
"""

def __init__(self, connection=None, id=None):
Expand All @@ -49,7 +49,7 @@ def __init__(self, connection=None, id=None):
self.port = None
self.status = None
self.availability_zone = None
self.master_username = None
self.main_username = None
self.allocated_storage = None
self.instance_id = None
self.availability_zone = None
Expand Down Expand Up @@ -77,8 +77,8 @@ def endElement(self, name, value, connection):
self.status = value
elif name == 'AvailabilityZone':
self.availability_zone = value
elif name == 'MasterUsername':
self.master_username = value
elif name == 'MainUsername':
self.main_username = value
elif name == 'AllocatedStorage':
self.allocated_storage = int(value)
elif name == 'SnapshotTime':
Expand Down
2 changes: 1 addition & 1 deletion dateutil/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# http://www.cl.cam.ac.uk/~mgk25/iso-time.html
# http://www.iso.ch/iso/en/prods-services/popstds/datesandtime.html
# http://www.w3.org/TR/NOTE-datetime
# http://ringmaster.arc.nasa.gov/tools/time_formats.html
# http://ringmain.arc.nasa.gov/tools/time_formats.html
# http://search.cpan.org/author/MUIR/Time-modules-2003.0211/lib/Time/ParseDate.pm
# http://stein.cshl.org/jade/distrib/docs/java.text.SimpleDateFormat.html

Expand Down