Browse Source

Restoring authorship annotation for <chernyak@yandex-team.ru>. Commit 2 of 2.

chernyak 3 years ago
parent
commit
27d9c978ef

+ 13 - 13
library/cpp/messagebus/locator.cpp

@@ -136,7 +136,7 @@ namespace NBus {
     TBusLocator::TServiceId TBusLocator::GetServiceId(const char* name) {
         const char* c = ServiceIdSet.insert(name).first->c_str();
         return (ui64)c;
-    } 
+    }
 
     int TBusLocator::RegisterBreak(TBusService service, const TVector<TBusKey>& starts, const TNetAddr& addr) {
         TGuard<TMutex> G(Lock);
@@ -261,16 +261,16 @@ namespace NBus {
             const TItem& item = *it;
             addrs.push_back(item.Addr);
         }
- 
+
         if (addrs.size() == 0) {
             return -1;
         }
         return (int)addrs.size();
-    } 
+    }
 
     int TBusLocator::Locate(TBusService service, TBusKey key, TNetAddr* addr) {
         TGuard<TMutex> G(Lock);
- 
+
         TServiceId serviceId = GetServiceId(service);
         TItems::const_iterator it;
 
@@ -299,7 +299,7 @@ namespace NBus {
             if (item.ServiceId != serviceId) {
                 break;
             }
- 
+
             if (IsLocal(item.Addr)) {
                 if (port != 0 && port != GetAddrPort(item.Addr)) {
                     Y_ASSERT(0 && "Can't decide which port to use.");
@@ -308,15 +308,15 @@ namespace NBus {
                 port = GetAddrPort(item.Addr);
             }
         }
- 
+
         return port;
-    } 
+    }
 
     int TBusLocator::GetLocalAddresses(TBusService service, TVector<TNetAddr>& addrs) {
         TGuard<TMutex> G(Lock);
         TServiceId serviceId = GetServiceId(service);
         TItems::const_iterator it;
- 
+
         for (it = Items.lower_bound(TItem(serviceId, 0, 0, TNetAddr())); it != Items.end(); ++it) {
             const TItem& item = *it;
             if (item.ServiceId != serviceId) {
@@ -386,7 +386,7 @@ namespace NBus {
         }
         Register(service, start, end, addr);
         return 0;
-    } 
+    }
 
     int TBusLocator::Register(TBusService service, TBusKey start, TBusKey end, const TNetworkAddress& na, EIpVersion requireVersion /*= EIP_VERSION_4*/, EIpVersion preferVersion /*= EIP_VERSION_ANY*/) {
         TNetAddr addr(na, requireVersion, preferVersion); // throws
@@ -396,7 +396,7 @@ namespace NBus {
 
     int TBusLocator::Register(TBusService service, TBusKey start, TBusKey end, const TNetAddr& addr) {
         TGuard<TMutex> G(Lock);
- 
+
         TServiceId serviceId = GetServiceId(service);
         TItems::const_iterator it;
 
@@ -416,12 +416,12 @@ namespace NBus {
         Items.insert(itemToReg);
         return 0;
     }
- 
+
     int TBusLocator::Unregister(TBusService service, TBusKey start, TBusKey end) {
         TGuard<TMutex> G(Lock);
         TServiceId serviceId = GetServiceId(service);
         Items.erase(TItem(serviceId, start, end, TNetAddr()));
         return 0;
-    } 
- 
+    }
+
 }

+ 5 - 5
library/cpp/messagebus/oldmodule/module.cpp

@@ -402,7 +402,7 @@ namespace NBus {
                 DoCallReplyHandler(call);
                 Pending.erase(Pending.begin() + it);
             }
-        } 
+        }
         return Pending.size() > 0;
     }
 
@@ -603,8 +603,8 @@ namespace NBus {
             strReturn += call.GetStatus(flags);
         }
         return strReturn;
-    } 
- 
+    }
+
     TString TJobState::GetStatus(unsigned flags) {
         Y_UNUSED(flags);
         TString strReturn;
@@ -616,7 +616,7 @@ namespace NBus {
                              ToString(Status).data());
         return strReturn;
     }
- 
+
     //////////////////////////////////////////////////////////////////////
 
     void TBusModuleImpl::CancelJob(TBusJob* job, EMessageStatus status) {
@@ -857,7 +857,7 @@ void TModuleClientHandler::OnReply(TAutoPtr<TBusMessage> req, TAutoPtr<TBusMessa
     Y_ASSERT(job->Job->Message != req.Get());
     job->EnqueueAndSchedule(TJobResponseMessage(req.Release(), resp.Release(), MESSAGE_OK));
     job->UnRef();
-} 
+}
 
 void TModuleClientHandler::OnMessageSentOneWay(TAutoPtr<TBusMessage> req) {
     TJobRunner* job = GetJob(req.Get());

+ 3 - 3
library/cpp/messagebus/oldmodule/module.h

@@ -127,7 +127,7 @@ namespace NBus {
             }
             UseAddr = !!addr;
         }
- 
+
     public:
         TString GetStatus(unsigned flags);
     };
@@ -270,7 +270,7 @@ namespace NBus {
 
         /// return human reabable status of this job
         virtual TString GetStatus(unsigned flags);
- 
+
         /// set sleep time for job
         void Sleep(int milliSeconds);
 
@@ -372,7 +372,7 @@ namespace NBus {
 
         /// get status of all jobs in flight
         TString GetStatus(unsigned flags = 0);
- 
+
         /// called when application is about to start
         virtual bool StartInput();
         /// called when application is about to exit

+ 1 - 1
library/cpp/messagebus/session.cpp

@@ -44,7 +44,7 @@ namespace NBus {
         GetConnectSyscallsNumBulkForTest({addr}, MakeArrayRef(&r, 1));
         return r;
     }
- 
+
     // Split 'host' into name and port taking into account that host can be specified
     // as ipv6 address ('[<ipv6 address]:port' notion).
     bool SplitHost(const TString& host, TString* hostName, TString* portNum) {

+ 2 - 2
library/cpp/messagebus/test/helper/example.h

@@ -80,7 +80,7 @@ namespace NBus {
 
             void SendMessages(size_t count, const TNetAddr* addr = nullptr);
             void SendMessages(size_t count, const TNetAddr& addr);
- 
+
             void ResetCounters();
             void WaitReplies();
             EMessageStatus WaitForError();
@@ -113,7 +113,7 @@ namespace NBus {
                 const TBusServerSessionConfig& sessionConfig = TBusServerSessionConfig());
 
             TExampleServer(unsigned port, const char* name = "TExampleServer");
- 
+
             ~TExampleServer() override;
 
         public:

+ 1 - 1
library/cpp/messagebus/test/perftest/perftest.cpp

@@ -514,7 +514,7 @@ TSimpleSharedPtr<TPerftestUsingModule> ServerUsingModule;
 TVector<TSimpleSharedPtr<TPerftestClient>> Clients;
 TMutex ClientsLock;
 
-void stopsignal(int /*sig*/) { 
+void stopsignal(int /*sig*/) {
     fprintf(stderr, "\n-------------------- exiting ------------------\n");
     TheExit = true;
     StopEvent.Signal();

+ 3 - 3
library/cpp/messagebus/test/ut/one_way_ut.cpp

@@ -59,9 +59,9 @@ struct NullClient : TBusClientHandlerError {
 
         /// register source/client session
         Session = TBusClientSession::Create(&Proto, this, sessionConfig, Queue);
- 
-        /// register service, announce to clients via LocatorService 
-        Session->RegisterService("localhost"); 
+
+        /// register service, announce to clients via LocatorService
+        Session->RegisterService("localhost");
     }
 
     ~NullClient() override {