NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
CNetStorageHandler Class Reference

Search Toolkit Book for CNetStorageHandler

#include "nst_handler.hpp"
(Private to src/app/netstorage.)

+ Inheritance diagram for CNetStorageHandler:
+ Collaboration diagram for CNetStorageHandler:

Classes

struct  SProcessorMap
 

Public Types

enum  EHTTPStatus {
  eStatus_OK = 200 , eStatus_BadRequest = 400 , eStatus_NotFound = 404 , eStatus_Inactive = 408 ,
  eStatus_Probe = 444 , eStatus_SocketIOError = 499 , eStatus_ServerError = 500 , eStatus_NotImplemented = 501 ,
  eStatus_ShuttingDown = 503
}
 
enum  ESocketTimeoutTreat { eTimeoutIsError , eTimeoutIsOK }
 
- Public Types inherited from IServer_ConnectionHandler
enum  EClosePeer { eOurClose , eClientClose }
 Type of connection closing. More...
 

Public Member Functions

 CNetStorageHandler (CNetStorageServer *server)
 
 ~CNetStorageHandler ()
 
virtual EIO_Event GetEventsToPollFor (const CTime **alarm_time) const
 Following three methods are guaranteed to be called NOT at the same time as On*, so if you implement them you should not guard the variables which they can use with mutexes. More...
 
virtual void OnOpen (void)
 Runs in response to an external event [asynchronous]. More...
 
virtual void OnRead (void)
 The client has just sent data. More...
 
virtual void OnWrite (void)
 The client is ready to receive data. More...
 
virtual void OnClose (IServer_ConnectionHandler::EClosePeer peer)
 The connection has closed (with information on type of closing) More...
 
virtual void OnTimeout (void)
 Runs when a client has been idle for too long, prior to closing the connection [synchronous]. More...
 
virtual void OnOverflow (EOverflowReason reason)
 Runs when there are insufficient resources to queue a connection, prior to closing it. More...
 
- Public Member Functions inherited from IServer_ConnectionHandler
virtual ~IServer_ConnectionHandler ()
 
virtual const STimeoutGetTimeout (void)
 Returns the timeout for this connection. More...
 
virtual bool IsOpen (void)
 Returns connection handler's perception of whether we open or not. More...
 
virtual bool IsReadyToProcess (void) const
 Returns the handler's readiness to process input data or to write some output data. More...
 
virtual void OnTimer (void)
 This method is called at the moment in time specified earlier by the alarm_time parameter of the GetEventsToPollFor method [synchronous]. More...
 
virtual void OnError (const string &)
 Runs when a socket error is detected. More...
 
CSocketGetSocket (void)
 Get underlying socket. More...
 
void SetSocket (CSocket *socket)
 

Private Types

enum  EReadMode { eReadMessages , eReadRawData }
 
enum  EOp { eReadOp , eWriteOp , eRelocateOp }
 
typedef void(CNetStorageHandler::* FProcessor) (const CJsonNode &, const SCommonRequestArguments &)
 

Private Member Functions

bool x_ReadRawData ()
 
void x_OnMessage (const CJsonNode &message)
 
void x_OnData (const void *data, size_t data_size)
 
void x_SendWriteConfirmation ()
 
EIO_Status x_SendSyncMessage (const CJsonNode &message, ESocketTimeoutTreat timeout_treat=eTimeoutIsError)
 
EIO_Status x_SendOutputBuffer (ESocketTimeoutTreat timeout_treat)
 
void x_OnSocketWriteError (EIO_Status status, size_t bytes_written, const char *output_buffer, size_t output_buffer_size)
 
void x_PrintMessageRequestStart (const CJsonNode &message)
 
void x_PrintMessageRequestStop (void)
 
void x_SendAsyncMessage (const CJsonNode &message)
 
void x_SetQuickAcknowledge (void)
 
void x_SetCmdRequestStatus (unsigned int status)
 
void x_SetConnRequestStatus (unsigned int status)
 
void x_CreateConnContext (void)
 
unsigned int x_GetPeerAddress (void)
 
FProcessor x_FindProcessor (const SCommonRequestArguments &common_args)
 
void x_ProcessBye (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessHello (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessInfo (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessConfiguration (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessHealth (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessAckAlert (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessReconfigure (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessShutdown (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessGetClientsInfo (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessGetUsersInfo (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessGetMetadataInfo (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessGetObjectInfo (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessGetAttrList (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessGetClientObjects (const CJsonNode &message, const SCommonRequestArguments &comm_args)
 
void x_ProcessGetUserObjects (const CJsonNode &message, const SCommonRequestArguments &comm_args)
 
void x_ProcessGetAttr (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessSetAttr (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessDelAttr (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessRead (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessCreate (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessWrite (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessDelete (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessRelocate (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessExists (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessGetSize (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessSetExpTime (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
void x_ProcessLockFTPath (const CJsonNode &message, const SCommonRequestArguments &common_args)
 
CDirectNetStorageObject x_GetObject (const CJsonNode &message, bool need_fake_write=false)
 
void x_CheckObjectLoc (const string &object_loc) const
 
void x_CheckICacheSettings (const SICacheSettings &icache_settings)
 
void x_CheckUserKey (const SUserKey &user_key)
 
void x_GetStorageParams (const CJsonNode &message, SICacheSettings *icache_settings, SUserKey *user_key, TNetStorageFlags *flags)
 
CDirectNetStorageObject x_CreateObjectStream (const SICacheSettings &icache_settings, TNetStorageFlags flags)
 
EIO_Status x_SendOverUTTP ()
 
EMetadataOption x_ConvertMetadataArgument (const CJsonNode &message) const
 
void x_ValidateWriteMetaDBAccess (const CJsonNode &message, bool expect_object=true) const
 
bool x_DetectMetaDBNeedUpdate (const CJsonNode &message, CNSTServiceProperties &props) const
 
bool x_DetectMetaDBNeedOnCreate (TNetStorageFlags flags)
 
bool x_DetectMetaDBNeedOnGetObjectInfo (const CJsonNode &message, CNSTServiceProperties &props) const
 
void x_CreateClient (void)
 
Int8 x_GetClientID (const string &client)
 
void x_CreateUser (void)
 
Int8 x_GetUserID (const CNSTUserID &user)
 
void x_FillObjectInfo (CJsonNode &reply, const string &val)
 
void x_SetObjectInfoReply (CJsonNode &reply, const string &name, const TNSTDBValue< CTime > &value)
 
void x_SetObjectInfoReply (CJsonNode &reply, const string &name, const TNSTDBValue< Int8 > &value)
 
void x_SetObjectInfoReply (CJsonNode &reply, const string &name, const TNSTDBValue< string > &value)
 
void x_OptionalExpirationUpdate (CDirectNetStorageObject &object, CJsonNode &reply, const string &user_message)
 
void x_CheckExistanceStatus (int status)
 
void x_CheckExpirationStatus (int status)
 
void x_CheckNonAnonymousClient (const string &op) const
 
string x_GetConnRef (void)
 
void x_ProlongObjectOnFailure (EOp operation, const string &object_key, const CNSTServiceProperties &service_props)
 

Private Attributes

CNetStorageServerm_Server
 
CRef< CRequestContextm_ConnContext
 
CRef< CRequestContextm_CmdContext
 
string m_Service
 
string m_Client
 
char m_ReadBuffer [kReadBufferSize]
 
EReadMode m_ReadMode
 
CUTTPReader m_UTTPReader
 
CJsonOverUTTPReader m_JSONReader
 
char m_WriteBuffer [kWriteBufferSize]
 
CUTTPWriter m_UTTPWriter
 
CJsonOverUTTPWriter m_JSONWriter
 
CFastMutex m_OutputQueueMutex
 
vector< CJsonNodem_OutputQueue
 
CDirectNetStorageObject m_ObjectBeingWritten
 
Int8 m_DataMessageSN
 
EMetadataOption m_MetadataOption
 
bool m_CreateRequest
 
TNSTDBValue< CTimeSpanm_CreateTTL
 
Int8 m_DBClientID
 
Int8 m_DBUserID
 
Int8 m_ObjectSize
 
CNSTServiceProperties m_WriteServiceProps
 
bool m_ByeReceived
 
bool m_FirstMessage
 
bool m_WriteCreateNeedMetaDBUpdate
 
CNSTTiming m_Timing
 

Static Private Attributes

static SProcessorMap sm_Processors []
 

Friends

class CRelocateCallback
 

Detailed Description

Definition at line 112 of file nst_handler.hpp.

Member Typedef Documentation

◆ FProcessor

typedef void(CNetStorageHandler::* CNetStorageHandler::FProcessor) (const CJsonNode &, const SCommonRequestArguments &)
private

Definition at line 237 of file nst_handler.hpp.

Member Enumeration Documentation

◆ EHTTPStatus

Enumerator
eStatus_OK 
eStatus_BadRequest 
eStatus_NotFound 
eStatus_Inactive 
eStatus_Probe 
eStatus_SocketIOError 
eStatus_ServerError 
eStatus_NotImplemented 
eStatus_ShuttingDown 

Definition at line 131 of file nst_handler.hpp.

◆ EOp

Enumerator
eReadOp 
eWriteOp 
eRelocateOp 

Definition at line 349 of file nst_handler.hpp.

◆ EReadMode

Enumerator
eReadMessages 
eReadRawData 

Definition at line 201 of file nst_handler.hpp.

◆ ESocketTimeoutTreat

Enumerator
eTimeoutIsError 
eTimeoutIsOK 

Definition at line 150 of file nst_handler.hpp.

Constructor & Destructor Documentation

◆ CNetStorageHandler()

CNetStorageHandler::CNetStorageHandler ( CNetStorageServer server)

Definition at line 165 of file nst_handler.cpp.

References kWriteBufferSize, m_UTTPWriter, m_WriteBuffer, and CUTTPWriter::Reset().

◆ ~CNetStorageHandler()

CNetStorageHandler::~CNetStorageHandler ( )

Definition at line 182 of file nst_handler.cpp.

Member Function Documentation

◆ GetEventsToPollFor()

EIO_Event CNetStorageHandler::GetEventsToPollFor ( const CTime **  ) const
virtual

Following three methods are guaranteed to be called NOT at the same time as On*, so if you implement them you should not guard the variables which they can use with mutexes.

Parameters
alarm_timeSet this parameter to a pointer to a CTime object to recieve an OnTimer event at the moment in time specified by this object.
Returns
Returns the set of events for which Poll should check.

Reimplemented from IServer_ConnectionHandler.

Definition at line 187 of file nst_handler.cpp.

References eIO_Read, eIO_ReadWrite, and m_OutputQueue.

◆ OnClose()

void CNetStorageHandler::OnClose ( IServer_ConnectionHandler::EClosePeer  )
virtual

◆ OnOpen()

void CNetStorageHandler::OnOpen ( void  )
virtual

Runs in response to an external event [asynchronous].

You can get socket by calling GetSocket(), if you close the socket this object will be destroyed. Individual events are: A client has just established this connection.

Implements IServer_ConnectionHandler.

Definition at line 198 of file nst_handler.cpp.

References CSocket::DisableOSSendDelay(), eIO_ReadWrite, CNetStorageServer::GetNetworkTimeout(), IServer_ConnectionHandler::GetSocket(), CNetStorageServer::IsLog(), m_Server, CSocket::SetTimeout(), x_CreateConnContext(), and x_SetQuickAcknowledge().

◆ OnOverflow()

void CNetStorageHandler::OnOverflow ( EOverflowReason  )
virtual

Runs when there are insufficient resources to queue a connection, prior to closing it.

Provides a reason why the connection is being close, which can be reported back to the client.

Reimplemented from IServer_ConnectionHandler.

Definition at line 430 of file nst_handler.cpp.

References eOR_ConnectionPoolFull, eOR_RequestQueueFull, eOR_UnpollableSocket, ERR_POST, m_CmdContext, m_ConnContext, CRef< C, Locker >::NotNull(), and CDiagContext::SetRequestContext().

◆ OnRead()

void CNetStorageHandler::OnRead ( void  )
virtual

◆ OnTimeout()

void CNetStorageHandler::OnTimeout ( void  )
virtual

Runs when a client has been idle for too long, prior to closing the connection [synchronous].

Reimplemented from IServer_ConnectionHandler.

Definition at line 423 of file nst_handler.cpp.

References eStatus_Inactive, m_ConnContext, CRef< C, Locker >::NotNull(), and CRequestContext::SetRequestStatus().

Referenced by OnRead().

◆ OnWrite()

void CNetStorageHandler::OnWrite ( void  )
virtual

◆ x_CheckExistanceStatus()

void CNetStorageHandler::x_CheckExistanceStatus ( int  status)
private

◆ x_CheckExpirationStatus()

void CNetStorageHandler::x_CheckExpirationStatus ( int  status)
private

◆ x_CheckICacheSettings()

void CNetStorageHandler::x_CheckICacheSettings ( const SICacheSettings icache_settings)
private

◆ x_CheckNonAnonymousClient()

void CNetStorageHandler::x_CheckNonAnonymousClient ( const string op) const
private

◆ x_CheckObjectLoc()

void CNetStorageHandler::x_CheckObjectLoc ( const string object_loc) const
private

◆ x_CheckUserKey()

void CNetStorageHandler::x_CheckUserKey ( const SUserKey user_key)
private

Definition at line 3580 of file nst_handler.cpp.

References SUserKey::m_AppDomain, SUserKey::m_UniqueID, and NCBI_THROW.

Referenced by x_GetStorageParams().

◆ x_ConvertMetadataArgument()

EMetadataOption CNetStorageHandler::x_ConvertMetadataArgument ( const CJsonNode message) const
private

◆ x_CreateClient()

void CNetStorageHandler::x_CreateClient ( void  )
private

◆ x_CreateConnContext()

void CNetStorageHandler::x_CreateConnContext ( void  )
private

◆ x_CreateObjectStream()

CDirectNetStorageObject CNetStorageHandler::x_CreateObjectStream ( const SICacheSettings icache_settings,
TNetStorageFlags  flags 
)
private

◆ x_CreateUser()

void CNetStorageHandler::x_CreateUser ( void  )
private

◆ x_DetectMetaDBNeedOnCreate()

bool CNetStorageHandler::x_DetectMetaDBNeedOnCreate ( TNetStorageFlags  flags)
private

◆ x_DetectMetaDBNeedOnGetObjectInfo()

bool CNetStorageHandler::x_DetectMetaDBNeedOnGetObjectInfo ( const CJsonNode message,
CNSTServiceProperties props 
) const
private

◆ x_DetectMetaDBNeedUpdate()

bool CNetStorageHandler::x_DetectMetaDBNeedUpdate ( const CJsonNode message,
CNSTServiceProperties props 
) const
private

◆ x_FillObjectInfo()

void CNetStorageHandler::x_FillObjectInfo ( CJsonNode reply,
const string val 
)
private

Definition at line 1897 of file nst_handler.cpp.

References CJsonNode::SetString(), and val.

Referenced by x_ProcessGetObjectInfo().

◆ x_FindProcessor()

CNetStorageHandler::FProcessor CNetStorageHandler::x_FindProcessor ( const SCommonRequestArguments common_args)
private

◆ x_GetClientID()

Int8 CNetStorageHandler::x_GetClientID ( const string client)
private

◆ x_GetConnRef()

string CNetStorageHandler::x_GetConnRef ( void  )
private

◆ x_GetObject()

CDirectNetStorageObject CNetStorageHandler::x_GetObject ( const CJsonNode message,
bool  need_fake_write = false 
)
private

◆ x_GetPeerAddress()

unsigned int CNetStorageHandler::x_GetPeerAddress ( void  )
private

◆ x_GetStorageParams()

void CNetStorageHandler::x_GetStorageParams ( const CJsonNode message,
SICacheSettings icache_settings,
SUserKey user_key,
TNetStorageFlags flags 
)
private

◆ x_GetUserID()

Int8 CNetStorageHandler::x_GetUserID ( const CNSTUserID user)
private

◆ x_OnData()

void CNetStorageHandler::x_OnData ( const void *  data,
size_t  data_size 
)
private

◆ x_OnMessage()

void CNetStorageHandler::x_OnMessage ( const CJsonNode message)
private

◆ x_OnSocketWriteError()

void CNetStorageHandler::x_OnSocketWriteError ( EIO_Status  status,
size_t  bytes_written,
const char *  output_buffer,
size_t  output_buffer_size 
)
private

◆ x_OptionalExpirationUpdate()

void CNetStorageHandler::x_OptionalExpirationUpdate ( CDirectNetStorageObject object,
CJsonNode reply,
const string user_message 
)
private

◆ x_PrintMessageRequestStart()

void CNetStorageHandler::x_PrintMessageRequestStart ( const CJsonNode message)
private

◆ x_PrintMessageRequestStop()

void CNetStorageHandler::x_PrintMessageRequestStop ( void  )
private

◆ x_ProcessAckAlert()

void CNetStorageHandler::x_ProcessAckAlert ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessBye()

void CNetStorageHandler::x_ProcessBye ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessConfiguration()

void CNetStorageHandler::x_ProcessConfiguration ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessCreate()

void CNetStorageHandler::x_ProcessCreate ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessDelAttr()

void CNetStorageHandler::x_ProcessDelAttr ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessDelete()

void CNetStorageHandler::x_ProcessDelete ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessExists()

void CNetStorageHandler::x_ProcessExists ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessGetAttr()

void CNetStorageHandler::x_ProcessGetAttr ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessGetAttrList()

void CNetStorageHandler::x_ProcessGetAttrList ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessGetClientObjects()

void CNetStorageHandler::x_ProcessGetClientObjects ( const CJsonNode message,
const SCommonRequestArguments comm_args 
)
private

◆ x_ProcessGetClientsInfo()

void CNetStorageHandler::x_ProcessGetClientsInfo ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessGetMetadataInfo()

void CNetStorageHandler::x_ProcessGetMetadataInfo ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessGetObjectInfo()

void CNetStorageHandler::x_ProcessGetObjectInfo ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessGetSize()

void CNetStorageHandler::x_ProcessGetSize ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessGetUserObjects()

void CNetStorageHandler::x_ProcessGetUserObjects ( const CJsonNode message,
const SCommonRequestArguments comm_args 
)
private

◆ x_ProcessGetUsersInfo()

void CNetStorageHandler::x_ProcessGetUsersInfo ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessHealth()

void CNetStorageHandler::x_ProcessHealth ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessHello()

void CNetStorageHandler::x_ProcessHello ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessInfo()

void CNetStorageHandler::x_ProcessInfo ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessLockFTPath()

void CNetStorageHandler::x_ProcessLockFTPath ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessRead()

void CNetStorageHandler::x_ProcessRead ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

Definition at line 2515 of file nst_handler.cpp.

References CNSTClientRegistry::AddBytesRead(), CNSTClientRegistry::AddObjectsRead(), CNSTTiming::Append(), AppendError(), CNSTClientRegistry::AppendType(), buffer, CNetStorageObject::Close(), CreateErrorResponseMessage(), CreateResponseMessage(), CNSTPreciseTime::Current(), CNetStorageServerError::eDatabaseError, eIO_Success, eMetadataNotSpecified, eMetadataRequired, CNetStorageObject::Eof(), CNSTClient::eReader, CNetStorageServerError::eReadError, eReadOp, ERR_POST, CNSTDatabase::ExecSP_DoesObjectExist(), CNSTDatabase::ExecSP_GetObjectExpiration(), CNSTDatabase::ExecSP_UpdateObjectOnRead(), CJsonNode::GetBoolean(), CNetStorageServer::GetClientRegistry(), CNetStorageServer::GetDb(), CNetStorageObjectLoc::GetLocator(), CNSTServiceProperties::GetProlongOnRead(), GetReplyMessageProperties(), CNSTServiceProperties::GetTTL(), CNetStorageObjectLoc::GetUniqueKey(), CJsonNode::HasKey(), CNetStorageServer::IsLogTimingNSTAPI(), kObjectNotFound, kReadBufferSize, kScopeUnknownException, kSPObjectNotFound, CDirectNetStorageObject::Locator(), m_Client, m_CmdContext, m_DBClientID, m_MetadataOption, SCommonRequestArguments::m_SerialNumber, m_Server, m_Timing, m_UTTPWriter, NCBI_ERRCODE_X_NAME, NCBI_THROW, CRef< C, Locker >::NotNull(), CNetStorageObject::Read(), CUTTPWriter::SendChunk(), CUTTPWriter::SendControlSymbol(), CRequestContext::SetBytesRd(), string, x_CheckExpirationStatus(), x_CheckNonAnonymousClient(), x_CreateClient(), x_DetectMetaDBNeedUpdate(), x_GetObject(), x_OptionalExpirationUpdate(), x_PrintMessageRequestStop(), x_ProlongObjectOnFailure(), x_SendOverUTTP(), and x_SendSyncMessage().

◆ x_ProcessReconfigure()

void CNetStorageHandler::x_ProcessReconfigure ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

Definition at line 1384 of file nst_handler.cpp.

References CNetStorageServer::AcknowledgeAlert(), CNetStorageServer::AnybodyCanReconfigure(), CNSTClientRegistry::AppendType(), AppendWarning(), CreateResponseMessage(), eAccess, CNSTClient::eAdministrator, eConfigNotChangedWarning, eConfigOutOfSync, eDecryptAdminNames, eReconfigure, ERR_POST, eStartupConfig, CDiagContext::Extra(), CMetaRegistry::fReloadIfChanged, CNetStorageServer::GetBackendConfDiff(), CNetStorageServer::GetClientRegistry(), CNcbiApplicationAPI::GetConfig(), CNcbiApplicationAPI::GetConfigPath(), CNetStorageServer::GetDb(), GetDiagContext(), CNcbiApplication::Instance(), CNetStorageServer::IsAdminClientName(), CJsonNode::IsNull(), kScopeLogic, m_Client, m_ConnContext, SCommonRequestArguments::m_SerialNumber, m_Server, NCBI_ERRCODE_X_NAME, NCBI_THROW, CJsonNode::NewObjectNode(), CRef< C, Locker >::NotNull(), NST_GetConfigFileChecksum(), NSTGetBackendConfiguration(), NSTValidateConfigFile(), CDiagContext_Extra::Print(), SNetStorageServerParameters::Read(), CNetStorageServer::ReadMetadataConfiguration(), CNetStorageServer::RegisterAlert(), CNcbiEncrypt::Reload(), CNcbiApplicationAPI::ReloadConfig(), CNetStorageServer::SetAnybodyCanReconfigure(), CNetStorageServer::SetBackendConfiguration(), CJsonNode::SetByKey(), CNetStorageServer::SetDiskConfigFileChecksum(), CNSTDatabase::SetParameters(), CNetStorageServer::SetParameters(), CNetStorageServer::SetRAMConfigFileChecksum(), x_CheckNonAnonymousClient(), x_PrintMessageRequestStop(), and x_SendSyncMessage().

◆ x_ProcessRelocate()

void CNetStorageHandler::x_ProcessRelocate ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

Definition at line 2834 of file nst_handler.cpp.

References CNSTClientRegistry::AddObjectsRelocated(), CNSTTiming::Append(), AppendError(), CNSTClientRegistry::AppendType(), CRelocateCallback::Callback(), CreateResponseMessage(), CNSTPreciseTime::Current(), CNetStorageServerError::eDatabaseError, CNetStorageException::eInterrupted, eMetadataMonitoring, eMetadataNotSpecified, eMetadataRequired, eRelocateOp, ERR_POST, CNSTClient::eWriter, CNSTDatabase::ExecSP_DoesObjectExist(), CNSTDatabase::ExecSP_GetObjectExpiration(), CNSTDatabase::ExecSP_UpdateObjectOnRelocate(), CDiagContext::Extra(), ExtractICacheSettings(), ExtractStorageFlags(), CJsonNode::GetBoolean(), CJsonNode::GetByKey(), CNetStorageServer::GetClientRegistry(), CNetStorageServer::GetDb(), GetDiagContext(), CException::GetErrCode(), CNSTServiceProperties::GetProlongOnRelocate(), GetReplyMessageProperties(), CNSTServiceProperties::GetTTL(), CNetStorageObjectLoc::GetUniqueKey(), CJsonNode::HasKey(), CNetStorageServer::IsLogTimingNSTAPI(), kObjectNotFound, kScopeUnknownException, kSPObjectNotFound, CDirectNetStorageObject::Locator(), m_Client, m_ConnContext, m_DBClientID, m_MetadataOption, SCommonRequestArguments::m_SerialNumber, m_Server, m_Timing, NCBI_ERRCODE_X_NAME, NCBI_THROW, CRef< C, Locker >::NotNull(), CDiagContext_Extra::Print(), CDirectNetStorageObject::Relocate(), CJsonNode::SetString(), x_CheckExpirationStatus(), x_CheckICacheSettings(), x_CheckNonAnonymousClient(), x_CreateClient(), x_DetectMetaDBNeedUpdate(), x_GetObject(), x_PrintMessageRequestStop(), x_ProlongObjectOnFailure(), and x_SendSyncMessage().

◆ x_ProcessSetAttr()

void CNetStorageHandler::x_ProcessSetAttr ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessSetExpTime()

void CNetStorageHandler::x_ProcessSetExpTime ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessShutdown()

void CNetStorageHandler::x_ProcessShutdown ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProcessWrite()

void CNetStorageHandler::x_ProcessWrite ( const CJsonNode message,
const SCommonRequestArguments common_args 
)
private

◆ x_ProlongObjectOnFailure()

void CNetStorageHandler::x_ProlongObjectOnFailure ( EOp  operation,
const string object_key,
const CNSTServiceProperties service_props 
)
private

◆ x_ReadRawData()

bool CNetStorageHandler::x_ReadRawData ( )
private

◆ x_SendAsyncMessage()

void CNetStorageHandler::x_SendAsyncMessage ( const CJsonNode message)
private

◆ x_SendOutputBuffer()

EIO_Status CNetStorageHandler::x_SendOutputBuffer ( ESocketTimeoutTreat  timeout_treat)
private

◆ x_SendOverUTTP()

EIO_Status CNetStorageHandler::x_SendOverUTTP ( )
private

◆ x_SendSyncMessage()

EIO_Status CNetStorageHandler::x_SendSyncMessage ( const CJsonNode message,
ESocketTimeoutTreat  timeout_treat = eTimeoutIsError 
)
private

◆ x_SendWriteConfirmation()

void CNetStorageHandler::x_SendWriteConfirmation ( )
private

◆ x_SetCmdRequestStatus()

void CNetStorageHandler::x_SetCmdRequestStatus ( unsigned int  status)
inlineprivate

◆ x_SetConnRequestStatus()

void CNetStorageHandler::x_SetConnRequestStatus ( unsigned int  status)
inlineprivate

◆ x_SetObjectInfoReply() [1/3]

void CNetStorageHandler::x_SetObjectInfoReply ( CJsonNode reply,
const string name,
const TNSTDBValue< CTime > &  value 
)
private

Definition at line 1917 of file nst_handler.cpp.

References CJsonNode::SetString(), and rapidjson::value.

Referenced by x_ProcessGetObjectInfo().

◆ x_SetObjectInfoReply() [2/3]

void CNetStorageHandler::x_SetObjectInfoReply ( CJsonNode reply,
const string name,
const TNSTDBValue< Int8 > &  value 
)
private

◆ x_SetObjectInfoReply() [3/3]

void CNetStorageHandler::x_SetObjectInfoReply ( CJsonNode reply,
const string name,
const TNSTDBValue< string > &  value 
)
private

Definition at line 1941 of file nst_handler.cpp.

References CJsonNode::SetString(), and rapidjson::value.

◆ x_SetQuickAcknowledge()

void CNetStorageHandler::x_SetQuickAcknowledge ( void  )
private

Definition at line 1014 of file nst_handler.cpp.

References CSocket::GetOSHandle(), IServer_ConnectionHandler::GetSocket(), and val.

Referenced by OnOpen(), and x_SendOutputBuffer().

◆ x_ValidateWriteMetaDBAccess()

void CNetStorageHandler::x_ValidateWriteMetaDBAccess ( const CJsonNode message,
bool  expect_object = true 
) const
private

Friends And Related Function Documentation

◆ CRelocateCallback

friend class CRelocateCallback
friend

Definition at line 358 of file nst_handler.hpp.

Member Data Documentation

◆ m_ByeReceived

bool CNetStorageHandler::m_ByeReceived
private

Definition at line 231 of file nst_handler.hpp.

Referenced by x_OnMessage(), and x_ProcessBye().

◆ m_Client

string CNetStorageHandler::m_Client
private

◆ m_CmdContext

CRef<CRequestContext> CNetStorageHandler::m_CmdContext
private

◆ m_ConnContext

CRef<CRequestContext> CNetStorageHandler::m_ConnContext
private

◆ m_CreateRequest

bool CNetStorageHandler::m_CreateRequest
private

◆ m_CreateTTL

TNSTDBValue<CTimeSpan> CNetStorageHandler::m_CreateTTL
private

Definition at line 224 of file nst_handler.hpp.

Referenced by x_DetectMetaDBNeedOnCreate(), and x_SendWriteConfirmation().

◆ m_DataMessageSN

Int8 CNetStorageHandler::m_DataMessageSN
private

◆ m_DBClientID

Int8 CNetStorageHandler::m_DBClientID
private

◆ m_DBUserID

Int8 CNetStorageHandler::m_DBUserID
private

Definition at line 226 of file nst_handler.hpp.

Referenced by x_CreateUser(), and x_SendWriteConfirmation().

◆ m_FirstMessage

bool CNetStorageHandler::m_FirstMessage
private

Definition at line 232 of file nst_handler.hpp.

Referenced by OnRead().

◆ m_JSONReader

CJsonOverUTTPReader CNetStorageHandler::m_JSONReader
private

Definition at line 209 of file nst_handler.hpp.

Referenced by OnRead().

◆ m_JSONWriter

CJsonOverUTTPWriter CNetStorageHandler::m_JSONWriter
private

Definition at line 213 of file nst_handler.hpp.

Referenced by OnWrite(), x_SendOutputBuffer(), and x_SendSyncMessage().

◆ m_MetadataOption

EMetadataOption CNetStorageHandler::m_MetadataOption
private

◆ m_ObjectBeingWritten

CDirectNetStorageObject CNetStorageHandler::m_ObjectBeingWritten
private

◆ m_ObjectSize

Int8 CNetStorageHandler::m_ObjectSize
private

◆ m_OutputQueue

vector<CJsonNode> CNetStorageHandler::m_OutputQueue
private

Definition at line 216 of file nst_handler.hpp.

Referenced by GetEventsToPollFor(), OnWrite(), and x_SendAsyncMessage().

◆ m_OutputQueueMutex

CFastMutex CNetStorageHandler::m_OutputQueueMutex
private

Definition at line 215 of file nst_handler.hpp.

Referenced by OnWrite(), and x_SendAsyncMessage().

◆ m_ReadBuffer

char CNetStorageHandler::m_ReadBuffer[kReadBufferSize]
private

Definition at line 206 of file nst_handler.hpp.

Referenced by OnRead().

◆ m_ReadMode

EReadMode CNetStorageHandler::m_ReadMode
private

Definition at line 207 of file nst_handler.hpp.

Referenced by OnRead(), x_ProcessCreate(), x_ProcessWrite(), and x_ReadRawData().

◆ m_Server

CNetStorageServer* CNetStorageHandler::m_Server
private

◆ m_Service

string CNetStorageHandler::m_Service
private

◆ m_Timing

CNSTTiming CNetStorageHandler::m_Timing
private

◆ m_UTTPReader

CUTTPReader CNetStorageHandler::m_UTTPReader
private

Definition at line 208 of file nst_handler.hpp.

Referenced by OnRead(), and x_ReadRawData().

◆ m_UTTPWriter

CUTTPWriter CNetStorageHandler::m_UTTPWriter
private

Definition at line 212 of file nst_handler.hpp.

Referenced by CNetStorageHandler(), x_ProcessRead(), and x_SendOverUTTP().

◆ m_WriteBuffer

char CNetStorageHandler::m_WriteBuffer[kWriteBufferSize]
private

Definition at line 211 of file nst_handler.hpp.

Referenced by CNetStorageHandler().

◆ m_WriteCreateNeedMetaDBUpdate

bool CNetStorageHandler::m_WriteCreateNeedMetaDBUpdate
private

◆ m_WriteServiceProps

CNSTServiceProperties CNetStorageHandler::m_WriteServiceProps
private

Definition at line 228 of file nst_handler.hpp.

Referenced by x_OnData(), x_ProcessWrite(), and x_SendWriteConfirmation().

◆ sm_Processors

CNetStorageHandler::SProcessorMap CNetStorageHandler::sm_Processors
staticprivate

Definition at line 245 of file nst_handler.hpp.

Referenced by x_FindProcessor().


The documentation for this class was generated from the following files:
Modified on Wed Apr 17 13:10:12 2024 by modify_doxy.py rev. 669887