src/Orleans.Core/Manifest/GrainVersionManifest.cs
/// <summary>
/// Gets the set of supported silos for the specified combination of grain type, interface type, and version.
/// </summary>
/// <param name="grainType">The grain type.</param>
/// <param name="interfaceType">The grain interface type name.</param>
/// <param name="versions">The grain interface version.</param>
/// <returns>The set of silos which support the specifed grain.</returns>
Gets the set of supported silos for the specified combination of grain type, interface type, and version.
Gets the set of supported silos for the specified combination of grain type interface type and version .
public (MajorMinorVersion Version, Dictionary<ushort, SiloAddress[]> Result) GetSupportedSilos(GrainType grainType, GrainInterfaceType interfaceType, ushort[] versions)
        {
            var result = new Dictionary<ushort, SiloAddress[]>();
            MajorMinorVersion? minCacheVersion = null;
            foreach (var version in versions)
            {
                (var cacheVersion, var silosWithGrain) = this.GetSupportedSilos(grainType);
                if (!minCacheVersion.HasValue || cacheVersion > minCacheVersion.Value)
                {
                    minCacheVersion = cacheVersion;
                }
                SiloAddress[] silosWithCorrectVersion;
                (cacheVersion, silosWithCorrectVersion) = this.GetSupportedSilos(interfaceType, version);
                if (!minCacheVersion.HasValue || cacheVersion > minCacheVersion.Value)
                {
                    minCacheVersion = cacheVersion;
                }
                result[version] = silosWithCorrectVersion
                    .Intersect(silosWithGrain)
                    .OrderBy(addr => addr)
                    .ToArray();
            }
            if (!minCacheVersion.HasValue) minCacheVersion = MajorMinorVersion.Zero;
            return (minCacheVersion.Value, result);
        }
public ( MajorMinorVersion Version , Dictionary < ushort , SiloAddress [ ] > Result ) GetSupportedSilos ( GrainType grainType , GrainInterfaceType interfaceType , ushort [ ] versions ) { var result = new Dictionary < ushort , SiloAddress [ ] > ( ) ; MajorMinorVersion ? minCacheVersion = null ; foreach ( var version in versions ) { ( var cacheVersion , var silosWithGrain ) = this . GetSupportedSilos ( grainType ) ; if ( ! minCacheVersion . HasValue || cacheVersion > minCacheVersion . Value ) { minCacheVersion = cacheVersion ; } SiloAddress [ ] silosWithCorrectVersion ; ( cacheVersion , silosWithCorrectVersion ) = this . GetSupportedSilos ( interfaceType , version ) ; if ( ! minCacheVersion . HasValue || cacheVersion > minCacheVersion . Value ) { minCacheVersion = cacheVersion ; } result [ version ] = silosWithCorrectVersion . Intersect ( silosWithGrain ) . OrderBy ( addr => addr ) . ToArray ( ) ; } if ( ! minCacheVersion . HasValue ) minCacheVersion = MajorMinorVersion . Zero ; return ( minCacheVersion . Value , result ) ; }
Gets the set of supported silos for the specified combination of grain type, interface type, and version.
Gets the set of supported silos for the specified combination of grain type interface type and version .
// Track the minimum version in case of inconsistent reads, since the caller can use that information to // ensure they refresh on the next call. // We need to sort this so the list of silos returned will // be the same across all silos in the cluster
The set of silos which support the specifed grain.
The set of silos which support the specifed grain .
grainType
GrainType
The grain type.
The grain type .
interfaceType
GrainInterfaceType
The grain interface type name.
The grain interface type name .
versions
ushort[]
The grain interface version.
The grain interface version .