Skip to content

Commit

Permalink
Removal of param name from Tuning Parameter Constraint , modification…
Browse files Browse the repository at this point in the history
…s in 6.sql
  • Loading branch information
pralabhkumar committed Jul 31, 2018
1 parent 028321d commit ac7bf2e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
9 changes: 4 additions & 5 deletions app/com/linkedin/drelephant/tuning/IPSOManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ private void setDefaultParameterValues(TuningAlgorithm tuningAlgorithm, JobSugge
tuningParameterConstraint.lowerBound = tuningParameter.minValue;
tuningParameterConstraint.upperBound = tuningParameter.maxValue;
tuningParameterConstraint.constraintType = TuningParameterConstraint.ConstraintType.BOUNDARY;
tuningParameterConstraint.paramName = tuningParameter.paramName;
tuningParameterConstraint.save();
}
}
Expand Down Expand Up @@ -170,18 +169,18 @@ private Map<String, TuningParameterConstraint> filterMemoryConstraint(
Map<String, TuningParameterConstraint> memoryConstraints = new HashMap<String, TuningParameterConstraint>();
for (TuningParameterConstraint parameterConstraint : parameterConstraints) {
if (functionType.equals("map")) {
if (parameterConstraint.paramName.equals(ParameterKeys.MAPPER_MEMORY_HADOOP_CONF.getValue())) {
if (parameterConstraint.tuningParameter.paramName.equals(ParameterKeys.MAPPER_MEMORY_HADOOP_CONF.getValue())) {
memoryConstraints.put("CONTAINER_MEMORY", parameterConstraint);
}
if (parameterConstraint.paramName.equals(ParameterKeys.MAPPER_HEAP_HADOOP_CONF.getValue())) {
if (parameterConstraint.tuningParameter.paramName.equals(ParameterKeys.MAPPER_HEAP_HADOOP_CONF.getValue())) {
memoryConstraints.put("CONTAINER_HEAP", parameterConstraint);
}
}
if (functionType.equals("reduce")) {
if (parameterConstraint.paramName.equals(ParameterKeys.REDUCER_MEMORY_HADOOP_CONF.getValue())) {
if (parameterConstraint.tuningParameter.paramName.equals(ParameterKeys.REDUCER_MEMORY_HADOOP_CONF.getValue())) {
memoryConstraints.put("CONTAINER_MEMORY", parameterConstraint);
}
if (parameterConstraint.paramName.equals(ParameterKeys.REDUCER_HEAP_HADOOP_CONF.getValue())) {
if (parameterConstraint.tuningParameter.paramName.equals(ParameterKeys.REDUCER_HEAP_HADOOP_CONF.getValue())) {
memoryConstraints.put("CONTAINER_HEAP", parameterConstraint);
}
}
Expand Down
3 changes: 0 additions & 3 deletions app/models/TuningParameterConstraint.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public static class TABLE {
public static final String upperBound = "upperBound";
public static final String createdTs = "createdTs";
public static final String updatedTs = "updatedTs";
public static final String paramName = "paramName";
}

@Id
Expand Down Expand Up @@ -88,8 +87,6 @@ public static class TABLE {
@UpdatedTimestamp
public Timestamp updatedTs;

@Column(nullable = false)
public String paramName;

public static Finder<Integer, TuningParameterConstraint> find =
new Finder<Integer, TuningParameterConstraint>(Integer.class, TuningParameterConstraint.class);
Expand Down
9 changes: 3 additions & 6 deletions conf/evolutions/default/6.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ INSERT INTO tuning_parameter VALUES (11,'mapreduce.map.memory.mb',3,2048,1024,81
INSERT INTO tuning_parameter VALUES (12,'mapreduce.task.io.sort.factor',3,10,10,150,10 ,0, current_timestamp(0), current_timestamp(0));
INSERT INTO tuning_parameter VALUES (13,'mapreduce.map.sort.spill.percent',3,0.8,0.6,0.9,0.1, 0, current_timestamp(0), current_timestamp(0));
INSERT INTO tuning_parameter VALUES (14,'mapreduce.reduce.memory.mb',3,2048,1024,8192,1024, 0, current_timestamp(0), current_timestamp(0));
INSERT INTO tuning_parameter VALUES (15,'pig.maxCombinedSplitSize',3,536870912,536870912,536870912,128, 0, current_timestamp(0), current_timestamp(0));
INSERT INTO tuning_parameter VALUES (16,'mapreduce.reduce.java.opts',3,1536,500,6144,64, 0, current_timestamp(0), current_timestamp(0));
INSERT INTO tuning_parameter VALUES (17,'mapreduce.map.java.opts',3,1536,500,6144,64, 0, current_timestamp(0), current_timestamp(0));
INSERT INTO tuning_parameter VALUES (18,'mapreduce.input.fileinputformat.split.maxsize',3,536870912,536870912,536870912,128, 1, current_timestamp(0), current_timestamp(0));
INSERT INTO tuning_parameter VALUES (15,'mapreduce.reduce.java.opts',3,1536,500,6144,64, 0, current_timestamp(0), current_timestamp(0));
INSERT INTO tuning_parameter VALUES (16,'mapreduce.map.java.opts',3,1536,500,6144,64, 0, current_timestamp(0), current_timestamp(0));


CREATE TABLE IF NOT EXISTS tuning_parameter_constraint (
Expand All @@ -43,15 +41,14 @@ CREATE TABLE IF NOT EXISTS tuning_parameter_constraint (
constraint_type enum('BOUNDARY','INTERDEPENDENT') NOT NULL COMMENT 'Constraint ID',
lower_bound double COMMENT 'Lower bound of parameter',
upper_bound double COMMENT 'Upper bound of parameter',
param_name varchar(100) NOT NULL COMMENT 'name of the hadoop parameter e.g. mapreduce.task.io.sort.mb ',
created_ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
CONSTRAINT tuning_parameter_constraint_ibfk_1 FOREIGN KEY (job_definition_id) REFERENCES tuning_job_definition (job_definition_id),
CONSTRAINT tuning_parameter_constraint_ibfk_2 FOREIGN KEY (tuning_parameter_id) REFERENCES tuning_parameter (id)
) ENGINE=InnoDB;

create index index_tuning_parameter_constraint on tuning_parameter_constraint (tuning_parameter_id);
create index index_tuning_parameter_constraint on tuning_parameter_constraint (job_definition_id);

# --- !Downs
DELETE FROM tuning_parameter WHERE tuning_algorithm_id=3;
Expand Down
12 changes: 6 additions & 6 deletions test/com/linkedin/drelephant/tuning/IPSOManagerTestRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void testIPSOIntializePrerequisite(AutoTuningOptimizeManager optimizeMan
optimizeManager.intializePrerequisite(tuningAlgorithm, jobSuggestedParamSet);
List<TuningParameterConstraint> tuningParameterConstraint =
TuningParameterConstraint.find.where().eq("job_definition_id", 100003).findList();
assertTrue(" Parameters Constraint Size ", tuningParameterConstraint.size() == 9);
assertTrue(" Parameters Constraint Size ", tuningParameterConstraint.size() == 7);
}

private void testIPSOExtractParameterInformation(JobExecution jobExecution,
Expand Down Expand Up @@ -108,25 +108,25 @@ private void testIPSOParameterOptimizer(JobExecution jobExecution, AutoTuningOpt
}

private void testMapParameterBoundries(TuningParameterConstraint parameterConstraint) {
if (parameterConstraint.paramName.equals(
if (parameterConstraint.tuningParameter.paramName.equals(
CommonConstantsHeuristic.ParameterKeys.MAPPER_MEMORY_HADOOP_CONF.getValue())) {
assertTrue("Mapper Memory Lower Bound ", parameterConstraint.lowerBound == 2048.0);
assertTrue("Mapper Memory Upper Bound ", parameterConstraint.upperBound == 2048.0);
}
if (parameterConstraint.paramName.equals(
if (parameterConstraint.tuningParameter.paramName.equals(
CommonConstantsHeuristic.ParameterKeys.MAPPER_HEAP_HADOOP_CONF.getValue())) {
assertTrue("Mapper Heap Memory Lower Bound ", parameterConstraint.lowerBound == 427.0);
assertTrue("Mapper Heap Memory Upper Bound ", parameterConstraint.upperBound == 512.4);
}
}

private void testReduceParameterBoundries(TuningParameterConstraint parameterConstraint) {
if (parameterConstraint.paramName.equals(
if (parameterConstraint.tuningParameter.paramName.equals(
CommonConstantsHeuristic.ParameterKeys.REDUCER_MEMORY_HADOOP_CONF.getValue())) {
assertTrue("Mapper Memory Lower Bound ", parameterConstraint.lowerBound == 1024.0);
assertTrue("Mapper Memory Upper Bound ", parameterConstraint.upperBound == 2048.0);
}
if (parameterConstraint.paramName.equals(
if (parameterConstraint.tuningParameter.paramName.equals(
CommonConstantsHeuristic.ParameterKeys.REDUCER_HEAP_HADOOP_CONF.getValue())) {
assertTrue("Reducer Heap Memory Lower Bound ", parameterConstraint.lowerBound == 300.0);
assertTrue("Reducer Heap Memory Upper Bound ", parameterConstraint.upperBound == 360.0);
Expand Down Expand Up @@ -183,7 +183,7 @@ private void testIPSONumberOfConstraintsViolated(AutoTuningOptimizeManager optim
jobSuggestedParamValue.tuningParameter = TuningParameter.find.byId(11);
jobSuggestedParamValue.paramValue = 2048.0;
JobSuggestedParamValue jobSuggestedParamValue1 = new JobSuggestedParamValue();
jobSuggestedParamValue1.tuningParameter = TuningParameter.find.byId(17);
jobSuggestedParamValue1.tuningParameter = TuningParameter.find.byId(16);
jobSuggestedParamValue1.paramValue = 2048.0;
List<JobSuggestedParamValue> jobSuggestedParamValueList = new ArrayList<JobSuggestedParamValue>();
jobSuggestedParamValueList.add(jobSuggestedParamValue);
Expand Down
6 changes: 2 additions & 4 deletions test/resources/test-init-ipso.sql
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ INSERT INTO job_suggested_param_value(id, job_suggested_param_set_id, tuning_par
(3211,1541,12,10,'2018-02-14 05:30:42','2018-02-14 05:30:42'),
(3212,1541,13,0.761466551875019,'2018-02-14 05:30:42','2018-02-14 05:30:42'),
(3213,1541,14,2844.365182469904,'2018-02-14 05:30:42','2018-02-14 05:30:42'),
(3214,1541,15,536870912,'2018-02-14 05:30:42','2018-02-14 05:30:42'),
(3215,1541,16,2133.273886852428,'2018-02-14 05:30:42','2018-02-14 05:30:42'),
(3216,1541,17,1152,'2018-02-14 05:30:42','2018-02-14 05:30:42'),
(3217,1541,18,536870912,'2018-02-14 05:30:42','2018-02-14 05:30:42');
(3215,1541,15,2133.273886852428,'2018-02-14 05:30:42','2018-02-14 05:30:42'),
(3216,1541,16,1152,'2018-02-14 05:30:42','2018-02-14 05:30:42');

0 comments on commit ac7bf2e

Please sign in to comment.