Example #1
0
 internal UniformInt64RangePartitionSchemeDescription(UniformInt64RangePartitionSchemeDescription other)
     : base(other)
 {
     this.PartitionCount = other.PartitionCount;
     this.LowKey         = other.LowKey;
     this.HighKey        = other.HighKey;
 }
Example #2
0
        internal static unsafe PartitionSchemeDescription CreateFromNative(NativeTypes.FABRIC_PARTITION_SCHEME scheme, IntPtr ptr)
        {
            ReleaseAssert.AssertIfNot(scheme != NativeTypes.FABRIC_PARTITION_SCHEME.FABRIC_PARTITION_SCHEME_INVALID, StringResources.Error_PartitionSchemeNotSupported);

            switch (scheme)
            {
            case NativeTypes.FABRIC_PARTITION_SCHEME.FABRIC_PARTITION_SCHEME_SINGLETON:
                return(SingletonPartitionSchemeDescription.CreateFromNative(ptr));

            case NativeTypes.FABRIC_PARTITION_SCHEME.FABRIC_PARTITION_SCHEME_UNIFORM_INT64_RANGE:
                return(UniformInt64RangePartitionSchemeDescription.CreateFromNative(ptr));

            case NativeTypes.FABRIC_PARTITION_SCHEME.FABRIC_PARTITION_SCHEME_NAMED:
                return(NamedPartitionSchemeDescription.CreateFromNative(ptr));

            default:
                AppTrace.TraceSource.WriteError("ServicePartitionDescription.CreateFromNative", "Unknown scheme: {0}", scheme);
                ReleaseAssert.Failfast(string.Format(CultureInfo.CurrentCulture, StringResources.Error_PartitionSchemeUnknown_Formatted, scheme));
                break;
            }

            return(null);
        }