<commit_before>package to.etc.webapp.pendingoperations;

import to.etc.util.*;


public class PendingJobExecutor implements Runnable {

	private final PendingOperation m_pendingOperation;

	private final ILogSink m_logSink;


	public PendingJobExecutor(final PendingOperation pendingOperation, final ILogSink sink) {
		m_pendingOperation = pendingOperation;
		m_logSink = sink;
	}

	public ILogSink getLogSink() {
		return m_logSink;
	}

	static public void register() {
		PendingOperationTaskProvider.getInstance().registerPendingOperationType("PJEX", new IPendingOperationExecutor() {
			@Override
			public void executePendingOperation(final PendingOperation po, final ILogSink ls) throws Exception {
				new PendingJobExecutor(po, ls).run();
			}
		});
	}

	/**
	 * Registers a delayed pending job. It will be executed as soon as possible.
	 *
	 */

	static public void registerOperation(final String userid, final String submitter, final String desc, final IPendingJob operation) throws Exception {
		PendingOperation po = new PendingOperation();
		po.setCreationTime(new java.util.Date());
		po.setUserID(userid);
		po.setDescription(desc);
		po.setSubmitsource(submitter);

		po.setType("PJEX");
		PendingOperationTaskProvider.getInstance().saveOperation(po, operation);
	}



	public String getRequestID() {
		return "pjex" + m_pendingOperation.getId();
	}

	public PendingOperation getPendingOperation() {
		return m_pendingOperation;
	}

	@Override
	public void run() {
		try {
			IPendingJob j = (IPendingJob) m_pendingOperation.getSerializedObject();
			Progress p = new Progress("Job");
			j.execute(m_logSink, m_pendingOperation, p);

		} catch(Exception x) {
			m_logSink.exception(x, "in executing pending scenario claculation job");
			m_pendingOperation.setError(PendingOperationState.FATL, "Error: " + x);
		}

	}
}<commit_msg>Remove unused PendingOperation stuff<commit_after>package to.etc.webapp.pendingoperations;

import to.etc.util.*;


public class PendingJobExecutor implements Runnable {

	private final PendingOperation m_pendingOperation;

	private final ILogSink m_logSink;


	public PendingJobExecutor(final PendingOperation pendingOperation, final ILogSink sink) {
		m_pendingOperation = pendingOperation;
		m_logSink = sink;
	}

	public ILogSink getLogSink() {
		return m_logSink;
	}

	static public void register() {
		PendingOperationTaskProvider.getInstance().registerPendingOperationType("PJEX", new IPendingOperationExecutor() {
			@Override
			public void executePendingOperation(final PendingOperation po, final ILogSink ls) throws Exception {
				new PendingJobExecutor(po, ls).run();
			}
		});
	}

	/**
	 * Registers a delayed pending job. It will be executed as soon as possible.
	 *
	 */

	static public void registerOperation(final String userid, final String submitter, final String desc, final IPendingJob operation) throws Exception {
		PendingOperation po = new PendingOperation();
		po.setCreationTime(new java.util.Date());
		po.setUserID(userid);
		po.setDescription(desc);
		po.setSubmitsource(submitter);

		po.setType("PJEX");
		PendingOperationTaskProvider.getInstance().saveOperation(po, operation);
	}

	public PendingOperation getPendingOperation() {
		return m_pendingOperation;
	}

	@Override
	public void run() {
		try {
			IPendingJob j = (IPendingJob) m_pendingOperation.getSerializedObject();
			Progress p = new Progress("Job");
			j.execute(m_logSink, m_pendingOperation, p);

		} catch(Exception x) {
			m_logSink.exception(x, "in executing pending scenario claculation job");
			m_pendingOperation.setError(PendingOperationState.FATL, "Error: " + x);
		}

	}
}
{'fraction_non_alphanumeric': 0.09501514734232994, 'fraction_numerical': 0.0, 'mean_word_length': 5.124789207419899, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6544123', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1081, 'n_words': 267}