Ejemplo n.º 1
0
        /* Helper function to create a key in the Key Provider. */
        /// <exception cref="Sharpen.NoSuchAlgorithmException"/>
        /// <exception cref="System.IO.IOException"/>
        private void CreateAKey(string keyName, Configuration conf)
        {
            KeyProvider provider = dfsCluster.GetNameNode().GetNamesystem().GetProvider();

            KeyProvider.Options options = KeyProvider.Options(conf);
            provider.CreateKey(keyName, options);
            provider.Flush();
        }
Ejemplo n.º 2
0
        private static Key GetKey(int cardSet, int discardsCount = 0, int otherSuitsDistribution = 0, bool isOwnMove = false)
        {
            Debug.Assert(cardSet <= CardSet.MaxValue);

            KeyProvider provider = GetKeyProvider(cardSet, isOwnMove);

            return(provider.CreateKey(cardSet, discardsCount, otherSuitsDistribution, isOwnMove));
        }
Ejemplo n.º 3
0
        public void AddResult <TNodeFunction>(object result) where TNodeFunction : IFunc <TIn>
        {
            var key = KeyProvider.CreateKey <TNodeFunction>();

            if (_results.ContainsKey(key))
            {
                _results[key] = new FuncResult(result.GetType(), result);
                return;
            }

            _results.Add(KeyProvider.CreateKey <TNodeFunction>(), new FuncResult(result.GetType(), result));
        }