Ejemplo n.º 1
0
        private PartitionStatus[] Init(Policy policy, int partitionCount, byte[] digest)
        {
            PartitionStatus[] partsAll = new PartitionStatus[partitionCount];

            for (int i = 0; i < partitionCount; i++)
            {
                partsAll[i] = new PartitionStatus(partitionBegin + i);
            }

            if (digest != null)
            {
                partsAll[0].digest = digest;
            }

            sleepBetweenRetries = policy.sleepBetweenRetries;
            socketTimeout       = policy.socketTimeout;
            totalTimeout        = policy.totalTimeout;

            if (totalTimeout > 0)
            {
                deadline = DateTime.UtcNow.AddMilliseconds(totalTimeout);

                if (socketTimeout == 0 || socketTimeout > totalTimeout)
                {
                    socketTimeout = totalTimeout;
                }
            }
            return(partsAll);
        }
Ejemplo n.º 2
0
 public void AddPartition(PartitionStatus part)
 {
     if (part.digest == null)
     {
         partsFull.Add(part);
     }
     else
     {
         partsPartial.Add(part);
     }
     partsRequested++;
 }