private final ClientResponseImpl dispatchLoadSinglepartitionTable ( Procedure catProc , StoredProcedureInvocation task , InvocationClientHandler handler , Connection ccxn ) { int partition = - 1 ; try { CatalogMap < Table > tables = m_catalogContext . get ( ) . database . getTables ( ) ; int partitionParamType = getLoadSinglePartitionTablePartitionParamType ( tables , task ) ; byte [ ] valueToHash = ( byte [ ] ) task . getParameterAtIndex ( 0 ) ; partition = TheHashinator . getPartitionForParameter ( partitionParamType , valueToHash ) ; } catch ( Exception e ) { authLog . warn ( e . getMessage ( ) ) ; return new ClientResponseImpl ( ClientResponseImpl . UNEXPECTED_FAILURE , new VoltTable [ 0 ] , e . getMessage ( ) , task . clientHandle ) ; } assert ( partition != - 1 ) ; createTransaction ( handler . connectionId ( ) , task , catProc . getReadonly ( ) , catProc . getSinglepartition ( ) , catProc . getEverysite ( ) , new int [ ] { partition } , task . getSerializedSize ( ) , System . nanoTime ( ) ) ; return null ; }
Coward way out of the legacy hashinator hell . LoadSinglepartitionTable gets the partitioning parameter as a byte array . Legacy hashinator hashes numbers and byte arrays differently so have to convert it back to long if it s a number . UGLY!!!