Some updates to data affinity doc

- Example code updated.

Thanks :)