コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: VertexBase.cs プロジェクト: nlebeck/CRA
 public virtual void UpdateShardingInfo(ShardingInfo shardingInfo)
 {
 }
コード例 #4
0
ファイル: VertexBase.cs プロジェクト: nlebeck/CRA
 public abstract void Initialize(int shardId, ShardingInfo shardingInfo, object vertexParameter);
コード例 #5
0
 public virtual void UpdateShardingInfo(string otherVertex, ShardingInfo shardingInfo)
 {
 }
コード例 #6
0
ファイル: VertexBase.cs プロジェクト: klawrawkz/CRA
 public abstract Task InitializeAsync(int shardId, ShardingInfo shardingInfo, object vertexParameter);