(
storeDims: DataStoreDimensionDefine[],
seriesSource: Source,
sourceReadKey: string
)
| 384 | } |
| 385 | |
| 386 | private _innerGetDataStore( |
| 387 | storeDims: DataStoreDimensionDefine[], |
| 388 | seriesSource: Source, |
| 389 | sourceReadKey: string |
| 390 | ): DataStore | undefined { |
| 391 | // TODO Can use other sourceIndex? |
| 392 | const sourceIndex = 0; |
| 393 | |
| 394 | const storeList = this._storeList; |
| 395 | |
| 396 | let cachedStoreMap = storeList[sourceIndex]; |
| 397 | |
| 398 | if (!cachedStoreMap) { |
| 399 | cachedStoreMap = storeList[sourceIndex] = {}; |
| 400 | } |
| 401 | |
| 402 | let cachedStore = cachedStoreMap[sourceReadKey]; |
| 403 | if (!cachedStore) { |
| 404 | const upSourceMgr = this._getUpstreamSourceManagers()[0]; |
| 405 | |
| 406 | if (isSeries(this._sourceHost) && upSourceMgr) { |
| 407 | cachedStore = upSourceMgr._innerGetDataStore( |
| 408 | storeDims, seriesSource, sourceReadKey |
| 409 | ); |
| 410 | } |
| 411 | else { |
| 412 | cachedStore = new DataStore(); |
| 413 | // Always create store from source of series. |
| 414 | cachedStore.initData( |
| 415 | new DefaultDataProvider(seriesSource, storeDims.length), |
| 416 | storeDims |
| 417 | ); |
| 418 | } |
| 419 | cachedStoreMap[sourceReadKey] = cachedStore; |
| 420 | } |
| 421 | |
| 422 | return cachedStore; |
| 423 | } |
| 424 | |
| 425 | /** |
| 426 | * PENDING: Is it fast enough? |
no test coverage detected