Exemplo n.º 1
0
        /// <summary>
        /// Attempted access to unpinned CasHash entry
        /// </summary>
        /// <param name="cacheId">Cache id where the failure was</param>
        /// <param name="casHash">The CasHash that was being accessed</param>
        public UnpinnedCasEntryFailure(string cacheId, CasHash casHash)
        {
            Contract.Requires(cacheId != null);

            m_cacheId = cacheId;
            m_casHash = casHash;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create the failure, including the CasHash that failed
        /// </summary>
        /// <param name="cacheId">The cacheId where the failure happened</param>
        /// <param name="casHash">The CasHash that failed</param>
        /// <param name="rootCause">Optional root cause exception</param>
        public ProduceStreamFailure(string cacheId, CasHash casHash, Exception rootCause = null)
        {
            Contract.Requires(cacheId != null);

            m_cacheId   = cacheId;
            m_casHash   = casHash;
            m_rootCause = rootCause;
        }
Exemplo n.º 3
0
        /// <summary>
        /// .ctr
        /// </summary>
        /// <param name="weak">Weak Fingerprint Hash of this selector</param>
        /// <param name="casElement">The CAS addressed part of this selector</param>
        /// <param name="hashElement">The basic Hash part of this selector</param>
        /// <param name="cacheId">A string representing this instance of the cache.</param>
        public StrongFingerprint(WeakFingerprintHash weak, CasHash casElement, Hash hashElement, string cacheId)
        {
            Contract.Requires(cacheId != null);

            m_weakFingerprint = weak;
            m_casElement      = casElement;
            m_hashElement     = hashElement;
            m_cacheId         = cacheId;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Create the failure, including the CasHash and the target filename that failed
        /// </summary>
        /// <param name="cacheId">The cacheId where the failure happened</param>
        /// <param name="casHash">The CasHash that failed</param>
        /// <param name="filename">The filename that failed</param>
        /// <param name="rootCause">Optional root cause exception</param>
        public ProduceFileFailure(string cacheId, CasHash casHash, string filename, Exception rootCause = null)
        {
            Contract.Requires(cacheId != null);
            Contract.Requires(filename != null);

            m_cacheId   = cacheId;
            m_casHash   = casHash;
            m_filename  = filename;
            m_rootCause = rootCause;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Create the failure.
        /// </summary>
        /// <param name="cacheId">Id of the cache doing the transfer</param>
        /// <param name="destinationCacheId">Id of the cache that the file would have been moved to.</param>
        /// <param name="fileHash">Hash for the file</param>
        /// <param name="innerFailure">Failure that occurrec when transferring the file</param>
        /// <param name="message">Additional context information about when the failure occurred.</param>
        /// <param name="sourceCacheId">Id of the cache the file would have transferred from.</param>
        public CASTransferFailure(string cacheId, string sourceCacheId, string destinationCacheId, CasHash fileHash, string message, Failure innerFailure)
            : base(innerFailure)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(sourceCacheId));
            Contract.Requires(!string.IsNullOrWhiteSpace(destinationCacheId));
            Contract.Requires(!string.IsNullOrWhiteSpace(cacheId));
            Contract.Requires(innerFailure != null);

            m_sourceCacheId      = sourceCacheId;
            m_destinationCacheId = destinationCacheId;
            m_message            = message == null ? string.Empty : message;
            m_fileHash           = fileHash;
            m_cacheId            = cacheId;
        }