A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/ns__group_8cpp_source.html below:

NCBI C++ ToolKit: src/app/netschedule/ns_group.cpp Source File

95  size_t

max_records)

const 106  bool

allow_exception)

const 114  "Group "

+ group +

" is unknown"

);

118  return

found->second->m_Jobs;

130  for

(en = group_ids.

first

(); en.

valid

(); ++en) {

133

jobs |= found->second->m_Jobs;

147  "Group "

+ group +

" is unknown"

);

150

bv &= found->second->m_Jobs;

162  for

(en = group_ids.

first

(); en.

valid

(); ++en) {

165

jobs_in_groups |= found->second->m_Jobs;

167

bv &= jobs_in_groups;

189  return

found->second->m_GroupId;

203  "Group with id "

+ to_string(group_id) +

" is unknown"

);

205  return

*found->second->m_GroupToken;

213  for

(list<string>::const_iterator k(tokens.begin());

214

k != tokens.end(); ++k) {

224  unsigned int

first_job_id,

227  if

(first_job_id == 0 ||

count

== 0 || group_id == 0)

234

found->second->m_Jobs.set_range(first_job_id, first_job_id +

count

- 1);

235  return

found->second->m_GroupId;

241  "Group with id "

+ to_string(group_id) +

" is unknown"

);

248  if

(job_id == 0 || group.empty())

256

found->second->m_Jobs.set_bit(job_id);

257  return

found->second->m_GroupId;

262  m_IDToAttr

[group_id]->m_Jobs.set_bit(job_id);

270  if

(group_id == 0 || job_id == 0)

277

found->second->m_Jobs.set_bit(job_id);

284  "Group with id "

+ to_string(group_id) +

" is unknown"

);

296  throw

runtime_error(

"Error while restoring jobs from the dump. " 297  "The group with id "

+ to_string(group_id) +

298  " is not found in the loaded dictionary." 299  " (Lost group dictionary dump?)"

);

300

found->second->m_Jobs.set_bit(job_id);

307  if

(group_id == 0 || job_id == 0)

314

found->second->m_Jobs.set_bit(job_id,

false

);

316  if

(found->second->CanBeDeleted())

326  const string

& scope,

336  while

(en.

valid

()) {

340  if

(batch.

count

() >= batch_size) {

346  if

(batch.

count

() > 0)

359  unsigned int

max_group_id = 0;

363  if

(candidate->first > max_group_id)

366

max_group_id = candidate->first;

368  if

(candidate->second->CanBeDeleted()) {

382  unsigned int

del_count = 0;

386  for

( ; en.

valid

(); ++en) {

387  unsigned int

group_id = *en;

395  if

(found->second->CanBeDeleted())

399  if

(del_count >= max_to_del)

409  unsigned int

still_candidate = 0;

413  for

( ; en.

valid

(); ++en) {

414  unsigned int

group_id = *en;

422  if

(found->second->CanBeDeleted())

427  return

still_candidate;

453

unique_ptr<string> new_token(

new string

(group));

456

new_attr->m_GroupToken = new_token.get();

457

new_attr->m_GroupId = group_id;

477  const string

& scope,

486  if

(batch.

get_bit

(k->first)) {

489  if

(printed >= batch.

count

())

502  const string

& scope,

513  else if

(!scope.empty()) {

521  "OK: ID: "

+ to_string(group_attr.

m_GroupId

) +

"\n"

;

528  for

( ; en.

valid

(); ++en) {

529  unsigned int

job_id = *en;

536  buffer

+=

"OK: JOBS: NONE\n"

;

539  buffer

+=

"OK: NUMBER OF JOBS: "

+ to_string(jobs.

count

()) +

"\n"

;

551  delete

to_del->second->m_GroupToken;

552  delete

to_del->second;

564  unsigned int

group_id = to_del->second->m_GroupId;

565  const string

* group_token = to_del->second->m_GroupToken;

570  delete

to_del->second;

575  ERR_POST

(

"Internal inconsistency detected. The group "

+

576

to_string(group_id) +

" exists in the id->attr container " 577  "and does not exist in the token->attr container."

);

590  const string

& qname)

const 597  if

(k->second->m_Jobs.any())

598

groups_to_dump.

set_bit

(k->first);

601  if

(!groups_to_dump.

any

())

605

FILE * grp_dict_file = fopen(grp_dict_file_name.c_str(),

"wb"

);

607  if

(grp_dict_file ==

NULL

)

608  throw

runtime_error(

"Cannot open file "

+ grp_dict_file_name +

612

setbuf(grp_dict_file,

NULL

);

614  if

(groups_to_dump.

any

()) {

618

header.

Write

(grp_dict_file);

619

}

catch

(

const

exception & ex) {

620

fclose(grp_dict_file);

621  throw

runtime_error(

"Writing error while dumping groups header: "

+

627  for

( ; en.

valid

(); ++en) {

630  const string

& token = *(grp_it->second->m_GroupToken);

635

memcpy(grp_dump.

token

, token.data(), token.size());

638

grp_dump.

Write

(grp_dict_file);

639

}

catch

(

const

exception & ex) {

640

fclose(grp_dict_file);

641  throw

runtime_error(

"Writing error while dumping groups: "

+

646

fclose(grp_dict_file);

651  const string

& qname)

const 654  if

(access(grp_dict_file_name.c_str(), F_OK) != -1)

655  remove

(grp_dict_file_name.c_str());

660  const string

& qname)

const 662  const string

fname(

"group_dict_dump."

);

663  string

upper_queue_name = qname;

665  return

dump_dir_name + fname + upper_queue_name;

677  const string

& qname)

679  if

(!

CDir

(dump_dir_name).Exists())

683  if

(!

CFile

(grp_dict_file_name).Exists())

686

FILE * grp_dict_file = fopen(grp_dict_file_name.c_str(),

"rb"

);

687  if

(grp_dict_file ==

NULL

)

688  throw

runtime_error(

"Cannot open file "

+ grp_dict_file_name +

689  " to load dumped groups"

);

692

header.

Read

(grp_dict_file);

695  while

(grp_dump.

Read

(grp_dict_file, header.

fixed_size

) == 0) {

708

}

catch

(

const

exception & ex) {

709

fclose(grp_dict_file);

711  throw

runtime_error(

"Reading error while loading dumped groups: "

+

715

fclose(grp_dict_file);

unsigned int m_LastGroupID

void RemoveJob(unsigned int group_id, unsigned int job_id)

TNSBitVector m_RegisteredGroups

string x_PrintOne(const SNSGroupJobs &group_attr, const CQueue *queue, const TNSBitVector &scope_jobs, const string &scope, bool verbose) const

CFastMutex m_LastGroupIDLock

void x_DeleteSingleInMemory(TGroupIDToAttrMap::iterator to_del)

void RemoveDump(const string &dump_dir_name, const string &queue_name) const

unsigned int CollectGarbage(unsigned int max_to_del)

unsigned int x_GetNextGroupID(void)

TNSBitVector GetRegisteredGroups(void) const

string x_PrintSelected(const TNSBitVector &batch, const CQueue *queue, const TNSBitVector &scope_jobs, const string &scope, bool verbose) const

unsigned int CheckRemoveCandidates(void)

TNSBitVector GetJobs(const string &group, bool allow_exception=true) const

unsigned int ResolveGroup(const string &group)

bool CanAccept(const string &group, size_t max_records) const

void x_InitLastGroupID(unsigned int value)

unsigned int x_CreateGroup(const string &group)

void AddJobToGroup(unsigned int group_id, unsigned int job_id)

string x_GetDumpFileName(const string &dump_dir_name, const string &qname) const

unsigned int AddJob(const string &group, unsigned int job_id)

unsigned int AddJobs(unsigned int group_id, unsigned int first_job_id, unsigned int count)

void FinalizeGroupDictionaryLoading(void)

TGroupIDToAttrMap m_IDToAttr

string Print(const CQueue *queue, const TNSBitVector &scope_jobs, const string &scope, size_t batch_size, bool verbose) const

TNSBitVector m_RemoveCandidates

void ResolveGroups(const list< string > &tokens, TNSBitVector &group_ids_vector)

TGroupTokenToAttrMap m_TokenToAttr

void RestrictByGroup(const string &group, TNSBitVector &bv) const

void Dump(const string &dump_dir_name, const string &queue_name) const

void LoadFromDump(const string &dump_dir_name, const string &queue_name)

NetSchedule internal exception.

string MakeJobKey(unsigned int job_id) const

TJobStatus GetJobStatus(unsigned job_id) const

Constant iterator designed to enumerate "ON" bits.

bool valid() const noexcept

Checks if iterator is still valid.

Bitvector Bit-vector container with runtime compression of bits.

bool get_bit(size_type n) const noexcept

returns true if bit n is set and false is bit n is 0.

bool any() const noexcept

Returns true if any bits in this bitset are set, and otherwise returns false.

bool set_bit(size_type n, bool val=true)

Sets bit n.

enumerator first() const

Returns enumerator pointing on the first non-zero bit.

void clear(const size_type *ids, size_type ids_size, bm::sort_order so=bm::BM_UNKNOWN)

clear list of bits in this bitset

size_type count() const noexcept

population count (count of ON bits)

container_type::const_iterator const_iterator

container_type::iterator iterator

const_iterator begin() const

const_iterator end() const

const_iterator find(const key_type &key) const

Include a standard set of the NCBI C++ Toolkit most basic headers.

static void DLIST_NAME() remove(DLIST_LIST_TYPE *list, DLIST_TYPE *item)

#define ERR_POST(message)

Error posting with file, line number information but without error codes.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

EJobStatus

Job status codes.

static string StatusToString(EJobStatus status)

Printable status type.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)

Get a printable version of the specified string.

static string & ToUpper(string &str)

Convert string to upper case – string& version.

@ BM_GAP

GAP compression is ON.

const GenericPointer< typename T::ValueType > T2 value

const string kNoScopeOnly

const TNSBitVector kEmptyBitVector

int Read(FILE *f, size_t fixed_size_from_header)

char token[kNetScheduleMaxDBDataSize]

bool CanBeDeleted(void) const

const string * m_GroupToken


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4