Beispiel #1
0
        /// <summary>
        /// Request topology information.
        /// </summary>
        /// <returns>Topology version with nodes identifiers.</returns>rns>
        private Tuple <long, Guid[]> RequestTopologyInformation(long oldTopVer)
        {
            Action <ClientRequestContext> writeAction = ctx =>
            {
                ctx.Stream.WriteLong(oldTopVer);
                _projection.Write(ctx.Writer);
            };

            Func <ClientResponseContext, Tuple <long, Guid[]> > readFunc = ctx =>
            {
                if (!ctx.Stream.ReadBool())
                {
                    // No topology changes.
                    return(null);
                }

                long remoteTopVer = ctx.Stream.ReadLong();
                return(Tuple.Create(remoteTopVer, ReadNodeIds(ctx.Reader)));
            };

            return(DoOutInOp(ClientOp.ClusterGroupGetNodeIds, writeAction, readFunc));
        }
Beispiel #2
0
        /// <summary>
        /// Request topology information.
        /// </summary>
        /// <returns>Topology version with nodes identifiers.</returns>rns>
        private Tuple <long, Guid[]> RequestTopologyInformation(long oldTopVer)
        {
            Action <IBinaryRawWriter> writeAction = writer =>
            {
                writer.WriteLong(oldTopVer);
                _projection.Write(writer);
            };

            Func <IBinaryRawReader, Tuple <long, Guid[]> > readFunc = reader =>
            {
                if (!reader.ReadBoolean())
                {
                    // No topology changes.
                    return(null);
                }

                long remoteTopVer = reader.ReadLong();
                return(Tuple.Create(remoteTopVer, ReadNodeIds(reader)));
            };

            return(DoOutInOp(ClientOp.ClusterGroupGetNodeIds, writeAction, readFunc));
        }