public static string ConstructPartitionKey(string serviceId, uint number)
        {
            // IMPORTANT NOTE: Other code using this return data is very sensitive to format changes,
            //       so take great care when making any changes here!!!

            // this format of partition key makes sure that the comparisons in FindReminderEntries(begin, end) work correctly
            // the idea is that when converting to string, negative numbers start with 0, and positive start with 1. Now,
            // when comparisons will be done on strings, this will ensure that positive numbers are always greater than negative
            // string grainHash = number < 0 ? string.Format("0{0}", number.ToString("X")) : string.Format("1{0:d16}", number);

            return(AzureStorageUtils.SanitizeTableProperty($"{serviceId}_{number:X8}"));
        }
Ejemplo n.º 2
0
        public static string MakeRowKey(string partition)
        {
            string key = $"partition_{partition}";

            return(AzureStorageUtils.SanitizeTableProperty(key));
        }
Ejemplo n.º 3
0
        public static string MakePartitionKey(string streamProviderName, string checkpointNamespace)
        {
            string key = $"EventHubCheckpoints_{streamProviderName}_{checkpointNamespace}";

            return(AzureStorageUtils.SanitizeTableProperty(key));
        }
Ejemplo n.º 4
0
        private string GetKeyString(GrainReference grainReference)
        {
            var key = String.Format("{0}_{1}", this.clusterOptions.ServiceId, grainReference.ToKeyString());

            return(AzureStorageUtils.SanitizeTableProperty(key));
        }
Ejemplo n.º 5
0
        }                                                     // Part of PartitionKey


        public static string ConstructRowKey(GrainReference grainRef, string reminderName)
        {
            var key = String.Format("{0}-{1}", grainRef.ToKeyString(), reminderName); //grainRef.ToString(), reminderName);

            return(AzureStorageUtils.SanitizeTableProperty(key));
        }
Ejemplo n.º 6
0
        public static string MakeRowKey(string partition)
        {
            string key = String.Format("partition_{0}", partition);

            return(AzureStorageUtils.SanitizeTableProperty(key));
        }
Ejemplo n.º 7
0
        public static string MakePartitionKey(string streamProviderName, string checkpointNamespace)
        {
            string key = String.Format("EHCheckpoints_{0}_{1}", streamProviderName, checkpointNamespace);

            return(AzureStorageUtils.SanitizeTableProperty(key));
        }
Ejemplo n.º 8
0
        public void AzureStorageUtils_TablePropertyShouldBeSanitized()
        {
            var tableProperty = "/A\\C#?";

            Assert.Equal("_A_C__", AzureStorageUtils.SanitizeTableProperty(tableProperty));
        }