The old way trims the invalid targets, shrinks the array ( by using a tmp ArrayList).
In the patch, I want to replace the invalid targets, or EMPTY targets with null, but don't shrinks the array. (So trimmedStorages is not a proper name here?)
Short story, they are for striped block.
Long story, UC.replicas are sorted in the order of block index, so as the newTargets sent by Client/DN. So we don't have to extend updatePipeline(..) or commitBlockSynchronization(..) protocol to send indices. A missing block is null in the newTargets slot, in this way we know its index.
A little awkward here...hmm...Thanks for deeply looking. Maybe it's inappropriate to keep the changes here, and I should keep the changes in
HDFS-9173, how do you think?