c++/EEDB/WebServices/RegionServer.cpp
//========================================================
//
// remote TrackCache check/create/sync code
//
//========================================================
remote TrackCache check/create/sync code
remote TrackCache check / create / sync code
void  EEDB::WebServices::RegionServer::_remote_trackcache_setup() {
  if(_known_remote_peers.empty()) { return; }
  map<string,bool>             hashkeys;
  map<string, bool>::iterator  it1;
  _get_all_cachpoint_hashkeys(_stream_processing_head, hashkeys);
  if(hashkeys.empty()) { return; }
  string hashkey_list;
  for(it1 = hashkeys.begin(); it1!=hashkeys.end(); it1++) {
    string hashkey = (*it1).first;
    if(!hashkey_list.empty()) { hashkey_list += ","; }
    hashkey_list += hashkey;
  }
  map<string, EEDB::Peer*>::iterator  it2;
  for(it2 = _known_remote_peers.begin(); it2!=_known_remote_peers.end(); it2++) {
    EEDB::Peer* peer = (*it2).second;
    EEDB::SPStreams::RemoteServerStream *rstream = (EEDB::SPStreams::RemoteServerStream*)peer->source_stream();
    rstream->set_userDB(_userDB);
    rstream->mirror_remote_trackcaches(hashkey_list);
  }
}
void EEDB :: WebServices :: RegionServer :: _remote_trackcache_setup ( ) { if ( _known_remote_peers . empty ( ) ) { return ; } map < string , bool > hashkeys ; map < string , bool > :: iterator it1 ; _get_all_cachpoint_hashkeys ( _stream_processing_head , hashkeys ) ; if ( hashkeys . empty ( ) ) { return ; } string hashkey_list ; for ( it1 = hashkeys . begin ( ) ; it1 != hashkeys . end ( ) ; it1 ++ ) { string hashkey = ( * it1 ) . first ; if ( ! hashkey_list . empty ( ) ) { hashkey_list += " " ; } hashkey_list += hashkey ; } map < string , EEDB :: Peer * > :: iterator it2 ; for ( it2 = _known_remote_peers . begin ( ) ; it2 != _known_remote_peers . end ( ) ; it2 ++ ) { EEDB :: Peer * peer = ( * it2 ) . second ; EEDB :: SPStreams :: RemoteServerStream * rstream = ( EEDB :: SPStreams :: RemoteServerStream * ) peer -> source_stream ( ) ; rstream -> set_userDB ( _userDB ) ; rstream -> mirror_remote_trackcaches ( hashkey_list ) ; } }
remote TrackCache check/create/sync code
remote TrackCache check / create / sync code
//fprintf(stderr, "RegionServer::_remote_trackcache_setup :: %ld remote peers in this track\n", _known_remote_peers.size()); //recursive cache_point check to get all intermediate hashkeys //fprintf(stderr, "collected %ld cachepoint hashkeys\n", hashkeys.size()); //fprintf(stderr, "remote-server %s\n", rstream->xml().c_str());