private void serializeKeyAsColumn ( String fieldName , byte [ ] family , String prefix , Object fieldValue , Put put ) { // keyAsColumn mapping, so extract each value from the keyAsColumn field // using the entityComposer, serialize them, and them to the put. Map < CharSequence , Object > keyAsColumnValues = entityComposer . extractKeyAsColumnValues ( fieldName , fieldValue ) ; for ( Entry < CharSequence , Object > entry : keyAsColumnValues . entrySet ( ) ) { CharSequence qualifier = entry . getKey ( ) ; byte [ ] qualifierBytes ; byte [ ] columnKeyBytes = serializeKeyAsColumnKeyToBytes ( fieldName , qualifier ) ; if ( prefix != null ) { byte [ ] prefixBytes = prefix . getBytes ( ) ; qualifierBytes = new byte [ prefixBytes . length + columnKeyBytes . length ] ; System . arraycopy ( prefixBytes , 0 , qualifierBytes , 0 , prefixBytes . length ) ; System . arraycopy ( columnKeyBytes , 0 , qualifierBytes , prefixBytes . length , columnKeyBytes . length ) ; } else { qualifierBytes = columnKeyBytes ; } // serialize the value, and add it to the put. byte [ ] bytes = serializeKeyAsColumnValueToBytes ( fieldName , qualifier , entry . getValue ( ) ) ; put . add ( family , qualifierBytes , bytes ) ; } }
Serialize a keyAsColumn field and update the put with the serialized bytes from each subfield of the keyAsColumn value .