anchor.diff:          member this.Capacity: int = size
           
           member this.CurrentSize: Async<int> = async {
  -            let! entities = getEntities ()
  -            let guard = getGuard entities
  -            return guard.Counter
  +            let! item = getTable().GetItemAsync(TableKey.Hash hashKey)
  +            return item.AggregatedUris.Count
           }
           
           member this.Dispose(): Async<unit> = async {
  -            let! records = getEntities ()
  -            do! Table.deleteBatch clusterId.DynamoDBAccount clusterId.RuntimeTable records
  +            let table = getTable()
  +            let! deleted = table.DeleteItemAsync(TableKey.Hash hashKey)
               do! 
  -                records
  -                |> Seq.choose (fun r -> match r.S3Uri with null -> None | uri -> Some uri)
  -                |> Seq.map (fun uri -> S3Persist.DeletePersistedClosure(clusterId, uri))
  +                deleted.AggregatedUris
  +                |> Seq.map (fun kv -> S3Persist.DeletePersistedClosure(clusterId, kv.Value))
                   |> Async.Parallel
                   |> Async.Ignore
           }
  
positive.code:             return currentSize = size
          }
          
          member this.SetResult(index: int, value: 'T, workerId : IWorkerId): Async<bool> = async { 
              let rangeKey = IndexedReferenceEntity.MakeRangeKey index
              let uri = sprintf "%s/%s" partitionKey (guid())
              do! S3Persist.PersistClosure(clusterId, value, uri, allowNewSifts = false)
              let entity = new IndexedReferenceEntity(hashKey, rangeKey, uri, workerId.Id, -1)
              let rec loop () = async {
                  let! entities = getEntities()
                  let guard = getGuard entities
                  match tryGetEntity index entities with
                  | Some index when index.S3Uri <> uri && enableOverWrite = false -> return guard.Counter = size
                  | entOpt ->
                      try
                          if Option.isNone entOpt then
                              do! Table.update clusterId.DynamoDBAccount clusterId.RuntimeTable entity
  
                          let guard' = guard.Incr()
                          do! Table.update clusterId.DynamoDBAccount clusterId.RuntimeTable guard'
                          return guard.Counter = size
                      with e when StoreException.PreconditionFailed e ->
                          return! loop ()
              }
  
              return! loop ()
          }
          
          member this.ToArray(): Async<'T []> = async { 
              let! entities = getEntities()
              let guard = getGuard entities
              if guard.Counter <> size then
                  return! Async.Raise <| new InvalidOperationException(sprintf "Result aggregator incomplete (%d/%d)." guard.Counter size)
              else
                  return!
                      entities
                      |> Seq.filter (fun e -> e.S3Uri <> null) 
                      |> Seq.sortBy (fun r -> r.RangeKey)
                      |> Seq.map (fun e -> S3Persist.ReadPersistedClosure<'T>(clusterId, e.S3Uri))
                      |> Async.Parallel
          }
  
  [<Sealed; AutoSerializable(false)>]
  type DynamoDBResultAggregatorFactory private (clusterId : ClusterId) =
      interface ICloudResultAggregatorFactory with
          member x.CreateResultAggregator(_aggregatorId : string, capacity: int): Async<ICloudResultAggregator<'T>> = async {
              let partitionKey = guid()
              let guard = new IndexedReferenceEntity(partitionKey, IndexedReferenceEntity.DefaultRangeKey, null, null, counter = 0)
              do! Table.put clusterId.S3Account clusterId.RuntimeTable guard
              return new ResultAggregator<'T>(clusterId, partitionKey, capacity) :> ICloudResultAggregator<'T>
          }
      
      static member Create(clusterId : ClusterId) = new DynamoDBResultAggregatorFactory(clusterId)
negative.code: open MBrace.AWS.Runtime.Utilities
  open MBrace.AWS
  
  open FSharp.DynamoDB
  
   [<AutoOpen>]
   module private ResultAggregatorImpl =
  
      [<ConstantRangeKey("RangeKey", "ResultAggregator")>]
      type ResultAggregatorEntry =
          {
              [<HashKey; CustomName("HashKey")>]
              Id : string
  
              Capacity : int
  
              AggregatedUris : Map<string, string>
          }
  
      let template = RecordTemplate.Define<ResultAggregatorEntry>()
  
      let entryNotExists = 
          <@ fun id r -> r.AggregatedUris |> Map.containsKey id |> not @>
          |> template.PrecomputeConditionalExpr
  
      let addEntry =
          <@ fun id path r -> { r with AggregatedUris = r.AggregatedUris |> Map.add id path } @>
          |> template.PrecomputeUpdateExpr
  
  [<DataContract; Sealed>]
  type ResultAggregator<'T> internal (clusterId : ClusterId, hashKey : string, size : int) =
      let [<DataMember(Name = "ClusterId")>] clusterId = clusterId
      let [<DataMember(Name = "HashKey")>] partitionKey = hashKey
      let [<DataMember(Name = "Size")>] size = size
  
      let getTable() = clusterId.GetRuntimeTable<ResultAggregatorEntry>()
  
      member this.UUID = hashKey
  
  