Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnavailableException"/> class.
 /// </summary>
 /// <param name="protocolVersion">The CQL binary protocol version in use.</param>
 /// <param name="message">The message.</param>
 /// <param name="cqlConsistency">The CQL consistency.</param>
 /// <param name="required">The required.</param>
 /// <param name="alive">The alive.</param>
 /// <param name="tracingId">The tracing identifier.</param>
 internal UnavailableException(byte protocolVersion, string message, CqlConsistency cqlConsistency, int required, int alive, Guid? tracingId)
     : base(protocolVersion, Protocol.ErrorCode.Unavailable, message, tracingId)
 {
     CqlConsistency = cqlConsistency;
     Required = required;
     Alive = alive;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TimeOutException"/> class.
 /// </summary>
 /// <param name="protocolVersion">The CQL binary protocol version in use.</param>
 /// <param name="code">The error code.</param>
 /// <param name="message">The message.</param>
 /// <param name="cqlConsistency">The CQL consistency.</param>
 /// <param name="received">The number of nodes of which a response is received.</param>
 /// <param name="blockFor">The number of nodes the query was waiting for.</param>
 /// <param name="tracingId">The tracing identifier.</param>
 protected TimeOutException(byte protocolVersion, ErrorCode code, string message, CqlConsistency cqlConsistency, int received, int blockFor, Guid? tracingId)
     : base(protocolVersion, code, message, tracingId)
 {
     CqlConsistency = cqlConsistency;
     Received = received;
     BlockFor = blockFor;
 }
Example #3
0
 public UnavailableException(string message, CqlConsistency cqlConsistency, int required, int alive)
     : base(ErrorCode.Unavailable, message)
 {
     CqlConsistency = cqlConsistency;
     Required       = required;
     Alive          = alive;
 }
 public UnavailableException(string message, CqlConsistency cqlConsistency, int required, int alive)
     : base(ErrorCode.Unavailable, message)
 {
     CqlConsistency = cqlConsistency;
     Required = required;
     Alive = alive;
 }
Example #5
0
 protected TimeOutException(ErrorCode code, string message, CqlConsistency cqlConsistency, int received,
                            int blockFor)
     : base(code, message)
 {
     CqlConsistency = cqlConsistency;
     Received = received;
     BlockFor = blockFor;
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CqlBatchTransaction" /> class.
 /// </summary>
 /// <param name="connection"> The connection. </param>
 /// <param name="batchType"> Type of the batch. </param>
 /// <param name="consistency"> The consistency. </param>
 public CqlBatchTransaction(CqlConnection connection, CqlBatchType batchType = CqlBatchType.Logged,
                            CqlConsistency consistency = CqlConsistency.One)
 {
     _batchCommand = new CqlCommand(connection) {Consistency = consistency, Transaction = this};
     _commands = new List<BatchFrame.BatchedCommand>();
     _batchType = batchType;
     _state = TransactionState.Pending;
 }
Example #7
0
 protected TimeOutException(ErrorCode code, string message, CqlConsistency cqlConsistency, int received,
                            int blockFor)
     : base(code, message)
 {
     CqlConsistency = cqlConsistency;
     Received       = received;
     BlockFor       = blockFor;
 }
 public ProjectionExpression(SelectStatementExpression @select, Expression projection, LambdaExpression aggregator, bool canTrackChanges, CqlConsistency? consistency, int? pageSize)
 {
     _select = @select;
     _projection = projection;
     _canTrackChanges = canTrackChanges;
     _consistency = consistency;
     _pageSize = pageSize;
     _aggregator = aggregator;
 }
Example #9
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="CqlCommand" /> class.
 /// </summary>
 /// <param name="connection"> The connection. </param>
 /// <param name="cql"> The CQL. </param>
 /// <param name="level"> The level. </param>
 public CqlCommand(CqlConnection connection, string cql, CqlConsistency level)
 {
     _connection  = connection;
     _cql         = cql;
     _level       = level;
     _prepared    = false;
     Load         = 1;
     UseBuffering = connection.Config.UseBuffering;
 }
Example #10
0
        public QueryFrame(string cql, CqlConsistency cqlConsistency)
        {
            Cql = cql;
            CqlConsistency = cqlConsistency;

            Version = FrameVersion.Request | FrameVersion.ProtocolVersion;
            Flags = FrameFlags.None;
            Stream = 0;
            OpCode = FrameOpcode.Query;
        }
Example #11
0
        public QueryFrame(string cql, CqlConsistency cqlConsistency)
        {
            Cql            = cql;
            CqlConsistency = cqlConsistency;

            Version = FrameVersion.Request | FrameVersion.ProtocolVersion;
            Flags   = FrameFlags.None;
            Stream  = 0;
            OpCode  = FrameOpcode.Query;
        }
Example #12
0
        public ExecuteFrame(byte[] queryId, CqlConsistency cqlConsistency, params byte[][] prms)
        {
            QueryId        = queryId;
            CqlConsistency = cqlConsistency;
            Parameters     = prms;

            Version = FrameVersion.Request | FrameVersion.ProtocolVersion;
            Flags   = FrameFlags.None;
            Stream  = 0;
            OpCode  = FrameOpcode.Execute;
        }
Example #13
0
        public ExecuteFrame(byte[] queryId, CqlConsistency cqlConsistency, params byte[][] prms)
        {
            QueryId = queryId;
            CqlConsistency = cqlConsistency;
            Parameters = prms;

            Version = FrameVersion.Request | FrameVersion.ProtocolVersion;
            Flags = FrameFlags.None;
            Stream = 0;
            OpCode = FrameOpcode.Execute;
        }
Example #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BatchFrame" /> class.
        /// </summary>
        public BatchFrame(CqlBatchType batchType, CqlConsistency consistency)
        {
            IsRequest = true;
            Flags = FrameFlags.None;
            Stream = 0;
            OpCode = FrameOpcode.Batch;

            Type = batchType;
            CqlConsistency = consistency;
            Commands = new List<BatchedCommand>();
        }
Example #15
0
        public ExecuteFrame(byte[] queryId, CqlConsistency cqlConsistency, byte[][] parameters)
        {
            QueryId = queryId;
            CqlConsistency = cqlConsistency;
            Parameters = parameters;
            SkipMetaData = true;

            IsRequest = true;
            Flags = FrameFlags.None;
            Stream = 0;
            OpCode = FrameOpcode.Execute;
        }
Example #16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueryFrame" /> class.
        /// </summary>
        /// <param name="cql"> The CQL. </param>
        /// <param name="cqlConsistency"> The CQL consistency. </param>
        /// <param name="parameters"> The parameters. </param>
        public QueryFrame(string cql, CqlConsistency cqlConsistency, byte[][] parameters)
        {
            Cql = cql;
            CqlConsistency = cqlConsistency;

            IsRequest = true;
            Flags = FrameFlags.None;
            Stream = 0;
            OpCode = FrameOpcode.Query;

            Parameters = parameters;
        }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WriteTimeOutException" /> class.
 /// </summary>
 /// <param name="protocolVersion">The CQL binary protocol version in use.</param>
 /// <param name="message">The message.</param>
 /// <param name="cqlConsistency">The CQL consistency.</param>
 /// <param name="received">The number of nodes of which a response is received.</param>
 /// <param name="blockFor">The number of nodes the query was waiting for.</param>
 /// <param name="writeType">Type of the write.</param>
 /// <param name="tracingId">The tracing identifier.</param>
 internal WriteTimeOutException(byte protocolVersion, string message, CqlConsistency cqlConsistency, int received, int blockFor, string writeType, Guid? tracingId)
     : base(protocolVersion, Protocol.ErrorCode.WriteTimeout, message, cqlConsistency, received, blockFor, tracingId)
 {
     WriteType = writeType;
 }
Example #18
0
 public ReadTimeOutException(string message, CqlConsistency cqlConsistency, int received, int blockFor,
                             bool dataPresent)
     : base(ErrorCode.ReadTimeout, message, cqlConsistency, received, blockFor)
 {
     DataPresent = dataPresent;
 }
 public WriteTimeOutException(string message, CqlConsistency cqlConsistency, int received, int blockFor,
                              string writeType)
     : base(ErrorCode.WriteTimeout, message, cqlConsistency, received, blockFor)
 {
     WriteType = writeType;
 }
Example #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReadTimeOutException"/> class.
 /// </summary>
 /// <param name="protocolVersion">The CQL binary protocol version in use.</param>
 /// <param name="message">The message.</param>
 /// <param name="cqlConsistency">The CQL consistency.</param>
 /// <param name="received">The number of nodes of which a response is received.</param>
 /// <param name="blockFor">The number of nodes the query was waiting for.</param>
 /// <param name="dataPresent">signal that some data was present</param>
 /// <param name="tracingId">The tracing identifier.</param>
 internal ReadTimeOutException(byte protocolVersion, string message, CqlConsistency cqlConsistency, int received, int blockFor, bool dataPresent, Guid? tracingId)
     : base(protocolVersion, Protocol.ErrorCode.ReadTimeout, message, cqlConsistency, received, blockFor, tracingId)
 {
     DataPresent = dataPresent;
 }
 public WriteTimeOutException(string message, CqlConsistency cqlConsistency, int received, int blockFor,
                              string writeType)
     : base(ErrorCode.WriteTimeout, message, cqlConsistency, received, blockFor)
 {
     WriteType = writeType;
 }
Example #22
0
 /// <summary>
 /// Writes the consistency.
 /// </summary>
 /// <param name="stream"> The stream. </param>
 /// <param name="consistency"> The consistency. </param>
 public static void WriteConsistency(this Stream stream, CqlConsistency consistency)
 {
     stream.WriteShort((ushort)consistency);
 }
 public ReadTimeOutException(string message, CqlConsistency cqlConsistency, int received, int blockFor,
                             bool dataPresent)
     : base(ErrorCode.ReadTimeout, message, cqlConsistency, received, blockFor)
 {
     DataPresent = dataPresent;
 }