/// <summary> /// Connect a set of vertices in one sharded CRA vertex to another with a full mesh topology, via pre-defined endpoints. We contact the "from" vertex /// to initiate the creation of the link. /// </summary> /// <param name="fromVertexName"></param> /// <param name="fromEndpoints"></param> /// <param name="toVertexName"></param> /// <param name="toEndpoints"></param> /// <returns></returns> public CRAErrorCode ConnectShardedVerticesWithFullMesh(string fromVertexName, string[] fromEndpoints, string toVertexName, string[] toEndpoints) { var fromVerticesRows = VertexTable.GetRowsForShardedVertex(_vertexTable, fromVertexName); string[] fromVerticesNames = new string[fromVerticesRows.Count()]; int i = 0; foreach (var fromVertexRow in fromVerticesRows) { fromVerticesNames[i] = fromVertexRow.VertexName; i++; } var toVerticesRows = VertexTable.GetRowsForShardedVertex(_vertexTable, toVertexName); string[] toVerticesNames = new string[toVerticesRows.Count()]; i = 0; foreach (var toVertexRow in toVerticesRows) { toVerticesNames[i] = toVertexRow.VertexName; i++; } return(ConnectShardedVerticesWithFullMesh(fromVerticesNames, fromEndpoints, toVerticesNames, toEndpoints, ConnectionInitiator.FromSide)); }
/// <summary> /// Disconnect a set of vertices in one sharded CRA vertex from another, via pre-defined endpoints. /// </summary> /// <param name="fromVertexName"></param> /// <param name="fromEndpoints"></param> /// <param name="toVertexName"></param> /// <param name="toEndpoints"></param> /// <returns></returns> public void DisconnectShardedVertices(string fromVertexName, string[] fromEndpoints, string toVertexName, string[] toEndpoints) { var fromVerticesRows = VertexTable.GetRowsForShardedVertex(_vertexTable, fromVertexName); string[] fromVerticesNames = new string[fromVerticesRows.Count()]; int i = 0; foreach (var fromVertexRow in fromVerticesRows) { fromVerticesNames[i] = fromVertexRow.VertexName; i++; } var toVerticesRows = VertexTable.GetRowsForShardedVertex(_vertexTable, toVertexName); string[] toVerticesNames = new string[toVerticesRows.Count()]; i = 0; foreach (var toVertexRow in toVerticesRows) { toVerticesNames[i] = toVertexRow.VertexName; i++; } DisconnectShardedVertices(fromVerticesNames, fromEndpoints, toVerticesNames, toEndpoints); }
internal void DeleteShardedVertex(string vertexName) { foreach (var row in VertexTable.GetRowsForShardedVertex(_vertexTable, vertexName)) { TableOperation deleteOperation = TableOperation.Delete(row); _vertexTable.ExecuteAsync(deleteOperation).Wait(); } }