• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

XrdOlbManTree.hh

Go to the documentation of this file.
00001 #ifndef __XRDOLBMANTREE_HH_
00002 #define __XRDOLBMANTREE_HH_
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                      X r d O l b M a n T r e e . h h                       */
00006 /*                                                                            */
00007 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*                            All Rights Reserved                             */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*              DE-AC02-76-SFO0515 with the Department of Energy              */
00011 /******************************************************************************/
00012 
00013 //         $Id: XrdOlbManTree.hh,v 1.4 2007/07/26 15:18:24 ganis Exp $
00014 
00015 #include "XrdOlb/XrdOlbManager.hh"
00016 #include "XrdSys/XrdSysPthread.hh"
00017 
00018 class XrdOlbServer;
00019   
00020 class XrdOlbManTree
00021 {
00022 public:
00023 
00024 int  Connect(int sID, XrdOlbServer *sp);
00025 
00026 void Disc(int sID);
00027 
00028 int  Register();
00029 
00030 void setMaxCon(int i);
00031 
00032 int  Trying(int sID, int Lvl);
00033 
00034 enum connStat {Active, Connected, None, Pending, Waiting};
00035 
00036      XrdOlbManTree() : maxTMI(0),   numConn(0), maxConn(0),    atRoot(0),
00037                        conLevel(0), conSID(-1), numWaiting(0),
00038                        myStatus(Active) {};
00039     ~XrdOlbManTree() {};
00040 
00041 private:
00042 
00043 void Redrive(int sID) {tmInfo[sID].Status = Active;
00044                        tmInfo[sID].theSem.Post();
00045                        numWaiting--;
00046                       }
00047 void Pause(int sID)   {tmInfo[sID].Status = Waiting;
00048                        numWaiting++;
00049                        myMutex.UnLock();
00050                        tmInfo[sID].theSem.Wait();
00051                       }
00052 
00053 XrdSysMutex     myMutex;
00054 
00055 
00056 struct TreeInfo
00057        {XrdSysSemaphore theSem;
00058         XrdOlbServer   *servP;
00059         connStat        Status;
00060         int             Level;
00061 
00062         TreeInfo() : theSem(0), servP(0), Status(None), Level(0) {};
00063        ~TreeInfo() {};
00064 
00065        }         tmInfo[XrdOlbManager::MTMax];
00066 
00067 char            buff[8];
00068 int             maxTMI;
00069 int             numConn;
00070 int             maxConn;
00071 int             atRoot;
00072 int             conLevel;
00073 int             conSID;
00074 int             numWaiting;
00075 connStat        myStatus;
00076 };
00077 
00078 namespace XrdOlb
00079 {
00080 extern XrdOlbManTree ManTree;
00081 }
00082 #endif

Generated on Wed Sep 1 2010 for xrootd by  doxygen 1.7.1