internal static DataObjectReplica FromString(string partitionId, string objectId, string value, bool isMasterReplica) { return(new DataObjectReplica { Object = DataObjectBuilder.FromString(partitionId, objectId, value), IsMasterReplica = isMasterReplica }); }
private GStoreListServerReply ExecuteListServer() { Console.WriteLine($"ListServer request"); ICollection <GStoreObject> gStoreObjects = gStore.ReadAll(); GStoreListServerReply reply = new GStoreListServerReply(); foreach (GStoreObject gStoreObject in gStoreObjects) { reply.Objects.Add(DataObjectBuilder.FromString(gStoreObject.Identifier.PartitionId, gStoreObject.Identifier.ObjectId, gStoreObject.Value)); } return(reply); }
private GStoreReadReply ExecuteRead(GStoreReadRequest request) { Console.WriteLine($"Read request -> PartitionId: {request.ObjectIdentifier.PartitionId} ObjectId: {request.ObjectIdentifier.ObjectId}"); GStoreObjectIdentifier gStoreObjectIdentifier = new GStoreObjectIdentifier(request.ObjectIdentifier.PartitionId, request.ObjectIdentifier.ObjectId); string value = gStore.Read(gStoreObjectIdentifier); if (value == null) { value = "N/A"; } return(new GStoreReadReply { Object = DataObjectBuilder.FromObjectIdentifier(request.ObjectIdentifier, value) }); }