Ejemplo n.º 1
0
 internal static DataObjectReplica FromString(string partitionId, string objectId, string value, bool isMasterReplica)
 {
     return(new DataObjectReplica
     {
         Object = DataObjectBuilder.FromString(partitionId, objectId, value),
         IsMasterReplica = isMasterReplica
     });
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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)
            });
        }