Class Moped::Operation::Read
In: lib/moped/operation/read.rb
Parent: Object

Represents a read from the database that is executed on a specific node determined by a read preference.

@since 2.0.0

Methods

execute   new  

Attributes

database  [R]  @!attribute database
  @return [ String ] The database the read is from.

@!attribute operation

  @return [ Protocol::Query, Protocol::GetMore, Protocol::Command ]
    The read operation.
operation  [R]  @!attribute database
  @return [ String ] The database the read is from.

@!attribute operation

  @return [ Protocol::Query, Protocol::GetMore, Protocol::Command ]
    The read operation.

Public Class methods

Instantiate the read operation.

@example Instantiate the read.

  Read.new(get_more)

@param [ Protocol::Query, Protocol::GetMore, Protocol::Command ] operation

  The read operation.

@since 2.0.0

Public Instance methods

Execute the read operation on the provided node. If the query failed, we will check if the failure was due to authorization and attempt the operation again. This could sometimes happen in the case of a step down or reconfiguration on the server side.

@example Execute the operation.

  read.execute(node)

@param [ Node ] node The node to execute the read on.

@raise [ Failure ] If the read operation failed.

@return [ Protocol::Reply ] The reply from the database.

@since 2.0.0

[Validate]