public static ClasspathConstructor buildClasspath(String sliderConfDir,
String libdir,
Configuration config,
boolean usingMiniMRCluster) {
ClasspathConstructor classpath = new ClasspathConstructor();
// add the runtime classpath needed for tests to work
if (usingMiniMRCluster) {
// for mini cluster we pass down the java CP properties
// and nothing else
classpath.appendAll(classpath.javaVMClasspath());
} else {
classpath.addLibDir("./" + libdir);
if (sliderConfDir != null) {
classpath.addClassDirectory(sliderConfDir);
}
classpath.addRemoteClasspathEnvVar();
classpath.appendAll(classpath.yarnApplicationClasspath(config));
}
return classpath;
}