public PadIntMetadata CreatePadInt(int uid) { if (dataServers.Count > 0) { if (metadata.ContainsKey(uid)) { return null; } List<string> servers = getServersToStore(); PadIntMetadata pmeta = new PadIntMetadata(); pmeta.uid = uid; pmeta.servers = servers; metadata.Add(uid, pmeta); foreach(string url in servers) { dataServers[url].PadintCount++; } if (servers.Count < 2) { nonReplicatedPadInts.Add(pmeta); } return pmeta; } return null; }
public PadInt CreatePadInt(int uid, PadIntMetadata metadata) { checkFreeze(); if (padInts.ContainsKey(uid)) { return null; } PadInt p = new PadInt(uid); foreach (string s in metadata.servers) { p.servers.Add(s); } padInts.Add(uid, p); log.AddNewLogEntry(0, uid, 0); Console.WriteLine("Created PadInt with uid: " + uid); return p; }