<commit_before>package components.job;

import cloud.colosseum.ColosseumComputeService;
import models.generic.Model;
import models.service.api.generic.ModelService;

/**
 * Created by daniel on 08.05.15.
 */
public abstract class GenericJob<T extends Model> implements Job {

    private final String resourceUuid;
    private final ModelService<T> modelService;
    private final ColosseumComputeService colosseumComputeService;
    private JobState jobState;

    public GenericJob(T t, ModelService<T> modelService,
        ColosseumComputeService colosseumComputeService) {
        this.colosseumComputeService = colosseumComputeService;
        this.resourceUuid = t.getUuid();
        this.modelService = modelService;
    }

    @Override public String getResourceUuid() {
        return resourceUuid;
    }

    @Override public JobState state() {
        return jobState;
    }

    @Override public void state(JobState jobState) {
        this.jobState = jobState;
    }

    @Override public int getPriority() {
        return Priority.HIGH;
    }

    @Override public void execute() throws JobException {
        T t = null;
        /**

         * todo: find a better way for waiting for the database
         */<commit_msg>PS-65 finalized execute method on generic job<commit_after>package components.job;

import cloud.colosseum.ColosseumComputeService;
import models.generic.Model;
import models.service.api.generic.ModelService;

/**
 * Created by daniel on 08.05.15.
 */
public abstract class GenericJob<T extends Model> implements Job {

    private final String resourceUuid;
    private final ModelService<T> modelService;
    private final ColosseumComputeService colosseumComputeService;
    private JobState jobState;

    public GenericJob(T t, ModelService<T> modelService,
        ColosseumComputeService colosseumComputeService) {
        this.colosseumComputeService = colosseumComputeService;
        this.resourceUuid = t.getUuid();
        this.modelService = modelService;
    }

    @Override public String getResourceUuid() {
        return resourceUuid;
    }

    @Override public JobState state() {
        return jobState;
    }

    @Override public void state(JobState jobState) {
        this.jobState = jobState;
    }

    @Override public int getPriority() {
        return Priority.HIGH;
    }

    @Override public final void execute() throws JobException {
        T t = null;
        /**

         * todo: find a better way for waiting for the database
         */
{'fraction_non_alphanumeric': 0.07517899761336516, 'fraction_numerical': 0.005568814638027049, 'mean_word_length': 3.0369181380417336, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4492827', 'n_tokens_mistral': 706, 'n_tokens_neox': 678, 'n_words': 193}