hollow/src/main/java/com/netflix/hollow/core/index/HollowPrimaryKeyIndex.java
public int getMatchingOrdinal(Object key) {
        PrimaryKeyIndexHashTable hashTable = hashTableVolatile;
        if(fieldPathIndexes.length != 1 || hashTable.bitsPerElement == 0)
            return -1;

        int hashCode = keyHashCode(key, 0);

        int ordinal = -1;

        do {
            hashTable = this.hashTableVolatile;
            int bucket = hashCode & hashTable.hashMask;
            ordinal = readOrdinal(hashTable, bucket);
            while(ordinal != -1) {
                if(keyDeriver.keyMatches(key, ordinal, 0))
                    break;

                bucket++;
                bucket &= hashTable.hashMask;
                ordinal = readOrdinal(hashTable, bucket);
            }
        } while(hashTableVolatile != hashTable);

        return ordinal;
    }
public int getMatchingOrdinal(Object key) {
        PrimaryKeyIndexHashTable hashTable = hashTableVolatile;
        if(fieldPathIndexes.length != 1 || hashTable.bitsPerElement == 0)
            return -1;

        int hashCode = keyHashCode(key, 0);

        int ordinal = -1;

        do {
            hashTable = this.hashTableVolatile;
            int bucket = hashCode & hashTable.hashMask;
            ordinal = readOrdinal(hashTable, bucket);
            while(ordinal != -1) {
                if(keyDeriver.keyMatches(key, ordinal, 0))
                    break;

                bucket++;
                bucket &= hashTable.hashMask;
                ordinal = readOrdinal(hashTable, bucket);
            }
        } while(hashTableVolatile != hashTable);

        return ordinal;
    }
public int getMatchingOrdinal ( Object key ) { PrimaryKeyIndexHashTable hashTable = hashTableVolatile ; if ( fieldPathIndexes . length != 1 || hashTable . bitsPerElement == 0 ) return - 1 ; int hashCode = keyHashCode ( key , 0 ) ; int ordinal = - 1 ; do { hashTable = this . hashTableVolatile ; int bucket = hashCode & hashTable . hashMask ; ordinal = readOrdinal ( hashTable , bucket ) ; while ( ordinal != - 1 ) { if ( keyDeriver . keyMatches ( key , ordinal , 0 ) ) break ; bucket ++ ; bucket &= hashTable . hashMask ; ordinal = readOrdinal ( hashTable , bucket ) ; } } while ( hashTableVolatile != hashTable ) ; return ordinal ; }
Query an index with a single specified field.  The returned value with be the ordinal of the matching record.
<p>
Use a generated API or the Generic Object API to use the returned ordinal.

@param key the field key
@return the matching ordinal for the key, otherwise -1 if the key is not present
Query an index with a single specified field . The returned value with be the ordinal of the matching record . <p > Use a generated API or the Generic Object API to use the returned ordinal .