Skip to content

Commit

Permalink
getUrlStr(StringBuffer -> getEndpointHostText
Browse files Browse the repository at this point in the history
  • Loading branch information
jakesmith committed Sep 22, 2023
1 parent 3f364c9 commit 0ace2a8
Show file tree
Hide file tree
Showing 86 changed files with 269 additions and 269 deletions.
2 changes: 1 addition & 1 deletion common/environment/dalienv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ bool getRemoteRunInfo(const char * keyName, const char * exeName, const char * v
// use dafilesrv to work out OS
StringBuffer dalis;
if (remotedali)
remotedali->endpoint().getUrlStr(dalis);
remotedali->endpoint().getEndpointHostText(dalis);
// first get machine by IP
StringBuffer ips;
ip.getHostText(ips);
Expand Down
6 changes: 3 additions & 3 deletions common/pkgfiles/referencedfilelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ IPropertyTree *ReferencedFile::getSpecifiedOrRemoteFileTree(IUserDescriptor *use
if (!fileTree)
return NULL;
StringAttrBuilder daliipText(daliip);
remote->endpoint().getUrlStr(daliipText);
remote->endpoint().getEndpointHostText(daliipText);
filePrefix.set(remotePrefix);
return fileTree.getClear();
}
Expand Down Expand Up @@ -471,7 +471,7 @@ void ReferencedFile::resolveRemote(IUserDescriptor *user, INode *remote, const c
flags |= RefFileNotFound;

StringBuffer dest;
DBGLOG("Remote ReferencedFile not found %s [dali=%s, remote=%s, prefix=%s]", logicalName.str(), daliip.get(), remote ? remote->endpoint().getUrlStr(dest).str() : nullptr, remotePrefix);
DBGLOG("Remote ReferencedFile not found %s [dali=%s, remote=%s, prefix=%s]", logicalName.str(), daliip.get(), remote ? remote->endpoint().getEndpointHostText(dest).str() : nullptr, remotePrefix);
}

void ReferencedFile::resolve(const StringArray &locations, const char *srcCluster, IUserDescriptor *user, INode *remote, const char *remotePrefix, bool checkLocalFirst, StringArray *subfiles, bool _trackSubFiles, bool resolveForeign)
Expand Down Expand Up @@ -1025,7 +1025,7 @@ void ReferencedFileList::cloneRelationships()
return;

StringBuffer addr;
remote->endpoint().getUrlStr(addr);
remote->endpoint().getEndpointHostText(addr);
IDistributedFileDirectory &dir = queryDistributedFileDirectory();
ReferencedFileIterator files(this);
ForEach(files)
Expand Down
6 changes: 3 additions & 3 deletions common/remote/rmtspawn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ISocket *spawnRemoteChild(SpawnKind kind, const char * exe, const SocketEndpoint
unsigned port = SLAVE_CONNECT_PORT + ((unsigned)kind * NUM_SLAVE_CONNECT_PORT) + getRandom() % NUM_SLAVE_CONNECT_PORT;
StringBuffer args;

myEP.getUrlStr(args);
myEP.getEndpointHostText(args);
args.append(' ').append(replyTag).append(' ').append((unsigned)kind).append(" ").append(port);
if (extra)
args.append(' ').append(extra);
Expand Down Expand Up @@ -177,7 +177,7 @@ ISocket *spawnRemoteChild(SpawnKind kind, const char * exe, const SocketEndpoint
try
{
StringBuffer tmp;
connectEP.getUrlStr(tmp);
connectEP.getEndpointHostText(tmp);
LOG(MCdetailDebugInfo, unknownJob, "Try to connect to slave %s",tmp.str());
Owned<ISocket> socket = ISocket::connect_wait(connectEP,MASTER_CONNECT_SLAVE_TIMEOUT);
if (socket)
Expand Down Expand Up @@ -288,7 +288,7 @@ bool CRemoteParentInfo::processCommandLine(int argc, const char * * argv, String
void CRemoteParentInfo::log()
{
StringBuffer temp;
LOG(MCdebugProgress, unknownJob, "Starting remote slave. Master=%s reply=%d port=%d", parent.getUrlStr(temp).str(), replyTag, port);
LOG(MCdebugProgress, unknownJob, "Starting remote slave. Master=%s reply=%d port=%d", parent.getEndpointHostText(temp).str(), replyTag, port);
}

bool CRemoteParentInfo::sendReply(unsigned version)
Expand Down
2 changes: 1 addition & 1 deletion common/roxiecommlib/roxiecommunicationclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class CRoxieCommunicationClient: implements IRoxieCommunicationClient, public CI
if (remoteIP)
buf.append(remoteIP);
else
ep.getUrlStr(buf);
ep.getEndpointHostText(buf);

throw MakeStringException(ROXIECOMM_SOCKET_ERROR, "%s", buf.str());
}
Expand Down
8 changes: 4 additions & 4 deletions common/thorhelper/persistent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CPersistentInfo : implements IInterface, public CInterface
{
if(_ep)
{
_ep->getUrlStr(epstr);
_ep->getEndpointHostText(epstr);
keystr.set(epstr);
addKeySuffix(proto, keystr);
}
Expand Down Expand Up @@ -121,7 +121,7 @@ class CAvailKeeper
private:
inline StringBuffer& calcKey(SocketEndpoint& ep, PersistentProtocol proto, StringBuffer& keystr)
{
ep.getUrlStr(keystr);
ep.getEndpointHostText(keystr);
return addKeySuffix(proto, keystr);
}
SocketSet* findSet(CPersistentInfo* info, bool create = false)
Expand Down Expand Up @@ -214,7 +214,7 @@ class CPersistentHandler : implements IPersistentHandler, implements ISocketSele
if (m_enableDoNotReuseList && ep != nullptr)
{
StringBuffer epstr;
ep->getUrlStr(epstr);
ep->getEndpointHostText(epstr);
if(m_doNotReuseList.getValue(epstr.str()) != nullptr)
{
PERSILOG(PersistentLogLevel::PLogNormal, "PERSISTENT: socket %d's target endpoint %s is in DoNotReuseList, will not add it.", sock->OShandle(), epstr.str());
Expand Down Expand Up @@ -434,7 +434,7 @@ class CPersistentHandler : implements IPersistentHandler, implements ISocketSele
if(!ep)
return false;
StringBuffer epstr;
ep->getUrlStr(epstr);
ep->getEndpointHostText(epstr);
if(epstr.length()> 0 && m_doNotReuseList.getValue(epstr.str()) != nullptr)
return true;
return false;
Expand Down
12 changes: 6 additions & 6 deletions common/thorhelper/thorsoapcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ class BlackLister : public CInterface, implements IThreadFactory
if (soapTraceLevel > 3)
{
StringBuffer s;
logctx.CTXLOG("endpoint %s is blacklisted", ep.getUrlStr(s).str());
logctx.CTXLOG("endpoint %s is blacklisted", ep.getEndpointHostText(s).str());
}
return true;
}
Expand All @@ -364,15 +364,15 @@ class BlackLister : public CInterface, implements IThreadFactory
if (soapTraceLevel > 0)
{
StringBuffer s;
logctx.CTXLOG("Blacklisting endpoint %s", p.ep.getUrlStr(s).str());
logctx.CTXLOG("Blacklisting endpoint %s", p.ep.getEndpointHostText(s).str());
}
}
else
{
if (soapTraceLevel > 3)
{
StringBuffer s;
logctx.CTXLOG("Endpoint %s is already blacklisted", p.ep.getUrlStr(s).str());
logctx.CTXLOG("Endpoint %s is already blacklisted", p.ep.getEndpointHostText(s).str());
}

}
Expand All @@ -390,7 +390,7 @@ class BlackLister : public CInterface, implements IThreadFactory
if ((match != NotFound) && (soapTraceLevel > 0))
{
StringBuffer s;
DBGLOG("De-blacklisting endpoint %s", ep.getUrlStr(s).str());
DBGLOG("De-blacklisting endpoint %s", ep.getEndpointHostText(s).str());
}
}

Expand All @@ -413,7 +413,7 @@ class BlackLister : public CInterface, implements IThreadFactory
if (useBlacklister && lookup(ep, logctx))
{
StringBuffer s;
ep.getUrlStr(s);
ep.getEndpointHostText(s);
throw MakeStringException(JSOCKERR_connection_failed, "%s %s", blOptions->getBLerror(), s.str());
}
Owned<IException> exc;
Expand Down Expand Up @@ -470,7 +470,7 @@ class BlackLister : public CInterface, implements IThreadFactory
}
if (exc->errorCode()==JSOCKERR_connection_failed) {
StringBuffer s;
ep.getUrlStr(s);
ep.getEndpointHostText(s);
throw MakeStringException(JSOCKERR_connection_failed, "connection failed %s", s.str());
}
throw exc.getClear();
Expand Down
8 changes: 4 additions & 4 deletions common/workunit/workunit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14451,7 +14451,7 @@ void executeThorGraph(const char * graphName, IConstWorkUnit &workunit, const IP
myep.serialize(msg); // only used for tracing
if (!conversation->send(msg)) {
StringBuffer s("Failed to send query to Thor on ");
thorMaster.getUrlStr(s);
thorMaster.getEndpointHostText(s);
throw MakeStringExceptionDirect(-1, s.str()); // maybe retry?
}
unsigned __int64 blockedTime = elapsedTimer.elapsedNs();
Expand All @@ -14461,21 +14461,21 @@ void executeThorGraph(const char * graphName, IConstWorkUnit &workunit, const IP
}

StringBuffer eps;
PROGLOG("Thor on %s running %s", thorMaster.getUrlStr(eps).str(), jobName.str());
PROGLOG("Thor on %s running %s", thorMaster.getEndpointHostText(eps).str(), jobName.str());
MemoryBuffer reply;
try
{
if (!conversation->recv(reply,INFINITE))
{
StringBuffer s("Failed to receive reply from thor ");
thorMaster.getUrlStr(s);
thorMaster.getEndpointHostText(s);
throw MakeStringExceptionDirect(-1, s.str());
}
}
catch (IException *e)
{
StringBuffer s("Failed to receive reply from thor ");
thorMaster.getUrlStr(s);
thorMaster.getEndpointHostText(s);
s.append("; (").append(e->errorCode()).append(", ");
e->errorMessage(s).append(")");
e->Release();
Expand Down
2 changes: 1 addition & 1 deletion common/workunit/wujobq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ class CJobQueue: public CJobQueueBase, implements IJobQueue
ret = qd.root->addPropTree("Client");
ret->setPropInt64("@session",sessionid);
StringBuffer eps;
ret->setProp("@node",queryMyNode()->endpoint().getUrlStr(eps).str());
ret->setProp("@node",queryMyNode()->endpoint().getEndpointHostText(eps).str());
}
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion dali/base/daclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ bool updateDaliEnv(IPropertyTree *env, bool forceGroupUpdate, const char *daliIp
if (querySDS().updateEnvironment(env, forceGroupUpdate, response))
{
StringBuffer tmp;
PROGLOG("Environment and node groups updated in dali at %s",daliep.getUrlStr(tmp).str());
PROGLOG("Environment and node groups updated in dali at %s",daliep.getEndpointHostText(tmp).str());
}
else
ret = false;
Expand Down
10 changes: 5 additions & 5 deletions dali/base/dacoven.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static void checkDaliVersionInfo(ICommunicator *comm, CDaliVersion &serverVersio
mb.append(ClientVersion);
mb.append(MinServerVersion);
StringBuffer daliEpStr;
comm->queryGroup().queryNode(0).endpoint().getUrlStr(daliEpStr); // NB: there's always exactly 1 node
comm->queryGroup().queryNode(0).endpoint().getEndpointHostText(daliEpStr); // NB: there's always exactly 1 node
if (!comm->sendRecv(mb, RANK_RANDOM, MPTAG_DALI_COVEN_REQUEST, VERSION_REQUEST_TIMEOUT))
throw makeStringExceptionV(-1, "Failed retrieving version information from server [%s], legacy server?", daliEpStr.str());
if (!mb.length())
Expand Down Expand Up @@ -206,7 +206,7 @@ static CriticalSection foreignDaliVersionCacheCrit;
void checkForeignDaliVersionInfo(const INode *foreignDali, CDaliVersion &serverVersion, CDaliVersion &minClientVersion)
{
StringBuffer foreignDaliStr;
foreignDali->endpoint().getUrlStr(foreignDaliStr);
foreignDali->endpoint().getEndpointHostText(foreignDaliStr);

CriticalBlock b(foreignDaliVersionCacheCrit);
std::pair<CDaliVersion, CDaliVersion> result;
Expand Down Expand Up @@ -395,7 +395,7 @@ CDaliUidAllocator &CDaliUidAllocator::find(CIArrayOf<CDaliUidAllocator> &uidallo
uidallocators.append(*ret);
}
StringBuffer eps;
DBGLOG("Added foreign UID allocator for %s", ret->node.getUrlStr(eps).str());
DBGLOG("Added foreign UID allocator for %s", ret->node.getEndpointHostText(eps).str());
return *ret;
}

Expand Down Expand Up @@ -498,7 +498,7 @@ class CCovenServer: public CCovenBase
store->serialize(mb.clear());
if (!sendRecv(mb,r,MPTAG_DALI_COVEN_REQUEST, COVEN_SERVER_TIMEOUT)) {
StringBuffer str;
throw MakeStringException(-1,"Could not connect to %s",grp->queryNode(r).endpoint().getUrlStr(str).str());
throw MakeStringException(-1,"Could not connect to %s",grp->queryNode(r).endpoint().getEndpointHostText(str).str());
}
mergeStore(store,mb,true);
}
Expand All @@ -508,7 +508,7 @@ class CCovenServer: public CCovenBase
for (;;)
{
if (!recv(mb,r,MPTAG_DALI_COVEN_REQUEST,&sender,COVEN_SERVER_TIMEOUT)) {
throw MakeStringException(-1,"Could not connect to %s",grp->queryNode(r).endpoint().getUrlStr(str).str());
throw MakeStringException(-1,"Could not connect to %s",grp->queryNode(r).endpoint().getEndpointHostText(str).str());
}
if (RANK_NULL==sender)
processMessage(mb);
Expand Down
22 changes: 11 additions & 11 deletions dali/base/dadfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ static void foreignDaliSendRecv(const INode *foreigndali,CMessageBuffer &mb, uns
Owned<ICommunicator> comm = createCommunicator(grp,true);
if (!comm->verifyConnection(0,foreigndalitimeout)) {
StringBuffer tmp;
IDFS_Exception *e = new CDFS_Exception(DFSERR_ForeignDaliTimeout, foreigndali->endpoint().getUrlStr(tmp).str());
IDFS_Exception *e = new CDFS_Exception(DFSERR_ForeignDaliTimeout, foreigndali->endpoint().getEndpointHostText(tmp).str());
throw e;
}
comm->sendRecv(mb,0,MPTAG_DFS_REQUEST);
Expand Down Expand Up @@ -3394,7 +3394,7 @@ class CDistributedFile: public CDistributedFileBase<IDistributedFile>
const char *grp = root->queryProp("@group");
if (!grp||!*grp) {
StringBuffer eps;
pt->addProp("@node",part.queryNode(0)->endpoint().getUrlStr(eps).str()); // legacy
pt->addProp("@node",part.queryNode(0)->endpoint().getEndpointHostText(eps).str()); // legacy
}
const char *override = part.queryOverrideName();
if (override&&*override)
Expand Down Expand Up @@ -4319,7 +4319,7 @@ protected: friend class CDistributedFilePart;
CriticalBlock block(errcrit);
StringBuffer s("Failed to find file part ");
s.append(partfile->queryFilename()).append(" on ");
rfn.queryEndpoint().getUrlStr(s);
rfn.queryEndpoint().getEndpointHostText(s);
EXCLOG(e, s.str());
e->Release();
}
Expand Down Expand Up @@ -8957,7 +8957,7 @@ void CDistributedFileDirectory::fixDates(IDistributedFile *file)
CriticalBlock block(crit);
StringBuffer s("Failed to find file part ");
s.append(partfile->queryFilename()).append(" on ");
rfn.queryEndpoint().getUrlStr(s);
rfn.queryEndpoint().getEndpointHostText(s);
EXCLOG(e, s.str());
e->Release();
}
Expand Down Expand Up @@ -11334,7 +11334,7 @@ class CDaliDFSServer: public Thread, public CTransactionLogTracker, implements I
if (block0.slow())
{
SocketEndpoint ep = mb.getSender();
ep.getUrlStr(block0.appendMsg(trc).append(" from "));
ep.getEndpointHostText(block0.appendMsg(trc).append(" from "));
}
}

Expand Down Expand Up @@ -11939,10 +11939,10 @@ bool removePhysicalFiles(IGroup *grp,const char *_filemask,unsigned short port,C
PROGLOG("Removed '%s'",partfile->queryFilename());
unsigned t = msTick()-start;
if (t>5*1000)
DBGLOG("Removing %s from %s took %ds", partfile->queryFilename(), rfn.queryEndpoint().getUrlStr(eps).str(), t/1000);
DBGLOG("Removing %s from %s took %ds", partfile->queryFilename(), rfn.queryEndpoint().getEndpointHostText(eps).str(), t/1000);
}
else
IWARNLOG("Failed to remove file part %s from %s", partfile->queryFilename(),rfn.queryEndpoint().getUrlStr(eps).str());
IWARNLOG("Failed to remove file part %s from %s", partfile->queryFilename(),rfn.queryEndpoint().getEndpointHostText(eps).str());
#else
if (partfile->exists())
PROGLOG("Would remove '%s'",partfile->queryFilename());
Expand All @@ -11957,7 +11957,7 @@ bool removePhysicalFiles(IGroup *grp,const char *_filemask,unsigned short port,C
else {
StringBuffer s("Failed to remove file part ");
s.append(partfile->queryFilename()).append(" from ");
rfn.queryEndpoint().getUrlStr(s);
rfn.queryEndpoint().getEndpointHostText(s);
EXCLOG(e, s.str());
e->Release();
}
Expand Down Expand Up @@ -13651,12 +13651,12 @@ bool CDistributedFileDirectory::removePhysicalPartFiles(const char *logicalName,
{
unsigned start = msTick();
if (!partfile->remove()&&(copy==0)&&!islazy) // only warn about missing primary files
LOG(MCwarning, unknownJob, "Failed to remove file part %s from %s", partfile->queryFilename(),rfn.queryEndpoint().getUrlStr(eps).str());
LOG(MCwarning, unknownJob, "Failed to remove file part %s from %s", partfile->queryFilename(),rfn.queryEndpoint().getEndpointHostText(eps).str());
else
{
unsigned t = msTick()-start;
if (t>5*1000)
LOG(MCwarning, unknownJob, "Removing %s from %s took %ds", partfile->queryFilename(), rfn.queryEndpoint().getUrlStr(eps).str(), t/1000);
LOG(MCwarning, unknownJob, "Removing %s from %s took %ds", partfile->queryFilename(), rfn.queryEndpoint().getEndpointHostText(eps).str(), t/1000);
}
}
catch (IException *e)
Expand All @@ -13668,7 +13668,7 @@ bool CDistributedFileDirectory::removePhysicalPartFiles(const char *logicalName,
{
StringBuffer s("Failed to remove file part ");
s.append(partfile->queryFilename()).append(" from ");
rfn.queryEndpoint().getUrlStr(s);
rfn.queryEndpoint().getEndpointHostText(s);
EXCLOG(e, s.str());
e->Release();
}
Expand Down
Loading

0 comments on commit 0ace2a8

Please sign in to comment.