NCBI C++ ToolKit
|
Search Toolkit Book for CRemoteAppRequest
Remote Application Request (both client side and application executor side) More...
#include <connect/services/remote_app.hpp>
Protected Types | |
typedef map< string, EStdOutErrStorageType > | TFiles |
typedef map< string, string > | TStoredFiles |
Protected Member Functions | |
CNetCacheAPI & | GetNetCacheAPI () |
const TFiles & | GetFileNames () const |
void | x_CreateWDir () |
void | x_RemoveWDir () |
bool | x_Deserialize (CNcbiIstream &is, TStoredFiles *files=NULL) |
Static Private Attributes | |
static CAtomicCounter | sm_DirCounter |
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.
|
protected |
Definition at line 166 of file remote_app.hpp.
|
protected |
Definition at line 174 of file remote_app.hpp.
|
explicit |
Definition at line 327 of file remote_app.cpp.
CRemoteAppRequest::~CRemoteAppRequest | ( | ) |
Definition at line 157 of file remote_app.cpp.
References NCBI_CATCH_ALL_X, and Reset().
|
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().
|
inline |
Definition at line 161 of file remote_app.hpp.
References x_Deserialize().
Referenced by CRemoteAppJob::Do(), and CGridCommandLineInterfaceApp::DumpJobInputOutput().
|
inline |
Definition at line 111 of file remote_app.hpp.
References m_AppRunTimeout.
Referenced by CRemoteAppJob::Do(), SRemoteApp::Input(), and Send().
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().
Definition at line 154 of file remote_app.hpp.
References m_InBlobIdOrData.
Referenced by CRemoteAppJob::Do(), and SRemoteApp::Input().
|
inlineprotected |
Definition at line 168 of file remote_app.hpp.
References m_NetCacheAPI.
Referenced by Send(), and x_Deserialize().
Definition at line 150 of file remote_app.hpp.
References m_StdErrFileName.
Referenced by CRemoteAppJob::Do().
|
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().
|
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().
|
inline |
Definition at line 151 of file remote_app.hpp.
References m_StorageType.
Referenced by CRemoteAppJob::Do().
Definition at line 149 of file remote_app.hpp.
References m_StdOutFileName.
Referenced by CRemoteAppJob::Do().
Definition at line 123 of file remote_app.hpp.
References m_TmpDirName.
Referenced by x_Deserialize().
|
inline |
Definition at line 137 of file remote_app.hpp.
References m_ExlusiveMode.
Referenced by SRemoteApp::Input().
void CRemoteAppRequest::Reset | ( | void | ) |
Definition at line 289 of file remote_app.cpp.
References map_checker< Container >::clear(), m_AppRunTimeout, m_CmdLine, m_ExlusiveMode, m_Files, m_InBlobIdOrData, m_StdIn, m_StdInDataSize, CBlobStreamHelper::Reset(), and x_RemoveWDir().
Referenced by CRemoteAppJob::Do(), Send(), x_Deserialize(), and ~CRemoteAppRequest().
void CRemoteAppRequest::Send | ( | CNcbiOstream & | os | ) |
Serialize a request to a given stream.
After call to this method the instance cleans itself an it can be reused.
Definition at line 164 of file remote_app.cpp.
References eLocalFile, file, NStr::Find(), GetAppRunTimeout(), GetCmdLine(), GetFileNames(), GetNetCacheAPI(), int, ITERATE, kLocalFSSign, LOG_POST_X, m_ExlusiveMode, m_InBlobIdOrData, m_StdErrFileName, m_StdIn, m_StdOutFileName, m_StorageType, NPOS, CBlobStreamHelper::Reset(), Reset(), Warning(), and WriteStrWithLen().
Referenced by CGridCommandLineInterfaceApp::PrepareRemoteAppJobInput(), and CRemoteAppClientSampleApp::Run().
|
inline |
Definition at line 110 of file remote_app.hpp.
References m_AppRunTimeout.
Referenced by x_Deserialize().
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().
|
inline |
Definition at line 136 of file remote_app.hpp.
References m_ExlusiveMode.
|
inline |
Definition at line 156 of file remote_app.hpp.
References m_MaxInlineSize.
Referenced by CGridCommandLineInterfaceApp::PrepareRemoteAppJobInput().
|
inline |
Definition at line 140 of file remote_app.hpp.
References m_StdErrFileName, m_StdOutFileName, m_StorageType, and type.
|
protected |
Definition at line 302 of file remote_app.cpp.
References CAtomicCounter::Add(), CDir::CreatePath(), CDir::Exists(), m_TmpDirName, m_TmpDirPath, NStr::NumericToString(), CDir::Remove(), and sm_DirCounter.
Referenced by x_Deserialize().
|
protected |
Definition at line 225 of file remote_app.cpp.
References map_checker< Container >::clear(), GetCmdLine(), GetIStream(), GetNetCacheAPI(), CDirEntry::GetPathSeparator(), GetWorkingDir(), i, map_checker< Container >::insert(), JoinCmdLine(), kEmptyStr, kLocalFSSign, m_ExlusiveMode, m_InBlobIdOrData, m_StdErrFileName, m_StdOutFileName, m_StorageType, ReadStrWithLen(), Reset(), s_ReplaceArg(), SetAppRunTimeout(), SetCmdLine(), tmp, TokenizeCmdLine(), and x_CreateWDir().
Referenced by Deserialize(), and SRemoteApp::SRequest::SRequest().
|
protected |
Definition at line 313 of file remote_app.cpp.
References CDir::Exists(), m_TmpDirName, and CDir::Remove().
Referenced by Reset().
|
private |
Definition at line 182 of file remote_app.hpp.
Referenced by GetAppRunTimeout(), Reset(), and SetAppRunTimeout().
|
private |
Definition at line 181 of file remote_app.hpp.
Referenced by GetCmdLine(), Reset(), and SetCmdLine().
|
private |
Definition at line 196 of file remote_app.hpp.
Referenced by IsExclusiveMode(), Reset(), Send(), SetExclusiveMode(), and x_Deserialize().
|
private |
Definition at line 186 of file remote_app.hpp.
Referenced by AddFileForTransfer(), GetFileNames(), and Reset().
|
private |
Definition at line 191 of file remote_app.hpp.
Referenced by GetInBlobIdOrData(), Reset(), Send(), and x_Deserialize().
|
private |
Definition at line 197 of file remote_app.hpp.
Referenced by GetStdIn(), and SetMaxInlineSize().
|
private |
Definition at line 180 of file remote_app.hpp.
Referenced by GetNetCacheAPI().
|
private |
Definition at line 193 of file remote_app.hpp.
Referenced by GetStdErrFileName(), Send(), SetStdOutErrFileNames(), and x_Deserialize().
|
private |
Definition at line 188 of file remote_app.hpp.
Referenced by GetStdIn(), GetStdInForRead(), Reset(), and Send().
|
private |
Definition at line 189 of file remote_app.hpp.
Referenced by Reset().
|
private |
Definition at line 194 of file remote_app.hpp.
Referenced by GetStdOutFileName(), Send(), SetStdOutErrFileNames(), and x_Deserialize().
|
private |
Definition at line 195 of file remote_app.hpp.
Referenced by GetStdOutErrStorageType(), Send(), SetStdOutErrFileNames(), and x_Deserialize().
|
private |
Definition at line 185 of file remote_app.hpp.
Referenced by GetWorkingDir(), x_CreateWDir(), and x_RemoveWDir().
|
private |
Definition at line 184 of file remote_app.hpp.
Referenced by x_CreateWDir().
|
staticprivate |
Definition at line 178 of file remote_app.hpp.
Referenced by x_CreateWDir().