예제 #1
0
        private bool LoadAggregatedAdvertSpecific()
        {
            _advertChannelClickProportionsPath      = _logPath + "\\a_c_c_p.dat";
            _advertChannelImpressionProportionsPath = _logPath + "\\a_c_i_p.dat";

            _advertChannelClickProportionsExisting      = LogFileReader.LoadAggregatedLogFile(_advertChannelClickProportionsPath, ref _advertChannelClickProportionsStream, _password);
            _advertChannelImpressionProportionsExisting = LogFileReader.LoadAggregatedLogFile(_advertChannelImpressionProportionsPath, ref _advertChannelImpressionProportionsStream, _password);

            if (_advertChannelClickProportionsExisting == "" && _advertChannelImpressionProportionsExisting == "")
            {
                return(false);
            }

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Locks and loads aggregated data if they exist, into four strings.
        /// For each log file not found, its lock is released
        /// </summary>
        private bool LoadAggregatedNonAdvertSpecific(string channelAggregatedLogsPath)
        {
            _dateClicksPerAssetPath      = channelAggregatedLogsPath + "\\c_d_a.dat";
            _dateImpressionsPerAssetPath = channelAggregatedLogsPath + "\\i_d_a.dat";

            _dateClicksPerAssetExisting      = LogFileReader.LoadAggregatedLogFile(_dateClicksPerAssetPath, ref _dateClicksPerAssetStream, _password);
            _dateImpressionsPerAssetExisting = LogFileReader.LoadAggregatedLogFile(_dateImpressionsPerAssetPath, ref _dateImpressionsPerAssetStream, _password);

            if (_dateClicksPerAssetExisting == "" && _dateImpressionsPerAssetExisting == "")
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
        /// <summary>
        /// Reads raw log files if they exist and converts their entries into LogEntry objects.
        /// For each log file with no data, the lock is released.
        /// If there are errors on a file, it is released.
        /// </summary>
        private bool LoadRawAll()
        {
            string contentClickLogsPath1      = _logPath + "\\ss_co_c_1.dat";
            string contentClickLogsPath2      = _logPath + "\\ss_co_c_2.dat";
            string contentImpressionLogsPath1 = _logPath + "\\ss_co_i_1.dat";
            string contentImpressionLogsPath2 = _logPath + "\\ss_co_i_2.dat";
            string advertClickLogsPath1       = _logPath + "\\ss_ad_c_1.dat";
            string advertClickLogsPath2       = _logPath + "\\ss_ad_c_2.dat";
            string advertImpressionLogsPath1  = _logPath + "\\ss_ad_i_1.dat";
            string advertImpressionLogsPath2  = _logPath + "\\ss_ad_i_2.dat";

            try
            {
                _contentClickLog = LogFileReader.TryGetEntries <ClickLogEntry>(ref _contentClickLogStream, contentClickLogsPath1, contentClickLogsPath2, _password, _logger);
            }
            catch (Exception ex)
            {
                // log and continue with the next file
                _logger.WriteError(ex);
            }

            try
            {
                _contentImpressionLog = LogFileReader.TryGetEntries <ImpressionLogEntry>(ref _contentImpressionLogStream, contentImpressionLogsPath1, contentImpressionLogsPath2, _password, _logger);
            }
            catch (Exception ex)
            {
                // log and continue with the next file
                _logger.WriteError(ex);
            }

            try
            {
                _advertClickLog = LogFileReader.TryGetEntries <ClickLogEntry>(ref _advertClickLogStream, advertClickLogsPath1, advertClickLogsPath2, _password, _logger);
            }
            catch (Exception ex)
            {
                // log and continue with the next file
                _logger.WriteError(ex);
            }

            try
            {
                _advertImpressionLog = LogFileReader.TryGetEntries <ImpressionLogEntry>(ref _advertImpressionLogStream, advertImpressionLogsPath1, advertImpressionLogsPath2, _password, _logger);
            }
            catch (Exception ex)
            {
                // log and continue with the next file
                _logger.WriteError(ex);
            }

            if (_advertImpressionLog.Count == 0 &&
                _contentImpressionLog.Count == 0 &&
                _advertClickLog.Count == 0 &&
                _contentClickLog.Count == 0)
            {
                return(false);
            }

            return(true);
        }