37 #define CANONICAL_SEQ_ID_CONSISTENCY CassConsistency::CASS_CONSISTENCY_LOCAL_QUORUM
38 #define BIOSEQ_INFO_CONSISTENCY CassConsistency::CASS_CONSISTENCY_LOCAL_QUORUM
51 accession =
query->FieldGetStrValue(0);
53 seq_id_type =
query->FieldGetInt16Value(2);
59 const string & keyspace,
60 const string & sec_seq_id,
62 bool sec_seq_id_type_provided,
67 static const string s_Select =
"SELECT accession, version, seq_id_type FROM ";
68 static const string s_Where_2 =
".SI2CSI WHERE sec_seq_id = ? AND sec_seq_id_type = ?";
69 static const string s_Where_1 =
".SI2CSI WHERE sec_seq_id = ?";
70 shared_ptr<CCassQuery>
query =
conn->NewQuery();
76 if (sec_seq_id_type_provided) {
77 sql.append(s_Where_2);
79 query->BindStr(0, sec_seq_id);
80 query->BindInt16(1, sec_seq_id_type);
82 sql.append(s_Where_1);
84 query->BindStr(0, sec_seq_id);
89 if (sec_seq_id_type_provided) {
148 const string & keyspace,
149 bool version_provided,
150 bool seq_id_type_provided,
157 shared_ptr<CCassQuery>
query =
conn->NewQuery();
159 if (version_provided && seq_id_type_provided) {
160 query->SetSQL(
"SELECT "
173 keyspace +
".BIOSEQ_INFO WHERE "
174 "accession = ? AND version = ? AND seq_id_type = ?", 3);
178 }
else if (version_provided) {
179 query->SetSQL(
"SELECT "
193 keyspace +
".BIOSEQ_INFO WHERE "
194 "accession = ? AND version = ?", 2);
198 query->SetSQL(
"SELECT "
213 keyspace +
".BIOSEQ_INFO WHERE "
222 if (version_provided && seq_id_type_provided) {
232 if (version_provided) {
234 int selected_seq_id_type = INT_MIN;
255 if (seq_id_type_provided) {
257 int selected_version = INT_MIN;
263 if (!found ||
version > selected_version) {
272 bioseq_info.
m_Version = selected_version;
282 int selected_version = INT_MIN;
283 int selected_seq_id_type = INT_MIN;
294 if (selected_seq_id_type == seq_id_type) {
297 if (
version > selected_version) {
307 bioseq_info.
m_Version = selected_version;
#define BEGIN_IDBLOB_SCOPE
const_iterator end() const
static CS_CONNECTION * conn
const string version
version string
static EIO_Status s_Select(size_t n, SSOCK_Poll polls[], const struct timeval *tv, int asis)
set< tuple< int16_t, string > > m_SeqIds