~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/scoreboard.cc

  • Committer: Joe Daly
  • Date: 2010-06-25 03:22:55 UTC
  • mto: This revision was merged to the branch mainline in revision 1656.
  • Revision ID: skinny.moey@gmail.com-20100625032255-bzj84xre67qldfpi
initial user stats impl

Show diffs side-by-side

added added

removed removed

Lines of Context:
202
202
  ScoreboardSlot *scoreboard_slot= scoreboard_vector->at(session_scoreboard_slot);
203
203
  return scoreboard_slot;
204
204
}
205
 
 
206
 
ScoreboardSlot* Scoreboard::findAndResetScoreboardSlot(Session *session)
207
 
{
208
 
  /* our bucket */
209
 
  uint32_t bucket_number= session->getSessionId() % number_buckets;
210
 
 
211
 
  /* our vector corresponding to bucket_number */
212
 
  vector<ScoreboardSlot* > *scoreboard_vector= vector_of_scoreboard_vectors.at(bucket_number);
213
 
 
214
 
  /* Check if this session has already claimed a slot */
215
 
  int32_t session_scoreboard_slot= session->getScoreboardIndex();
216
 
 
217
 
  /* Its possible if the plugin was being enabled/disabled to get this far and have -1 */
218
 
  if (session_scoreboard_slot == -1)
219
 
  {
220
 
    return NULL;
221
 
  }
222
 
 
223
 
  ScoreboardSlot *scoreboard_slot= scoreboard_vector->at(session_scoreboard_slot);
224
 
  ScoreboardSlot *return_scoreboard_slot= new ScoreboardSlot(*scoreboard_slot);
225
 
  scoreboard_slot->reset();
226
 
 
227
 
  return return_scoreboard_slot;
228
 
}