Exemple #1
0
int MeshTest::svc_i(void* arg) {
    printf("Starting RPC test...\n");
    RPCService* s = new RPCService();
    UUIDPtr sid;
    s->getSID(sid);
    UUIDPtr iid;
    ServiceParams* params = 0;
    if (m_ft) {
        FTServiceParamsPtr ftParams(new FTServiceParams(m_replicasNo, 0));
        params = new ServiceParams(sid, ftParams);
    } else {
        params = new ServiceParams(sid);
    }

    ServiceParamsPtr paramsPtr(params);
    try {
        UUIDPtr deployUUIDD;
        m_runtime->startService(sid, paramsPtr, iid, deployUUIDD);        
        ClientParamsPtr cp(new ClientParams(QoS::HRT, CPUQoS::MAX_RT_PRIO));                
        OverlayInterface* overlay = m_runtime->getOverlayInterface();
        //overlay->getDiscovery()->executeQuery()
        
        
        return 0;
    } catch (ServiceException& se) {
        printf("MeshTest:: failed to bootstrap rpc service\n");
        return -1;
    }
    return -1;
}
Exemple #2
0
void MeshTest::performFaultInPrimary(UUIDPtr& primaryUUID) {
    RPCService s;
    UUIDPtr sid;
    s.getSID(sid);
    UUIDPtr iid;
    ServiceParams* params = 0;
    params = new ServiceParams(sid);
    //NO-FT
    //ServiceParams* params = new ServiceParams(sid);            
    ServiceParamsPtr paramsPtr(params);
    ServiceClient* c = 0;
    RPCServiceClient* rpcClient = 0;
    RPCRuntimeManagerObjectClient* rpcManagerObjectClient = 0;
    try {
        m_runtime->startService(sid, primaryUUID, paramsPtr, iid);
        ClientParamsPtr cp(new ClientParams(QoS::HRT, CPUQoS::MAX_RT_PRIO));
        c = m_runtime->getClient(sid, iid, cp);
        rpcClient = static_cast<RPCServiceClient*> (c);
        rpcManagerObjectClient = new RPCRuntimeManagerObjectClient(rpcClient);
        rpcManagerObjectClient->hardFault();
    } catch (ServiceException& se) {
        printf("failed to inject fault\n");
    }
    if (rpcManagerObjectClient != 0) {
        delete rpcManagerObjectClient;
    }
}