class VersionedSchemaSet {

  void updateMd5Index(VersionedSchema schema, SchemaId id)
  {
    if (_rehash)
    {
      Schema avroSchema = schema.getSchema();
      //Ensure that we include md5 of different variations of the schema
      //TODO Remove once we move the client to Relay Protocol V4
      Set<SchemaId> md5Ids = new HashSet<SchemaId>(MAX_REHASH_NUM);
      md5Ids.add(id);
      //re-parse and add md5 until md5's stop changing
      for (int i = 0, numElems = 0; i < MAX_REHASH_NUM && numElems != md5Ids.size(); ++i)
      {
        _log.info("Registering md5 " +  id + " --> name=" + schema.getSchemaBaseName() + " version=" + schema.getVersion());
        _idToSchema.put(id, schema);
        numElems = md5Ids.size();
        avroSchema = Schema.parse(avroSchema.toString());
        id = SchemaId.createWithMd5(avroSchema);
        md5Ids.add(id);
      }
    }
    else
    {
      _log.info("Registering md5 " +  id + " --> name=" + schema.getSchemaBaseName() + " version=" + schema.getVersion());
      _idToSchema.put(id, schema);
    }
  }

  public  VersionedSchemaSet();
  public  VersionedSchemaSet(boolean rehash);

}