Search in sources :

Example 1 with ThriftException

use of com.facebook.buck.slb.ThriftException in project buck by facebook.

the class ThriftCoordinatorServer method start.

public ThriftCoordinatorServer start() throws IOException {
    synchronized (lock) {
        try {
            transport = new TNonblockingServerSocket(this.port);
        } catch (TTransportException e) {
            throw new ThriftException(e);
        }
        TThreadedSelectorServer.Args serverArgs = new TThreadedSelectorServer.Args(transport);
        serverArgs.processor(processor);
        server = new TThreadedSelectorServer(serverArgs);
        serverThread = new Thread(() -> Preconditions.checkNotNull(server).serve());
        serverThread.start();
    }
    return this;
}
Also used : ThriftException(com.facebook.buck.slb.ThriftException) TNonblockingServerSocket(org.apache.thrift.transport.TNonblockingServerSocket) TThreadedSelectorServer(org.apache.thrift.server.TThreadedSelectorServer) TTransportException(org.apache.thrift.transport.TTransportException)

Example 2 with ThriftException

use of com.facebook.buck.slb.ThriftException in project buck by facebook.

the class ThriftCoordinatorClient method finishedBuilding.

public FinishedBuildingResponse finishedBuilding(String minionId, int minionExitCode) throws IOException {
    LOG.debug(String.format("Minion [%s] is reporting that it finished building.", minionId));
    Preconditions.checkNotNull(client, "Client was not started.");
    FinishedBuildingRequest request = new FinishedBuildingRequest().setStampedeId(stampedeId).setMinionId(minionId).setBuildExitCode(minionExitCode);
    try {
        FinishedBuildingResponse response = client.finishedBuilding(request);
        return response;
    } catch (TException e) {
        throw new ThriftException(e);
    }
}
Also used : FinishedBuildingResponse(com.facebook.buck.distributed.thrift.FinishedBuildingResponse) TException(org.apache.thrift.TException) ThriftException(com.facebook.buck.slb.ThriftException) FinishedBuildingRequest(com.facebook.buck.distributed.thrift.FinishedBuildingRequest)

Example 3 with ThriftException

use of com.facebook.buck.slb.ThriftException in project buck by facebook.

the class ThriftCoordinatorClient method getTargetsToBuild.

public GetTargetsToBuildResponse getTargetsToBuild(String minionId) throws IOException {
    LOG.debug(String.format("Minion [%s] is requesting targets to build.", minionId));
    Preconditions.checkNotNull(client, "Client was not started.");
    GetTargetsToBuildRequest request = new GetTargetsToBuildRequest().setMinionId(minionId).setStampedeId(stampedeId);
    try {
        GetTargetsToBuildResponse response = client.getTargetsToBuild(request);
        return response;
    } catch (TException e) {
        throw new ThriftException(e);
    }
}
Also used : TException(org.apache.thrift.TException) ThriftException(com.facebook.buck.slb.ThriftException) GetTargetsToBuildRequest(com.facebook.buck.distributed.thrift.GetTargetsToBuildRequest) GetTargetsToBuildResponse(com.facebook.buck.distributed.thrift.GetTargetsToBuildResponse)

Aggregations

ThriftException (com.facebook.buck.slb.ThriftException)3 TException (org.apache.thrift.TException)2 FinishedBuildingRequest (com.facebook.buck.distributed.thrift.FinishedBuildingRequest)1 FinishedBuildingResponse (com.facebook.buck.distributed.thrift.FinishedBuildingResponse)1 GetTargetsToBuildRequest (com.facebook.buck.distributed.thrift.GetTargetsToBuildRequest)1 GetTargetsToBuildResponse (com.facebook.buck.distributed.thrift.GetTargetsToBuildResponse)1 TThreadedSelectorServer (org.apache.thrift.server.TThreadedSelectorServer)1 TNonblockingServerSocket (org.apache.thrift.transport.TNonblockingServerSocket)1 TTransportException (org.apache.thrift.transport.TTransportException)1