I do not see how we can avoid iteration in a general case because cache can have more than one backup. But I think it makes sense to create a separate method which will not use views and will start iteration from the second element of nodes collection (which is always an ArrayList).
2015-02-07 3:36 GMT-08:00 Yakov Zhdanov <[email protected]>: > Guys, > > cctx.affinity().backups(entry.key(), > cctx.topology().topologyVersion()).contains(cctx.localNode()) > > does not seem to be fast enough. > > cctx.affinity().backups() returns F.view() over ArrayList with excluded > first element which always ends up into an iteration. > > Alex G, thoughts? > > --Yakov >
