private Map < String , ByteBuffer > tupleToKeyMap ( Tuple t ) throws IOException { Map < String , ByteBuffer > keys = new HashMap < String , ByteBuffer > ( ) ; for ( int i = 0 ; i < t . size ( ) ; i ++ ) { if ( t . getType ( i ) == DataType . TUPLE ) { Tuple inner = ( Tuple ) t . get ( i ) ; if ( inner . size ( ) == 2 ) { Object name = inner . get ( 0 ) ; if ( name != null ) { keys . put ( name . toString ( ) , objToBB ( inner . get ( 1 ) ) ) ; } else throw new IOException ( "Key name was empty" ) ; } else throw new IOException ( "Keys were not in name and value pairs" ) ; } else { throw new IOException ( "keys was not a tuple" ) ; } } return keys ; }
convert key tuple to key map