예제 #1
0
    private Timestamps(@Nullable DataInputStream stream) throws IOException {
      if (stream != null) {
        try {

          long dominatingIndexStamp = DataInputOutputUtil.readTIME(stream);
          while (stream.available() > 0) {
            ID<?, ?> id = ID.findById(DataInputOutputUtil.readINT(stream));
            if (id != null) {
              long stamp = IndexInfrastructure.getIndexCreationStamp(id);
              if (myIndexStamps == null) myIndexStamps = new TObjectLongHashMap<ID<?, ?>>(5, 0.98f);
              if (stamp <= dominatingIndexStamp) myIndexStamps.put(id, stamp);
            }
          }
        } finally {
          stream.close();
        }
      }
    }
예제 #2
0
 public Timestamps(@Nullable DataInputStream stream) throws IOException {
   if (stream != null) {
     try {
       int count = DataInputOutputUtil.readINT(stream);
       if (count > 0) {
         myIndexStamps = new TObjectLongHashMap<ID<?, ?>>(20);
         for (int i = 0; i < count; i++) {
           ID<?, ?> id = ID.findById(DataInputOutputUtil.readINT(stream));
           long timestamp = DataInputOutputUtil.readTIME(stream);
           if (id != null) {
             myIndexStamps.put(id, timestamp);
           }
         }
       }
     } finally {
       stream.close();
     }
   }
 }