Esempio n. 1
0
        public Bucket Bucket(string name, bool loadKeys)
        {
            Bucket b = new Bucket(this, name);

            b.Refresh(loadKeys);

            return b;
        }
Esempio n. 2
0
 public static void DeleteAllKeys(Bucket bucket)
 {
     foreach (string key in bucket.Keys)
     {
         RiakObject o = bucket.Get(key);
         o.Delete();
     }
 }
Esempio n. 3
0
        public static RiakObject Load(Bucket bucket, RiakHttpResponse response)
        {
            RiakObject ro = new RiakObject
                                {
                                    Bucket = bucket
                                };

            ro.LoadFromResponse(response);

            return ro;
        }
Esempio n. 4
0
        public static RiakObject Load(Bucket bucket, string keyName, string siblingId)
        {
            RiakObject ro = new RiakObject
                                {
                                    Bucket = bucket, 
                                    SiblingId = siblingId, 
                                    KeyName = keyName
                                };
            ro.Refresh();

            return ro;
        }
Esempio n. 5
0
        public static RiakObject Load(Bucket bucket, string keyName, Document part)
        {
            RiakObject ro = new RiakObject
                                {
                                    Bucket = bucket, 
                                    KeyName = keyName
                                };

            ro.LoadDocumentHeaders(part);
            ro._cachedData = part.Content;

            return ro;
        }
Esempio n. 6
0
        public static RiakObject Load(Bucket bucket, string keyName, bool autoRefresh)
        {
            RiakObject ro = new RiakObject
                                {
                                    Bucket = bucket, 
                                    KeyName = keyName
                                };

            if (autoRefresh)
            {
                if(string.IsNullOrEmpty(keyName))
                {
                    throw new RiakClientException("Loading a RiakObject requires a key name.");
                }

                ro.Refresh();
            }

            return ro;
        }
Esempio n. 7
0
 public MapReduce Input(RiakObject riakObject, string arg)
 {
     _inputBucket = null;
     _inputKeys.Add(new KeyValuePair<RiakObject, string>(riakObject, arg));
     return this;
 }
Esempio n. 8
0
 public MapReduce Input(Bucket bucket)
 {
     _inputKeys.Clear();
     _inputBucket = bucket;
     return this;
 }
Esempio n. 9
0
 public static RiakObject Load(Bucket bucket, string keyName)
 {
     return Load(bucket, keyName, true);
 }
Esempio n. 10
0
 protected RiakObject(Bucket bucket, string name)
 {
     Bucket = bucket;
     KeyName = name;
 }
Esempio n. 11
0
        private static RiakObject CreateTextObject(Bucket bucket, string name)
        {
            RiakObject o = bucket.GetNew(name);
            o.ContentType = "text/plain";
            o.Store(name);

            return o;
        }