public override void ExecuteCmdlet()
        {
            Utility.ValidateResourceGroupAndResourceName(ResourceGroupName, Name);
            ResourceGroupName = CacheClient.GetResourceGroupNameIfNotProvided(ResourceGroupName, Name);

            RedisKeyType keyTypeToRegenerated = RedisKeyType.Primary;

            if (KeyType.Equals("Secondary"))
            {
                keyTypeToRegenerated = RedisKeyType.Secondary;
            }

            ConfirmAction(
                Force.IsPresent,
                string.Format(Resources.RegeneratingRedisCacheKey, Name, keyTypeToRegenerated.ToString()),
                string.Format(Resources.RegenerateRedisCacheKey, Name, keyTypeToRegenerated.ToString()),
                Name,
                () =>
            {
                CacheClient.RegenerateAccessKeys(ResourceGroupName, Name, keyTypeToRegenerated);
                RedisAccessKeys keysResponse = CacheClient.GetAccessKeys(ResourceGroupName, Name);
                WriteObject(keysResponse);
            }
                );
        }
        public override void ExecuteCmdlet()
        {
            RedisKeyType keyTypeToRegenerated = RedisKeyType.Primary;

            if (KeyType.Equals("Secondary"))
            {
                keyTypeToRegenerated = RedisKeyType.Secondary;
            }

            if (!Force.IsPresent)
            {
                ConfirmAction(
                    Force.IsPresent,
                    string.Format(Resources.RegeneratingRedisCacheKey, Name, keyTypeToRegenerated.ToString()),
                    string.Format(Resources.RegenerateRedisCacheKey, Name, keyTypeToRegenerated.ToString()),
                    Name,
                    () => CacheClient.RegenerateAccessKeys(ResourceGroupName, Name, keyTypeToRegenerated)
                    );
            }
            else
            {
                CacheClient.RegenerateAccessKeys(ResourceGroupName, Name, keyTypeToRegenerated);
            }

            RedisListKeysResult keysResponse = CacheClient.GetAccessKeys(ResourceGroupName, Name);

            WriteObject(new RedisAccessKeys()
            {
                PrimaryKey   = keysResponse.PrimaryKey,
                SecondaryKey = keysResponse.SecondaryKey
            });
        }
Пример #3
0
 public bool OnKeyEvent(IWebBrowser browserControl, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey)
 {
     //对按键的处理
     switch (windowsKeyCode)
     {
     case 123:     //功能键 F12 的KeyCode
         if (type.Equals(KeyType.RawKeyDown))
         {
             browser.GetHost().ShowDevTools();
         }
         break;
     }
     return(false);
 }
        // Checks that all the label columns of the model have the same key type as their label column - including the same
        // cardinality and the same key values, and returns the cardinality of the label column key.
        private static int CheckKeyLabelColumnCore <T>(IHostEnvironment env, PredictorModel[] models, KeyType labelType, Schema schema, int labelIndex, VectorType keyValuesType)
            where T : IEquatable <T>
        {
            env.Assert(keyValuesType.ItemType.RawType == typeof(T));
            env.AssertNonEmpty(models);
            var labelNames = default(VBuffer <T>);

            schema[labelIndex].GetKeyValues(ref labelNames);
            var classCount = labelNames.Length;

            var curLabelNames = default(VBuffer <T>);

            for (int i = 1; i < models.Length; i++)
            {
                var model = models[i];
                var edv   = new EmptyDataView(env, model.TransformModel.InputSchema);
                model.PrepareData(env, edv, out RoleMappedData rmd, out IPredictor pred);
                var labelInfo = rmd.Schema.Label.HasValue;
                if (!rmd.Schema.Label.HasValue)
                {
                    throw env.Except("Training schema for model {0} does not have a label column", i);
                }
                var labelCol = rmd.Schema.Label.Value;

                var curLabelType = labelCol.Type as KeyType;
                if (!labelType.Equals(curLabelType))
                {
                    throw env.Except("Label column of model {0} has different type than model 0", i);
                }

                var mdType = labelCol.Metadata.Schema.GetColumnOrNull(MetadataUtils.Kinds.KeyValues)?.Type;
                if (!mdType.Equals(keyValuesType))
                {
                    throw env.Except("Label column of model {0} has different key value type than model 0", i);
                }
                labelCol.GetKeyValues(ref curLabelNames);
                if (!AreEqual(in labelNames, in curLabelNames))
                {
                    throw env.Except("Label of model {0} has different values than model 0", i);
                }
            }
            return(classCount);
        }
Пример #5
0
        public override bool Equals(object other)
        {
            if (!(other is TelepathyMapSchema))
            {
                return(false);
            }

            var otherSchema = (TelepathyMapSchema)other;

            if (!Name.Equals(otherSchema.Name))
            {
                return(false);
            }

            if (!KeyType.Equals(otherSchema.KeyType))
            {
                return(false);
            }

            return(ValueType.Equals(otherSchema.ValueType) && HashKey.Equals(otherSchema.HashKey));
        }
Пример #6
0
        public override bool Equals(Object obj)
        {
            MapField other = (MapField)obj;

            return(Name.Equals(other.Name) && KeyType.Equals(other.KeyType) && ValueType.Equals(other.ValueType));
        }
Пример #7
0
 /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
 /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
 /// <param name="other">An object to compare with this object.</param>
 public Boolean Equals(TypeMap other) => other != null && KeyType.Equals(other.KeyType) && ValueType.Equals(other.ValueType);