public IEnumerable<IEnumerable<IClusterNode>> AssignPartitions(AffinityFunctionContext context)
 {
     return Enumerable.Range(0, Partitions).Select(x => context.CurrentTopologySnapshot);
 }
            public override IEnumerable<IEnumerable<IClusterNode>> AssignPartitions(AffinityFunctionContext context)
            {
                var baseRes = base.AssignPartitions(context).ToList();  // test base call

                Assert.AreEqual(Partitions, baseRes.Count);

                return baseRes;
            }
        /// <summary>
        /// Gets affinity nodes for a partition. In case of replicated cache, all returned
        /// nodes are updated in the same manner. In case of partitioned cache, the returned
        /// list should contain only the primary and back up nodes with primary node being
        /// always first.
        /// <pare />
        /// Note that partitioned affinity must obey the following contract: given that node
        /// <code>N</code> is primary for some key <code>K</code>, if any other node(s) leave
        /// grid and no node joins grid, node <code>N</code> will remain primary for key <code>K</code>.
        /// </summary>
        /// <param name="context">The affinity function context.</param>
        /// <returns>
        /// A collection of partitions, where each partition is a collection of nodes,
        /// where first node is a primary node, and other nodes are backup nodes.
        /// </returns>
        public virtual IEnumerable<IEnumerable<IClusterNode>> AssignPartitions(AffinityFunctionContext context)
        {
            ThrowIfUninitialized();

            return _baseFunction.AssignPartitions(context);
        }
示例#4
0
        /// <summary>
        /// Gets affinity nodes for a partition. In case of replicated cache, all returned
        /// nodes are updated in the same manner. In case of partitioned cache, the returned
        /// list should contain only the primary and back up nodes with primary node being
        /// always first.
        /// <pare />
        /// Note that partitioned affinity must obey the following contract: given that node
        /// <code>N</code> is primary for some key <code>K</code>, if any other node(s) leave
        /// grid and no node joins grid, node <code>N</code> will remain primary for key <code>K</code>.
        /// </summary>
        /// <param name="context">The affinity function context.</param>
        /// <returns>
        /// A collection of partitions, where each partition is a collection of nodes,
        /// where first node is a primary node, and other nodes are backup nodes.
        /// </returns>
        public virtual IEnumerable <IEnumerable <IClusterNode> > AssignPartitions(AffinityFunctionContext context)
        {
            ThrowIfUninitialized();

            return(_baseFunction.AssignPartitions(context));
        }
示例#5
0
 /// <summary>
 /// Gets affinity nodes for a partition. In case of replicated cache, all returned
 /// nodes are updated in the same manner. In case of partitioned cache, the returned
 /// list should contain only the primary and back up nodes with primary node being
 /// always first.
 /// <pare />
 /// Note that partitioned affinity must obey the following contract: given that node
 /// <code>N</code> is primary for some key <code>K</code>, if any other node(s) leave
 /// grid and no node joins grid, node <code>N</code> will remain primary for key <code>K</code>.
 /// </summary>
 /// <param name="context">The affinity function context.</param>
 /// <returns>
 /// A collection of partitions, where each partition is a collection of nodes,
 /// where first node is a primary node, and other nodes are backup nodes.
 /// </returns>
 public IEnumerable<IEnumerable<IClusterNode>> AssignPartitions(AffinityFunctionContext context)
 {
     throw GetDirectUsageError();
 }
示例#6
0
            public IEnumerable<IEnumerable<IClusterNode>> AssignPartitions(AffinityFunctionContext context)
            {
                Assert.IsNotNull(_ignite);

                Contexts.Add(context);

                // All partitions are the same
                return Enumerable.Range(0, Partitions).Select(x => context.CurrentTopologySnapshot);
            }
示例#7
0
            public override IEnumerable<IEnumerable<IClusterNode>> AssignPartitions(AffinityFunctionContext context)
            {
                var res = base.AssignPartitions(context).Reverse();

                Interlocked.Increment(ref AssignCount);

                return res;
            }
示例#8
0
 /// <summary>
 /// Gets affinity nodes for a partition. In case of replicated cache, all returned
 /// nodes are updated in the same manner. In case of partitioned cache, the returned
 /// list should contain only the primary and back up nodes with primary node being
 /// always first.
 /// <pare />
 /// Note that partitioned affinity must obey the following contract: given that node
 /// <code>N</code> is primary for some key <code>K</code>, if any other node(s) leave
 /// grid and no node joins grid, node <code>N</code> will remain primary for key <code>K</code>.
 /// </summary>
 /// <param name="context">The affinity function context.</param>
 /// <returns>
 /// A collection of partitions, where each partition is a collection of nodes,
 /// where first node is a primary node, and other nodes are backup nodes.
 /// </returns>
 public IEnumerable <IEnumerable <IClusterNode> > AssignPartitions(AffinityFunctionContext context)
 {
     throw GetDirectUsageError();
 }
 /** <inheritdoc /> */
 public IEnumerable<IEnumerable<IClusterNode>> AssignPartitions(AffinityFunctionContext context)
 {
     return DoInOp((int) Op.AssignPartitions, s => AffinityFunctionSerializer.ReadPartitions(s, Marshaller));
 }