Package com.foundationdb.server.service.externaldata

Examples of com.foundationdb.server.service.externaldata.ExternalDataService


    @Override
    public int execute(PostgresQueryContext context, QueryBindings bindings, int maxrows) throws IOException {
        context.initStore(schema);
        PostgresServerSession server = context.getServer();
        Session session = server.getSession();
        ExternalDataService externalData = server.getExternalDataService();
        InputStream istr;
        long nrows = 0;
        if (fromFile != null)
            istr = new FileInputStream(fromFile);
        else
            // Always use a stream: we align records and messages, but
            // this is not a requirement on the client.
            istr = new PostgresCopyInputStream(server.getMessenger(),
                                               toColumns.size());
        try {
            preExecute(context, DXLFunction.UNSPECIFIED_DML_WRITE);
            switch (format) {
            case CSV:
                nrows = externalData.loadTableFromCsv(session, istr, csvFormat, skipRows,
                                                      toTable, toColumns,
                                                      commitFrequency, maxRetries,
                                                      context);
                break;
            case MYSQL_DUMP:
                nrows = externalData.loadTableFromMysqlDump(session, istr, encoding,
                                                            toTable, toColumns,
                                                            commitFrequency, maxRetries,
                                                            context);
                break;
            }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.service.externaldata.ExternalDataService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.