示例#1
0
 HashQueue.Request req(
     Object cookie, long deadlineIn, int duration, int bytes, HashService.Callback callback) {
   MockCachedUrlSetHasher hasher = new MockCachedUrlSetHasher();
   hasher.setNumBytes(bytes);
   cus.setContentHasher(hasher);
   //      cus.setHashDuration(duration, bytes);
   HashQueue.Request req =
       new HashQueue.Request(cus, Deadline.in(deadlineIn), callback, cookie, hasher, duration);
   return req;
 }
示例#2
0
 private long getBytesLeft(HashQueue.Request req) {
   MockCachedUrlSetHasher hasher = (MockCachedUrlSetHasher) req.urlsetHasher;
   return hasher.getBytesLeft();
 }