@Test public void testCheck() { JobEntrySparkSubmit je = new JobEntrySparkSubmit( "SparkSubmit" ); je.setJobType( JOB_TYPE_JAVA_SCALA ); List<CheckResultInterface> remarks = new ArrayList<>(); je.setMaster( "" ); je.check( remarks, null, null, null, null ); Assert.assertEquals( "Number of remarks should be 4", 4, remarks.size() ); int errors = 0; for ( CheckResultInterface remark : remarks ) { if ( remark.getType() == CheckResultInterface.TYPE_RESULT_ERROR ) { errors++; } } Assert.assertEquals( "Number of errors should be 4", 4, errors ); remarks.clear(); je.setJobType( JobEntrySparkSubmit.JOB_TYPE_PYTHON ); je.check( remarks, null, null, null, null ); Assert.assertEquals( "Number of remarks should be 4", 4, remarks.size() ); errors = 0; for ( CheckResultInterface remark : remarks ) { if ( remark.getType() == CheckResultInterface.TYPE_RESULT_ERROR ) { errors++; } } Assert.assertEquals( "Number of errors should be 4", 4, errors ); }
@Override public void check( List<CheckResultInterface> remarks, JobMeta jobMeta, VariableSpace space, Repository repository, IMetaStore metaStore ) { andValidator().validate( this, "scriptPath", remarks, putValidators( notBlankValidator() ) ); andValidator().validate( this, "scriptPath", remarks, putValidators( fileExistsValidator() ) ); andValidator().validate( this, "master", remarks, putValidators( notBlankValidator() ) ); if ( JOB_TYPE_JAVA_SCALA.equals( getJobType() ) ) { andValidator().validate( this, "jar", remarks, putValidators( notBlankValidator() ) ); } else { andValidator().validate( this, "pyFile", remarks, putValidators( notBlankValidator() ) ); } }
JobEntrySparkSubmit extends JobEntryBase implements Cloneable, JobEntryInterface, JobEntryListener { @Override public void check( List<CheckResultInterface> remarks, JobMeta jobMeta, VariableSpace space, Repository repository, IMetaStore metaStore ) { andValidator().validate( this, "scriptPath", remarks, putValidators( notBlankValidator() ) ); andValidator().validate( this, "scriptPath", remarks, putValidators( fileExistsValidator() ) ); andValidator().validate( this, "master", remarks, putValidators( notBlankValidator() ) ); if ( JOB_TYPE_JAVA_SCALA.equals( getJobType() ) ) { andValidator().validate( this, "jar", remarks, putValidators( notBlankValidator() ) ); } else { andValidator().validate( this, "pyFile", remarks, putValidators( notBlankValidator() ) ); } } }
JobEntrySparkSubmit extends JobEntryBase implements Cloneable, JobEntryInterface, JobEntryListener { @Override public void check( List<CheckResultInterface> remarks, JobMeta jobMeta, VariableSpace space, Repository repository, IMetaStore metaStore ) { andValidator().validate( this, "scriptPath", remarks, putValidators( notBlankValidator() ) ); andValidator().validate( this, "scriptPath", remarks, putValidators( fileExistsValidator() ) ); andValidator().validate( this, "master", remarks, putValidators( notBlankValidator() ) ); if ( JOB_TYPE_JAVA_SCALA.equals( getJobType() ) ) { andValidator().validate( this, "jar", remarks, putValidators( notBlankValidator() ) ); } else { andValidator().validate( this, "pyFile", remarks, putValidators( notBlankValidator() ) ); } } JobEntrySparkSubmit( String n );  JobEntrySparkSubmit(); }
JobEntrySparkSubmit extends JobEntryBase implements Cloneable, JobEntryInterface, JobEntryListener { @Override public void check( List<CheckResultInterface> remarks, JobMeta jobMeta, VariableSpace space, Repository repository, IMetaStore metaStore ) { andValidator().validate( this, "scriptPath", remarks, putValidators( notBlankValidator() ) ); andValidator().validate( this, "scriptPath", remarks, putValidators( fileExistsValidator() ) ); andValidator().validate( this, "master", remarks, putValidators( notBlankValidator() ) ); if ( JOB_TYPE_JAVA_SCALA.equals( getJobType() ) ) { andValidator().validate( this, "jar", remarks, putValidators( notBlankValidator() ) ); } else { andValidator().validate( this, "pyFile", remarks, putValidators( notBlankValidator() ) ); } } JobEntrySparkSubmit( String n );  JobEntrySparkSubmit(); Object clone(); String getXML(); void loadXML( Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep,
                       IMetaStore metaStore ); void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
                       List<SlaveServer> slaveServers ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ); String getScriptPath(); void setScriptPath( String scriptPath ); String getMaster(); void setMaster( String master ); List<String> getConfigParams(); void setConfigParams( List<String> configParams ); Map<String, String> getLibs(); void setLibs( Map<String, String> docs ); String getJar(); void setJar( String jar ); String getClassName(); void setClassName( String className ); String getArgs(); void setArgs( String args ); String getExecutorMemory(); void setExecutorMemory( String executorMemory ); String getDriverMemory(); void setDriverMemory( String driverMemory ); boolean isBlockExecution(); void setBlockExecution( boolean blockExecution ); String getJobType(); void setJobType( String jobType ); String getPyFile(); void setPyFile( String pyFile ); List<String> getCmds(); Result execute( Result result, int nr ); boolean evaluates(); @Override void check( List<CheckResultInterface> remarks, JobMeta jobMeta, VariableSpace space, Repository repository,
                     IMetaStore metaStore ); List<String> parseCommandLine( String commandLineString ); @Override void afterExecution( Job arg0, JobEntryCopy arg1, JobEntryInterface arg2, Result arg3 ); @Override void beforeExecution( Job arg0, JobEntryCopy arg1, JobEntryInterface arg2 ); }
JobEntrySparkSubmit extends JobEntryBase implements Cloneable, JobEntryInterface, JobEntryListener { @Override public void check( List<CheckResultInterface> remarks, JobMeta jobMeta, VariableSpace space, Repository repository, IMetaStore metaStore ) { andValidator().validate( this, "scriptPath", remarks, putValidators( notBlankValidator() ) ); andValidator().validate( this, "scriptPath", remarks, putValidators( fileExistsValidator() ) ); andValidator().validate( this, "master", remarks, putValidators( notBlankValidator() ) ); if ( JOB_TYPE_JAVA_SCALA.equals( getJobType() ) ) { andValidator().validate( this, "jar", remarks, putValidators( notBlankValidator() ) ); } else { andValidator().validate( this, "pyFile", remarks, putValidators( notBlankValidator() ) ); } } JobEntrySparkSubmit( String n );  JobEntrySparkSubmit(); Object clone(); String getXML(); void loadXML( Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep,
                       IMetaStore metaStore ); void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
                       List<SlaveServer> slaveServers ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ); String getScriptPath(); void setScriptPath( String scriptPath ); String getMaster(); void setMaster( String master ); List<String> getConfigParams(); void setConfigParams( List<String> configParams ); Map<String, String> getLibs(); void setLibs( Map<String, String> docs ); String getJar(); void setJar( String jar ); String getClassName(); void setClassName( String className ); String getArgs(); void setArgs( String args ); String getExecutorMemory(); void setExecutorMemory( String executorMemory ); String getDriverMemory(); void setDriverMemory( String driverMemory ); boolean isBlockExecution(); void setBlockExecution( boolean blockExecution ); String getJobType(); void setJobType( String jobType ); String getPyFile(); void setPyFile( String pyFile ); List<String> getCmds(); Result execute( Result result, int nr ); boolean evaluates(); @Override void check( List<CheckResultInterface> remarks, JobMeta jobMeta, VariableSpace space, Repository repository,
                     IMetaStore metaStore ); List<String> parseCommandLine( String commandLineString ); @Override void afterExecution( Job arg0, JobEntryCopy arg1, JobEntryInterface arg2, Result arg3 ); @Override void beforeExecution( Job arg0, JobEntryCopy arg1, JobEntryInterface arg2 ); static final String JOB_TYPE_JAVA_SCALA; static final String JOB_TYPE_PYTHON; static final String HADOOP_CLUSTER_PREFIX; }