public void ensureIndex(String idxName,QueryIndexType idxType){
  QueryIndex idx=idxs.get(idxName);
  if (idx == null) {
    idx=new QueryIndex();
    idx.setName(idxName);
    idx.setIndexType(idxType);
    idxs.put(idxName,idx);
  }
 else   throw new IllegalArgumentException("An index with the same name and of a different type already exists " + "[idxName=" + idxName + ", existingIdxType="+ idx.getIndexType()+ ", newIdxType="+ idxType+ ']');
}

public void ensureIndex ( String idxName , QueryIndexType idxType ) { QueryIndex idx = idxs . get ( idxName ) ; if ( idx == null ) { idx = new QueryIndex ( ) ; idx . setName ( idxName ) ; idx . setIndexType ( idxType ) ; idxs . put ( idxName , idx ) ; } else throw new IllegalArgumentException ( "An index with the same name and of a different type already exists " + "[idxName=" + idxName + ", existingIdxType=" + idx . getIndexType ( ) + ", newIdxType=" + idxType + ']' ) ; }
ensures that index with the given name exists .
