// Path: cassandra-unit/src/main/java/org/cassandraunit/CQLDataLoader.java
// public class CQLDataLoader {
// 
//     private static final Logger log = LoggerFactory.getLogger(CQLDataLoader.class);
//     public static final String DEFAULT_KEYSPACE_NAME = "cassandraunitkeyspace";
// 
//     public CqlSession getSession() {
//         return session;
//     }
// 
//     private final CqlSession session;
// 
//     public CQLDataLoader(CqlSession session) {
//         this.session = session;
//     }
// 
//     public void load(CQLDataSet dataSet) {
//         initKeyspaceContext(session, dataSet);
// 
//         log.debug("loading data");
//         dataSet.getCQLStatements().stream()
//                 .forEach(execute(session));
// 
//         if (dataSet.getKeyspaceName() != null) {
//             use(session).accept(dataSet.getKeyspaceName());
//         }
//     }
// 
//     private void initKeyspaceContext(CqlSession session, CQLDataSet dataSet) {
//         String keyspaceName = DEFAULT_KEYSPACE_NAME;
//         if (dataSet.getKeyspaceName() != null) {
//             keyspaceName = dataSet.getKeyspaceName();
//         }
// 
//         log.debug("initKeyspaceContext : keyspaceDeletion={} keyspaceCreation={} ;keyspaceName={}",
//                 dataSet.isKeyspaceDeletion(), dataSet.isKeyspaceCreation(), keyspaceName);
// 
//         if (dataSet.isKeyspaceDeletion()) {
//             dropKeyspace(session).accept(keyspaceName);
//         }
// 
//         if (dataSet.isKeyspaceCreation()) {
//             createKeyspace(session).accept(keyspaceName);
//             use(session).accept(keyspaceName);
//         }
//     }
// }
// 
// Path: cassandra-unit/src/main/java/org/cassandraunit/dataset/cql/FileCQLDataSet.java
// public class FileCQLDataSet extends AbstractCQLDataSet implements CQLDataSet {
// 
//     public FileCQLDataSet(String dataSetLocation) {
//         super(dataSetLocation, true, true, null);
//     }
// 
//     public FileCQLDataSet(String dataSetLocation, boolean keyspaceCreation, boolean keyspaceDeletion) {
//         super(dataSetLocation, keyspaceCreation, keyspaceDeletion, null);
//     }
// 
//     public FileCQLDataSet(String dataSetLocation, String keyspaceName) {
//         super(dataSetLocation, true, true, keyspaceName);
//     }
// 
//     public FileCQLDataSet(String dataSetLocation, boolean keyspaceCreation) {
//       super(dataSetLocation, keyspaceCreation, true, null);
//     }
// 
//     public FileCQLDataSet(String dataSetLocation, boolean keyspaceCreation, boolean keyspaceDeletion, String keyspaceName) {
//         super(dataSetLocation, keyspaceCreation, keyspaceDeletion, keyspaceName);
//     }
// 
//     @Override
//     protected InputStream getInputDataSetLocation(String dataSetLocation) {
//         if (dataSetLocation == null) {
//             return null;
//         }
//         try {
//             return new FileInputStream(dataSetLocation);
//         } catch (FileNotFoundException e) {
//             return null;
//         }
//     }
// }


import com.datastax.oss.driver.api.core.CqlSession;
import org.apache.commons.cli.*;
import org.apache.commons.lang3.StringUtils;
import org.cassandraunit.CQLDataLoader;
import org.cassandraunit.dataset.cql.FileCQLDataSet;
import java.net.InetSocketAddress;
            exit = true;
        }

        return exit;
    }

    protected static void load() {
        System.out.println("Start Loading...");
        String host = commandLine.getOptionValue("h");
        String port = commandLine.getOptionValue("p");
        String file = commandLine.getOptionValue("f");

        String fileExtension = StringUtils.substringAfterLast(file, ".");

        if (CQL_FILE_EXTENSION.equals(fileExtension)) {
            cqlDataSetLoad(host, port, file);
        } else {
            otherTypeOfDataSetLoad(host, port, file);
        }

        System.out.println("Loading completed");
    }

    private static void otherTypeOfDataSetLoad(String host, String port, String file) {

        CqlSession session = CqlSession.builder()
                .addContactPoint(new InetSocketAddress(host, Integer.parseInt(port)))
                .withLocalDatacenter("datacenter1")
                .build();

// Path: cassandra-unit/src/main/java/org/cassandraunit/CQLDataLoader.java
// public class CQLDataLoader {
// 
//     private static final Logger log = LoggerFactory.getLogger(CQLDataLoader.class);
//     public static final String DEFAULT_KEYSPACE_NAME = "cassandraunitkeyspace";
// 
//     public CqlSession getSession() {
//         return session;
//     }
// 
//     private final CqlSession session;
// 
//     public CQLDataLoader(CqlSession session) {
//         this.session = session;
//     }
// 
//     public void load(CQLDataSet dataSet) {
//         initKeyspaceContext(session, dataSet);
// 
//         log.debug("loading data");
//         dataSet.getCQLStatements().stream()
//                 .forEach(execute(session));
// 
//         if (dataSet.getKeyspaceName() != null) {
//             use(session).accept(dataSet.getKeyspaceName());
//         }
//     }
// 
//     private void initKeyspaceContext(CqlSession session, CQLDataSet dataSet) {
//         String keyspaceName = DEFAULT_KEYSPACE_NAME;
//         if (dataSet.getKeyspaceName() != null) {
//             keyspaceName = dataSet.getKeyspaceName();
//         }
// 
//         log.debug("initKeyspaceContext : keyspaceDeletion={} keyspaceCreation={} ;keyspaceName={}",
//                 dataSet.isKeyspaceDeletion(), dataSet.isKeyspaceCreation(), keyspaceName);
// 
//         if (dataSet.isKeyspaceDeletion()) {
//             dropKeyspace(session).accept(keyspaceName);
//         }
// 
//         if (dataSet.isKeyspaceCreation()) {
//             createKeyspace(session).accept(keyspaceName);
//             use(session).accept(keyspaceName);
//         }
//     }
// }
// 
// Path: cassandra-unit/src/main/java/org/cassandraunit/dataset/cql/FileCQLDataSet.java
// public class FileCQLDataSet extends AbstractCQLDataSet implements CQLDataSet {
// 
//     public FileCQLDataSet(String dataSetLocation) {
//         super(dataSetLocation, true, true, null);
//     }
// 
//     public FileCQLDataSet(String dataSetLocation, boolean keyspaceCreation, boolean keyspaceDeletion) {
//         super(dataSetLocation, keyspaceCreation, keyspaceDeletion, null);
//     }
// 
//     public FileCQLDataSet(String dataSetLocation, String keyspaceName) {
//         super(dataSetLocation, true, true, keyspaceName);
//     }
// 
//     public FileCQLDataSet(String dataSetLocation, boolean keyspaceCreation) {
//       super(dataSetLocation, keyspaceCreation, true, null);
//     }
// 
//     public FileCQLDataSet(String dataSetLocation, boolean keyspaceCreation, boolean keyspaceDeletion, String keyspaceName) {
//         super(dataSetLocation, keyspaceCreation, keyspaceDeletion, keyspaceName);
//     }
// 
//     @Override
//     protected InputStream getInputDataSetLocation(String dataSetLocation) {
//         if (dataSetLocation == null) {
//             return null;
//         }
//         try {
//             return new FileInputStream(dataSetLocation);
//         } catch (FileNotFoundException e) {
//             return null;
//         }
//     }
// }


// Path: cassandra-unit/src/main/java/org/cassandraunit/cli/CassandraUnitCommandLineLoader.java
import com.datastax.oss.driver.api.core.CqlSession;
import org.apache.commons.cli.*;
import org.apache.commons.lang3.StringUtils;
import org.cassandraunit.CQLDataLoader;
import org.cassandraunit.dataset.cql.FileCQLDataSet;
import java.net.InetSocketAddress;

            exit = true;
        }

        return exit;
    }

    protected static void load() {
        System.out.println("Start Loading...");
        String host = commandLine.getOptionValue("h");
        String port = commandLine.getOptionValue("p");
        String file = commandLine.getOptionValue("f");

        String fileExtension = StringUtils.substringAfterLast(file, ".");

        if (CQL_FILE_EXTENSION.equals(fileExtension)) {
            cqlDataSetLoad(host, port, file);
        } else {
            otherTypeOfDataSetLoad(host, port, file);
        }

        System.out.println("Loading completed");
    }

    private static void otherTypeOfDataSetLoad(String host, String port, String file) {

        CqlSession session = CqlSession.builder()
                .addContactPoint(new InetSocketAddress(host, Integer.parseInt(port)))
                .withLocalDatacenter("datacenter1")
                .build();

        CQLDataLoader dataLoader = new CQLDataLoader(session);