unique_ptr<CObjectOStream>
101unique_ptr<CCompressionOStream> outstr_zip(
117 staticunique_ptr<CObjectIStream>
123 staticunique_ptr<CObjectIStream>
130 staticunique_ptr<CObjectIStream>
137 staticunique_ptr<CNcbiIstream>
144 staticunique_ptr<CNcbiIstream>
154 staticunique_ptr<CObjectIStream>
160unique_ptr<CCompressionIStream> instr_zip(
172 if(job_content.empty()) {
178 size_tbytes_read = 0UL;
202 static const char kMagic[] = {
'L',
'Z',
'O',
'\0'};
211unique_ptr<CCompressionStreamProcessor> sp;
223unique_ptr<CCompressionStreamProcessor> sp;
281 template<
typenameTConnectTraits = CAsnBinCompressed,
intDefaultTimeout = 20>
286 const string& NS_queue,
287 const string& client_name,
288 const string& NC_registry_section
290:
m_NS_api(NS_service, client_name, NS_queue),
293 x_Init(NC_registry_section);
297 const string& NC_registry_section =
kEmptyStr 306? cfg.
GetString(NS_registry_section,
"netcache_api",
"netcache_api")
307: NC_registry_section
321 void x_Init(
const string& NC_registry_section)
364 autoinstr = TConnectTraits::GetRawIStream(job.
output,
m_NC_api);
387 returnmake_pair(job,
false);
403 template<
classTRequest,
classTReply>
404pair<CNetScheduleJob, bool>
Ask(
constTRequest& request, TReply& reply)
const 413 autooutstr = TConnectTraits::GetOStream(job_in);
452 returnmake_pair(job,
false);
467 template<
classTReply>
510 template<
typenameTRequest,
typenameTReply>
Traits class for compressed binary ASN.1 streams.
static bool IsLZOStream(CNcbiIstream &istr)
static unique_ptr< CObjectIStream > GetIStream(const string &job_content, CNetCacheAPI &nc_api)
static bool IsLZOStream(const CTempString &str)
static unique_ptr< CNcbiIstream > GetRawIStream(const string &job_content, CNetCacheAPI &nc_api, SStreamProp &streamprop)
static unique_ptr< CObjectIStream > GetIStream(const string &job_content, CNetCacheAPI &nc_api, SStreamProp &streamprop)
static unique_ptr< CObjectOStream > GetOStream(CNcbiOstream &ostr, SStreamProp stream_prop=SStreamProp(CCompressStream::eZip))
Return an object output stream (CObjectOStream)
static unique_ptr< CObjectIStream > GetIStream(CNcbiIstream &istr)
Return an object input stream (CObjectIStream)
static CCompressionStreamProcessor * CreateStreamCompressor(const SStreamProp &stream_prop)
static CCompressionStreamProcessor * CreateStreamDecompressor(const SStreamProp &stream_prop)
static string CompMethodToString(const CCompressStream::EMethod method)
static unique_ptr< CNcbiIstream > GetRawIStream(const string &job_content, CNetCacheAPI &nc_api)
static SStreamProp GetJobStreamProperties(const string &job_content, CNetCacheAPI &nc_api)
static unique_ptr< CObjectIStream > GetIStream(CNcbiIstream &istr, const SStreamProp &stream_prop, TOwnership ownership=CCompressionStream::fOwnProcessor)
static SStreamProp GetIStreamProperties(CNcbiIstream &istr)
Traits class for binary ASN.1.
static ESerialDataFormat GetDataFormat(void)
Return the serialization type.
Grid Client (the submitter).
@ eWaitTimeout
timeout while waiting for job completion
virtual const char * GetErrCodeString(void) const override
Get error code interpreted as text.
NCBI_EXCEPTION_DEFAULT(CGridRPCBaseClientException, CException)
CGridRPCBaseClient<typename TConnectTraits>
CNetScheduleJob x_GetJobById(const string job_id, TReply &reply) const
virtual void x_PrepareJob(CNetScheduleJob &) const
pair< CNetScheduleJob, bool > AskStream(CNcbiIstream &request, CNcbiOstream &reply) const
Sends an ASN.1 request, waiting specified time.
CGridRPCBaseClient(const string &NS_service, const string &NS_queue, const string &client_name, const string &NC_registry_section)
void x_Init(const string &NC_registry_section)
void SetTimeout(const size_t timeout)
Sets the request timeout (default is 20s)
CGridRPCBaseClient(const string &NS_registry_section="netschedule_api", const string &NC_registry_section=kEmptyStr)
CGridRPCBaseClient(const CGridRPCBaseClient &)=delete
pair< CNetScheduleJob, bool > Ask(const TRequest &request, TReply &reply) const
Sends an ASN.1 request, waiting specified time.
CGridRPCBaseClient(CGridRPCBaseClient &&c)
virtual ~CGridRPCBaseClient()=default
virtual void x_Connect() override
These run with m_Mutex already acquired.
virtual ~CGridRPCHttpClient()=default
CGridRPCHttpClient(const string &http_service)
CLZOStreamCompressor â lzo based compression stream processor.
CLZOStreamDecompressor â lzo based decompression stream processor.
Client API for NetCache server.
Client API for NCBI NetSchedule server.
Smart pointer to the job submission part of the NetSchedule API.
CRPCClient â prototype client for ASN.1/XML-based RPC.
Note about the "buf_size" parameter for streams in this API.
@ fOwnReader
Own the underlying reader.
String or Blob Storage Reader.
virtual ERW_Result Read(void *buf, size_t count, size_t *bytes_read=0)
Read as many as "count" bytes into a buffer pointed to by the "buf" argument.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
CZipStreamCompressor â zlib based compression stream processor.
CZipStreamDecompressor â zlib based decompression stream processor.
const unsigned char kMagic[2]
static const char * str(char *buf, int n)
NetSchedule Framework specs.
NetSchedule worker node application.
static CNcbiApplicationGuard InstanceGuard(void)
Singleton method.
const CNcbiRegistry & GetConfig(void) const
Get the application's cached configuration parameters (read-only).
constexpr size_t ArraySize(const Element(&)[Size])
@ eTakeOwnership
An object can take ownership of another.
EMethod
Compression/decompression methods.
@ eZip
ZLIB (raw zip data / DEFLATE method)
@ eGZipCloudflareFile
.gz file (including concatenated files) Cloudflare fork
@ eZipCloudflare
ZLIB (raw zip data / DEFLATE method) Cloudflare fork.
@ eNone
no compression method (copy "as is")
@ eZstd
ZStandard (raw zstd data)
@ eConcatenatedGZipFile
Synonym for eGZipFile (for backward compatibility) - deprecated.
@ eGZipFile
.gz file (including concatenated files)
void Post(CRequestStatus::ECode status, CTempString status_msg=CTempString())
Write the collected resource info and timing to the log.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
EErrCode
Error types that an application can generate.
unique_ptr< CObjectIStream > m_In
unique_ptr< CObjectOStream > m_Out
virtual void x_Connect(void) override
These run with m_Mutex already acquired.
unique_ptr< CNcbiIostream > m_Stream
ESerialDataFormat
Data file format.
@ eSerial_AsnBinary
ASN.1 binary.
EJobStatus
Job status codes.
CNetScheduleAPI::EJobStatus SubmitAndWait(unsigned wait_time)
Submit a job to the queue.
CNetScheduleSubmitter GetSubmitter()
Create an instance of CNetScheduleSubmitter.
string output
Job result data.
EJobStatus GetJobDetails(CNetScheduleJob &job, time_t *job_exptime=NULL, ENetScheduleQueuePauseMode *pause_mode=NULL)
Get job details.
static string StatusToString(EJobStatus status)
Printable status type.
CNetScheduleAPI::EJobStatus WaitForJob(const string &job_id, unsigned wait_time)
Wait for job to finish its execution (done/failed/canceled).
CNetScheduleJob & GetJob()
CNcbiOstream & GetOStream()
Get a stream where a client can write an input data for the remote job.
string job_id
Output job key.
@ eDone
Job is ready (computed successfully)
@ eReading
Job has its output been reading.
@ eCanceled
Explicitly canceled.
@ eRunning
Running on a worker node.
@ ePending
Waiting for execution.
@ eFailed
Failed to run (execution timeout)
static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)
Create serial object writer and attach it to an output stream.
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
uint32_t Uint4
4-byte (32-bit) unsigned integer
virtual string GetString(const string §ion, const string &name, const string &default_value, TFlags flags=0) const
Get the parameter string value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static void Stepback(CNcbiIstream &is, CT_CHAR_TYPE *buf, streamsize buf_size, void *del_ptr=0)
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
static streamsize Readsome(CNcbiIstream &is, CT_CHAR_TYPE *buf, streamsize buf_size)
bool NcbiStreamCopy(CNcbiOstream &os, CNcbiIstream &is)
Copy the entire contents of stream "is" to stream "os".
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
unsigned int
A callback function used to compare two keys in a database.
const size_t kMagicSize
Size of magic signature.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Defines NCBI C++ API for timing-and-logging, classes, and macros.
Reader-writer based streams.
C++ I/O stream wrappers to compress/decompress data on-the-fly.
SStreamProp(const CCompressStream::EMethod comp_mthd=CCompressStream::eZip)
CCompressStream::EMethod compress_method
unique_ptr< CObjectIStream > GetIStream(string path, ESerialDataFormat serial_format)
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