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

NCBI C++ ToolKit: src/app/netstorage/utils/netstorage_gc.cpp Source File

51

m_DeleteCount(0), m_TotalCount(0), m_RemoteErrors(0)

58

full_version->AddComponentVersion(

59  "Expected NetStorage DB structure (lowest)"

,

62

full_version->AddComponentVersion(

63  "Expected NetStorage DB structure (highest)"

,

76

arg_desc->SetUsageContext(

GetArguments

().GetProgramBasename(),

77  "Garbage collector for NetStorage database " 78  "and backend storages"

);

79

arg_desc->AddFlag(

"verbose"

,

"Be verbose (messages on stdout)"

);

80

arg_desc->AddFlag(

"dry"

,

"Dry run, no real cleanup is done"

);

81

arg_desc->AddDefaultKey(

"t"

,

"timeout"

,

82  "DB operations timeout in seconds"

,

93

.

Print

(

"_type"

,

"startup"

)

94

.

Print

(

"info"

,

"versions"

)

104  bool verbose

= args[

"verbose"

];

105  bool

dryrun = args[

"dry"

];

106  int

timeout = args[

"t"

].AsInteger();

109  ERR_POST

(

"DB timeout expected to be > 0. Received: "

<< timeout <<

111  " seconds instead."

);

121  string

message(

"NetStorage meta info database " 122  "structure version mismatch. "

);

125

message +=

"Expected: "

+

130

message +=

"Expected range: "

+

138

cerr << message << endl;

152  if

(!candidates.empty()) {

191  string

service_name = reg.

GetString

(

"netstorage_server"

,

193  if

(service_name.empty()) {

194  string

message =

"[netstorage_server]/service is not specified"

;

195

cerr << message << endl;

199  CNetStorage

nst(

"nst="

+ service_name +

"&client_name=netstorage_gc"

);

200  for

(vector<string>::const_iterator k = locators.begin();

201

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

204

cout <<

"Checking expiration via NetStorage server for "

<< *k << endl;

207  string msg

=

"Expected expired object; " 208  "NetStorage reports it is not"

;

209

cerr <<

msg

<<

": "

<< *k << endl;

214

cerr <<

"Exception while checking expiration for object " 231  for

(vector<string>::const_iterator k = locators.begin();

232

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

241

cout <<

"Removing backend storage object "

<< *k << endl;

244  ctx

->SetRequestID();

246  ctx

->SetHitID(hit_id);

248

.Print(

"action"

,

"backend_remove"

)

249

.Print(

"locator"

, *k);

254  ctx

->SetRequestStatus(200);

263  ctx

->SetRequestStatus(500);

268

cerr <<

"Exception while removing backend object " 270

}

catch

(

const

std::exception & ex ) {

273  ctx

->SetRequestStatus(500);

278

cerr <<

"std::exception while removing backend object " 283  ctx

->SetRequestStatus(500);

288

cerr <<

"Unknown exception while removing backend object " 293  if

(

error

==

false

) {

305

.

Print

(

"_type"

,

"finish"

)

317 int main

(

int

argc,

const char

* argv[])

void x_RemoveObjects(const vector< string > &locators, bool verbose, CNetStorageGCDatabase &db, bool dryrun)

void x_CheckExpiration(const vector< string > &locators, bool verbose)

virtual void Init(void)

Initialize the application.

virtual int Run(void)

Run the application.

void x_PrintFinishCounters(bool verbose)

void RemoveObject(const string &locator, bool dryrun, const string &hit_id)

void ReleaseAppLock(void)

vector< string > GetGCCandidates(void)

int GetDBStructureVersion(void)

Network BLOB storage API.

void SetFullVersion(CRef< CVersionAPI > version)

Set version data for the program.

const CNcbiRegistry & GetConfig(void) const

Get the application's cached configuration parameters (read-only).

virtual const CArgs & GetArgs(void) const

Get parsed command line arguments.

int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)

Main function (entry point) for the NCBI application.

virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)

Setup the command line argument descriptions.

const CNcbiArguments & GetArguments(void) const

Get the application's cached unprocessed command-line arguments.

void SetVersion(const CVersionInfo &version)

Set the version number for the program.

@ eInteger

Convertible into an integer number (int or Int8)

void PrintRequestStop(void)

Print request stop message (for request-driven applications)

CDiagContext_Extra & Print(const string &name, const string &value)

The method does not print the argument, but adds it to the string.

CDiagContext & GetDiagContext(void)

Get diag context instance.

static void SetRequestContext(CRequestContext *ctx)

Shortcut to CDiagContextThreadData::GetThreadData().SetRequestContext()

void PrintRequestStart(const string &message)

Print request start message (for request-driven applications)

CDiagContext_Extra Extra(void) const

Create a temporary CDiagContext_Extra object.

static CRequestContext & GetRequestContext(void)

Shortcut to CDiagContextThreadData::GetThreadData().GetRequestContext()

void SetHitID(const string &hit)

Set explicit hit id. The id is reset on request end.

#define ERR_POST(message)

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

static void SetOldPostFormat(bool value)

Set old/new format flag.

@ eDS_ToStdlog

Try standard log file (app.name + ".log") in /log/ and current directory, use stderr if both fail.

#define NCBI_THROW(exception_class, err_code, message)

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

virtual const char * what(void) const noexcept

Standard report (includes full backlog).

bool Exists(const string &object_loc)

Check if the object addressed by 'object_loc' exists.

ENetStorageRemoveResult Remove(const string &object_loc)

Remove the object addressed by 'object_loc'.

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

Get the parameter string value.

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 string version

version string

#define NCBI_PACKAGE_VERSION_PATCH

#define NCBI_PACKAGE_VERSION_MINOR

#define NCBI_PACKAGE_VERSION_MAJOR

#define NCBI_CLANG_ANALYZER_SUPPRESS

Suppress clang analyzer report.

Defines NCBI C++ diagnostic APIs, classes, and macros.

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

const unsigned int kDefaultDBTimeout

const string k_UnknownException

#define NETSTORAGE_GC_BUILD_DATE

#define NETSTORAGE_GC_EXPECTED_DB_STRUCTURE_HIGH

#define NETSTORAGE_GC_VERSION

#define NETSTORAGE_GC_EXPECTED_DB_STRUCTURE_LOW

Defines CRequestContext class for NCBI C++ diagnostic API.

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


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