<commit_before>package org.kuali.kfs.module.cab.batch;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Date;

import javax.sql.DataSource;

import org.kuali.kfs.sys.batch.AbstractStep;
import org.kuali.kfs.sys.context.SpringContext;

//FIXME--to be removed later when CAB testing is over
/**
 * This class is created for temporarily incrementing the sequence so that old data can be res-stored
 */
public class SequenceIncrementerStep extends AbstractStep {
    protected Connection getConnection() throws SQLException {
        DataSource dataSource = SpringContext.getBean(DataSource.class);
        Connection connection = dataSource.getConnection();
        return connection;
    }

    public void incrementAll() {
        try {
            Connection connection = getConnection();
            Statement stmt = connection.createStatement();
            ResultSet rs = stmt.executeQuery("select sequence_name from user_sequences order by 1");
            while (rs != null && rs.next()) {
                String seqName = rs.getString(1);
                // Alter the increment
                String alterSql = "ALTER SEQUENCE " + seqName + " INCREMENT BY 6000";
                executeStatement(connection, alterSql);

                // Increment the sequence, resulting a 2001 increment<commit_msg>Implemented marker interface TestingStep<commit_after>package org.kuali.kfs.module.cab.batch;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Date;

import javax.sql.DataSource;

import org.kuali.kfs.sys.batch.AbstractStep;
import org.kuali.kfs.sys.batch.TestingStep;
import org.kuali.kfs.sys.context.SpringContext;

//FIXME--to be removed later when CAB testing is over
/**
 * This class is created for temporarily incrementing the sequence so that old data can be res-stored
 */
public class SequenceIncrementerStep extends AbstractStep implements TestingStep {
    protected Connection getConnection() throws SQLException {
        DataSource dataSource = SpringContext.getBean(DataSource.class);
        Connection connection = dataSource.getConnection();
        return connection;
    }

    public void incrementAll() {
        try {
            Connection connection = getConnection();
            Statement stmt = connection.createStatement();
            ResultSet rs = stmt.executeQuery("select sequence_name from user_sequences order by 1");
            while (rs != null && rs.next()) {
                String seqName = rs.getString(1);
                // Alter the increment
                String alterSql = "ALTER SEQUENCE " + seqName + " INCREMENT BY 6000";
                executeStatement(connection, alterSql);

                // Increment the sequence, resulting a 2001 increment
{'fraction_non_alphanumeric': 0.0849762066621346, 'fraction_numerical': 0.006798096532970768, 'mean_word_length': 3.0259917920656636, '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': '2654187', 'n_tokens_mistral': 783, 'n_tokens_neox': 740, 'n_words': 224}