Search in sources :

Example 1 with MapReduceApplicationData

use of com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData in project dr-elephant by linkedin.

the class ReducerTimeHeuristicTest method analyzeJob.

private Severity analyzeJob(long runtimeMs, int numTasks) throws IOException {
    MapReduceCounterData dummyCounter = new MapReduceCounterData();
    MapReduceTaskData[] reducers = new MapReduceTaskData[numTasks + 1];
    int i = 0;
    for (; i < numTasks; i++) {
        reducers[i] = new MapReduceTaskData("task-id-" + i, "task-attempt-id-" + i);
        reducers[i].setTimeAndCounter(new long[] { runtimeMs, 0, 0, 0, 0 }, dummyCounter);
    }
    // Non-sampled task, which does not contain time and counter data
    reducers[i] = new MapReduceTaskData("task-id-" + i, "task-attempt-id-" + i);
    MapReduceApplicationData data = new MapReduceApplicationData().setCounters(dummyCounter).setReducerData(reducers);
    HeuristicResult result = _heuristic.apply(data);
    return result.getSeverity();
}
Also used : MapReduceApplicationData(com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData) MapReduceCounterData(com.linkedin.drelephant.mapreduce.data.MapReduceCounterData) MapReduceTaskData(com.linkedin.drelephant.mapreduce.data.MapReduceTaskData) HeuristicResult(com.linkedin.drelephant.analysis.HeuristicResult)

Example 2 with MapReduceApplicationData

use of com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData in project dr-elephant by linkedin.

the class DistributedCacheLimitHeuristicTest method testHeuristicResultCacheFileLimitViolated.

/**
 * File size limit exceeded for file in cache.
 */
@Test
public void testHeuristicResultCacheFileLimitViolated() {
    jobConf.setProperty("mapreduce.job.cache.files.filesizes", "100,200,600000000");
    jobConf.setProperty("mapreduce.job.cache.archives.filesizes", "400,500,600");
    MapReduceApplicationData data = new MapReduceApplicationData().setJobConf(jobConf);
    HeuristicResult result = _heuristic.apply(data);
    assertTrue("Failed to match on expected severity", result.getSeverity() == Severity.CRITICAL);
}
Also used : MapReduceApplicationData(com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData) HeuristicResult(com.linkedin.drelephant.analysis.HeuristicResult) Test(org.junit.Test)

Example 3 with MapReduceApplicationData

use of com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData in project dr-elephant by linkedin.

the class DistributedCacheLimitHeuristicTest method testHeuristicResultArchiveCacheFilesAndSizeLengthMismatch.

/**
 * File size not found for all the files in archive cache.
 */
@Test
public void testHeuristicResultArchiveCacheFilesAndSizeLengthMismatch() {
    jobConf.setProperty("mapreduce.job.cache.files.filesizes", "100,200,300");
    jobConf.setProperty("mapreduce.job.cache.archives.filesizes", "400,500");
    MapReduceApplicationData data = new MapReduceApplicationData().setJobConf(jobConf);
    HeuristicResult result = _heuristic.apply(data);
    assertTrue("Failed to match on expected severity", result.getSeverity() == Severity.MODERATE);
}
Also used : MapReduceApplicationData(com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData) HeuristicResult(com.linkedin.drelephant.analysis.HeuristicResult) Test(org.junit.Test)

Example 4 with MapReduceApplicationData

use of com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData in project dr-elephant by linkedin.

the class DistributedCacheLimitHeuristicTest method testHeuristicResultArchiveCacheFileLimitViolated.

/**
 * File size limit exceeded for file in archive cache.
 */
@Test
public void testHeuristicResultArchiveCacheFileLimitViolated() {
    jobConf.setProperty("mapreduce.job.cache.files.filesizes", "100,200,300");
    jobConf.setProperty("mapreduce.job.cache.archives.filesizes", "400,500,600000000");
    MapReduceApplicationData data = new MapReduceApplicationData().setJobConf(jobConf);
    HeuristicResult result = _heuristic.apply(data);
    assertTrue("Failed to match on expected severity", result.getSeverity() == Severity.CRITICAL);
}
Also used : MapReduceApplicationData(com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData) HeuristicResult(com.linkedin.drelephant.analysis.HeuristicResult) Test(org.junit.Test)

Example 5 with MapReduceApplicationData

use of com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData in project dr-elephant by linkedin.

the class DistributedCacheLimitHeuristicTest method testHeuristicResultWithEmptyArchiveCacheFiles.

/**
 * Archive cache not used by the application.
 */
@Test
public void testHeuristicResultWithEmptyArchiveCacheFiles() {
    jobConf.remove("mapreduce.job.cache.archives");
    jobConf.setProperty("mapreduce.job.cache.files.filesizes", "100,200,300");
    MapReduceApplicationData data = new MapReduceApplicationData().setJobConf(jobConf);
    HeuristicResult result = _heuristic.apply(data);
    assertTrue("Failed to match on expected severity", result.getSeverity() == Severity.NONE);
}
Also used : MapReduceApplicationData(com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData) HeuristicResult(com.linkedin.drelephant.analysis.HeuristicResult) Test(org.junit.Test)

Aggregations

MapReduceApplicationData (com.linkedin.drelephant.mapreduce.data.MapReduceApplicationData)28 HeuristicResult (com.linkedin.drelephant.analysis.HeuristicResult)22 MapReduceTaskData (com.linkedin.drelephant.mapreduce.data.MapReduceTaskData)17 MapReduceCounterData (com.linkedin.drelephant.mapreduce.data.MapReduceCounterData)15 Test (org.junit.Test)10 Properties (java.util.Properties)8 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)2 AppResult (models.AppResult)2 HadoopApplicationData (com.linkedin.drelephant.analysis.HadoopApplicationData)1 MapperSkewHeuristic (com.linkedin.drelephant.mapreduce.heuristics.MapperSkewHeuristic)1 Scheduler (com.linkedin.drelephant.schedulers.Scheduler)1 SparkApplicationData (com.linkedin.drelephant.spark.data.SparkApplicationData)1 TezApplicationData (com.linkedin.drelephant.tez.data.TezApplicationData)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 List (java.util.List)1 Map (java.util.Map)1 Expectations (mockit.Expectations)1 Configuration (org.apache.hadoop.conf.Configuration)1