internal ShardingInfo GetLatestShardingInfo(string vertexName) { ShardingInfo result = new ShardingInfo(); if (ShardedVertexTable.GetEntriesForVertex(_shardedVertexTable, vertexName).Count() == 0) { return(result); } var entry = ShardedVertexTable.GetLatestEntryForVertex(_shardedVertexTable, vertexName); result.AllShards = entry.AllShards.Split(';').Select(e => Int32.Parse(e)).ToArray(); result.RemovedShards = new int[0]; if (entry.RemovedShards != "") { result.RemovedShards = entry.RemovedShards.Split(';').Select(e => Int32.Parse(e)).ToArray(); } result.AddedShards = new int[0]; if (entry.AddedShards != "") { result.AddedShards = entry.AddedShards.Split(';').Select(e => Int32.Parse(e)).ToArray(); } result.ShardLocator = entry.GetShardLocatorExpr(); return(result); }
internal void DeleteShardedVertex(string vertexName) { _vertexTableManager.DeleteShardedVertex(vertexName); foreach (var entry in ShardedVertexTable.GetEntriesForVertex(_shardedVertexTable, vertexName)) { TableOperation deleteOperation = TableOperation.Delete(entry); _shardedVertexTable.ExecuteAsync(deleteOperation).Wait(); } }