Exemplo n.º 1
0
        public static List <GetOpResult> Get(string [] keys)
        {
            List <GetOpResult> results = new List <GetOpResult>();

            foreach (string key in keys)
            {
                StoreObject obj = null;
                lock (_ht)
                {
                    obj = (StoreObject)_ht[key];
                }

                if (obj != null)
                {
                    GetOpResult r = new GetOpResult();
                    r.Value        = obj.Value;
                    r.Key          = key;
                    r.Flag         = obj.Flags;
                    r.Version      = 1;
                    r.ReturnResult = Result.SUCCESS;
                    results.Add(r);
                }
            }

            return(results);
        }
Exemplo n.º 2
0
        public static OperationResult Set(string key, object value, uint flags)
        {
            StoreObject obj = new StoreObject();
            obj.Flags = flags;
            obj.Value = value;
            lock (_ht)
            {
                _ht[key] = obj;
            }
            OperationResult result = new OperationResult();
            result.ReturnResult = Result.SUCCESS;
            ulong cas=1;
            result.Value = cas;

            return result;
        }
Exemplo n.º 3
0
        public static OperationResult Set(string key, object value, uint flags)
        {
            StoreObject obj = new StoreObject();

            obj.Flags = flags;
            obj.Value = value;
            lock (_ht)
            {
                _ht[key] = obj;
            }
            OperationResult result = new OperationResult();

            result.ReturnResult = Result.SUCCESS;
            ulong cas = 1;

            result.Value = cas;

            return(result);
        }