NCBI C++ ToolKit
Public Member Functions | Protected Types | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
CRemoteAppRequest Class Reference

Search Toolkit Book for CRemoteAppRequest

Remote Application Request (both client side and application executor side) More...

#include <connect/services/remote_app.hpp>

+ Inheritance diagram for CRemoteAppRequest:
+ Collaboration diagram for CRemoteAppRequest:

Public Member Functions

 CRemoteAppRequest (CNetCacheAPI::TInstance storage, size_t max_inline_size=kMaxBlobInlineSize)
 
 ~CRemoteAppRequest ()
 
void SetCmdLine (const string &cmdline)
 Set the command line for the remote application. More...
 
const stringGetCmdLine () const
 Get the command line of the remote application. More...
 
void SetAppRunTimeout (unsigned int sec)
 
unsigned int GetAppRunTimeout () const
 
void AddFileForTransfer (const string &fname, EStdOutErrStorageType tt=eBlobStorage)
 Transfer a file to an application executor side. More...
 
const stringGetWorkingDir () const
 
CNcbiOstreamGetStdIn ()
 Get an output stream to write data to a remote application stdin. More...
 
CNcbiIstreamGetStdInForRead ()
 Get the stdin stream of the remote application. More...
 
void SetExclusiveMode (bool on_off)
 
bool IsExclusiveMode () const
 
void SetStdOutErrFileNames (const string &stdout_fname, const string &stderr_fname, EStdOutErrStorageType type)
 
const stringGetStdOutFileName () const
 
const stringGetStdErrFileName () const
 
EStdOutErrStorageType GetStdOutErrStorageType () const
 
const stringGetInBlobIdOrData () const
 
void SetMaxInlineSize (size_t max_inline_size)
 
void Send (CNcbiOstream &os)
 Serialize a request to a given stream. More...
 
void Deserialize (CNcbiIstream &is)
 
void Reset ()
 

Protected Types

typedef map< string, EStdOutErrStorageTypeTFiles
 
typedef map< string, stringTStoredFiles
 

Protected Member Functions

CNetCacheAPIGetNetCacheAPI ()
 
const TFilesGetFileNames () const
 
void x_CreateWDir ()
 
void x_RemoveWDir ()
 
bool x_Deserialize (CNcbiIstream &is, TStoredFiles *files=NULL)
 

Private Attributes

CNetCacheAPI m_NetCacheAPI
 
string m_CmdLine
 
unsigned int m_AppRunTimeout
 
string m_TmpDirPath
 
string m_TmpDirName
 
TFiles m_Files
 
CBlobStreamHelper m_StdIn
 
size_t m_StdInDataSize
 
string m_InBlobIdOrData
 
string m_StdErrFileName
 
string m_StdOutFileName
 
EStdOutErrStorageType m_StorageType
 
bool m_ExlusiveMode
 
size_t m_MaxInlineSize
 

Static Private Attributes

static CAtomicCounter sm_DirCounter
 

Detailed Description

Remote Application Request (both client side and application executor side)

It is used by a client application which wants to run a remote application through NetSchedule infrastructure and should be used in conjunction with CGridJobSubmitter class

It is also used by a grid worker node to get parameters for the remote application.

Definition at line 95 of file remote_app.hpp.

Member Typedef Documentation

◆ TFiles

Definition at line 166 of file remote_app.hpp.

◆ TStoredFiles

Definition at line 174 of file remote_app.hpp.

Constructor & Destructor Documentation

◆ CRemoteAppRequest()

CRemoteAppRequest::CRemoteAppRequest ( CNetCacheAPI::TInstance  storage,
size_t  max_inline_size = kMaxBlobInlineSize 
)
explicit

Definition at line 327 of file remote_app.cpp.

◆ ~CRemoteAppRequest()

CRemoteAppRequest::~CRemoteAppRequest ( )

Definition at line 157 of file remote_app.cpp.

References NCBI_CATCH_ALL_X, and Reset().

Member Function Documentation

◆ AddFileForTransfer()

void CRemoteAppRequest::AddFileForTransfer ( const string fname,
EStdOutErrStorageType  tt = eBlobStorage 
)
inline

Transfer a file to an application executor side.

It only makes sense to transfer a file if its name also mentioned in the command line for the remote application. When the file is transfered the the executor side it gets stored to a temporary directory and then its original name in the command line will be replaced with the new temporary name.

Definition at line 118 of file remote_app.hpp.

References m_Files.

Referenced by CRemoteAppClientSampleApp::Run().

◆ Deserialize()

void CRemoteAppRequest::Deserialize ( CNcbiIstream is)
inline

◆ GetAppRunTimeout()

unsigned int CRemoteAppRequest::GetAppRunTimeout ( ) const
inline

Definition at line 111 of file remote_app.hpp.

References m_AppRunTimeout.

Referenced by CRemoteAppJob::Do(), SRemoteApp::Input(), and Send().

◆ GetCmdLine()

const string& CRemoteAppRequest::GetCmdLine ( ) const
inline

Get the command line of the remote application.

Definition at line 108 of file remote_app.hpp.

References m_CmdLine.

Referenced by CRemoteAppJob::Do(), SRemoteApp::Input(), Send(), and x_Deserialize().

◆ GetFileNames()

const TFiles& CRemoteAppRequest::GetFileNames ( ) const
inlineprotected

Definition at line 169 of file remote_app.hpp.

References m_Files.

Referenced by Send().

◆ GetInBlobIdOrData()

const string& CRemoteAppRequest::GetInBlobIdOrData ( ) const
inline

Definition at line 154 of file remote_app.hpp.

References m_InBlobIdOrData.

Referenced by CRemoteAppJob::Do(), and SRemoteApp::Input().

◆ GetNetCacheAPI()

CNetCacheAPI& CRemoteAppRequest::GetNetCacheAPI ( )
inlineprotected

Definition at line 168 of file remote_app.hpp.

References m_NetCacheAPI.

Referenced by Send(), and x_Deserialize().

◆ GetStdErrFileName()

const string& CRemoteAppRequest::GetStdErrFileName ( ) const
inline

Definition at line 150 of file remote_app.hpp.

References m_StdErrFileName.

Referenced by CRemoteAppJob::Do().

◆ GetStdIn()

CNcbiOstream& CRemoteAppRequest::GetStdIn ( )
inline

Get an output stream to write data to a remote application stdin.

Definition at line 126 of file remote_app.hpp.

References eBlobStorage, CBlobStreamHelper::GetOStream(), m_MaxInlineSize, and m_StdIn.

Referenced by CGridCommandLineInterfaceApp::PrepareRemoteAppJobInput(), and CRemoteAppClientSampleApp::Run().

◆ GetStdInForRead()

CNcbiIstream& CRemoteAppRequest::GetStdInForRead ( )
inline

Get the stdin stream of the remote application.

Definition at line 131 of file remote_app.hpp.

References CBlobStreamHelper::GetIStream(), and m_StdIn.

Referenced by CRemoteAppJob::Do(), and CGridCommandLineInterfaceApp::DumpJobInputOutput().

◆ GetStdOutErrStorageType()

EStdOutErrStorageType CRemoteAppRequest::GetStdOutErrStorageType ( ) const
inline

Definition at line 151 of file remote_app.hpp.

References m_StorageType.

Referenced by CRemoteAppJob::Do().

◆ GetStdOutFileName()

const string& CRemoteAppRequest::GetStdOutFileName ( ) const
inline

Definition at line 149 of file remote_app.hpp.

References m_StdOutFileName.

Referenced by CRemoteAppJob::Do().

◆ GetWorkingDir()

const string& CRemoteAppRequest::GetWorkingDir ( ) const
inline

Definition at line 123 of file remote_app.hpp.

References m_TmpDirName.

Referenced by x_Deserialize().

◆ IsExclusiveMode()

bool CRemoteAppRequest::IsExclusiveMode ( ) const
inline

Definition at line 137 of file remote_app.hpp.

References m_ExlusiveMode.

Referenced by SRemoteApp::Input().

◆ Reset()

void CRemoteAppRequest::Reset ( void  )

◆ Send()

void CRemoteAppRequest::Send ( CNcbiOstream os)

◆ SetAppRunTimeout()

void CRemoteAppRequest::SetAppRunTimeout ( unsigned int  sec)
inline

Definition at line 110 of file remote_app.hpp.

References m_AppRunTimeout.

Referenced by x_Deserialize().

◆ SetCmdLine()

void CRemoteAppRequest::SetCmdLine ( const string cmdline)
inline

Set the command line for the remote application.

The command line must not contain the remote program name – only its arguments.

Definition at line 106 of file remote_app.hpp.

References m_CmdLine.

Referenced by CGridCommandLineInterfaceApp::PrepareRemoteAppJobInput(), CRemoteAppClientSampleApp::Run(), and x_Deserialize().

◆ SetExclusiveMode()

void CRemoteAppRequest::SetExclusiveMode ( bool  on_off)
inline

Definition at line 136 of file remote_app.hpp.

References m_ExlusiveMode.

◆ SetMaxInlineSize()

void CRemoteAppRequest::SetMaxInlineSize ( size_t  max_inline_size)
inline

Definition at line 156 of file remote_app.hpp.

References m_MaxInlineSize.

Referenced by CGridCommandLineInterfaceApp::PrepareRemoteAppJobInput().

◆ SetStdOutErrFileNames()

void CRemoteAppRequest::SetStdOutErrFileNames ( const string stdout_fname,
const string stderr_fname,
EStdOutErrStorageType  type 
)
inline

Definition at line 140 of file remote_app.hpp.

References m_StdErrFileName, m_StdOutFileName, m_StorageType, and type.

◆ x_CreateWDir()

void CRemoteAppRequest::x_CreateWDir ( )
protected

◆ x_Deserialize()

bool CRemoteAppRequest::x_Deserialize ( CNcbiIstream is,
TStoredFiles files = NULL 
)
protected

◆ x_RemoveWDir()

void CRemoteAppRequest::x_RemoveWDir ( )
protected

Definition at line 313 of file remote_app.cpp.

References CDir::Exists(), m_TmpDirName, and CDir::Remove().

Referenced by Reset().

Member Data Documentation

◆ m_AppRunTimeout

unsigned int CRemoteAppRequest::m_AppRunTimeout
private

Definition at line 182 of file remote_app.hpp.

Referenced by GetAppRunTimeout(), Reset(), and SetAppRunTimeout().

◆ m_CmdLine

string CRemoteAppRequest::m_CmdLine
private

Definition at line 181 of file remote_app.hpp.

Referenced by GetCmdLine(), Reset(), and SetCmdLine().

◆ m_ExlusiveMode

bool CRemoteAppRequest::m_ExlusiveMode
private

Definition at line 196 of file remote_app.hpp.

Referenced by IsExclusiveMode(), Reset(), Send(), SetExclusiveMode(), and x_Deserialize().

◆ m_Files

TFiles CRemoteAppRequest::m_Files
private

Definition at line 186 of file remote_app.hpp.

Referenced by AddFileForTransfer(), GetFileNames(), and Reset().

◆ m_InBlobIdOrData

string CRemoteAppRequest::m_InBlobIdOrData
private

Definition at line 191 of file remote_app.hpp.

Referenced by GetInBlobIdOrData(), Reset(), Send(), and x_Deserialize().

◆ m_MaxInlineSize

size_t CRemoteAppRequest::m_MaxInlineSize
private

Definition at line 197 of file remote_app.hpp.

Referenced by GetStdIn(), and SetMaxInlineSize().

◆ m_NetCacheAPI

CNetCacheAPI CRemoteAppRequest::m_NetCacheAPI
private

Definition at line 180 of file remote_app.hpp.

Referenced by GetNetCacheAPI().

◆ m_StdErrFileName

string CRemoteAppRequest::m_StdErrFileName
private

Definition at line 193 of file remote_app.hpp.

Referenced by GetStdErrFileName(), Send(), SetStdOutErrFileNames(), and x_Deserialize().

◆ m_StdIn

CBlobStreamHelper CRemoteAppRequest::m_StdIn
private

Definition at line 188 of file remote_app.hpp.

Referenced by GetStdIn(), GetStdInForRead(), Reset(), and Send().

◆ m_StdInDataSize

size_t CRemoteAppRequest::m_StdInDataSize
private

Definition at line 189 of file remote_app.hpp.

Referenced by Reset().

◆ m_StdOutFileName

string CRemoteAppRequest::m_StdOutFileName
private

Definition at line 194 of file remote_app.hpp.

Referenced by GetStdOutFileName(), Send(), SetStdOutErrFileNames(), and x_Deserialize().

◆ m_StorageType

EStdOutErrStorageType CRemoteAppRequest::m_StorageType
private

◆ m_TmpDirName

string CRemoteAppRequest::m_TmpDirName
private

Definition at line 185 of file remote_app.hpp.

Referenced by GetWorkingDir(), x_CreateWDir(), and x_RemoveWDir().

◆ m_TmpDirPath

string CRemoteAppRequest::m_TmpDirPath
private

Definition at line 184 of file remote_app.hpp.

Referenced by x_CreateWDir().

◆ sm_DirCounter

CAtomicCounter CRemoteAppRequest::sm_DirCounter
staticprivate

Definition at line 178 of file remote_app.hpp.

Referenced by x_CreateWDir().


The documentation for this class was generated from the following files:
Modified on Sun May 19 04:45:15 2024 by modify_doxy.py rev. 669887