Exemplo n.º 1
0
 public Integer call() throws Exception {
   _barrier.await();
   int count = 0;
   for (TestKey item : _items) {
     if (_map.contains(item._id)) {
       System.err.printf("COLLISION DETECTED: %s exists\n", item.toString());
     }
     final TestKey exists = _map.putIfAbsent(item._id, item);
     if (exists == null) {
       count++;
     } else {
       System.err.printf(
           "COLLISION DETECTED: %s exists as %s\n", item.toString(), exists.toString());
     }
   }
   return count;
 }
Exemplo n.º 2
0
 @Override
 public int hashCode() {
   int hash = iData + (int) lData + key.hashCode();
   if (sData != null) {
     for (int i = 0; i < sData.length; i++) {
       hash += sData.hashCode();
     }
   }
   return hash;
 }
Exemplo n.º 3
0
 public void write(RepositoryDataOutput out) throws IOException {
   key.write(out);
   if (sData == null) {
     out.writeInt(-1);
   } else {
     out.writeInt(sData.length);
     for (int i = 0; i < sData.length; i++) {
       out.writeUTF(sData[i]);
     }
   }
   out.writeInt(iData);
   out.writeLong(lData);
 }