blob: 805f495c5a6045bc1c1d2a38cb5a61732af1af6b [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
//
// @@@ START COPYRIGHT @@@
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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.
//
// @@@ END COPYRIGHT @@@
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NAMESERVER_H_
#define NAMESERVER_H_
#ifndef NAMESERVER_PROCESS
#include "process.h"
#include "comm.h"
class CNameServer : public CComm
{
protected:
int eyecatcher_; // Debuggging aid -- leave as first
// member variable of the class
public:
CNameServer( void );
virtual ~CNameServer( void );
bool IsNameServerConfigured( int pnid );
void NameServerExited( void );
int NameServerStop( struct message_def* msg );
int ProcessDelete(CProcess* process );
int ProcessInfo( struct message_def* msg );
int ProcessInfoCont( struct message_def* msg );
int ProcessInfoNs( struct message_def* msg );
int ProcessNew(CProcess* process );
int ProcessNodeDown( int nid, char* nodeName );
int ProcessShutdown( void );
void SetLocalHost( void );
private:
bool nsStartupComplete_;
bool shutdown_;
int ioWaitTimeout_;
int ioRetryCount_;
int mon2nsSock_;
int seqNum_;
char mon2nsHost_[MAX_PROCESSOR_NAME];
char mon2nsPort_[10];
int ChooseNextNs( void );
void CloseNs( void );
int ConnectToNs( bool* retry );
int GetM2NPort( int PNid );
int ProcessRequest( struct message_def* msg );
int SendToNs( const char* reqType, struct message_def* msg, int size );
void SetShutdown( bool shutdown );
};
#endif
#endif /*NAMESERVER_H_*/