Quellcode durchsuchen

Merge pull request #7692 from mckellyln/hpcc-14073

HPCC-14073 Removed unused jbroadcast code

Reviewed By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman vor 9 Jahren
Ursprung
Commit
bb87156e8d

+ 0 - 3
system/jlib/CMakeLists.txt

@@ -35,7 +35,6 @@ set (    SRCS
          jargv.cpp 
          jarray.cpp 
          javahash.cpp 
-         jbroadcast.cpp 
          jbsocket.cpp 
          jbuff.cpp 
          jcomp.cpp 
@@ -86,8 +85,6 @@ set (    INCLUDES
         jatomic.hpp
         javahash.hpp
         javahash.tpp
-        jbroadcast.hpp
-        jbroadcast.ipp
         jbuff.hpp
         jcomp.hpp
         jcomp.ipp

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 1136
system/jlib/jbroadcast.cpp


+ 0 - 68
system/jlib/jbroadcast.hpp

@@ -1,68 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-
-#ifndef JBROADCAST_HPP
-#define JBROADCAST_HPP
-
-#include "jiface.hpp"
-
-enum bctag_t
-{
-    bctag_unknown = -1,
-    bctag_general = 0,
-    bctag_DYNAMIC = 1,
-};
-
-bctag_t jlib_decl allocBcTag();
-void jlib_decl freeBcTag();
-
-interface IBroadcast : extends IInterface
-{
-    virtual bool send(bctag_t, size32_t sz, const void *data) = 0;
-    virtual void stop() = 0;
-    virtual void stopClients() = 0;
-};
-
-interface IBroadcastReceiver : extends IInterface
-{
-    virtual bool eos() = 0;
-    virtual bool read(MemoryBuffer &mb) = 0;
-    virtual void stop() = 0;
-};
-
-
-IBroadcast jlib_decl *createGroupBroadcast(SocketEndpointArray &eps, const char *mcastIp, unsigned mcastPort, unsigned broadcasterAckPort);
-IBroadcast jlib_decl *createGroupBroadcast(SocketEndpointArray &eps, SocketEndpoint &mcastEp, unsigned broadcasterAckPort);
-IBroadcastReceiver jlib_decl *createGroupBroadcastReceiver(bctag_t tag);
-
-void jlib_decl startMCastRecvServer(const char *broadcastRoot, unsigned groupMember, SocketEndpoint &mcastEp, unsigned broadcasterAckPort);
-void jlib_decl startMCastRecvServer(const char *broadcastRoot, unsigned rank, const char *mcastIp, unsigned mcastPort, unsigned broadcasterAckPort);
-void jlib_decl stopMCastRecvServer();
-
-enum bcopt_t
-{
-    bcopt_pollDelay,
-    bcopt_useUniCast,
-    bcopt_tracingLevel,
-    bcopt_unicastLimit,
-    bcopt_unicastPcent,
-};
-
-void jlib_decl setBroadcastOpt(bcopt_t opt, unsigned value);
-
-#endif

+ 0 - 166
system/jlib/jbroadcast.ipp

@@ -1,166 +0,0 @@
-/*##############################################################################
-
-    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-############################################################################## */
-
-
-#ifndef JBROADCAST_IPP
-#define JBROADCAST_IPP
-
-#include "jarray.hpp"
-#include "jbuff.hpp"
-#include "jsuperhash.hpp"
-
-#include "jbroadcast.hpp"
-
-enum MCPacket_Cmd { MCPacket_None, MCPacket_Poll, MCPacket_Stop } ;
-
-#define MC_PACKET_SIZE 64000
-#define MC_ACK_PACKET_SIZE 64000
-
-struct MCPacketHeader
-{
-    bctag_t tag;        // filters to different client receivers
-    unsigned jobId;     // sequenced per broadcast to identify new streams from old resent packets in old streams
-    unsigned id;        // sequence id
-    unsigned length;    // length of data in packet
-    unsigned offset;    // offset of data in stream
-    unsigned total;     // total # of packets in stream
-    byte cmd;           // optional cmd (e.g. poll)
-};
-
-class CDataPacket : public CInterface
-{
-public:
-    CDataPacket()
-    {
-        header = (MCPacketHeader *)mb.reserveTruncate(MC_PACKET_SIZE);
-        pktData = ((byte*)header)+sizeof(MCPacketHeader);
-    }
-
-    MCPacketHeader *header;
-    void *queryData() { return pktData; }
-    MCPacketHeader *detachPacket() { return (MCPacketHeader *) mb.detach(); }
-
-private:
-    void *pktData;
-    MemoryBuffer mb;
-};
-
-struct MCAckPacketHeader
-{
-    unsigned node;
-    bctag_t tag;
-    unsigned jobId;
-    bool ackDone;
-};
-
-class CUIntValue : public CInterface
-{
-    unsigned value;
-public:
-    CUIntValue(unsigned _value) : value(_value) { }
-    const unsigned &queryValue() { return value; }
-    const void *queryFindParam() const { return &value; }
-};
-
-typedef OwningSimpleHashTableOf<CUIntValue, unsigned> CUIntTable;
-
-class CMCastReceiver : public CInterface, implements IBroadcastReceiver
-{
-public:
-    IMPLEMENT_IINTERFACE;
-
-    CMCastReceiver(bctag_t _tag);
-    ~CMCastReceiver();
-
-    bool packetReceived(CDataPacket &dataPacket, bool &complete);
-    bool buildNack(MCAckPacketHeader *ackPacket, size32_t &sz, unsigned total=0);
-    void reset();
-    const void *queryFindParam() const { return &tag; }
-
-// IBroadcastReceiver impl.
-    virtual bool eos();
-    virtual bool read(MemoryBuffer &mb);
-    virtual void stop();
-
-private:
-    CIArrayOf<CDataPacket> dataPackets;
-    UnsignedArray pktsReceived;
-    Semaphore receivedSem;
-    bctag_t tag;
-    unsigned nextPacket;
-    CriticalSection crit;
-    bool aborted, eosHit;
-    CTimeMon logTmRecv, logTmCons;
-};
-
-class CMCastRecvServer : public Thread
-{
-    CUIntTable oldJobIds; // could expire these after a short time.
-    StringAttr broadcastRoot;
-    bool stopped;
-    Owned<ISocket> sock, ackSock;
-    SimpleHashTableOf<CMCastReceiver, bctag_t> receivers;
-    CIArrayOf<CDataPacket> dataPackets;
-    CriticalSection receiversCrit;
-    unsigned groupMember;
-    SocketEndpoint mcastEp;
-    unsigned ackPort;
-
-public:
-    IMPLEMENT_IINTERFACE;
-
-    CMCastRecvServer(const char *_broadcastRoot, unsigned groupMember, SocketEndpoint &mcastEp, unsigned broadcastAckPort);
-
-    CMCastReceiver *getReceiver(bctag_t tag);
-    void registerReceiver(CMCastReceiver &receiver);
-    void deregisterReceiver(CMCastReceiver &receiver);
-    void stop();
-    virtual int run();
-};
-
-class CUIntTableItem : public CUIntTable
-{
-    unsigned pkt;
-public:
-    CUIntTableItem(unsigned _pkt) : pkt(_pkt) { }
-    const void *queryFindParam() const { return &pkt; }
-    const unsigned &queryPacket() { return pkt; }
-};
-
-typedef OwningSimpleHashTableOf<CUIntTableItem, unsigned> CPktNodeTable;
-
-class CCountedItem : public CUIntValue
-{
-public:
-    unsigned count;
-    CCountedItem(unsigned value) : CUIntValue(value) { count = 0; }
-};
-
-class CCountTable : public OwningSimpleHashTableOf<CCountedItem, unsigned>
-{
-public:
-    inline unsigned incItem(unsigned v)
-    {
-        CCountedItem *c = find(v);
-        if (!c) c = new CCountedItem(v);
-        add(* c);
-        c->count++;
-        return c->count;
-    }
-};
-
-#endif

+ 4 - 4
system/jlib/jsocket.hpp

@@ -246,14 +246,14 @@ public:
 
     // Create client socket connected to a multicast server socket
     //
-    static ISocket*  multicast_connect( unsigned short port, const char *mcgroupip, unsigned _ttl=0);
-    static ISocket*  multicast_connect( const SocketEndpoint &ep, unsigned _ttl=0);
+    static ISocket*  multicast_connect( unsigned short port, const char *mcgroupip, unsigned _ttl);
+    static ISocket*  multicast_connect( const SocketEndpoint &ep, unsigned _ttl);
 
     //
     // Create server multicast socket
     //
-    static ISocket*  multicast_create( unsigned short port, const char *mcgroupip, unsigned _ttl=0);
-    static ISocket*  multicast_create( unsigned short port, const IpAddress &mcgroupip, unsigned _ttl=0);
+    static ISocket*  multicast_create( unsigned short port, const char *mcgroupip, unsigned _ttl);
+    static ISocket*  multicast_create( unsigned short port, const IpAddress &mcgroupip, unsigned _ttl);
 
     //
     // Creates an ISocket for an already created socket