public static Map < Integer , byte [ ] > getBinaryPartitionKeys ( TheHashinator hashinator ) { Map < Integer , byte [ ] > partitionMap = new HashMap <> ( ) ; VoltTable partitionKeys = null ; if ( hashinator == null ) { partitionKeys = TheHashinator . getPartitionKeys ( VoltType . VARBINARY ) ; } else { partitionKeys = TheHashinator . getPartitionKeys ( hashinator , VoltType . VARBINARY ) ; } if ( partitionKeys == null ) { return null ; } else { // This is a shared resource so make a copy of the table to protect the cache copy in TheHashinator ByteBuffer buf = ByteBuffer . allocate ( partitionKeys . getSerializedSize ( ) ) ; partitionKeys . flattenToBuffer ( buf ) ; buf . flip ( ) ; VoltTable keyCopy = PrivateVoltTableFactory . createVoltTableFromSharedBuffer ( buf ) ; while ( keyCopy . advanceRow ( ) ) { partitionMap . put ( ( int ) keyCopy . getLong ( 0 ) , keyCopy . getVarbinary ( 1 ) ) ; } } return partitionMap ; }
Get VARBINARY partition keys for the specified topology .