<commit_before>/*
 * Copyright (c) 2014, Arjuna Technologies Limited, Newcastle-upon-Tyne, England. All rights reserved.
 */

package com.arjuna.dbsupport.jeebatch;

import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;

import com.arjuna.databroker.data.DataConsumer;
import com.arjuna.databroker.data.DataFlow;
import com.arjuna.databroker.data.DataProvider;
import com.arjuna.databroker.data.DataProcessor;

public class BatchDataProcessor implements DataProcessor
{
    private static final Logger logger = Logger.getLogger(BatchDataProcessor.class.getName());

    public static final String JOBID_PROPERTYNAME = "Job ID";

    public BatchDataProcessor(String name, Map<String, String> properties)
    {
        logger.log(Level.FINE, "BatchDataProcessor: " + name + ", " + properties);

        _name              = name;
        _properties        = properties;
        _batchDataConsumer = new BatchDataConsumer(this);
        _batchDataProvider = new BatchDataProvider(this);

        BatchDataConsumerMap.getBatchDataConsumerMap().add(_batchDataConsumer);
        BatchDataProviderMap.getBatchDataProviderMap().add(_batchDataProvider);

        JobOperator jobOperator = BatchRuntime.getJobOperator();

        Properties jobParameters = new Properties();
        jobParameters.setProperty(BatchDataConsumerMap.ID_PROPERTYNAME, _batchDataConsumer.getId());
        jobParameters.setProperty(BatchDataProviderMap.ID_PROPERTYNAME, _batchDataProvider.getId());

        long execId = jobOperator.start(_properties.get(JOBID_PROPERTYNAME), jobParameters);

        logger.log(Level.FINE, "BatchDataProcessor: " + execId);
    }

    @Override
    public DataFlow getDataFlow()
    {
        return _dataFlow;<commit_msg>Added default constructor<commit_after>/*
 * Copyright (c) 2014, Arjuna Technologies Limited, Newcastle-upon-Tyne, England. All rights reserved.
 */

package com.arjuna.dbsupport.jeebatch;

import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;

import com.arjuna.databroker.data.DataConsumer;
import com.arjuna.databroker.data.DataFlow;
import com.arjuna.databroker.data.DataProvider;
import com.arjuna.databroker.data.DataProcessor;

public class BatchDataProcessor implements DataProcessor
{
    private static final Logger logger = Logger.getLogger(BatchDataProcessor.class.getName());

    public static final String JOBID_PROPERTYNAME = "Job ID";

    public BatchDataProcessor()
    {
        logger.log(Level.FINE, "BatchDataProcessor");
    }

    public BatchDataProcessor(String name, Map<String, String> properties)
    {
        logger.log(Level.FINE, "BatchDataProcessor: " + name + ", " + properties);

        _name              = name;
        _properties        = properties;
        _batchDataConsumer = new BatchDataConsumer(this);
        _batchDataProvider = new BatchDataProvider(this);

        BatchDataConsumerMap.getBatchDataConsumerMap().add(_batchDataConsumer);
        BatchDataProviderMap.getBatchDataProviderMap().add(_batchDataProvider);

        JobOperator jobOperator = BatchRuntime.getJobOperator();

        Properties jobParameters = new Properties();
        jobParameters.setProperty(BatchDataConsumerMap.ID_PROPERTYNAME, _batchDataConsumer.getId());
        jobParameters.setProperty(BatchDataProviderMap.ID_PROPERTYNAME, _batchDataProvider.getId());

        long execId = jobOperator.start(_properties.get(JOBID_PROPERTYNAME), jobParameters);

        logger.log(Level.FINE, "BatchDataProcessor: " + execId);
    }

    @Override
    public DataFlow getDataFlow()
    {
        return _dataFlow;
{'fraction_non_alphanumeric': 0.09575251657255095, 'fraction_numerical': 0.001964154186103609, 'mean_word_length': 4.183206106870229, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1467974', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1133, 'n_words': 217}