예제 #1
0
        HistoryManagerAdapter GetOrCreateHistoryManagerAdapter(string symbol)
        {
            HistoryManagerAdapter result;

            lock (this.synchronizer)
            {
                if (!this.symbol2cache.TryGetValue(symbol, out result))
                {
                    var symbols = new HashSet <ISymbolProperties>
                    {
                        new SymbolProperties(symbol)
                    };

                    var storageVersion = this.storageVersion;

                    if (this.historyFeed != null)
                    {
                        storageVersion = this.historyFeed.Server.GetQuotesHistoryVersion();
                    }

                    var provider = HistoryManager.Create(
                        storageVersion,
                        this.store,
                        symbols,
                        DataFeedStorage.GetSupportedPeriodicityToStoreLevel(this.storageVersion),
                        this.saveTickLevel2History,
                        Cache.ClientInstance(Guid.NewGuid().ToString()),
                        true,
                        this.flushOnDispose,
                        NullMonitoringService,
                        NullMonitoringItem);

                    result = new HistoryManagerAdapter(provider);
                    this.symbol2cache[symbol] = result;
                }
            }

            return(result);
        }
예제 #2
0
파일: DataFeedStorage.cs 프로젝트: ifzz/FDK
		HistoryManagerAdapter GetOrCreateHistoryManagerAdapter(string symbol)
		{
			HistoryManagerAdapter result;

			lock (this.synchronizer)
			{
				if (!this.symbol2cache.TryGetValue(symbol, out result))
				{
                    var symbols = new HashSet<string>
                    {
                        symbol
                    };

					var storageVersion = this.storageVersion;

					if (this.historyFeed != null)
						storageVersion = this.historyFeed.Server.GetQuotesHistoryVersion();

					var provider = HistoryManager.Create(
                        storageVersion,
                        this.store,
                        symbols,
                        DataFeedStorage.GetSupportedPeriodicityToStoreLevel(this.storageVersion),
                        this.saveTickLevel2History,
                        Cache.ClientInstance(Guid.NewGuid().ToString()),
                        true,
                        this.flushOnDispose,
                        NullMonitoringService,
                        NullMonitoringItem);

					result = new HistoryManagerAdapter(provider);
					this.symbol2cache[symbol] = result;
				}
			}

			return result;
		}