Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'develop'

  • Loading branch information...
commit 3056e136e846e53fb5cf1828f0ce4af2e987763d 2 parents bb0cd62 + f8e1187
@peschkaj peschkaj authored
View
4 CorrugatedIron.Tests.Live/GeneralIntegrationTests.cs
@@ -490,14 +490,14 @@ public void DeleteBucketDeletesAllKeysInABucketAsynchronously()
public void LastModifiedShouldChangeAfterAPutRequest()
{
var o = new RiakObject(TestBucket, "1234", new { value = 1234 });
- Client.Put(o);
+ o = Client.Put(o).Value;
var lm2 = o.LastModified;
var lmu2 = o.LastModifiedUsec;
Thread.Sleep(500);
o.SetObject(new { value = 12345 });
- Client.Put(o);
+ o = Client.Put(o).Value;
var lm3 = o.LastModified;
var lmu3 = o.LastModifiedUsec;
View
21 CorrugatedIron/Models/RiakObject.cs
@@ -218,11 +218,6 @@ public RiakObjectId ToRiakObjectId()
return new RiakObjectId(Bucket, Key);
}
- public void MarkClean()
- {
- _hashCode = CalculateHashCode();
- }
-
internal RiakObject(string bucket, string key, RpbContent content, byte[] vectorClock)
{
Bucket = bucket;
@@ -255,8 +250,6 @@ internal RiakObject(string bucket, string key, ICollection<RpbContent> contents,
internal RpbPutReq ToMessage()
{
- UpdateLastModified();
-
var message = new RpbPutReq
{
Bucket = Bucket.ToRiakString(),
@@ -269,8 +262,6 @@ internal RpbPutReq ToMessage()
VTag = VTag.ToRiakString(),
UserMeta = UserMetaData.Select(kv => new RpbPair { Key = kv.Key.ToRiakString(), Value = kv.Value.ToRiakString() }).ToList(),
Indexes = Indexes.Select(kv => new RpbPair { Key = kv.Key.ToRiakString(), Value = kv.Value.ToRiakString() }).ToList(),
- LastMod = LastModified,
- LastModUSecs = LastModifiedUsec,
Links = Links.Select(l => l.ToMessage()).ToList()
}
};
@@ -295,18 +286,6 @@ public override bool Equals(object obj)
return Equals((RiakObject)obj);
}
- private void UpdateLastModified()
- {
- if(HasChanged)
- {
- var t = DateTime.UtcNow - new DateTime(1970, 1, 1);
- var ms = (ulong)Math.Round(t.TotalMilliseconds);
-
- LastModified = (uint)(ms / 1000u);
- LastModifiedUsec = (uint)((ms - LastModified * 1000u) * 100u);
- }
- }
-
public bool Equals(RiakObject other)
{
if(ReferenceEquals(null, other))
View
12 CorrugatedIron/RiakClient.cs
@@ -239,8 +239,6 @@ public RiakResult<RiakObject> Put(RiakObject value, RiakPutOptions options = nul
new RiakObject(value.Bucket, value.Key, c, result.Value.VectorClock)).ToList();
}
- value.MarkClean();
-
return RiakResult<RiakObject>.Success(finalResult);
}
@@ -271,16 +269,6 @@ public IEnumerable<RiakResult<RiakObject>> Put(IEnumerable<RiakObject> values, R
return RiakResult<IEnumerable<RiakResult<RpbPutResp>>>.Success(responses);
});
- var resultsArray = results.Value.ToArray();
-
- for(var i = 0; i < resultsArray.Length; i++)
- {
- if(resultsArray[i].IsSuccess)
- {
- values.ElementAt(i).MarkClean();
- }
- }
-
return results.Value.Zip(values, Tuple.Create).Select(t =>
{
if(t.Item1.IsSuccess)
Please sign in to comment.
Something went wrong with that request. Please try again.