Search in sources :

Example 1 with IndexNotFoundException

use of com.torodb.core.exceptions.user.IndexNotFoundException in project torodb by torodb.

the class SqlTorodTransaction method getIndexInfo.

@Override
public IndexInfo getIndexInfo(String dbName, String colName, String idxName) throws IndexNotFoundException {
    MetaDatabase db = getInternalTransaction().getMetaSnapshot().getMetaDatabaseByName(dbName);
    if (db == null) {
        throw new IndexNotFoundException(dbName, colName, idxName);
    }
    MetaCollection col = db.getMetaCollectionByName(colName);
    if (col == null) {
        throw new IndexNotFoundException(dbName, colName, idxName);
    }
    MetaIndex idx = col.getMetaIndexByName(idxName);
    if (idx == null) {
        throw new IndexNotFoundException(dbName, colName, idxName);
    }
    return createIndexInfo(idx);
}
Also used : MetaIndex(com.torodb.core.transaction.metainf.MetaIndex) MetaDatabase(com.torodb.core.transaction.metainf.MetaDatabase) MetaCollection(com.torodb.core.transaction.metainf.MetaCollection) IndexNotFoundException(com.torodb.core.exceptions.user.IndexNotFoundException)

Aggregations

IndexNotFoundException (com.torodb.core.exceptions.user.IndexNotFoundException)1 MetaCollection (com.torodb.core.transaction.metainf.MetaCollection)1 MetaDatabase (com.torodb.core.transaction.metainf.MetaDatabase)1 MetaIndex (com.torodb.core.transaction.metainf.MetaIndex)1