The Uruguayan forward is expected to be one of Europe's most highly-sought assets this summer, with Paris Saint-Germain, Real Madrid and Manchester City rumoured to be among those chasing his signature.
Meanwhile, the 51-year-old coach is considering a break from the game after four years leading Partenopei.
Hamsik, 25, said that Cavani is not being distracted by talk linking him elsewhere and will leave a decision on his future until the summer.
"I hope Mazzarri and Cavani can stay here, as they are our strength," the Slovakian told Sky Sport Italia.
"Edi is relaxed and not thinking about the transfer gossip because we still have to earn second place.
"At the end of the season he will have two months to make a decision."
Napoli are currently second in Serie A.