src/Cassandra/Requests/BatchRequest.cs
/// <summary>
/// Gets the timestamp of the request or null if not defined.
/// </summary>
/// <exception cref="NotSupportedException" />
Gets the timestamp of the request or null if not defined.
Gets the timestamp of the request or null if not defined .
private static long? GetRequestTimestamp(ProtocolVersion protocolVersion, BatchStatement statement,
                                                 Policies policies)
        {
            if (!protocolVersion.SupportsTimestamp())
            {
                if (statement.Timestamp != null)
                {
                    throw new NotSupportedException(
                        "Timestamp for BATCH request is supported in Cassandra 2.1 or above.");
                }
                return null;
            }
            if (statement.Timestamp != null)
            {
                return TypeSerializer.SinceUnixEpoch(statement.Timestamp.Value).Ticks / 10;
            }
            var timestamp = policies.TimestampGenerator.Next();
            return timestamp != long.MinValue ? (long?) timestamp : null;
        }
private static long ? GetRequestTimestamp ( ProtocolVersion protocolVersion , BatchStatement statement , Policies policies ) { if ( ! protocolVersion . SupportsTimestamp ( ) ) { if ( statement . Timestamp != null ) { throw new NotSupportedException ( " " ) ; } return null ; } if ( statement . Timestamp != null ) { return TypeSerializer . SinceUnixEpoch ( statement . Timestamp . Value ) . Ticks / 10 ; } var timestamp = policies . TimestampGenerator . Next ( ) ; return timestamp != long . MinValue ? ( long ? ) timestamp : null ; }
Gets the timestamp of the request or null if not defined.
Gets the timestamp of the request or null if not defined .
None
protocolVersion
ProtocolVersion
statement
BatchStatement
policies
Policies