public void SerializeToString(HashType hashType, string expected) { var hashLength = HashInfoLookup.Find(hashType).ByteLength; var hash = new ContentHash(hashType, Enumerable.Range(0, hashLength).Select(i => (byte)i).ToArray()); Assert.Equal(expected, hash.Serialize()); }
/// <summary> /// Serializes <see cref="GraphAgnosticIncrementalSchedulingStateId" />. /// </summary> public void Serialize(BuildXLWriter writer) { Contract.Requires(writer != null); writer.Write(m_machineName); writer.Write(m_substSource); writer.Write(m_substTarget); m_preserveOutputSalt.Serialize(writer); }
public void SerializeFull(ContentHash contentHash) { contentHash.Serialize(_buffer, _offset, ContentHash.SerializeHashBytesMethod.Full); _offset += ContentHash.SerializedLength; }
public void Serialize(ContentHash contentHash) { contentHash.Serialize(_buffer, _offset); _offset += contentHash.ByteLength + 1; }
/// <summary> /// Serialize whole value to a binary writer. /// </summary> public void Serialize(BuildXLWriter writer) { ContentHash.Serialize(writer); ContentHashList.WriteNullableArray(Output, writer); }
private async Task StoreBuildManifestHashAsync(ContentHash hash, ContentHash manifestHash) { (var wf, var sf) = GetBuildManifestHashKey(hash); var result = await m_engineCache.TwoPhaseFingerprintStore.TryPublishCacheEntryAsync(wf, hash, sf, new CacheEntry(manifestHash, "", ArrayView <ContentHash> .Empty)); if (!result.Succeeded) { Tracing.Logger.Log.ApiServerStoreBuildManifestHashToCacheFailed(m_loggingContext, hash.Serialize(), manifestHash.Serialize(), result.Failure.DescribeIncludingInnerFailures()); } }
private async Task <ContentHash?> TryGetBuildManifestHashAsync(ContentHash hash) { (var wf, var sf) = GetBuildManifestHashKey(hash); var result = await m_engineCache.TwoPhaseFingerprintStore.TryGetCacheEntryAsync(wf, hash, sf); if (result.Succeeded) { return(result.Result?.MetadataHash); } Tracing.Logger.Log.ErrorApiServerGetBuildManifestHashFromCacheFailed(m_loggingContext, hash.Serialize(), result.Failure.DescribeIncludingInnerFailures()); return(null); }