Example #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);
        }
Example #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);
        }
Example #3
0
 public virtual void UpdateShardingInfo(ShardingInfo shardingInfo)
 {
 }
Example #4
0
 public abstract void Initialize(int shardId, ShardingInfo shardingInfo, object vertexParameter);
Example #5
0
 public virtual void UpdateShardingInfo(string otherVertex, ShardingInfo shardingInfo)
 {
 }
Example #6
0
 public abstract Task InitializeAsync(int shardId, ShardingInfo shardingInfo, object vertexParameter);