if (line.version > msg.getVersion()) {
LOG.warn("Got PUTX with version {} which is older than current version {}", msg.getVersion(), line.version);
return LINE_NO_CHANGE;
}
final TShortHashSet sharers = new TShortHashSet((msg.getSharers() != null ? msg.getSharers().length : 0) + 1);
if (msg.getSharers() != null)
sharers.addAll(msg.getSharers());
if (hasServer && msg.getNode() != Comm.SERVER)
sharers.add(Comm.SERVER); // this is so we make sure the server was notified for the ownership transfer. this is done by INV
sharers.remove(myNodeId()); // don't INV myself
int change = LINE_NO_CHANGE;
change |= line.getState().isLessThan(State.O) ? LINE_OWNER_CHANGED : 0;
change |= setState(line, sharers.isEmpty() ? State.E : State.O) ? LINE_STATE_CHANGED : 0;
if (sharers.isEmpty())
change |= setOwner(line, myNodeId()) ? LINE_OWNER_CHANGED : 0;
else
setOwner(line, msg.getNode()); // We set owner to the PREVIOUS owner - used// change |= setOwner(line, cluster.getMyNodeId()) ? LINE_OWNER_CHANGED : 0;
line.sharers.addAll(sharers);
line.version = msg.getVersion();