@Override public Object doCall() throws Exception { while ( condition.get() ) { int i = random.nextInt( INITIAL_JOB_MAP_SIZE ); CarteObjectEntry entry = jobMap.getJobObjects().get( i ); if ( entry == null ) { throw new IllegalStateException( String.format( "Returned CarteObjectEntry must not be null. EntryId = %d", i ) ); } final String jobName = JOB_NAME_STRING + i; Job job = jobMap.getJob( entry.getName() ); if ( job == null ) { throw new IllegalStateException( String.format( "Returned job must not be null. Job name = %s", jobName ) ); } JobConfiguration jobConfiguration = jobMap.getConfiguration( entry.getName() ); if ( jobConfiguration == null ) { throw new IllegalStateException( String.format( "Returned jobConfiguration must not be null. Job name = %s", jobName ) ); } } return null; } }
@Override public Object doCall() throws Exception { int i = random.nextInt( INITIAL_JOB_MAP_SIZE ); final String jobName = JOB_NAME_STRING + i; final String jobId = JOB_ID_STRING + i; CarteObjectEntry entry = new CarteObjectEntry( jobName, jobId ); jobMap.replaceJob( entry, mockJob( i + 1 ), mock( JobConfiguration.class ) ); return null; } }
entry = getJobMap().getFirstCarteObjectEntry( jobName ); if ( entry == null ) { job = null; } else { id = entry.getId(); job = getJobMap().getJob( entry ); job = getJobMap().getJob( entry ); JobConfiguration jobConfiguration = getJobMap().getConfiguration( jobName ); getJobMap().replaceJob( entry, newJob, jobConfiguration ); job = newJob;
entry = getJobMap().getFirstCarteObjectEntry( jobName ); if ( entry == null ) { job = null; } else { id = entry.getId(); job = getJobMap().getJob( entry ); job = getJobMap().findJob( id ); } else { entry = new CarteObjectEntry( jobName, id ); job = getJobMap().getJob( entry ); if ( job != null ) { jobName = job.getJobname();
for ( CarteObjectEntry entry : jobMap.getJobObjects() ) { Job job = jobMap.getJob( entry ); String id = jobMap.getJob( entry ).getLogChannelId(); LoggingRegistry.getInstance().removeLogChannelFileWriterBuffer( id ); jobMap.removeJob( entry );
/** * Find the first job in the list that comes to mind! * * @param jobName * @return the first transformation with the specified name */ public synchronized Job getJob( String jobName ) { for ( CarteObjectEntry entry : jobMap.keySet() ) { if ( entry.getName().equals( jobName ) ) { return getJob( entry ); } } return null; }
@Override public Exception call() throws Exception { Exception exception = null; try { for ( int i = 0; i < cycles; i++ ) { int id = generator.get(); jobMap.addJob( JOB_NAME_STRING + id, JOB_ID_STRING + id, mockJob( id ), mock( JobConfiguration.class ) ); } } catch ( Exception e ) { exception = e; } return exception; } }
entry = getJobMap().getFirstCarteObjectEntry( jobName ); if ( entry == null ) { job = null; } else { id = entry.getId(); job = getJobMap().getJob( entry ); job = getJobMap().getJob( entry ); getJobMap().removeJob( entry );
List<CarteObjectEntry> jobEntries = getJobMap().getJobObjects(); Job job = getJobMap().getJob( entry ); String status = job.getStatus(); SlaveServerJobStatus jobStatus = new SlaveServerJobStatus( entry.getName(), entry.getId(), status ); String name = jobEntries.get( i ).getName(); String id = jobEntries.get( i ).getId(); Job job = getJobMap().getJob( jobEntries.get( i ) ); String status = job.getStatus(); String trClass = evenRow ? "cellTableEvenRow" : "cellTableOddRow"; // alternating row color
JobConfiguration jobConfiguration = CarteSingleton.getInstance().getJobMap().getConfiguration( entry ); CarteSingleton.getInstance().getJobMap().replaceJob( entry, newJob, jobConfiguration ); job = newJob;
entry = getJobMap().getFirstCarteObjectEntry( jobName ); if ( entry == null ) { job = null; } else { id = entry.getId(); job = getJobMap().getJob( entry ); job = getJobMap().getJob( entry );
@GET @Path( "/jobs" ) @Produces( { MediaType.APPLICATION_JSON } ) public List<CarteObjectEntry> getJobs() { List<CarteObjectEntry> jobEntries = CarteSingleton.getInstance().getJobMap().getJobObjects(); return jobEntries; }
transformationMap = new TransformationMap(); transformationMap.setSlaveServerConfig( config ); jobMap = new JobMap(); jobMap.setSlaveServerConfig( config ); detections = new ArrayList<SlaveServerDetection>(); socketRepository = new SocketRepository( log );
job.getJobMeta().setMetaStore( jobMap.getSlaveServerConfig().getMetaStore() ); job.getJobMeta().setInternalKettleVariables( job ); job.injectVariables( jobConfiguration.getJobExecutionConfiguration().getVariables() ); getJobMap().addJob( job.getJobname(), carteObjectId, job, jobConfiguration );
public synchronized JobConfiguration getConfiguration( String jobName ) { for ( CarteObjectEntry entry : configurationMap.keySet() ) { if ( entry.getName().equals( jobName ) ) { return getConfiguration( entry ); } } return null; }
when( mockHttpServletRequest.getParameter( "xml" ) ).thenReturn( useXml ); when( mockHttpServletResponse.getOutputStream() ).thenReturn( outMock ); when( mockJobMap.findJob( id ) ).thenReturn( mockJob ); PowerMockito.when( mockJob.getJobname() ).thenReturn( ServletTestUtils.BAD_STRING_TO_TEST ); PowerMockito.when( mockJob.getLogChannel() ).thenReturn( mockLogChannelInterface );
@Override public synchronized void jobDelegationStarted( Job delegatedJob, JobExecutionConfiguration jobExecutionConfiguration ) { JobConfiguration jc = new JobConfiguration( delegatedJob.getJobMeta(), jobExecutionConfiguration ); jobMap.registerJob( delegatedJob, jc ); delegatedJob.addDelegationListener( this ); }
@Override public int compare( CarteObjectEntry o1, CarteObjectEntry o2 ) { Job t1 = getJobMap().getJob( o1 ); Job t2 = getJobMap().getJob( o2 ); Date d1 = t1.getLogDate(); Date d2 = t2.getLogDate(); // if both jobs have last log date, desc sort by log date if ( d1 != null && d2 != null ) { int logDateCompare = d2.compareTo( d1 ); if ( logDateCompare != 0 ) { return logDateCompare; } } return o1.compareTo( o2 ); } };
job.setSocketRepository( getSocketRepository() ); getJobMap().addJob( jobMeta.getName(), carteObjectId, job, jobConfiguration ); job.setContainerObjectId( carteObjectId );