The New York City mayor is rewriting the rules of ethnic politics in the nation’s largest city.