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/netcached_8cpp_source.html below:

NCBI C++ ToolKit: src/app/netcache/netcached.cpp Source File

58 # include <sys/resource.h> 62 #define MAKE_TEST_BUILD 0 67 void

s_InitTests(

void

);

138  for

(

int i

= 1;

i

< argc; ++

i

) {

159  return tmp

.GetVersion();

167  if

(

this

!= &another) {

187

+ blob_subkey.

size

() + 2);

202  const char

* key_str = cache_str + cache_size + 1;

203  size_t

key_size =

m_PackedKey

.find(

'\1'

, cache_size + 1)

207  const char

* subkey_str = key_str + key_size + 1;

208  size_t

subkey_size =

m_PackedKey

.size() - cache_size - key_size - 2;

221  result

.append(

"' from cache '"

);

232  if

(blob_key.

empty

() && cache_name.

empty

()) {

236  string

rawKey = blob_key;

245

}

else if

(cache_name.

empty

()) {

246  SRV_LOG

(

Warning

,

"CNetCacheKey failed to parse blob key: "

<< blob_key);

258 #if __NC_TASKS_MONITOR 259

m_TaskName =

"CNCHeartBeat"

;

268  static

time_t modified = 0;

285  if

(

mod

== modified) {

294  msg

+=

" GetTime() failed"

;

319  if

(left.size() != right.size())

320  return int

(left.size()) -

int

(right.size());

322  return

left.compare(right);

344  const string

& section,

364  Uint4

one_month = 2592000;

404  if

(pass_policy ==

"no_password"

) {

407  else if

(pass_policy ==

"with_password"

) {

411  if

(pass_policy !=

"any"

) {

413

<<

"' parameter: '"

<< pass_policy

414

<<

"', assuming 'any'"

);

423  unsigned int

best_index,

426

params_set->

entries

.insert(params_set->

entries

.begin() + best_index, entry);

432  unsigned int

& best_index)

434  unsigned int

low = 1;

437  unsigned int

mid = (low + high) / 2;

444  else if

(comp_res > 0)

460  if

(cur_set->

entries

.size() == 0) {

468  for

(

size_t i

= 0;

i

< cur_set->

entries

.size(); ++

i

) {

470

cur_set,

depth

- 1, this_deflt);

487

main_params->

disable

=

false

;

491

main_params->

max_ttl

= 2592000;

500

keys.push_back(

"default"

);

509

params_set = next_set;

514

list<string> conf_sections;

516  ITERATE

(list<string>, sec_it, conf_sections) {

517  const string

& section = *sec_it;

523  const string

& key_name = *prty_it;

525

keys.push_back(key_name);

526  const string

& key_value = reg.

Get

(section, key_name);

527  unsigned int

next_ind = 0;

531  if

(cur_set->

entries

.size() == 0) {

542  if

(cur_set->

entries

.size() == 0) {

548  if

(cur_set->

entries

.size() != 0) {

549  SRV_LOG

(

Error

,

"Section '"

<< section <<

"' in configuration file is " 550  "a duplicate of another section - ignoring it."

);

573

list<string> split_ports;

574

ncbi_NStr_Split(ports_str,

", \t\r\n"

, split_ports);

575  ITERATE

(list<string>, it, split_ports) {

581

<< *it <<

"': "

<< ex);

623

<<

") is greater than max_blob_size_store (" 633  INFO

(

"Initial Purge data: "

<< forget);

644  INFO

(

"Opening control port: "

<< port);

650  unsigned int

port = *it;

656

ports_str.append(

", "

, 2);

658

ports_str.resize(ports_str.size() - 2);

659  INFO

(

"Opening client ports: "

<< ports_str);

672  INFO

(

"NetCache server is finalizing."

);

692  if

(it != client_params.

end

()) {

693  const string

&

value

= it->second;

694  unsigned int

best_index = 0;

711  if

(it != client_params.

end

()) {

712  const string

&

value

= it->second;

713  unsigned int

best_index = 0;

720  if

(!cur_set->

entries

.empty()) {

730  if

(!

first

&& it != client_params.

end

()) {

731  const string

&

value

= it->second;

732  unsigned int

best_index = 0;

738

cur_set_2 = next_set;

739  if

(!cur_set_2->

entries

.empty()) {

758

vector<string>& keys)

764  for

(

size_t i

= 0;

i

< cur_set->

entries

.size(); ++

i

) {

765

keys.push_back(cur_set->

entries

[

i

].key);

767

cur_set,

depth

- 1, this_deflt, keys);

791

caches.push_back(

client

.at(

"cache"

));

795  ITERATE

(vector<string>, k, keys) {

796  if

(k->empty() || all_ports.

find

(*k) != all_ports.

end

()) {

799

caches.push_back(*k);

803

caches.push_front(

""

);

806  string

is(

"\": "

), iss(

"\": \""

), eol(

",\n\""

), eos(

"\""

);

809  bool

is_first =

true

;

810  ITERATE

(list<string>, c, caches) {

844  string

eol(

",\n\""

), is(

"\": "

), isv(

"\": { \"value\": "

),

845

iss(

", \"source\": \""

), eos(

"\""

),

846

isk(

", \"keys\": [\""

), eok(

"\"]}"

);

901  string

is(

"\": "

),iss(

"\": \""

), eol(

",\n\""

), eos(

"\""

);

926  INFO

(

"Initial synchronization complete"

);

934  INFO

(

"Initial synchronization required"

);

1006  return int

(cur_time.

Sec

());

1022  if

(!ofs.is_open()) {

1036 int main

(

int

argc,

const char

* argv[])

1038  for

(

int i

= 1;

i

< argc; ++

i

) {

1039  string

param(argv[

i

]);

1040  if

(param ==

"-version"

) {

1043

}

else if

(param ==

"-help"

) {

1044

cout <<

"Network data storage server"

<< endl;

1045

cout <<

"Arguments:"

<< endl;

1046

cout <<

"-conffile name - configuration file, default = netcached.ini"

<< endl;

1047

cout <<

"-logfile name - log file, default = netcached.log"

<< endl;

1048

cout <<

"-pidfile name - report process ID into this file"

<< endl;

1049

cout <<

"-reinit - reinitialize database, cleaning all data from it"

<< endl;

1050

cout <<

"-nodaemon - do not enter UNIX daemon mode"

<< endl;

1056 #ifdef NCBI_OS_LINUX 1058  if

(getrlimit(RLIMIT_CORE, &rlim) == 0) {

1059

rlim.rlim_cur = RLIM_INFINITY;

1060

setrlimit(RLIMIT_CORE, &rlim);

1075  bool

is_daemon =

true

;

1076  bool

is_reinit =

false

;

1079  for

(

int i

= 1;

i

< argc; ++

i

) {

1080  string

param(argv[

i

]);

1081  if

(param ==

"-nodaemon"

) {

1083

}

else if

(param ==

"-reinit"

) {

1085

}

else if

(param ==

"-pidfile"

) {

1087  if

(

i

+ 1 < argc) {

1088

pid_file = argv[++

i

];

1089  ok

= !pid_file.empty() && pid_file[0] !=

'-'

&&

s_ReportPid

(pid_file);

1092

cerr <<

"Cannot write into pidfile: "

<< pid_file << endl;

1097

cerr <<

"Parameter -pidfile misses file name"

<< endl;

1105

cerr <<

"Unknown parameter: "

<< param << endl;

1112 #ifdef NCBI_OS_LINUX 1114

cout <<

"Entering UNIX daemon mode..."

<< endl;

1115  INFO

(

"Entering UNIX daemon mode..."

);

1125

cerr <<

"Error during daemonization"

<< endl;

1132  if

(!pid_file.empty()) {

1152 static Uint4

MAKE_TEST_TASKS = 100;

1153 static Uint8

MAKE_TEST_MAXSIZE = 1000000;

1155 static Uint4

MAKE_TEST_DELAY = 1;

1156 static Uint4

MAKE_TEST_INTERVAL = 10;

1158 class

CTest_BlobStorage :

public CSrvStatesTask

<CTest_BlobStorage>

1161

CTest_BlobStorage(

Uint4 id

);

1162  virtual

~CTest_BlobStorage(

void

);

1164

State x_Start(

void

);

1165

State x_WaitForBlobAccess(

void

);

1166

State x_PutBegin(

void

);

1167

State x_PutBlobChunk(

void

);

1168

State x_PutEnd(

void

);

1169

State x_Remove(

void

);

1171

State x_Next(

void

);

1172

State x_Stop(

void

);

1176  size_t

PutData(

void

*

buf

,

size_t size

);

1178  bool

IsTaskPaused(

void

);

1179  void

PrintStat(

void

);

1184

vector<string> m_Keys;

1203  static const char

* ms_Commands[];

1205  friend void

s_InitTests(

void

);

1209 CRandom

CTest_BlobStorage::ms_Rnd;

1210 const char

* CTest_BlobStorage::ms_Commands[] = {

"UNKNOWN"

,

"PUT3"

,

"REMO"

};

1211 static const size_t

s_Noop = 0;

1212 static const size_t

s_Put3 = 1;

1213 static const size_t

s_Remove = 2;

1215 static Uint4

s_CounterPut = 0;

1216 static Uint4

s_CounterRem = 0;

1217 static Uint8

s_SizePut = 0;

1218 static Uint8

s_SizeRem = 0;

1220 static CFutex

s_ftxCounter;

1224 void

s_InitTests(

void

)

1228  INFO

(

"s_InitTests, seed: "

<<

seed

);

1230  for

(

Uint4 i

=0;

i

< MAKE_TEST_TASKS; ++

i

) {

1231  new

CTest_BlobStorage(

i

);

1237

CTest_BlobStorage::CTest_BlobStorage(

Uint4 id

)

1244

SetState(&Me::x_Start);

1247

CTest_BlobStorage::~CTest_BlobStorage(

void

)

1251 void

CTest_BlobStorage::Reset(

void

)

1259

m_BlobAccess =

nullptr

;

1265  Uint4

rand1 = ms_Rnd.GetRand(0, MAKE_TEST_MAXSIZE);

1266  Uint4

rand2 =

max

( ms_Rnd.GetRand(1, (rand1+3)/4 + 1), rand1/100);

1268  if

(m_Keys.size() > 10) {

1269  if

(ms_Rnd.GetRand(1, 2) == 2) {

1270

shuffle(m_Keys.begin(), m_Keys.end(), default_random_engine());

1271

m_BlobKey.Assign( *m_Keys.begin());

1272

m_Keys.erase(m_Keys.begin());

1276  if

(m_Counter == 2) {

1277

m_BlobKey = *m_Keys.begin();

1278

m_Keys.erase(m_Keys.begin());

1281

ms_RndLock.Unlock();

1287  if

(!m_BlobKey.IsValid()) {

1290

m_Command = s_Remove;

1294  if

(m_Counter > 2) {

1300 size_t

CTest_BlobStorage::PutData(

void

*

buf

,

size_t size

)

1306 bool

CTest_BlobStorage::IsTaskPaused(

void

)

1314  if

((m_Counter % MAKE_TEST_INTERVAL) == 0) {

1323 #ifdef NCBI_OS_LINUX 1329  if

(

count

== MAKE_TEST_TASKS) {

1366 void

CTest_BlobStorage::PrintStat(

void

)

1373

cout <<

"==============="

<< endl;

1374

cout <<

"s_CounterPut = "

<< s_CounterPut << endl;

1375

cout <<

"s_CounterRem = "

<< s_CounterRem << endl;

1376

cout <<

"blob expected = "

<< (s_CounterPut - s_CounterRem) << endl;

1377

cout <<

"s_SizePut = "

<< s_SizePut << endl;

1378

cout <<

"s_SizeRem = "

<< s_SizeRem << endl;

1379

cout <<

"size expected = "

<< (s_SizePut - s_SizeRem) << endl;

1380

cout <<

"==============="

<< endl;

1381

cout <<

"db_files = "

<<

state

.db_files << endl;

1382

cout <<

"cnt_blobs = "

<<

state

.cnt_blobs << endl;

1383

cout <<

"cnt_keys = "

<<

state

.cnt_keys << endl;

1386

cout <<

"min_dead_time = "

<<

state

.min_dead_time << endl;

1388

cout <<

"db_size = "

<<

state

.db_size << endl;

1389

cout <<

"db_garb = "

<<

state

.db_garb << endl;

1390

cout <<

"inuse = "

<<

state

.db_size -

state

.db_garb << endl;

1391

cout <<

"wb_size = "

<<

state

.wb_size << endl;

1392

cout <<

"wb_releasable = "

<<

state

.wb_releasable << endl;

1393

cout <<

"wb_releasing = "

<<

state

.wb_releasing << endl;

1394

cout <<

"==============="

<< endl;

1397

CTest_BlobStorage::State

1398

CTest_BlobStorage::x_Start(

void

)

1403  if

(m_Command == s_Put3) {

1405

m_BlobKey.Assign(m_RawKey);

1406

m_Keys.push_back(m_RawKey);

1412

m_BlobAccess->RequestMetaInfo(

this

);

1413  return

&CTest_BlobStorage::x_WaitForBlobAccess;

1416

CTest_BlobStorage::State

1417

CTest_BlobStorage::x_WaitForBlobAccess(

void

)

1419  if

(!m_BlobAccess->IsMetaInfoReady()) {

1422  if

(m_Command == s_Put3) {

1423  return

&CTest_BlobStorage::x_PutBegin;

1425  return

&CTest_BlobStorage::x_Remove;

1428

CTest_BlobStorage::State

1429

CTest_BlobStorage::x_PutBegin(

void

)

1431

m_BlobAccess->SetBlobTTL(m_AppSetup->blob_ttl);

1432

m_BlobAccess->SetVersionTTL(0);

1433

m_BlobAccess->SetBlobVersion(0);

1434  return

&CTest_BlobStorage::x_PutBlobChunk;

1437

CTest_BlobStorage::State

1438

CTest_BlobStorage::x_PutBlobChunk(

void

)

1440  Uint4

read_len =

Uint4

(m_BlobAccess->GetWriteMemSize());

1441  if

(m_BlobAccess->HasError()) {

1444  if

(read_len > m_ChunkLen) {

1445

read_len = m_ChunkLen;

1447  if

(read_len > m_DataSize) {

1448

read_len = (

Uint4

)m_DataSize;

1451  Uint4

n_read =

Uint4

(PutData(m_BlobAccess->GetWriteMemPtr(), read_len));

1452

m_BlobAccess->MoveWritePos(n_read);

1453

m_DataSize -= n_read;

1454

m_BlobSize += n_read;

1457  if

(m_DataSize != 0) {

1461  return

&CTest_BlobStorage::x_PutEnd;

1464

CTest_BlobStorage::State

1465

CTest_BlobStorage::x_PutEnd(

void

)

1469  int

cur_secs =

int

(cur_srv_time.

Sec

());

1470

m_BlobAccess->SetBlobCreateTime(cur_time);

1471  if

(m_BlobAccess->GetNewBlobExpire() == 0)

1472

m_BlobAccess->SetNewBlobExpire(cur_secs + m_BlobAccess->GetNewBlobTTL());

1473

m_BlobAccess->SetNewVerExpire(cur_secs + m_BlobAccess->GetNewVersionTTL());

1474

m_BlobAccess->SetCreateServer(

1476  if

(m_BlobAccess->HasError()) {

1482

CTest_BlobStorage::State

1483

CTest_BlobStorage::x_Remove(

void

)

1485  if

(m_BlobAccess->IsBlobExists() && !m_BlobAccess->IsCurBlobExpired())

1487

m_BlobSize = m_BlobAccess->GetCurBlobSize();

1492

m_BlobAccess->SetBlobTTL(m_AppSetup->blob_ttl);

1496  unsigned int

mirrored_ttl = is_good ?

min

(

Uint4

(300), m_AppSetup->blob_ttl) : m_AppSetup->blob_ttl;

1497  unsigned int

local_ttl = 5;

1498

m_BlobAccess->SetBlobTTL( is_mirrored ? mirrored_ttl : local_ttl);

1501

m_BlobAccess->SetBlobVersion(0);

1503  unsigned int

ttl = m_BlobAccess->GetNewBlobTTL();

1505  if

(m_BlobAccess->IsBlobExists() && m_BlobAccess->GetCurBlobTTL() > ttl)

1506

ttl = m_BlobAccess->GetCurBlobTTL();

1508

m_BlobAccess->SetNewBlobExpire(expire, expire + ttl + 1);

1514  int

cur_secs =

int

(cur_srv_time.

Sec

());

1515

m_BlobAccess->SetBlobCreateTime(cur_time);

1516  if

(m_BlobAccess->GetNewBlobExpire() == 0)

1517

m_BlobAccess->SetNewBlobExpire(cur_secs + m_BlobAccess->GetNewBlobTTL());

1518

m_BlobAccess->SetNewVerExpire(cur_secs + m_BlobAccess->GetNewVersionTTL());

1525

CTest_BlobStorage::State

1528  if

(m_Command == s_Put3) {

1536

m_BlobAccess->Finalize();

1537

m_BlobAccess->Release();

1538

m_BlobAccess =

NULL

;

1541

cmd_len -= m_CmdStartTime;

1546  return

&CTest_BlobStorage::x_Next;

1549

CTest_BlobStorage::State

1550

CTest_BlobStorage::x_Next(

void

)

1553  return

&CTest_BlobStorage::x_Stop;

1555  if

(IsTaskPaused()) {

1560  if

(m_Command != s_Noop) {

1561

SetState(&Me::x_Start);

1562  if

(MAKE_TEST_DELAY != 0) {

1563

RunAfter(MAKE_TEST_DELAY);

1571

CTest_BlobStorage::State

1572

CTest_BlobStorage::x_Stop(

void

)

Wrapper around Linux's futex.

EWaitResult WaitValueChange(int old_value)

Wait for futex's value to change (with and without timeout).

int GetValue(void)

Read value of the futex.

@ eTimedOut

Method returned because total waiting time exceeded given timeout.

bool ChangeValue(int old_value, int new_value)

Atomically change value of the futex.

int WakeUpWaiters(int cnt_to_wake)

Wake up some threads waiting on this futex.

int AddValue(int cnt_to_add)

Atomically add some amount to futex's value.

Mutex created to have minimum possible size (its size is 4 bytes) and to sleep using kernel capabilit...

static void Initialize(void)

static void Register(EAlertType alert_type, const string &message)

@ ePidFileFailed

Reporting Pid failed.

@ eStartupConfigChanged

Configuration file changed.

static bool UpdatePurgeData(const string &data, char separator='\n')

unsigned int m_KeyVersion

void PackBlobKey(const CTempString &cache_name, const CTempString &blob_key, const CTempString &blob_subkey)

CNCBlobKeyLight & operator=(const CNCBlobKeyLight &another)

string KeyForLogs(void) const

unsigned int KeyVersion(void) const

CNCBlobKeyLight & Copy(const CNCBlobKeyLight &another)

void SetKeyVersion(unsigned int v)

void Assign(const CTempString &cache_name, const CTempString &blob_key, const CTempString &blob_subkey)

static void SaveMaxSyncLogRecNo(void)

static Uint8 GetMaxSyncLogRecNo(void)

static void MeasureDB(SNCStateStat &state)

static string GetPurgeData(void)

static CNCBlobAccessor * GetBlobAccess(ENCAccessType access, const string &key, const string &password, Uint2 time_bucket)

Acquire access to the blob identified by key, subkey and version.

static void Finalize(void)

static bool Initialize(bool do_reinit)

static Uint8 GetMaxBlobSizeStore(void)

static bool IsCleanStart(void)

static void CheckDiskSpace(void)

static Uint4 GetNewBlobId(void)

static void GenerateBlobKey(Uint2 local_port, string &key, Uint2 &slot, Uint2 &time_bucket, unsigned int ver=1)

static void GetSlotByRnd(Uint4 key_rnd, Uint2 &slot, Uint2 &time_bucket)

static void Finalize(void)

static size_t CountServersForSlot(Uint2 slot)

static Uint8 GetMaxBlobSizeSync(void)

static Uint8 GetSelfID(void)

static bool Initialize(Uint2 control_port)

virtual void ExecuteSlice(TSrvThreadNum thr_num)

This is the main method to do all work this task should do.

static void CheckConfFile(void)

virtual ~CNCHeartBeat(void)

static void Finalize(void)

static bool HasPeerInThrottle(void)

static bool Initialize(void)

static void ReadCurState(SNCStateStat &state)

static void Finalize(void)

static bool Initialize(void)

static const SNCSpecificParams * GetAppSetup(const TStringMap &client_params)

static void ReadCurState(SNCStateStat &state)

static const string & GetAdminClient(void)

Get name of client that should be used for administrative commands.

static bool IsDebugMode(void)

static bool IsCachingComplete(void)

static void WriteAppSetup(TNCBufferType &task, const TStringMap &client)

static int GetDefBlobTTL(void)

Get inactivity timeout for each connection.

static string GetHostLocation(void)

static int GetUpTime(void)

Get total number of seconds the server is running.

static void WriteEnvInfo(CSrvSocketTask &task)

static bool IsInitiallySynced(void)

static void InitialSyncRequired(void)

static string GetHostRole(void)

static void CachingCompleted(void)

static void InitialSyncComplete(void)

static void CmdFinished(const char *cmd, Uint8 len_usec, int status)

static void SaveCurStateStat(const SNCStateStat &state)

static void CmdStarted(const char *cmd)

static void DumpAllStats(void)

static void ClientBlobWrite(Uint8 blob_size, Uint8 len_usec)

static void ClientDataWrite(size_t data_size)

static void Initialize(void)

static void Initialize(bool need_read_saved, Uint8 start_log_rec_no)

static bool Finalize(void)

static Uint8 GetLogSize(void)

static void Initialize(void)

Initialization of SQLite and tuning some default parameters.

static void Finalize(void)

Finish all SQLite operations.

Task controlling a socket.

CSrvSocketTask & WriteText(CTempString message)

Write text into socket.

CSrvSocketTask & WriteNumber(NumType num)

Write number into socket as string, i.e.

Special task which executes as finite state machine.

void RunAfter(Uint4 delay_sec)

This call is basically equivalent to SetRunnable() but with guarantee that task will be scheduled for...

void SetRunnable(bool boost=false)

Set this task "runnable", i.e.

Class incorporating convenient methods to work with struct timespec.

static int CurSecs(void)

Current time in seconds since epoch (time_t).

time_t & Sec(void)

Read/set number of seconds since epoch stored in the object.

static CSrvTime Current(void)

Exact current time with precision up to nanoseconds.

Uint8 AsUSec(void) const

Converts object's value to microseconds since epoch.

static const CNcbiRegistry & GetConfRegistry(void)

Obtains reference to registry read from application's ini-file.

static const string & GetHostName(void)

Returns name of server this application is executing on.

static void RequestShutdown(ESrvShutdownType shutdown_type)

Asks server to start shutdown procedures.

static bool AddListeningPort(Uint2 port, CSrvSocketFactory *factory)

Adds port for TaskServer to listen to.

static CSrvTime GetStartTime(void)

Returns time when this server application was started (when Initialize() method was called).

static void Finalize(void)

Finalizes TaskServer infrastructure.

static bool IsInShutdown(void)

Checks if TaskServer received request to shutdown.

static bool Initialize(int &argc, const char **argv)

Initializes TaskServer infrastructure from given command line arguments.

static void Run(void)

Run all TaskServer machinery.

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

static void Initialize(void)

static void ReadState(SNCStateStat &state)

TNCBufferType & WriteNumber(NumType num)

TNCBufferType & WriteText(const char *buf)

container_type::const_iterator const_iterator

const_iterator end() const

const_iterator find(const key_type &key) const

iterator_bool insert(const value_type &val)

const_iterator find(const key_type &key) const

const_iterator end() const

The NCBI C++ standard methods for dealing with std::string.

static unsigned char depth[2 *(256+1+29)+1]

std::ofstream out("events_result.xml")

main entry point for tests

static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

#define ERR_POST(message)

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

void Critical(CExceptionArgs_Base &args)

void Error(CExceptionArgs_Base &args)

void Warning(CExceptionArgs_Base &args)

static string NormalizePath(const string &path, EFollowLinks follow_links=eIgnoreLinks)

Normalize a path.

static bool IsAbsolutePath(const string &path)

Check if a "path" is absolute for the current OS.

Int8 GetLength(void) const

Get size of file.

bool GetTimeT(time_t *modification, time_t *last_access=0, time_t *creation=0) const

Get time stamp(s) of a directory entry (time_t version).

static string ConcatPath(const string &first, const string &second)

Concatenate two parts of the path for the current OS.

static string GetCwd(void)

Get the current working directory.

bool GetTime(CTime *modification, CTime *last_access=0, CTime *creation=0) const

Get time stamp(s) of a directory entry.

virtual bool Exists(void) const

Check existence of file.

static bool ParseBlobKey(const char *key_str, size_t key_len, CNetCacheKey *key_obj, CCompoundIDPool::TInstance id_pool=NULL)

Parse blob key string into a CNetCacheKey structure.

bool HasExtensions() const

unsigned GetVersion() const

string StripKeyExtensions() const

If the blob key has been parsed successfully, this method returns a trimmed "base" version of the key...

TObjectType * GetNCPointer(void) const THROWS_NONE

Get pointer,.

uint8_t Uint1

1-byte (8-bit) unsigned integer

uint32_t Uint4

4-byte (32-bit) unsigned integer

uint16_t Uint2

2-byte (16-bit) unsigned integer

int64_t Int8

8-byte (64-bit) signed integer

uint64_t Uint8

8-byte (64-bit) unsigned integer

static TPid Daemonize(const char *logfile=0, TDaemonFlags flags=0)

Go daemon.

static TPid GetPid(void)

Get process identifier (pid) for the current process.

Uint4 TValue

Type of the generated integer value and/or the seed value.

void SetSeed(TValue seed)

Seed the random number generator with "seed".

virtual bool GetBool(const string &section, const string &name, bool default_value, TFlags flags=0, EErrAction err_action=eThrow) const

Get boolean value of specified parameter name.

virtual void EnumerateSections(list< string > *sections, TFlags flags=fAllLayers) const

Enumerate section names.

virtual const string & Get(const string &section, const string &name, TFlags flags=0) const

Get the parameter value.

virtual int GetInt(const string &section, const string &name, int default_value, TFlags flags=0, EErrAction err_action=eThrow) const

Get integer value of specified parameter name.

virtual bool HasEntry(const string &section, const string &name=kEmptyStr, TFlags flags=0) const

virtual string GetString(const string &section, const string &name, const string &default_value, TFlags flags=0) const

Get the parameter string value.

@ fCountCleared

Let explicitly cleared entries stand.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

IO_PREFIX::ofstream CNcbiOfstream

Portable alias for ofstream.

IO_PREFIX::ifstream CNcbiIfstream

Portable alias for ifstream.

static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to int.

static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)

Find the pattern in the specified range of a string using a case insensitive search.

CTempString & assign(const char *src_str, size_type len)

Assign new values to the content of the a string.

static const string BoolToString(bool value)

Convert bool to string.

static string IntToString(int value, TNumToStringFlags flags=0, int base=10)

Convert int to string.

static string Join(const TContainer &arr, const CTempString &delim)

Join strings using the specified delimiter.

const char * data(void) const

Return a pointer to the array represented.

static string UInt8ToString_DataSize(Uint8 value, TNumToStringFlags flags=0, unsigned int max_digits=3)

Convert UInt8 to string using "software" qualifiers.

bool empty(void) const

Return true if the represented string is empty (i.e., the length is zero)

static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)

Check if a string starts with a specified prefix value.

void clear(void)

Clears the string.

static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)

Convert numeric value to string.

const char *const kEmptyCStr

Empty "C" string (points to a '\0').

size_type size(void) const

Return the length of the represented array.

@ eNocase

Case insensitive compare.

string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const

Transform time to string.

unsigned int

A callback function used to compare two keys in a database.

string GetLogFileName(void)

const struct ncbi::grid::netcache::search::fields::SIZE size

const struct ncbi::grid::netcache::search::fields::KEY key

const GenericPointer< typename T::ValueType > T2 value

const CharType(& source)[N]

void SetWBInitialSyncComplete(void)

void InitClientMessages(void)

Initializes maps between status codes and error texts sent to client to explain these codes.

map< string, string > TStringMap

@ eStatus_OK

Command is ok and execution is good.

@ eNCCreate

Create blob or re-write its contents.

static void x_Finalize(SERV_ITER iter)

Defines process management classes.

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

Process information in the NCBI Registry, including working with configuration files.

#define NETCACHED_FULL_VERSION

#define NETCACHED_VERSION

static const char * kNCReg_Quorum

static const char * kNCReg_SearchOnRead

static const char * kNCReg_FastOnMain

static const char * kNCReg_VerTTL

static const char * kNCReg_SpecPriority

static const char * kNCReg_ServerSection

static const char * kNCReg_AppSetupValue

static void s_StoreStartupParams(int argc, const char *argv[])

set< unsigned int > TPortsList

static const char * kNCReg_TTLUnit

static void s_Finalize(void)

static const char * kNCReg_LifespanTTL

static const char * kNCReg_ProlongOnRead

static int s_CompareStrings(const string &left, const string &right)

static const char * kNCReg_BlobTTL

static bool s_ReadServerParams(void)

static const char * kNCReg_DefAdminClient

static CNCMsgHandler_Factory s_MsgHandlerFactory

static void s_ReadPerClientConfig(const CNcbiRegistry &reg)

static const char * kNCReg_MaxTTL

static void s_ReadSpecificParams(const IRegistry &reg, const string &section, SNCSpecificParams *params, vector< string > &keys)

static const char * kNCReg_DefSpecPriority

static void s_CollectClientConfigKeys(SSpecParamsSet *cur_set, SSpecParamsSet *prev_set, Uint1 depth, SSpecParamsSet *deflt, vector< string > &keys)

static const char * kNCReg_DisableClient

bool s_ReportPid(const string &pid_file)

static const char * kNCReg_PassPolicy

static CSrvRef< SSpecParamsSet > s_SpecParams

static TPortsList s_Ports

Port where server runs.

static bool s_CachingComplete

static CNCHeartBeat * s_HeartBeat

static string s_AdminClient

Name of client that should be used for administrative commands.

static SSpecParamsSet * s_FindNextParamsSet(const SSpecParamsSet *cur_set, const string &key, unsigned int &best_index)

vector< string > TSpecKeysList

static string s_CmdLineArgs

static const char * kNCReg_AppSetupPrefix

static TSpecKeysList s_SpecPriority

static void s_CheckDefClientConfig(SSpecParamsSet *cur_set, SSpecParamsSet *prev_set, Uint1 depth, SSpecParamsSet *deflt)

static const char * kNCReg_CtrlPort

int main(int argc, const char *argv[])

static void s_PutNewParams(SSpecParamsSet *params_set, unsigned int best_index, const SSpecParamsEntry &entry)

static string s_HostLocation

static bool s_Initialize(bool do_reinit)

static bool s_InitiallySynced

static const char * kNCReg_Ports

static const char * kNCReg_AdminClient

@ eNCBlobPassAny

Both blobs with password and without are accepted.

@ eNCOnlyWithoutPass

Only blobs without password are accepted.

@ eNCOnlyWithPass

Only blobs with password are accepted.

std::istream & in(std::istream &in_, double &x_)

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

static CNamedPipeClient * client

#define INFO(msg)

Macro to be used for printing informational messages.

#define SRV_LOG(sev, msg)

Macro to be used for printing log messages.

T AtomicAdd(T volatile &var, T add_value)

Meaningful information encoded in the NetCache key.

map< string, string > keys

ENCBlobPassPolicy pass_policy

map< string, string > source

virtual ~SNCSpecificParams(void)

SSpecParamsEntry(const string &key, CObject *value)

vector< SSpecParamsEntry > entries

virtual ~SSpecParamsSet(void)

Uint2 TSrvThreadNum

Type for thread number in TaskServer.


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