| 22 | namespace tensorflow { |
| 23 | |
| 24 | bool RamFileBlockCache::BlockNotStale(const std::shared_ptr<Block>& block) { |
| 25 | mutex_lock l(block->mu); |
| 26 | if (block->state != FetchState::FINISHED) { |
| 27 | return true; // No need to check for staleness. |
| 28 | } |
| 29 | if (max_staleness_ == 0) return true; // Not enforcing staleness. |
| 30 | return env_->NowSeconds() - block->timestamp <= max_staleness_; |
| 31 | } |
| 32 | |
| 33 | std::shared_ptr<RamFileBlockCache::Block> RamFileBlockCache::Lookup( |
| 34 | const Key& key) { |
nothing calls this directly
no test coverage detected