private DataManagerClient GetDM(DMLocation location) { //TODO: lookup client in dictionary //return _dmClientLookup[location]; DataManagerClient client = new DataManagerClient("Endpoint1", "localhost:5432"); return client; }
private DataManagerClient GetDM(DMLocation location) { //TODO: lookup client in dictionary //return _dmClientLookup[location]; DataManagerClient client = new DataManagerClient("Endpoint1", "localhost:5432"); return(client); }
static void Main(string[] args) { DataManager dm = new DataManager(11000); dm.Start(); dm.GetLocation(); DMLocation dmLocation = new DMLocation("127.0.0.1:11000");//(@"db://[fe80::a91e:3a94:e27a:9035%13]:11000"); ObjectLocation objectLocation0 = new ObjectLocation(ObjectType.FileWithHeader, @"C:\DB\arrayName.db", 0); ObjectLocation objectLocation1 = new ObjectLocation(ObjectType.FileWithHeader, @"C:\DB\arrayName.db", 1); DataLocation dataLocation0 = new DataLocation(dmLocation, objectLocation0); DataLocation dataLocation1 = new DataLocation(dmLocation, objectLocation1); //First transaction Transaction t = new Transaction(); t.Begin(); t.Write(dataLocation0, 42); t.Write(dataLocation1, 77); Console.WriteLine("Read: " + t.Read(dataLocation0)); Console.WriteLine("Read: " + t.Read(dataLocation1)); //Second transaction Transaction t2 = new Transaction(); t2.Begin(); t2.Write(dataLocation1, 99); Console.WriteLine("Read: " + t2.Read(dataLocation1)); t.End(); t2.End(); dm.Stop(); Console.WriteLine("Press Enter...."); Console.ReadLine(); }
public void Restart(DMLocation dmLocation) { _communicator.Restart(dmLocation); }
public Vote EndStagingPhase(DMLocation dmLocation) { return(_communicator.EndStagingPhase(dmLocation)); }
public void Restart(DMLocation dmLocation) { GetDM(dmLocation).Restart(); }
public void End(DMLocation dmLocation) { GetDM(dmLocation).End(); }
private DataManagerClient GetDM(DMLocation location) { DataManagerClient client = _dmClientLookup[location]; return(client); }
public void End(DMLocation dmLocation) { _communicator.End(dmLocation); }
public void Begin(DMLocation dmLocation) { _communicator.Begin(dmLocation); }
public DataManagerClient(DMLocation dmLocation) { _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _socket.Connect(dmLocation.URI.Host, dmLocation.URI.Port); }
public void Abort(DMLocation dmLocation) { GetDM(dmLocation).Abort(); }
public void Abort(DMLocation dmLocation) { _communicator.Abort(dmLocation); }
public void Begin(DMLocation dmLocation) { GetDM(dmLocation).Begin(); }
public Vote EndStagingPhase(DMLocation dmLocation) { return(GetDM(dmLocation).EndStagingPhase()); }
public Vote EndStagingPhase(DMLocation dmLocation) { return _communicator.EndStagingPhase(dmLocation); }
private void AssertDMLocationIsMe(DMLocation dmLocation) { //TODO: assert yourself! }