Ejemplo n.º 1
0
void BuddyByAddTimeLoaderAdapter::load( const MyUtil::Int2IntSeqMap& lists ){
        MCE_DEBUG( "[BuddyByAddTimeLoaderAdapter::load] lists.size()=" << lists.size() );
	try {
	        getProxy( 0 )->load( lists );
	} catch (Ice::Exception& e) {
		ostringstream info;
		for (MyUtil::Int2IntSeqMap::const_iterator ui = lists.begin(); ui != lists.end(); ++ui) {
			info << ui->first << " ";
		}
		MCE_WARN("BuddyByAddTimeLoaderAdapter::load, Ice::Exception: " << e.what() << " ids: " << info.str());
	} catch (std::exception& e) {
		MCE_WARN("BuddyByAddTimeLoaderAdapter::load,Exception: " << e.what());
	} catch (...) {
		MCE_WARN("BuddyByAddTimeLoaderAdapter::load,Exception");
	}
}
Ejemplo n.º 2
0
void
MyUtil::__writeInt2IntSeqMap(::IceInternal::BasicStream* __os, const ::MyUtil::Int2IntSeqMap& v)
{
    __os->writeSize(::Ice::Int(v.size()));
    ::MyUtil::Int2IntSeqMap::const_iterator p;
    for(p = v.begin(); p != v.end(); ++p)
    {
        __os->write(p->first);
        if(p->second.size() == 0)
        {
            __os->writeSize(0);
        }
        else
        {
            __os->write(&p->second[0], &p->second[0] + p->second.size());
        }
    }
}
Ejemplo n.º 3
0
void CommonFriendCalculator::buildWeight(const MyUtil::Int2IntSeqMap& users, int weight) {
	MCE_DEBUG("build " << _userId << " size=" << users.size());
	try
	{
		for(MyUtil::Int2IntSeqMap::const_iterator i=users.begin();
				i!=users.end();
				++i)
		{
			for(MyUtil::IntSeq::const_iterator ui=i->second.begin();ui!=i->second.end();++ui)
			{
				_weightCount[*ui] += weight;
				MyUtil::Int2IntSeqMap::iterator sIt = _shareCount.find(*ui);
				if(sIt == _shareCount.end())
				{
					MyUtil::IntSeq firstShares;
					firstShares.push_back( i->first );
					_shareCount.insert(make_pair(*ui, firstShares));
				}
				else
				{
					sIt->second.push_back( i->first );
				}
			}
		}
	}
	catch(Ice::Exception& e)
	{
		MCE_WARN("buildUser IceException " << _userId << e.what());
	}
	catch(std::exception& e)
	{
		MCE_WARN("buildUser stdException " << _userId << e.what());
	}
	catch(...)
	{
		MCE_WARN("buildUser exception " << _userId);
	}
}
Ejemplo n.º 4
0
void BuddyByNameLoaderAdapter::load( const MyUtil::Int2IntSeqMap& lists ){
	MCE_DEBUG( "[BuddyByNameLoaderAdapter::load] lists.size()=" << lists.size() );
	getProxy( 0 )->load( lists );
}
Ejemplo n.º 5
0
void BuddyByAddTimeLoaderI::load(const MyUtil::Int2IntSeqMap& lists,
    const Ice::Current& current) {
  MCE_INFO("[BuddyByAddTimeLoaderI::load] lists.size()=" << lists.size() );
  TaskManager::instance().execute(new LoadTask(lists));
}