Search in sources :

Example 1 with Accept

use of org.apache.mesos.v1.scheduler.Protos.Call.Accept in project Singularity by HubSpot.

the class SingularityMesosSchedulerClient method accept.

/**
 * Sent by the scheduler when it accepts offer(s) sent by the master. The ACCEPT request includes the type of
 * operations (e.g., launch task, launch task group, reserve resources, create volumes) that the scheduler wants to
 * perform on the offers. Note that until the scheduler replies (accepts or declines) to an offer, the offer’s
 * resources are considered allocated to the offer’s role and to the framework.
 *
 * @param offerIds
 * @param offerOperations
 */
public void accept(List<OfferID> offerIds, List<Offer.Operation> offerOperations) {
    Builder accept = build().setAccept(Accept.newBuilder().addAllOfferIds(offerIds).addAllOperations(offerOperations));
    sendCall(accept, Type.ACCEPT);
}
Also used : MesosClientBuilder(com.hubspot.mesos.rx.java.MesosClientBuilder) Builder(org.apache.mesos.v1.scheduler.Protos.Call.Builder) ProtobufMesosClientBuilder(com.hubspot.mesos.rx.java.protobuf.ProtobufMesosClientBuilder)

Example 2 with Accept

use of org.apache.mesos.v1.scheduler.Protos.Call.Accept in project Singularity by HubSpot.

the class SingularityMesosSchedulerClient method accept.

public void accept(List<OfferID> offerIds, List<Offer.Operation> offerOperations, Filters filters) {
    Builder accept = build().setAccept(Accept.newBuilder().addAllOfferIds(offerIds).addAllOperations(offerOperations).setFilters(filters));
    sendCall(accept, Type.ACCEPT);
}
Also used : MesosClientBuilder(com.hubspot.mesos.rx.java.MesosClientBuilder) Builder(org.apache.mesos.v1.scheduler.Protos.Call.Builder) ProtobufMesosClientBuilder(com.hubspot.mesos.rx.java.protobuf.ProtobufMesosClientBuilder)

Example 3 with Accept

use of org.apache.mesos.v1.scheduler.Protos.Call.Accept in project Singularity by HubSpot.

the class SingularityMesosSchedulerClient method decline.

/**
 * Sent by the scheduler to explicitly decline offer(s) received. Note that this is same as sending an
 * ACCEPT call with no operations.
 *
 * @param offerIds
 */
public void decline(List<OfferID> offerIds) {
    Builder decline = build().setDecline(Decline.newBuilder().addAllOfferIds(offerIds));
    sendCall(decline, Type.DECLINE);
}
Also used : MesosClientBuilder(com.hubspot.mesos.rx.java.MesosClientBuilder) Builder(org.apache.mesos.v1.scheduler.Protos.Call.Builder) ProtobufMesosClientBuilder(com.hubspot.mesos.rx.java.protobuf.ProtobufMesosClientBuilder)

Example 4 with Accept

use of org.apache.mesos.v1.scheduler.Protos.Call.Accept in project Singularity by HubSpot.

the class SingularityMesosSchedulerClient method revive.

/**
 * Sent by the scheduler to remove any/all filters that it has previously set via ACCEPT or DECLINE calls.
 */
public void revive() {
    Builder revive = build();
    sendCall(revive, Type.REVIVE);
}
Also used : MesosClientBuilder(com.hubspot.mesos.rx.java.MesosClientBuilder) Builder(org.apache.mesos.v1.scheduler.Protos.Call.Builder) ProtobufMesosClientBuilder(com.hubspot.mesos.rx.java.protobuf.ProtobufMesosClientBuilder)

Aggregations

MesosClientBuilder (com.hubspot.mesos.rx.java.MesosClientBuilder)4 ProtobufMesosClientBuilder (com.hubspot.mesos.rx.java.protobuf.ProtobufMesosClientBuilder)4 Builder (org.apache.mesos.v1.scheduler.Protos.Call.Builder)4