Exemplo n.º 1
0
        public TableWriter(IShellContext context, IConnectionProvider connection, NameWithSchema name, TableInfo inputRowFormat, CopyTableTargetOptions options, TableInfo destinationTableOverride = null, LinkedDatabaseInfo linkedInfo = null, DataFormatSettings sourceDataFormat = null)
        {
            _connectionProvider = connection;
            _linkedInfo = linkedInfo;
            _name = name;
            _inputRowFormat = inputRowFormat;
            _queue = new CdlDataQueue(inputRowFormat);
            _context = context;

            _inserter = connection.Factory.CreateBulkInserter();
            _inserter.SourceDataFormat = sourceDataFormat;
            _connection = _connectionProvider.Connect();
            _inserter.Connection = _connection;
            _inserter.Factory = connection.Factory;
            _inserter.LinkedInfo = _linkedInfo;
            var db = context.GetDatabaseStructure(connection.ProviderString);
            _inserter.DestinationTable = destinationTableOverride ?? db.FindTableLike(_name.Schema, _name.Name);
            _inserter.CopyOptions = options;
            _inserter.Log += _inserter_Log;

            _thread = new Thread(Run);
            _thread.Start();
        }
Exemplo n.º 2
0
 public CdlDataQueueAdapter(CdlDataQueue queue)
 {
     _queue = queue;
 }
Exemplo n.º 3
0
 public CdlDataQueueAdapter(CdlDataQueue queue)
 {
     _queue = queue;
 }