It may not be safe to use LocatedBlock as a key since the object content may change from time to time. How about use String?
I may be wrong, but in your patch, are you assuming a datanode can't be in more than one pipeline simultaneously?
Well, it wasn't an intentional assumption anyway. I think you're right and I need to change the way of creating the keys of the pipelines' cache. Update is coming.