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); }
public async Task <ShardingInfo> GetLatestShardingInfo(string vertexName) { ShardingInfo result = new ShardingInfo(); //if (await this.ExistsShardedVertex(vertexName)) //{ return result; } var entry = await _shardedVertexInfoProvider.GetLatestEntryForVertex(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); }
public virtual void UpdateShardingInfo(ShardingInfo shardingInfo) { }
public abstract void Initialize(int shardId, ShardingInfo shardingInfo, object vertexParameter);
public virtual void UpdateShardingInfo(string otherVertex, ShardingInfo shardingInfo) { }
public abstract Task InitializeAsync(int shardId, ShardingInfo shardingInfo, object vertexParameter);