mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
Server: try downloading from all if we have a dummy object
just speeds up sync a little
This commit is contained in:
@@ -46,6 +46,8 @@ public class RemoteObjectServiceClient {
|
|||||||
ProtoSerializer<OpP, Op> opProtoSerializer;
|
ProtoSerializer<OpP, Op> opProtoSerializer;
|
||||||
@Inject
|
@Inject
|
||||||
ProtoSerializer<GetObjectReply, ReceivedObject> receivedObjectProtoSerializer;
|
ProtoSerializer<GetObjectReply, ReceivedObject> receivedObjectProtoSerializer;
|
||||||
|
@Inject
|
||||||
|
PeerManager peerManager;
|
||||||
|
|
||||||
public Pair<PeerId, ReceivedObject> getSpecificObject(JObjectKey key, PeerId peerId) {
|
public Pair<PeerId, ReceivedObject> getSpecificObject(JObjectKey key, PeerId peerId) {
|
||||||
return rpcClientFactory.withObjSyncClient(peerId, (peer, client) -> {
|
return rpcClientFactory.withObjSyncClient(peerId, (peer, client) -> {
|
||||||
@@ -63,7 +65,9 @@ public class RemoteObjectServiceClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var targetVersion = objMeta.versionSum();
|
var targetVersion = objMeta.versionSum();
|
||||||
var targets = objMeta.knownRemoteVersions().entrySet().stream()
|
var targets = objMeta.knownRemoteVersions().isEmpty()
|
||||||
|
? peerManager.getAvailableHosts()
|
||||||
|
: objMeta.knownRemoteVersions().entrySet().stream()
|
||||||
.filter(entry -> entry.getValue().equals(targetVersion))
|
.filter(entry -> entry.getValue().equals(targetVersion))
|
||||||
.map(Map.Entry::getKey).toList();
|
.map(Map.Entry::getKey).toList();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user