| 572 | } |
| 573 | |
| 574 | static Standalone<IndexedBlobGranuleFile> fromFileBytes(const StringRef& fileBytes, |
| 575 | const Optional<BlobGranuleCipherKeysCtx> cipherKeysCtx) { |
| 576 | // parse index block at head of file |
| 577 | Arena arena; |
| 578 | IndexedBlobGranuleFile file; |
| 579 | ObjectReader dataReader(fileBytes.begin(), IncludeVersion()); |
| 580 | dataReader.deserialize(FileIdentifierFor<IndexedBlobGranuleFile>::value, file, arena); |
| 581 | |
| 582 | file.init(fileBytes, arena, cipherKeysCtx); |
| 583 | |
| 584 | // do sanity checks |
| 585 | if (file.formatVersion > LATEST_BG_FORMAT_VERSION || file.formatVersion < MIN_SUPPORTED_BG_FORMAT_VERSION) { |
| 586 | TraceEvent(SevWarn, "BlobGranuleFileInvalidFormatVersion") |
| 587 | .suppressFor(5.0) |
| 588 | .detail("FoundFormatVersion", file.formatVersion) |
| 589 | .detail("MinSupported", MIN_SUPPORTED_BG_FORMAT_VERSION) |
| 590 | .detail("LatestSupported", LATEST_BG_FORMAT_VERSION); |
| 591 | throw unsupported_format_version(); |
| 592 | } |
| 593 | ASSERT(file.fileType == SNAPSHOT_FILE_TYPE || file.fileType == DELTA_FILE_TYPE); |
| 594 | |
| 595 | return Standalone<IndexedBlobGranuleFile>(file, arena); |
| 596 | } |
| 597 | |
| 598 | ChildBlockPointerRef* findStartBlock(const KeyRef& beginKey) const { |
| 599 | ChildBlockPointerRef searchKey(beginKey, 0); |
nothing calls this directly
no test coverage detected