<commit_before>package ##package_prefix##;

import java.io.IOException;

// VoltTable is VoltDB's table representation.
import org.voltdb.VoltTable;
import org.voltdb.VoltTableRow;
import org.voltdb.client.ClientConfig;

// Procedures are invoked by class name. Import them to
// allow access to the class name programmatically.
import ##package_prefix##.procedures.*;

public class Client {

    /** Example SELECT: select rows matching the specified id parameter.
     *
     * Call <code>##package_prefix##.procedures.Select</code> passing
     * the <code>id</code> as the only parameter. An array of tables
     * one table long will be returned.
     *
     * Use <code>VoltTable.getRowCount()</code> and
     * <code>VoltTable.fetchRow(int row)</code> to read the resulting
     * rows. Use <code>VoltTableRow.getLong(int column)</code> to read
     * a specific column.
     *
     * @param long id: the id parameter value.
     * @throws java.io.IOException on client communication error.
     * @throws org.voltdb.client.Client.ProcCallException on VoltDB server error.
     */
    private void doSelect(int id) {
        System.out.println("Select(" + id + ")");
        try {
            VoltTable[] result = client.callProcedure(Select.class.getSimpleName(), id).getResults();
            assert result.length == 1;
            final int rowCount = result[0].getRowCount();
            if (rowCount == 0) {
                System.out.println("Selected: 0 rows selected.");
            }
            for (int ii = 0; ii < rowCount; ii++) {
                final VoltTableRow row = result[0].fetchRow(0);
                final long ##project_name##_ID = row.getLong(0);
                final long ##project_name##_ITEM = row.getLong(1);
                System.out.println("Selected: ##project_name##_ID == " + ##project_name##_ID + " ##project_name##_ITEM == " + ##project_name##_ITEM);
            }

        }
        catch (java.io.IOException e) {
            e.printStackTrace();
        }
        catch (org.voltdb.client.ProcCallException e) {
            System.out.println("Select(" + id + ") failed: " + e.getMessage());
        }
    }

    /** Example INSERT: insert an id, item pair as specified by the id
     * and item parameters.
     *
     * Call <code>##package_prefix##.procedures.Insert</code> passing
     * the id and item parameters.  Inserts return one table
     * containing exactly one row with exactly one integer column. The
     * sole value is the count of inserted rows.
     *
     * Use <code>VoltTable.getRowCount()</code> and
     * <code>VoltTable.fetchRow(int row)</code> to read the resulting
     * rows. Use <code>VoltTableRow.getLong(int column)</code> to read
     * a specific column.
     *
     * @param id: the id parameter value.
     * @param item: the item parameter value.
     * @throws java.io.IOException on client communication error.
     * @throws org.voltdb.client.Client.ProcCallException on VoltDB server error.
     */
    private void doInsert(int id, long item) {
        System.out.println("Insert(" + id + "," + item + ")");
        try {
            VoltTable[] result = client.callProcedure(Insert.class.getSimpleName(), id, item).getResults();
            assert (result != null);
            long insertedRows = result[0].fetchRow(0).getLong(0);
            System.out.println("INSERT(" + id + "," + item + ") successfully inserted " + insertedRows + " row(s)");
        }
        catch (java.io.IOException e) {
            e.printStackTrace();
        }
        catch (org.voltdb.client.ProcCallException e) {
            System.out.println("Insert(" + id + "," + item + ") failed: " + e.getMessage());
        }
    }

    /** Example error: attempt an invalid INSERT.
     *
     * Call <code>##package_prefix##.procedures.Insert</code> with an
     * invalid number of parameters.  This procedure invocation will
     * <code>throw org.voltdb.client.Client.ProcCallException</code>.
     *
     * @param id: the id parameter value.
     * @throws java.io.IOException on client communication error.
     * @throws org.voltdb.client.Client.ProcCallException on VoltDB server error, expected in this example.
     */
    private void tryInvalidInsert(int id) {
        System.out.println("Insert(" + id + ")");
        try {
            VoltTable[] result = client.callProcedure(Insert.class.getSimpleName(), id).getResults();
            assert (result != null);
            System.out.println("INVALID INSERT(" + id + ") successful");
        }
        catch (java.io.IOException e) {
            e.printStackTrace();
        }
        catch (org.voltdb.client.ProcCallException e) {
            System.out.println("Invalid Insert(" + id + ") failed: " + e.getMessage());
        }
    }

    /** Example DELETE: delete the row corresponding to the specified id.
     *
     *  Call <code>##package_prefix##.procedures.Delete</code> passing
     *  the id parameter. Deletes return one table containing exactly
     *  one row with exactly one integer column. The sole value is the
     *  count of deleted rows.
     *
     * @param id: the id parameter value.
     * @throws java.io.IOException on client communication error.
     * @throws org.voltdb.client.Client.ProcCallException on VoltDB server error, expected in this example.
     */
    private void doDelete(int id) {
        System.out.println("Delete (" + id + ")");
        try {
            VoltTable[] result = client.callProcedure(Delete.class.getSimpleName(), id).getResults();
            assert (result != null);
            long deletedRows = result[0].fetchRow(0).getLong(0);
            System.out.println("DELETE(" + id + ") successfully deleted " + deletedRows + " row(s)");

        }
        catch (java.io.IOException e) {
            e.printStackTrace();
        }
        catch (org.voltdb.client.ProcCallException e) {
            System.out.println("Delete(" + id + ") failed: " + e.getMessage());
        }
<commit_msg>ENG-903: Clearer error text for example error.<commit_after>package ##package_prefix##;

import java.io.IOException;

// VoltTable is VoltDB's table representation.
import org.voltdb.VoltTable;
import org.voltdb.VoltTableRow;
import org.voltdb.client.ClientConfig;

// Procedures are invoked by class name. Import them to
// allow access to the class name programmatically.
import ##package_prefix##.procedures.*;

public class Client {

    /** Example SELECT: select rows matching the specified id parameter.
     *
     * Call <code>##package_prefix##.procedures.Select</code> passing
     * the <code>id</code> as the only parameter. An array of tables
     * one table long will be returned.
     *
     * Use <code>VoltTable.getRowCount()</code> and
     * <code>VoltTable.fetchRow(int row)</code> to read the resulting
     * rows. Use <code>VoltTableRow.getLong(int column)</code> to read
     * a specific column.
     *
     * @param long id: the id parameter value.
     * @throws java.io.IOException on client communication error.
     * @throws org.voltdb.client.Client.ProcCallException on VoltDB server error.
     */
    private void doSelect(int id) {
        System.out.println("Select(" + id + ")");
        try {
            VoltTable[] result = client.callProcedure(Select.class.getSimpleName(), id).getResults();
            assert result.length == 1;
            final int rowCount = result[0].getRowCount();
            if (rowCount == 0) {
                System.out.println("Selected: 0 rows selected.");
            }
            for (int ii = 0; ii < rowCount; ii++) {
                final VoltTableRow row = result[0].fetchRow(0);
                final long ##project_name##_ID = row.getLong(0);
                final long ##project_name##_ITEM = row.getLong(1);
                System.out.println("Selected: ##project_name##_ID == " + ##project_name##_ID + " ##project_name##_ITEM == " + ##project_name##_ITEM);
            }

        }
        catch (java.io.IOException e) {
            e.printStackTrace();
        }
        catch (org.voltdb.client.ProcCallException e) {
            System.out.println("Select(" + id + ") failed: " + e.getMessage());
        }
    }

    /** Example INSERT: insert an id, item pair as specified by the id
     * and item parameters.
     *
     * Call <code>##package_prefix##.procedures.Insert</code> passing
     * the id and item parameters.  Inserts return one table
     * containing exactly one row with exactly one integer column. The
     * sole value is the count of inserted rows.
     *
     * Use <code>VoltTable.getRowCount()</code> and
     * <code>VoltTable.fetchRow(int row)</code> to read the resulting
     * rows. Use <code>VoltTableRow.getLong(int column)</code> to read
     * a specific column.
     *
     * @param id: the id parameter value.
     * @param item: the item parameter value.
     * @throws java.io.IOException on client communication error.
     * @throws org.voltdb.client.Client.ProcCallException on VoltDB server error.
     */
    private void doInsert(int id, long item) {
        System.out.println("Insert(" + id + "," + item + ")");
        try {
            VoltTable[] result = client.callProcedure(Insert.class.getSimpleName(), id, item).getResults();
            assert (result != null);
            long insertedRows = result[0].fetchRow(0).getLong(0);
            System.out.println("INSERT(" + id + "," + item + ") successfully inserted " + insertedRows + " row(s)");
        }
        catch (java.io.IOException e) {
            e.printStackTrace();
        }
        catch (org.voltdb.client.ProcCallException e) {
            System.out.println("Insert(" + id + "," + item + ") failed: " + e.getMessage());
        }
    }

    /** Example error: attempt an invalid INSERT.
     *
     * Call <code>##package_prefix##.procedures.Insert</code> with an
     * invalid number of parameters.  This procedure invocation will
     * <code>throw org.voltdb.client.Client.ProcCallException</code>.
     *
     * @param id: the id parameter value.
     * @throws java.io.IOException on client communication error.
     * @throws org.voltdb.client.Client.ProcCallException on VoltDB server error, expected in this example.
     */
    private void tryInvalidInsert(int id) {
        System.out.println("Insert(" + id + ")");
        try {
            VoltTable[] result = client.callProcedure(Insert.class.getSimpleName(), id).getResults();
            assert (result != null);
            System.out.println("INVALID INSERT(" + id + ") successful");
        }
        catch (java.io.IOException e) {
            e.printStackTrace();
        }
        catch (org.voltdb.client.ProcCallException e) {
            System.out.println("Demonstrate a response with an error string: " + e.getMessage());
        }
    }

    /** Example DELETE: delete the row corresponding to the specified id.
     *
     *  Call <code>##package_prefix##.procedures.Delete</code> passing
     *  the id parameter. Deletes return one table containing exactly
     *  one row with exactly one integer column. The sole value is the
     *  count of deleted rows.
     *
     * @param id: the id parameter value.
     * @throws java.io.IOException on client communication error.
     * @throws org.voltdb.client.Client.ProcCallException on VoltDB server error, expected in this example.
     */
    private void doDelete(int id) {
        System.out.println("Delete (" + id + ")");
        try {
            VoltTable[] result = client.callProcedure(Delete.class.getSimpleName(), id).getResults();
            assert (result != null);
            long deletedRows = result[0].fetchRow(0).getLong(0);
            System.out.println("DELETE(" + id + ") successfully deleted " + deletedRows + " row(s)");

        }
        catch (java.io.IOException e) {
            e.printStackTrace();
        }
        catch (org.voltdb.client.ProcCallException e) {
            System.out.println("Delete(" + id + ") failed: " + e.getMessage());
        }

{'fraction_non_alphanumeric': 0.12686132601281092, 'fraction_numerical': 0.0027451959071624656, 'mean_word_length': 2.42604730692505, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 51, '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': '7453589', 'n_tokens_mistral': 3412, 'n_tokens_neox': 3359, 'n_words': 917}