コード例 #1
0
        //public override IDbConnection GetConnection(string odbcConnectionString)
        //{
        //   return new OdbcConnection();
        //}

        //public override IDataReader ReadChunkData(IDbConnection conn, IDbCommand cmd, QueryDefinition qd, int chunkId, string prefix)
        //{
        //    return cmd.ExecuteReader();
        //}

        public override IDataReader ReadChunkData(IDbConnection conn, IDbCommand cmd, QueryDefinition qd, int chunkId, string prefix)
        {
            var personIdFieldName = qd.GetPersonIdFieldName();
            var folder            = string.Format("{0}/{1}/raw", Settings.Current.Building.Vendor,
                                                  Settings.Current.Building.Id);

            //if (qd.FieldHeaders == null)
            //    RestoreMetadataFromS3(qd, folder);

            return(new S3DataReader(Settings.Current.Bucket, folder, Settings.Current.S3AwsAccessKeyId,
                                    Settings.Current.S3AwsSecretAccessKey, chunkId, qd.FileName, qd.FieldHeaders, prefix, (m) => Logger.Write(chunkId, LogMessageTypes.Debug, m)));
        }