When you use TokenAwarePolicy it does not work as expected since Metadata.tokenMap.tokensToHosts is empty immediately after cluster connection initialized.
I found a workaround. Changed ControlConnection.refreshSchema method so that it enforces re-reading ring data, line 310:
refreshNodeListAndTokenMap(connection, cluster, true);
to
refreshNodeListAndTokenMap(connection, cluster, false);
My change leads to reading ring tokens twice during initialization. More accurate code re-factoring is required to make only one read. It seems like the problem is connected to changes in JAVA-315.
Yes, we made changes to avoid repeating the same calls at initialization time. But it appears that there is an issue: building the tokens (Metadata#rebuildTokenMap) uses the list of keyspaces (Metadata#keyspaces), but it seems like we load the keyspaces after building the tokens. That explains why it works when you force it a second time. I'm going to look at how the calls can be reordered.