public IndexInfo getIndexInfoByName ( String idxName , Transaction tx ) { // Fetch from the cache IndexInfo ii = iiMapByIdxNames . get ( idxName ) ; if ( ii != null ) return ii ; // Read from the catalog files String tblName = null ; List < String > fldNames = new LinkedList < String > ( ) ; IndexType idxType = null ; // Find the index in the index catalog RecordFile rf = idxTi . open ( tx , true ) ; rf . beforeFirst ( ) ; while ( rf . next ( ) ) { if ( ( ( String ) rf . getVal ( ICAT_IDXNAME ) . asJavaVal ( ) ) . equals ( idxName ) ) { tblName = ( String ) rf . getVal ( ICAT_TBLNAME ) . asJavaVal ( ) ; int idxtypeVal = ( Integer ) rf . getVal ( ICAT_IDXTYPE ) . asJavaVal ( ) ; idxType = IndexType . fromInteger ( idxtypeVal ) ; break ; } } rf . close ( ) ; if ( tblName == null ) return null ; // Find the corresponding field names rf = keyTi . open ( tx , true ) ; rf . beforeFirst ( ) ; while ( rf . next ( ) ) { if ( ( ( String ) rf . getVal ( KCAT_IDXNAME ) . asJavaVal ( ) ) . equals ( idxName ) ) { fldNames . add ( ( String ) rf . getVal ( KCAT_KEYNAME ) . asJavaVal ( ) ) ; } } rf . close ( ) ; // Materialize IndexInfos ii = new IndexInfo ( idxName , tblName , fldNames , idxType ) ; updateCache ( ii ) ; return ii ; }
Returns the requested index info object with the given index name .