You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myriad.apache.org by jp...@apache.org on 2018/09/12 15:51:57 UTC
[01/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Repository: incubator-myriad
Updated Branches:
refs/heads/upgrademesos1.5 [created] 16467f39d
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Scheduler.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Scheduler.java b/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Scheduler.java
new file mode 100644
index 0000000..002acef
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Scheduler.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.v1.scheduler;
+
+import org.apache.mesos.v1.scheduler.Protos.Event;
+
+/**
+ * Callback interface to be implemented by schedulers.
+ * Note that only one callback will be invoked at a time,
+ * so it is not recommended that you block within a callback because
+ * it may cause a deadlock.
+ * <p>
+ * Each callback includes a reference to the Mesos interface that was
+ * used to run this scheduler. The reference will not change for the
+ * duration of a scheduler from the time it is instantiated.
+ * This is intended for convenience so that a scheduler doesn't need to
+ * store a reference to the interface itself.
+ */
+
+public interface Scheduler {
+ /**
+ * Invoked when a connection is established with the master upon a
+ * master (re-)detection.
+ */
+ void connected(Mesos mesos);
+
+ /**
+ * Invoked when no master is detected or when the existing persistent
+ * connection is interrupted.
+ */
+ void disconnected(Mesos mesos);
+
+ /**
+ * Invoked when a new event is received from the Mesos master.
+ */
+ void received(Mesos mesos, Event event);
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/V0Mesos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/V0Mesos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/V0Mesos.java
new file mode 100644
index 0000000..753de63
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/V0Mesos.java
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.v1.scheduler;
+
+import org.apache.mesos.MesosNativeLibrary;
+
+import org.apache.mesos.v1.Protos.Credential;
+import org.apache.mesos.v1.Protos.FrameworkInfo;
+
+import org.apache.mesos.v1.scheduler.Protos.Call;
+import org.apache.mesos.v1.scheduler.Protos.Event;
+
+/**
+ * This implementation acts as an adapter from the v0 (driver + scheduler)
+ * to the v1 Scheduler interface. It uses the MesosSchedulerDriver under
+ * the hood for interacting with Mesos. This class is thread-safe.
+ */
+public class V0Mesos implements Mesos {
+ static {
+ MesosNativeLibrary.load();
+ }
+
+ public V0Mesos(Scheduler scheduler, FrameworkInfo framework, String master) {
+ this(scheduler, framework, master, null);
+ }
+
+ public V0Mesos(Scheduler scheduler,
+ FrameworkInfo framework,
+ String master,
+ Credential credential) {
+ if (scheduler == null) {
+ throw new NullPointerException("Not expecting a null scheduler");
+ }
+
+ if (framework == null) {
+ throw new NullPointerException("Not expecting a null framework");
+ }
+
+ if (master == null) {
+ throw new NullPointerException("Not expecting a null master");
+ }
+
+ this.scheduler = scheduler;
+ this.framework = framework;
+ this.master = master;
+ this.credential = credential;
+
+ initialize();
+ }
+
+ @Override
+ public native void send(Call call);
+
+ // This is currently a no-op for the driver as it does not expose semantics
+ // to force reconnection.
+ @Override
+ public void reconnect() {}
+
+ protected native void initialize();
+ protected native void finalize();
+
+ private final Scheduler scheduler;
+ private final FrameworkInfo framework;
+ private final String master;
+ private final Credential credential;
+
+ private long __mesos;
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/V1Mesos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/V1Mesos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/V1Mesos.java
new file mode 100644
index 0000000..59a0a35
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/V1Mesos.java
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.v1.scheduler;
+
+import org.apache.mesos.MesosNativeLibrary;
+
+import org.apache.mesos.v1.Protos.Credential;
+import org.apache.mesos.v1.Protos.FrameworkInfo;
+
+import org.apache.mesos.v1.scheduler.Protos.Call;
+
+/**
+ * Concrete implementation of the Mesos interface that connects a Scheduler
+ * with a Mesos master. This class is thread-safe.
+ * <p>
+ * This implementation uses the scheduler library (src/scheduler/scheduler.cpp)
+ * based on the V1 Mesos Scheduler API. The library is responsible for
+ * invoking the Scheduler callbacks as it communicates with the Mesos master.
+ * <p>
+ * <p>
+ * Note that the scheduler library uses GLOG to do its own logging. GLOG flags
+ * can be set via environment variables, prefixing the flag name with
+ * "GLOG_", e.g., "GLOG_v=1". For Mesos specific logging flags see
+ * src/logging/flags.hpp. Mesos flags can also be set via environment
+ * variables, prefixing the flag name with "MESOS_", e.g., "MESOS_QUIET=1".
+ * <p>
+ * See src/examples/java/V1TestFramework.java for an example of using this.
+ */
+public class V1Mesos implements Mesos {
+ static {
+ MesosNativeLibrary.load();
+ }
+
+ public V1Mesos(Scheduler scheduler, String master) {
+ this(scheduler, master, null);
+ }
+
+ public V1Mesos(Scheduler scheduler, String master, Credential credential) {
+ if (scheduler == null) {
+ throw new NullPointerException("Not expecting a null scheduler");
+ }
+
+ if (master == null) {
+ throw new NullPointerException("Not expecting a null master");
+ }
+
+ this.scheduler = scheduler;
+ this.master = master;
+ this.credential = credential;
+
+ initialize();
+ }
+
+ @Override
+ public native void send(Call call);
+
+ @Override
+ public native void reconnect();
+
+ protected native void initialize();
+ protected native void finalize();
+
+ private final Scheduler scheduler;
+ private final String master;
+ private final Credential credential;
+
+ private long __mesos;
+}
[09/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/Scheduler.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/Scheduler.java b/myriad-commons/src/main/java/org/apache/mesos/Scheduler.java
new file mode 100644
index 0000000..da65116
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/Scheduler.java
@@ -0,0 +1,211 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos;
+
+import java.util.List;
+
+import org.apache.mesos.Protos.*;
+/**
+ * Callback interface to be implemented by frameworks'
+ * schedulers. Note that only one callback will be invoked at a time,
+ * so it is not recommended that you block within a callback because
+ * it may cause a deadlock.
+ * <p>
+ * Each callback includes a reference to the scheduler driver that was
+ * used to run this scheduler. The reference will not change for the
+ * duration of a scheduler (i.e., from the point you do {@link
+ * SchedulerDriver#start} to the point that {@link
+ * SchedulerDriver#join} returns). This is intended for convenience so
+ * that a scheduler doesn't need to store a reference to the driver
+ * itself.
+ */
+public interface Scheduler {
+ /**
+ * Invoked when the scheduler successfully registers with a Mesos
+ * master. A unique ID (generated by the master) used for
+ * distinguishing this framework from others and MasterInfo
+ * with the IP and port of the current master are provided as arguments.
+ *
+ * @param driver The scheduler driver that was registered.
+ * @param frameworkId The framework ID generated by the master.
+ * @param masterInfo Info about the current master, including IP and port.
+ *
+ * @see SchedulerDriver
+ * @see FrameworkID
+ * @see MasterInfo
+ */
+ void registered(SchedulerDriver driver,
+ FrameworkID frameworkId,
+ MasterInfo masterInfo);
+
+ /**
+ * Invoked when the scheduler re-registers with a newly elected Mesos master.
+ * This is only called when the scheduler has previously been registered.
+ * MasterInfo containing the updated information about the elected master
+ * is provided as an argument.
+ *
+ * @param driver The driver that was re-registered.
+ * @param masterInfo The updated information about the elected master.
+ *
+ * @see SchedulerDriver
+ * @see MasterInfo
+ */
+ void reregistered(SchedulerDriver driver, MasterInfo masterInfo);
+
+ /**
+ * Invoked when resources have been offered to this framework. A
+ * single offer will only contain resources from a single slave.
+ * Resources associated with an offer will not be re-offered to
+ * _this_ framework until either (a) this framework has rejected
+ * those resources (see {@link SchedulerDriver#launchTasks}) or (b)
+ * those resources have been rescinded (see {@link Scheduler#offerRescinded}).
+ * Note that resources may be concurrently offered to more than one
+ * framework at a time (depending on the allocator being used). In
+ * that case, the first framework to launch tasks using those
+ * resources will be able to use them while the other frameworks
+ * will have those resources rescinded (or if a framework has
+ * already launched tasks with those resources then those tasks will
+ * fail with a TASK_LOST status and a message saying as much).
+ *
+ * @param driver The driver that was used to run this scheduler.
+ * @param offers The resources offered to this framework.
+ *
+ * @see SchedulerDriver
+ * @see Offer
+ */
+ void resourceOffers(SchedulerDriver driver, List<Offer> offers);
+
+ /**
+ * Invoked when an offer is no longer valid (e.g., the slave was
+ * lost or another framework used resources in the offer). If for
+ * whatever reason an offer is never rescinded (e.g., dropped
+ * message, failing over framework, etc.), a framework that attempts
+ * to launch tasks using an invalid offer will receive TASK_LOST
+ * status updates for those tasks (see {@link #resourceOffers}).
+ *
+ * @param driver The driver that was used to run this scheduler.
+ * @param offerId The ID of the offer that was rescinded.
+ *
+ * @see SchedulerDriver
+ * @see OfferID
+ */
+ void offerRescinded(SchedulerDriver driver, OfferID offerId);
+
+ /**
+ * Invoked when the status of a task has changed (e.g., a slave is
+ * lost and so the task is lost, a task finishes and an executor
+ * sends a status update saying so, etc). If implicit
+ * acknowledgements are being used, then returning from this
+ * callback _acknowledges_ receipt of this status update! If for
+ * whatever reason the scheduler aborts during this callback (or
+ * the process exits) another status update will be delivered (note,
+ * however, that this is currently not true if the slave sending the
+ * status update is lost/fails during that time). If explicit
+ * acknowledgements are in use, the scheduler must acknowledge this
+ * status on the driver.
+ *
+ * @param driver The driver that was used to run this scheduler.
+ * @param status The status update, which includes the task ID and status.
+ *
+ * @see SchedulerDriver
+ * @see TaskStatus
+ */
+ void statusUpdate(SchedulerDriver driver, TaskStatus status);
+
+ /**
+ * Invoked when an executor sends a message. These messages are best
+ * effort; do not expect a framework message to be retransmitted in
+ * any reliable fashion.
+ *
+ * @param driver The driver that received the message.
+ * @param executorId The ID of the executor that sent the message.
+ * @param slaveId The ID of the slave that launched the executor.
+ * @param data The message payload.
+ *
+ * @see SchedulerDriver
+ * @see ExecutorID
+ * @see SlaveID
+ */
+ void frameworkMessage(SchedulerDriver driver,
+ ExecutorID executorId,
+ SlaveID slaveId,
+ byte[] data);
+
+ /**
+ * Invoked when the scheduler becomes "disconnected" from the master
+ * (e.g., the master fails and another is taking over).
+ *
+ * @param driver The driver that was used to run this scheduler.
+ *
+ * @see SchedulerDriver
+ */
+ void disconnected(SchedulerDriver driver);
+
+ /**
+ * Invoked when a slave has been determined unreachable (e.g.,
+ * machine failure, network partition). Most frameworks will need to
+ * reschedule any tasks launched on this slave on a new slave.
+ *
+ * NOTE: This callback is not reliably delivered. If a host or
+ * network failure causes messages between the master and the
+ * scheduler to be dropped, this callback may not be invoked.
+ *
+ * @param driver The driver that was used to run this scheduler.
+ * @param slaveId The ID of the slave that was lost.
+ *
+ * @see SchedulerDriver
+ * @see SlaveID
+ */
+ void slaveLost(SchedulerDriver driver, SlaveID slaveId);
+
+ /**
+ * Invoked when an executor has exited/terminated. Note that any
+ * tasks running will have TASK_LOST status updates automagically
+ * generated.
+ *
+ * NOTE: This callback is not reliably delivered. If a host or
+ * network failure causes messages between the master and the
+ * scheduler to be dropped, this callback may not be invoked.
+ *
+ * @param driver The driver that was used to run this scheduler.
+ * @param executorId The ID of the executor that was lost.
+ * @param slaveId The ID of the slave that launched the executor.
+ * @param status The exit status of the executor.
+ *
+ * @see SchedulerDriver
+ * @see ExecutorID
+ * @see SlaveID
+ * @see Status
+ */
+ void executorLost(SchedulerDriver driver,
+ ExecutorID executorId,
+ SlaveID slaveId,
+ int status);
+
+ /**
+ * Invoked when there is an unrecoverable error in the scheduler or
+ * driver. The driver will be aborted BEFORE invoking this callback.
+ *
+ * @param driver The driver that was used to run this scheduler.
+ * @param message The error message.
+ *
+ * @see SchedulerDriver
+ */
+ void error(SchedulerDriver driver, String message);
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/SchedulerDriver.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/SchedulerDriver.java b/myriad-commons/src/main/java/org/apache/mesos/SchedulerDriver.java
new file mode 100644
index 0000000..7de5515
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/SchedulerDriver.java
@@ -0,0 +1,323 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos;
+
+import java.util.Collection;
+
+import org.apache.mesos.Protos.*;
+/**
+ * Abstract interface for connecting a scheduler to Mesos. This
+ * interface is used both to manage the scheduler's lifecycle (start
+ * it, stop it, or wait for it to finish) and to interact with Mesos
+ * (e.g., launch tasks, kill tasks, etc.).
+ */
+public interface SchedulerDriver {
+ /**
+ * Starts the scheduler driver. This needs to be called before any
+ * other driver calls are made.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ Status start();
+
+ /**
+ * Stops the scheduler driver. If the 'failover' flag is set to
+ * false then it is expected that this framework will never
+ * reconnect to Mesos. So Mesos will unregister the framework
+ * and shutdown all its tasks and executors. If 'failover' is true,
+ * all executors and tasks will remain running (for some framework
+ * specific failover timeout) allowing the scheduler to reconnect
+ * (possibly in the same process, or from a different process, for
+ * example, on a different machine).
+ *
+ * @param failover Whether framework failover is expected.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ Status stop(boolean failover);
+
+ /**
+ * Stops the scheduler driver assuming no failover. This will
+ * cause Mesos to unregister the framework and shutdown all
+ * its tasks and executors. Please see {@link #stop(boolean)}
+ * for more details.
+ *
+ * @return The state of the driver after the call.
+ */
+ Status stop();
+
+ /**
+ * Aborts the driver so that no more callbacks can be made to the
+ * scheduler. The semantics of abort and stop have deliberately been
+ * separated so that code can detect an aborted driver (i.e., via
+ * the return status of {@link #join}, see below), and instantiate
+ * and start another driver if desired (from within the same
+ * process).
+ *
+ * @return The state of the driver after the call.
+ */
+ Status abort();
+
+ /**
+ * Waits for the driver to be stopped or aborted, possibly
+ * <i>blocking</i> the current thread indefinitely. The return status of
+ * this function can be used to determine if the driver was aborted
+ * (see mesos.proto for a description of Status).
+ *
+ * @return The state of the driver after the call.
+ */
+ Status join();
+
+ /**
+ * Starts and immediately joins (i.e., blocks on) the driver.
+ *
+ * @return The state of the driver after the call.
+ */
+ Status run();
+
+ /**
+ * Requests resources from Mesos (see mesos.proto for a description
+ * of Request and how, for example, to request resources
+ * from specific slaves). Any resources available are offered to the
+ * framework via {@link Scheduler#resourceOffers} callback,
+ * asynchronously.
+ *
+ * @param requests The resource requests.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Request
+ * @see Status
+ */
+ Status requestResources(Collection<Request> requests);
+
+ /**
+ * Launches the given set of tasks. Any remaining resources (i.e.,
+ * those that are not used by the launched tasks or their executors)
+ * will be considered declined. Note that this includes resources
+ * used by tasks that the framework attempted to launch but failed
+ * (with TASK_ERROR) due to a malformed task description. The
+ * specified filters are applied on all unused resources (see
+ * mesos.proto for a description of Filters). Available resources
+ * are aggregated when multiple offers are provided. Note that all
+ * offers must belong to the same slave. Invoking this function with
+ * an empty collection of tasks declines offers in their entirety
+ * (see {@link #declineOffer}).
+ *
+ * @param offerIds The collection of offer IDs.
+ * @param tasks The collection of tasks to be launched.
+ * @param filters The filters to set for any remaining resources.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see OfferID
+ * @see TaskInfo
+ * @see Filters
+ * @see Status
+ */
+ Status launchTasks(Collection<OfferID> offerIds,
+ Collection<TaskInfo> tasks,
+ Filters filters);
+
+ /**
+ * Launches the given set of tasks. See above for details.
+ * Note that this may add a default filter (see mesos.proto)
+ * for the remaining resources. Notably the MesosSchedulerDriver
+ * does so.
+ *
+ *
+ * @param offerIds The collection of offer IDs.
+ * @param tasks The collection of tasks to be launched.
+ *
+ * @return The state of the driver after the call.
+ */
+ Status launchTasks(Collection<OfferID> offerIds, Collection<TaskInfo> tasks);
+
+ /**
+ * @deprecated Use {@link #launchTasks(Collection, Collection, Filters)} instead.
+ *
+ * @param offerId The offer ID.
+ * @param tasks The collection of tasks to be launched.
+ * @param filters The filters to set for any remaining resources.
+ *
+ * @return The state of the driver after the call.
+ */
+ Status launchTasks(OfferID offerId,
+ Collection<TaskInfo> tasks,
+ Filters filters);
+
+ /**
+ * @deprecated Use {@link #launchTasks(Collection, Collection)} instead.
+ * Note that this may add a default filter (see mesos.proto)
+ * for the remaining resources. Notably the MesosSchedulerDriver
+ * does so.
+ *
+ * @param offerId The offer ID.
+ * @param tasks The collection of tasks to be launched.
+ *
+ * @return The state of the driver after the call.
+ */
+ Status launchTasks(OfferID offerId, Collection<TaskInfo> tasks);
+
+ /**
+ * Kills the specified task. Note that attempting to kill a task is
+ * currently not reliable. If, for example, a scheduler fails over
+ * while it was attempting to kill a task it will need to retry in
+ * the future Likewise, if unregistered / disconnected, the request
+ * will be dropped (these semantics may be changed in the future).
+ *
+ * @param taskId The ID of the task to be killed.
+ *
+ * @return The state of the driver after the call.
+ */
+ Status killTask(TaskID taskId);
+
+ /**
+ * Accepts the given offers and performs a sequence of operations on
+ * those accepted offers. See Offer.Operation in mesos.proto for the
+ * set of available operations. Any remaining resources (i.e., those
+ * that are not used by the launched tasks or their executors) will
+ * be considered declined. Note that this includes resources used by
+ * tasks that the framework attempted to launch but failed (with
+ * TASK_ERROR) due to a malformed task description. The specified
+ * filters are applied on all unused resources (see mesos.proto for
+ * a description of Filters). Available resources are aggregated
+ * when multiple offers are provided. Note that all offers must
+ * belong to the same slave.
+ *
+ * @param offerIds The collection of offer IDs.
+ * @param operations The collection of offer operations to perform.
+ * @param filters The filters to set for any remaining resources.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see OfferID
+ * @see Offer.Operation
+ * @see Filters
+ * @see Status
+ */
+ Status acceptOffers(Collection<OfferID> offerIds,
+ Collection<Offer.Operation> operations,
+ Filters filters);
+
+ /**
+ * Declines an offer in its entirety and applies the specified
+ * filters on the resources (see mesos.proto for a description of
+ * Filters). Note that this can be done at any time, it is not
+ * necessary to do this within the {@link Scheduler#resourceOffers}
+ * callback.
+ *
+ * @param offerId The ID of the offer to be declined.
+ * @param filters The filters to set for any remaining resources.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see OfferID
+ * @see Filters
+ * @see Status
+ */
+ Status declineOffer(OfferID offerId, Filters filters);
+
+ /**
+ * Declines an offer in its entirety. See above for details.
+ *
+ * @param offerId The ID of the offer to be declined.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see OfferID
+ * @see Status
+ */
+ Status declineOffer(OfferID offerId);
+
+ /**
+ * Removes all filters, previously set by the framework (via {@link
+ * #launchTasks}). This enables the framework to receive offers
+ * from those filtered slaves.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ Status reviveOffers();
+
+ /**
+ * Inform Mesos master to stop sending offers to the framework. The
+ * scheduler should call reviveOffers() to resume getting offers.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ Status suppressOffers();
+
+ /**
+ * Acknowledges the status update. This should only be called
+ * once the status update is processed durably by the scheduler.
+ * Not that explicit acknowledgements must be requested via the
+ * constructor argument, otherwise a call to this method will
+ * cause the driver to crash.
+ *
+ * @param status The status to acknowledge.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see TaskStatus
+ */
+ Status acknowledgeStatusUpdate(TaskStatus status);
+
+ /**
+ * Sends a message from the framework to one of its executors. These
+ * messages are best effort; do not expect a framework message to be
+ * retransmitted in any reliable fashion.
+ *
+ * @param executorId The ID of the executor to send the message to.
+ * @param slaveId The ID of the slave that is running the executor.
+ * @param data The message.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see ExecutorID
+ * @see SlaveID
+ */
+ Status sendFrameworkMessage(ExecutorID executorId,
+ SlaveID slaveId,
+ byte[] data);
+
+ /**
+ * Allows the framework to query the status for non-terminal tasks.
+ * This causes the master to send back the latest task status for
+ * each task in 'statuses', if possible. Tasks that are no longer
+ * known will result in a TASK_LOST update. If statuses is empty,
+ * then the master will send the latest status for each task
+ * currently known.
+ *
+ * @param statuses The collection of non-terminal TaskStatuses to reconcile.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see TaskStatus
+ * @see SlaveID
+ */
+ Status reconcileTasks(Collection<TaskStatus> statuses);
+}
[02/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Protos.java
new file mode 100644
index 0000000..ff599d8
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Protos.java
@@ -0,0 +1,24570 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/v1/scheduler.proto
+
+package org.apache.mesos.v1.scheduler;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface EventOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.v1.scheduler.Event.Type type = 1;
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Type type = 1;</code>
+ *
+ * <pre>
+ * Type of the event, indicates which optional field below should be
+ * present if that type has a nested message definition.
+ * Enum fields should be optional, see: MESOS-4997.
+ * </pre>
+ */
+ boolean hasType();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Type type = 1;</code>
+ *
+ * <pre>
+ * Type of the event, indicates which optional field below should be
+ * present if that type has a nested message definition.
+ * Enum fields should be optional, see: MESOS-4997.
+ * </pre>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.Type getType();
+
+ // optional .mesos.v1.scheduler.Event.Subscribed subscribed = 2;
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Subscribed subscribed = 2;</code>
+ */
+ boolean hasSubscribed();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Subscribed subscribed = 2;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.Subscribed getSubscribed();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Subscribed subscribed = 2;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.SubscribedOrBuilder getSubscribedOrBuilder();
+
+ // optional .mesos.v1.scheduler.Event.Offers offers = 3;
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Offers offers = 3;</code>
+ */
+ boolean hasOffers();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Offers offers = 3;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.Offers getOffers();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Offers offers = 3;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.OffersOrBuilder getOffersOrBuilder();
+
+ // optional .mesos.v1.scheduler.Event.InverseOffers inverse_offers = 9;
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.InverseOffers inverse_offers = 9;</code>
+ */
+ boolean hasInverseOffers();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.InverseOffers inverse_offers = 9;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.InverseOffers getInverseOffers();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.InverseOffers inverse_offers = 9;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.InverseOffersOrBuilder getInverseOffersOrBuilder();
+
+ // optional .mesos.v1.scheduler.Event.Rescind rescind = 4;
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Rescind rescind = 4;</code>
+ */
+ boolean hasRescind();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Rescind rescind = 4;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.Rescind getRescind();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Rescind rescind = 4;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.RescindOrBuilder getRescindOrBuilder();
+
+ // optional .mesos.v1.scheduler.Event.RescindInverseOffer rescind_inverse_offer = 10;
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.RescindInverseOffer rescind_inverse_offer = 10;</code>
+ */
+ boolean hasRescindInverseOffer();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.RescindInverseOffer rescind_inverse_offer = 10;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.RescindInverseOffer getRescindInverseOffer();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.RescindInverseOffer rescind_inverse_offer = 10;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.RescindInverseOfferOrBuilder getRescindInverseOfferOrBuilder();
+
+ // optional .mesos.v1.scheduler.Event.Update update = 5;
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Update update = 5;</code>
+ */
+ boolean hasUpdate();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Update update = 5;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.Update getUpdate();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Update update = 5;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.UpdateOrBuilder getUpdateOrBuilder();
+
+ // optional .mesos.v1.scheduler.Event.Message message = 6;
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Message message = 6;</code>
+ */
+ boolean hasMessage();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Message message = 6;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.Message getMessage();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Message message = 6;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.MessageOrBuilder getMessageOrBuilder();
+
+ // optional .mesos.v1.scheduler.Event.Failure failure = 7;
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Failure failure = 7;</code>
+ */
+ boolean hasFailure();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Failure failure = 7;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.Failure getFailure();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Failure failure = 7;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.FailureOrBuilder getFailureOrBuilder();
+
+ // optional .mesos.v1.scheduler.Event.Error error = 8;
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Error error = 8;</code>
+ */
+ boolean hasError();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Error error = 8;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.Error getError();
+ /**
+ * <code>optional .mesos.v1.scheduler.Event.Error error = 8;</code>
+ */
+ org.apache.mesos.v1.scheduler.Protos.Event.ErrorOrBuilder getErrorOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.scheduler.Event}
+ *
+ * <pre>
+ **
+ * Scheduler event API.
+ *
+ * An event is described using the standard protocol buffer "union"
+ * trick, see:
+ * https://developers.google.com/protocol-buffers/docs/techniques#union.
+ * </pre>
+ */
+ public static final class Event extends
+ com.google.protobuf.GeneratedMessage
+ implements EventOrBuilder {
+ // Use Event.newBuilder() to construct.
+ private Event(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Event(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Event defaultInstance;
+ public static Event getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Event getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Event(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ int rawValue = input.readEnum();
+ org.apache.mesos.v1.scheduler.Protos.Event.Type value = org.apache.mesos.v1.scheduler.Protos.Event.Type.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(1, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ type_ = value;
+ }
+ break;
+ }
+ case 18: {
+ org.apache.mesos.v1.scheduler.Protos.Event.Subscribed.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = subscribed_.toBuilder();
+ }
+ subscribed_ = input.readMessage(org.apache.mesos.v1.scheduler.Protos.Event.Subscribed.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(subscribed_);
+ subscribed_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.apache.mesos.v1.scheduler.Protos.Event.Offers.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = offers_.toBuilder();
+ }
+ offers_ = input.readMessage(org.apache.mesos.v1.scheduler.Protos.Event.Offers.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(offers_);
+ offers_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ org.apache.mesos.v1.scheduler.Protos.Event.Rescind.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ subBuilder = rescind_.toBuilder();
+ }
+ rescind_ = input.readMessage(org.apache.mesos.v1.scheduler.Protos.Event.Rescind.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(rescind_);
+ rescind_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
+ case 42: {
+ org.apache.mesos.v1.scheduler.Protos.Event.Update.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
+ subBuilder = update_.toBuilder();
+ }
+ update_ = input.readMessage(org.apache.mesos.v1.scheduler.Protos.Event.Update.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(update_);
+ update_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000040;
+ break;
+ }
+ case 50: {
+ org.apache.mesos.v1.scheduler.Protos.Event.Message.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ subBuilder = message_.toBuilder();
+ }
+ message_ = input.readMessage(org.apache.mesos.v1.scheduler.Protos.Event.Message.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(message_);
+ message_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000080;
+ break;
+ }
+ case 58: {
+ org.apache.mesos.v1.scheduler.Protos.Event.Failure.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000100) == 0x00000100)) {
+ subBuilder = failure_.toBuilder();
+ }
+ failure_ = input.readMessage(org.apache.mesos.v1.scheduler.Protos.Event.Failure.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(failure_);
+ failure_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000100;
+ break;
+ }
+ case 66: {
+ org.apache.mesos.v1.scheduler.Protos.Event.Error.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000200) == 0x00000200)) {
+ subBuilder = error_.toBuilder();
+ }
+ error_ = input.readMessage(org.apache.mesos.v1.scheduler.Protos.Event.Error.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(error_);
+ error_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000200;
+ break;
+ }
+ case 74: {
+ org.apache.mesos.v1.scheduler.Protos.Event.InverseOffers.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ subBuilder = inverseOffers_.toBuilder();
+ }
+ inverseOffers_ = input.readMessage(org.apache.mesos.v1.scheduler.Protos.Event.InverseOffers.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(inverseOffers_);
+ inverseOffers_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 82: {
+ org.apache.mesos.v1.scheduler.Protos.Event.RescindInverseOffer.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ subBuilder = rescindInverseOffer_.toBuilder();
+ }
+ rescindInverseOffer_ = input.readMessage(org.apache.mesos.v1.scheduler.Protos.Event.RescindInverseOffer.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(rescindInverseOffer_);
+ rescindInverseOffer_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000020;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.scheduler.Protos.Event.class, org.apache.mesos.v1.scheduler.Protos.Event.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Event> PARSER =
+ new com.google.protobuf.AbstractParser<Event>() {
+ public Event parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Event(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Event> getParserForType() {
+ return PARSER;
+ }
+
+ /**
+ * Protobuf enum {@code mesos.v1.scheduler.Event.Type}
+ *
+ * <pre>
+ * Possible event types, followed by message definitions if
+ * applicable.
+ * </pre>
+ */
+ public enum Type
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * This must be the first enum value in this list, to
+ * ensure that if 'type' is not set, the default value
+ * is UNKNOWN. This enables enum values to be added
+ * in a backwards-compatible way. See: MESOS-4997.
+ * </pre>
+ */
+ UNKNOWN(0, 0),
+ /**
+ * <code>SUBSCRIBED = 1;</code>
+ *
+ * <pre>
+ * See 'Subscribed' below.
+ * </pre>
+ */
+ SUBSCRIBED(1, 1),
+ /**
+ * <code>OFFERS = 2;</code>
+ *
+ * <pre>
+ * See 'Offers' below.
+ * </pre>
+ */
+ OFFERS(2, 2),
+ /**
+ * <code>INVERSE_OFFERS = 9;</code>
+ *
+ * <pre>
+ * See 'InverseOffers' below.
+ * </pre>
+ */
+ INVERSE_OFFERS(3, 9),
+ /**
+ * <code>RESCIND = 3;</code>
+ *
+ * <pre>
+ * See 'Rescind' below.
+ * </pre>
+ */
+ RESCIND(4, 3),
+ /**
+ * <code>RESCIND_INVERSE_OFFER = 10;</code>
+ *
+ * <pre>
+ * See 'RescindInverseOffer' below.
+ * </pre>
+ */
+ RESCIND_INVERSE_OFFER(5, 10),
+ /**
+ * <code>UPDATE = 4;</code>
+ *
+ * <pre>
+ * See 'Update' below.
+ * </pre>
+ */
+ UPDATE(6, 4),
+ /**
+ * <code>MESSAGE = 5;</code>
+ *
+ * <pre>
+ * See 'Message' below.
+ * </pre>
+ */
+ MESSAGE(7, 5),
+ /**
+ * <code>FAILURE = 6;</code>
+ *
+ * <pre>
+ * See 'Failure' below.
+ * </pre>
+ */
+ FAILURE(8, 6),
+ /**
+ * <code>ERROR = 7;</code>
+ *
+ * <pre>
+ * See 'Error' below.
+ * </pre>
+ */
+ ERROR(9, 7),
+ /**
+ * <code>HEARTBEAT = 8;</code>
+ *
+ * <pre>
+ * Periodic message sent by the Mesos master according to
+ * 'Subscribed.heartbeat_interval_seconds'. If the scheduler does
+ * not receive any events (including heartbeats) for an extended
+ * period of time (e.g., 5 x heartbeat_interval_seconds), there is
+ * likely a network partition. In such a case the scheduler should
+ * close the existing subscription connection and resubscribe
+ * using a backoff strategy.
+ * </pre>
+ */
+ HEARTBEAT(10, 8),
+ ;
+
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * This must be the first enum value in this list, to
+ * ensure that if 'type' is not set, the default value
+ * is UNKNOWN. This enables enum values to be added
+ * in a backwards-compatible way. See: MESOS-4997.
+ * </pre>
+ */
+ public static final int UNKNOWN_VALUE = 0;
+ /**
+ * <code>SUBSCRIBED = 1;</code>
+ *
+ * <pre>
+ * See 'Subscribed' below.
+ * </pre>
+ */
+ public static final int SUBSCRIBED_VALUE = 1;
+ /**
+ * <code>OFFERS = 2;</code>
+ *
+ * <pre>
+ * See 'Offers' below.
+ * </pre>
+ */
+ public static final int OFFERS_VALUE = 2;
+ /**
+ * <code>INVERSE_OFFERS = 9;</code>
+ *
+ * <pre>
+ * See 'InverseOffers' below.
+ * </pre>
+ */
+ public static final int INVERSE_OFFERS_VALUE = 9;
+ /**
+ * <code>RESCIND = 3;</code>
+ *
+ * <pre>
+ * See 'Rescind' below.
+ * </pre>
+ */
+ public static final int RESCIND_VALUE = 3;
+ /**
+ * <code>RESCIND_INVERSE_OFFER = 10;</code>
+ *
+ * <pre>
+ * See 'RescindInverseOffer' below.
+ * </pre>
+ */
+ public static final int RESCIND_INVERSE_OFFER_VALUE = 10;
+ /**
+ * <code>UPDATE = 4;</code>
+ *
+ * <pre>
+ * See 'Update' below.
+ * </pre>
+ */
+ public static final int UPDATE_VALUE = 4;
+ /**
+ * <code>MESSAGE = 5;</code>
+ *
+ * <pre>
+ * See 'Message' below.
+ * </pre>
+ */
+ public static final int MESSAGE_VALUE = 5;
+ /**
+ * <code>FAILURE = 6;</code>
+ *
+ * <pre>
+ * See 'Failure' below.
+ * </pre>
+ */
+ public static final int FAILURE_VALUE = 6;
+ /**
+ * <code>ERROR = 7;</code>
+ *
+ * <pre>
+ * See 'Error' below.
+ * </pre>
+ */
+ public static final int ERROR_VALUE = 7;
+ /**
+ * <code>HEARTBEAT = 8;</code>
+ *
+ * <pre>
+ * Periodic message sent by the Mesos master according to
+ * 'Subscribed.heartbeat_interval_seconds'. If the scheduler does
+ * not receive any events (including heartbeats) for an extended
+ * period of time (e.g., 5 x heartbeat_interval_seconds), there is
+ * likely a network partition. In such a case the scheduler should
+ * close the existing subscription connection and resubscribe
+ * using a backoff strategy.
+ * </pre>
+ */
+ public static final int HEARTBEAT_VALUE = 8;
+
+
+ public final int getNumber() { return value; }
+
+ public static Type valueOf(int value) {
+ switch (value) {
+ case 0: return UNKNOWN;
+ case 1: return SUBSCRIBED;
+ case 2: return OFFERS;
+ case 9: return INVERSE_OFFERS;
+ case 3: return RESCIND;
+ case 10: return RESCIND_INVERSE_OFFER;
+ case 4: return UPDATE;
+ case 5: return MESSAGE;
+ case 6: return FAILURE;
+ case 7: return ERROR;
+ case 8: return HEARTBEAT;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Type>() {
+ public Type findValueByNumber(int number) {
+ return Type.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.scheduler.Protos.Event.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Type[] VALUES = values();
+
+ public static Type valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private Type(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.v1.scheduler.Event.Type)
+ }
+
+ public interface SubscribedOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .mesos.v1.FrameworkID framework_id = 1;
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ boolean hasFrameworkId();
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.FrameworkID getFrameworkId();
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.FrameworkIDOrBuilder getFrameworkIdOrBuilder();
+
+ // optional double heartbeat_interval_seconds = 2;
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ boolean hasHeartbeatIntervalSeconds();
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ double getHeartbeatIntervalSeconds();
+
+ // optional .mesos.v1.MasterInfo master_info = 3;
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ boolean hasMasterInfo();
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.MasterInfo getMasterInfo();
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.MasterInfoOrBuilder getMasterInfoOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.scheduler.Event.Subscribed}
+ *
+ * <pre>
+ * First event received when the scheduler subscribes.
+ * </pre>
+ */
+ public static final class Subscribed extends
+ com.google.protobuf.GeneratedMessage
+ implements SubscribedOrBuilder {
+ // Use Subscribed.newBuilder() to construct.
+ private Subscribed(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Subscribed(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Subscribed defaultInstance;
+ public static Subscribed getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Subscribed getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Subscribed(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.v1.Protos.FrameworkID.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = frameworkId_.toBuilder();
+ }
+ frameworkId_ = input.readMessage(org.apache.mesos.v1.Protos.FrameworkID.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(frameworkId_);
+ frameworkId_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 17: {
+ bitField0_ |= 0x00000002;
+ heartbeatIntervalSeconds_ = input.readDouble();
+ break;
+ }
+ case 26: {
+ org.apache.mesos.v1.Protos.MasterInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = masterInfo_.toBuilder();
+ }
+ masterInfo_ = input.readMessage(org.apache.mesos.v1.Protos.MasterInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(masterInfo_);
+ masterInfo_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_Subscribed_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_Subscribed_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.scheduler.Protos.Event.Subscribed.class, org.apache.mesos.v1.scheduler.Protos.Event.Subscribed.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Subscribed> PARSER =
+ new com.google.protobuf.AbstractParser<Subscribed>() {
+ public Subscribed parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Subscribed(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Subscribed> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required .mesos.v1.FrameworkID framework_id = 1;
+ public static final int FRAMEWORK_ID_FIELD_NUMBER = 1;
+ private org.apache.mesos.v1.Protos.FrameworkID frameworkId_;
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public boolean hasFrameworkId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkID getFrameworkId() {
+ return frameworkId_;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkIDOrBuilder getFrameworkIdOrBuilder() {
+ return frameworkId_;
+ }
+
+ // optional double heartbeat_interval_seconds = 2;
+ public static final int HEARTBEAT_INTERVAL_SECONDS_FIELD_NUMBER = 2;
+ private double heartbeatIntervalSeconds_;
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public boolean hasHeartbeatIntervalSeconds() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public double getHeartbeatIntervalSeconds() {
+ return heartbeatIntervalSeconds_;
+ }
+
+ // optional .mesos.v1.MasterInfo master_info = 3;
+ public static final int MASTER_INFO_FIELD_NUMBER = 3;
+ private org.apache.mesos.v1.Protos.MasterInfo masterInfo_;
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public boolean hasMasterInfo() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MasterInfo getMasterInfo() {
+ return masterInfo_;
+ }
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MasterInfoOrBuilder getMasterInfoOrBuilder() {
+ return masterInfo_;
+ }
+
+ private void initFields() {
+ frameworkId_ = org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance();
+ heartbeatIntervalSeconds_ = 0D;
+ masterInfo_ = org.apache.mesos.v1.Protos.MasterInfo.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasFrameworkId()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getFrameworkId().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (hasMasterInfo()) {
+ if (!getMasterInfo().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, frameworkId_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeDouble(2, heartbeatIntervalSeconds_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeMessage(3, masterInfo_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, frameworkId_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeDoubleSize(2, heartbeatIntervalSeconds_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, masterInfo_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.scheduler.Protos.Event.Subscribed prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.scheduler.Event.Subscribed}
+ *
+ * <pre>
+ * First event received when the scheduler subscribes.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.scheduler.Protos.Event.SubscribedOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_Subscribed_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_Subscribed_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.scheduler.Protos.Event.Subscribed.class, org.apache.mesos.v1.scheduler.Protos.Event.Subscribed.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.scheduler.Protos.Event.Subscribed.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getFrameworkIdFieldBuilder();
+ getMasterInfoFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (frameworkIdBuilder_ == null) {
+ frameworkId_ = org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance();
+ } else {
+ frameworkIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ heartbeatIntervalSeconds_ = 0D;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (masterInfoBuilder_ == null) {
+ masterInfo_ = org.apache.mesos.v1.Protos.MasterInfo.getDefaultInstance();
+ } else {
+ masterInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_Subscribed_descriptor;
+ }
+
+ public org.apache.mesos.v1.scheduler.Protos.Event.Subscribed getDefaultInstanceForType() {
+ return org.apache.mesos.v1.scheduler.Protos.Event.Subscribed.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.scheduler.Protos.Event.Subscribed build() {
+ org.apache.mesos.v1.scheduler.Protos.Event.Subscribed result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.scheduler.Protos.Event.Subscribed buildPartial() {
+ org.apache.mesos.v1.scheduler.Protos.Event.Subscribed result = new org.apache.mesos.v1.scheduler.Protos.Event.Subscribed(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (frameworkIdBuilder_ == null) {
+ result.frameworkId_ = frameworkId_;
+ } else {
+ result.frameworkId_ = frameworkIdBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.heartbeatIntervalSeconds_ = heartbeatIntervalSeconds_;
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ if (masterInfoBuilder_ == null) {
+ result.masterInfo_ = masterInfo_;
+ } else {
+ result.masterInfo_ = masterInfoBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.scheduler.Protos.Event.Subscribed) {
+ return mergeFrom((org.apache.mesos.v1.scheduler.Protos.Event.Subscribed)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.scheduler.Protos.Event.Subscribed other) {
+ if (other == org.apache.mesos.v1.scheduler.Protos.Event.Subscribed.getDefaultInstance()) return this;
+ if (other.hasFrameworkId()) {
+ mergeFrameworkId(other.getFrameworkId());
+ }
+ if (other.hasHeartbeatIntervalSeconds()) {
+ setHeartbeatIntervalSeconds(other.getHeartbeatIntervalSeconds());
+ }
+ if (other.hasMasterInfo()) {
+ mergeMasterInfo(other.getMasterInfo());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasFrameworkId()) {
+
+ return false;
+ }
+ if (!getFrameworkId().isInitialized()) {
+
+ return false;
+ }
+ if (hasMasterInfo()) {
+ if (!getMasterInfo().isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.scheduler.Protos.Event.Subscribed parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.scheduler.Protos.Event.Subscribed) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required .mesos.v1.FrameworkID framework_id = 1;
+ private org.apache.mesos.v1.Protos.FrameworkID frameworkId_ = org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.FrameworkID, org.apache.mesos.v1.Protos.FrameworkID.Builder, org.apache.mesos.v1.Protos.FrameworkIDOrBuilder> frameworkIdBuilder_;
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public boolean hasFrameworkId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkID getFrameworkId() {
+ if (frameworkIdBuilder_ == null) {
+ return frameworkId_;
+ } else {
+ return frameworkIdBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public Builder setFrameworkId(org.apache.mesos.v1.Protos.FrameworkID value) {
+ if (frameworkIdBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ frameworkId_ = value;
+ onChanged();
+ } else {
+ frameworkIdBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public Builder setFrameworkId(
+ org.apache.mesos.v1.Protos.FrameworkID.Builder builderForValue) {
+ if (frameworkIdBuilder_ == null) {
+ frameworkId_ = builderForValue.build();
+ onChanged();
+ } else {
+ frameworkIdBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public Builder mergeFrameworkId(org.apache.mesos.v1.Protos.FrameworkID value) {
+ if (frameworkIdBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ frameworkId_ != org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance()) {
+ frameworkId_ =
+ org.apache.mesos.v1.Protos.FrameworkID.newBuilder(frameworkId_).mergeFrom(value).buildPartial();
+ } else {
+ frameworkId_ = value;
+ }
+ onChanged();
+ } else {
+ frameworkIdBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public Builder clearFrameworkId() {
+ if (frameworkIdBuilder_ == null) {
+ frameworkId_ = org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance();
+ onChanged();
+ } else {
+ frameworkIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkID.Builder getFrameworkIdBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getFrameworkIdFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkIDOrBuilder getFrameworkIdOrBuilder() {
+ if (frameworkIdBuilder_ != null) {
+ return frameworkIdBuilder_.getMessageOrBuilder();
+ } else {
+ return frameworkId_;
+ }
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.FrameworkID, org.apache.mesos.v1.Protos.FrameworkID.Builder, org.apache.mesos.v1.Protos.FrameworkIDOrBuilder>
+ getFrameworkIdFieldBuilder() {
+ if (frameworkIdBuilder_ == null) {
+ frameworkIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.FrameworkID, org.apache.mesos.v1.Protos.FrameworkID.Builder, org.apache.mesos.v1.Protos.FrameworkIDOrBuilder>(
+ frameworkId_,
+ getParentForChildren(),
+ isClean());
+ frameworkId_ = null;
+ }
+ return frameworkIdBuilder_;
+ }
+
+ // optional double heartbeat_interval_seconds = 2;
+ private double heartbeatIntervalSeconds_ ;
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public boolean hasHeartbeatIntervalSeconds() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public double getHeartbeatIntervalSeconds() {
+ return heartbeatIntervalSeconds_;
+ }
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public Builder setHeartbeatIntervalSeconds(double value) {
+ bitField0_ |= 0x00000002;
+ heartbeatIntervalSeconds_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public Builder clearHeartbeatIntervalSeconds() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ heartbeatIntervalSeconds_ = 0D;
+ onChanged();
+ return this;
+ }
+
+ // optional .mesos.v1.MasterInfo master_info = 3;
+ private org.apache.mesos.v1.Protos.MasterInfo masterInfo_ = org.apache.mesos.v1.Protos.MasterInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.MasterInfo, org.apache.mesos.v1.Protos.MasterInfo.Builder, org.apache.mesos.v1.Protos.MasterInfoOrBuilder> masterInfoBuilder_;
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public boolean hasMasterInfo() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MasterInfo getMasterInfo() {
+ if (masterInfoBuilder_ == null) {
+ return masterInfo_;
+ } else {
+ return masterInfoBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public Builder setMasterInfo(org.apache.mesos.v1.Protos.MasterInfo value) {
+ if (masterInfoBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ masterInfo_ = value;
+ onChanged();
+ } else {
+ masterInfoBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public Builder setMasterInfo(
+ org.apache.mesos.v1.Protos.MasterInfo.Builder builderForValue) {
+ if (masterInfoBuilder_ == null) {
+ masterInfo_ = builderForValue.build();
+ onChanged();
+ } else {
+ masterInfoBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public Builder mergeMasterInfo(org.apache.mesos.v1.Protos.MasterInfo value) {
+ if (masterInfoBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) == 0x00000004) &&
+ masterInfo_ != org.apache.mesos.v1.Protos.MasterInfo.getDefaultInstance()) {
+ masterInfo_ =
+ org.apache.mesos.v1.Protos.MasterInfo.newBuilder(masterInfo_).mergeFrom(value).buildPartial();
+ } else {
+ masterInfo_ = value;
+ }
+ onChanged();
+ } else {
+ masterInfoBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public Builder clearMasterInfo() {
+ if (masterInfoBuilder_ == null) {
+ masterInfo_ = org.apache.mesos.v1.Protos.MasterInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ masterInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MasterInfo.Builder getMasterInfoBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getMasterInfoFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MasterInfoOrBuilder getMasterInfoOrBuilder() {
+ if (masterInfoBuilder_ != null) {
+ return masterInfoBuilder_.getMessageOrBuilder();
+ } else {
+ return masterInfo_;
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.MasterInfo, org.apache.mesos.v1.Protos.MasterInfo.Builder, org.apache.mesos.v1.Protos.MasterInfoOrBuilder>
+ getMasterInfoFieldBuilder() {
+ if (masterInfoBuilder_ == null) {
+ masterInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.MasterInfo, org.apache.mesos.v1.Protos.MasterInfo.Builder, org.apache.mesos.v1.Protos.MasterInfoOrBuilder>(
+ masterInfo_,
+ getParentForChildren(),
+ isClean());
+ masterInfo_ = null;
+ }
+ return masterInfoBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.scheduler.Event.Subscribed)
+ }
+
+ static {
+ defaultInstance = new Subscribed(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.scheduler.Event.Subscribed)
+ }
+
+ public interface OffersOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // repeated .mesos.v1.Offer offers = 1;
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ java.util.List<org.apache.mesos.v1.Protos.Offer>
+ getOffersList();
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.Offer getOffers(int index);
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ int getOffersCount();
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ java.util.List<? extends org.apache.mesos.v1.Protos.OfferOrBuilder>
+ getOffersOrBuilderList();
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.OfferOrBuilder getOffersOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code mesos.v1.scheduler.Event.Offers}
+ *
+ * <pre>
+ * Received whenever there are new resources that are offered to the
+ * scheduler. Each offer corresponds to a set of resources on an
+ * agent. Until the scheduler accepts or declines an offer the
+ * resources are considered allocated to the scheduler.
+ * </pre>
+ */
+ public static final class Offers extends
+ com.google.protobuf.GeneratedMessage
+ implements OffersOrBuilder {
+ // Use Offers.newBuilder() to construct.
+ private Offers(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Offers(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Offers defaultInstance;
+ public static Offers getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Offers getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Offers(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ offers_ = new java.util.ArrayList<org.apache.mesos.v1.Protos.Offer>();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ offers_.add(input.readMessage(org.apache.mesos.v1.Protos.Offer.PARSER, extensionRegistry));
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ offers_ = java.util.Collections.unmodifiableList(offers_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_Offers_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_Offers_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.scheduler.Protos.Event.Offers.class, org.apache.mesos.v1.scheduler.Protos.Event.Offers.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Offers> PARSER =
+ new com.google.protobuf.AbstractParser<Offers>() {
+ public Offers parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Offers(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Offers> getParserForType() {
+ return PARSER;
+ }
+
+ // repeated .mesos.v1.Offer offers = 1;
+ public static final int OFFERS_FIELD_NUMBER = 1;
+ private java.util.List<org.apache.mesos.v1.Protos.Offer> offers_;
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.Offer> getOffersList() {
+ return offers_;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.Protos.OfferOrBuilder>
+ getOffersOrBuilderList() {
+ return offers_;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public int getOffersCount() {
+ return offers_.size();
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.Offer getOffers(int index) {
+ return offers_.get(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.OfferOrBuilder getOffersOrBuilder(
+ int index) {
+ return offers_.get(index);
+ }
+
+ private void initFields() {
+ offers_ = java.util.Collections.emptyList();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ for (int i = 0; i < getOffersCount(); i++) {
+ if (!getOffers(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ for (int i = 0; i < offers_.size(); i++) {
+ output.writeMessage(1, offers_.get(i));
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < offers_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, offers_.get(i));
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Offers parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Offers parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Offers parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Offers parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Offers parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Offers parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Offers parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Offers parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Offers parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.scheduler.Protos.Event.Offers parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.scheduler.Protos.Event.Offers prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.scheduler.Event.Offers}
+ *
+ * <pre>
+ * Received whenever there are new resources that are offered to the
+ * scheduler. Each offer corresponds to a set of resources on an
+ * agent. Until the scheduler accepts or declines an offer the
+ * resources are considered allocated to the scheduler.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.scheduler.Protos.Event.OffersOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_Offers_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_Offers_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.scheduler.Protos.Event.Offers.class, org.apache.mesos.v1.scheduler.Protos.Event.Offers.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.scheduler.Protos.Event.Offers.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getOffersFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (offersBuilder_ == null) {
+ offers_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ offersBuilder_.clear();
+ }
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.scheduler.Protos.internal_static_mesos_v1_scheduler_Event_Offers_descriptor;
+ }
+
+ public org.apache.mesos.v1.scheduler.Protos.Event.Offers getDefaultInstanceForType() {
+ return org.apache.mesos.v1.scheduler.Protos.Event.Offers.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.scheduler.Protos.Event.Offers build() {
+ org.apache.mesos.v1.scheduler.Protos.Event.Offers result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.scheduler.Protos.Event.Offers buildPartial() {
+ org.apache.mesos.v1.scheduler.Protos.Event.Offers result = new org.apache.mesos.v1.scheduler.Protos.Event.Offers(this);
+ int from_bitField0_ = bitField0_;
+ if (offersBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ offers_ = java.util.Collections.unmodifiableList(offers_);
+ bitField0_ = (bitField0_ & ~0x00000001);
+ }
+ result.offers_ = offers_;
+ } else {
+ result.offers_ = offersBuilder_.build();
+ }
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.scheduler.Protos.Event.Offers) {
+ return mergeFrom((org.apache.mesos.v1.scheduler.Protos.Event.Offers)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.scheduler.Protos.Event.Offers other) {
+ if (other == org.apache.mesos.v1.scheduler.Protos.Event.Offers.getDefaultInstance()) return this;
+ if (offersBuilder_ == null) {
+ if (!other.offers_.isEmpty()) {
+ if (offers_.isEmpty()) {
+ offers_ = other.offers_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ ensureOffersIsMutable();
+ offers_.addAll(other.offers_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.offers_.isEmpty()) {
+ if (offersBuilder_.isEmpty()) {
+ offersBuilder_.dispose();
+ offersBuilder_ = null;
+ offers_ = other.offers_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ offersBuilder_ =
+ com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+ getOffersFieldBuilder() : null;
+ } else {
+ offersBuilder_.addAllMessages(other.offers_);
+ }
+ }
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ for (int i = 0; i < getOffersCount(); i++) {
+ if (!getOffers(i).isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.scheduler.Protos.Event.Offers parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.scheduler.Protos.Event.Offers) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // repeated .mesos.v1.Offer offers = 1;
+ private java.util.List<org.apache.mesos.v1.Protos.Offer> offers_ =
+ java.util.Collections.emptyList();
+ private void ensureOffersIsMutable() {
+ if (!((bitField0_ & 0x00000001) == 0x00000001)) {
+ offers_ = new java.util.ArrayList<org.apache.mesos.v1.Protos.Offer>(offers_);
+ bitField0_ |= 0x00000001;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.Offer, org.apache.mesos.v1.Protos.Offer.Builder, org.apache.mesos.v1.Protos.OfferOrBuilder> offersBuilder_;
+
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.Offer> getOffersList() {
+ if (offersBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(offers_);
+ } else {
+ return offersBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public int getOffersCount() {
+ if (offersBuilder_ == null) {
+ return offers_.size();
+ } else {
+ return offersBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.Offer getOffers(int index) {
+ if (offersBuilder_ == null) {
+ return offers_.get(index);
+ } else {
+ return offersBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public Builder setOffers(
+ int index, org.apache.mesos.v1.Protos.Offer value) {
+ if (offersBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOffersIsMutable();
+ offers_.set(index, value);
+ onChanged();
+ } else {
+ offersBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public Builder setOffers(
+ int index, org.apache.mesos.v1.Protos.Offer.Builder builderForValue) {
+ if (offersBuilder_ == null) {
+ ensureOffersIsMutable();
+ offers_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ offersBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public Builder addOffers(org.apache.mesos.v1.Protos.Offer value) {
+ if (offersBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOffersIsMutable();
+ offers_.add(value);
+ onChanged();
+ } else {
+ offersBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public Builder addOffers(
+ int index, org.apache.mesos.v1.Protos.Offer value) {
+ if (offersBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOffersIsMutable();
+ offers_.add(index, value);
+ onChanged();
+ } else {
+ offersBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public Builder addOffers(
+ org.apache.mesos.v1.Protos.Offer.Builder builderForValue) {
+ if (offersBuilder_ == null) {
+ ensureOffersIsMutable();
+ offers_.add(builderForValue.build());
+ onChanged();
+ } else {
+ offersBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public Builder addOffers(
+ int index, org.apache.mesos.v1.Protos.Offer.Builder builderForValue) {
+ if (offersBuilder_ == null) {
+ ensureOffersIsMutable();
+ offers_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ offersBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public Builder addAllOffers(
+ java.lang.Iterable<? extends org.apache.mesos.v1.Protos.Offer> values) {
+ if (offersBuilder_ == null) {
+ ensureOffersIsMutable();
+ super.addAll(values, offers_);
+ onChanged();
+ } else {
+ offersBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public Builder clearOffers() {
+ if (offersBuilder_ == null) {
+ offers_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ offersBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public Builder removeOffers(int index) {
+ if (offersBuilder_ == null) {
+ ensureOffersIsMutable();
+ offers_.remove(index);
+ onChanged();
+ } else {
+ offersBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.Offer.Builder getOffersBuilder(
+ int index) {
+ return getOffersFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.OfferOrBuilder getOffersOrBuilder(
+ int index) {
+ if (offersBuilder_ == null) {
+ return offers_.get(index); } else {
+ return offersBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.Protos.OfferOrBuilder>
+ getOffersOrBuilderList() {
+ if (offersBuilder_ != null) {
+ return offersBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(offers_);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.Offer.Builder addOffersBuilder() {
+ return getOffersFieldBuilder().addBuilder(
+ org.apache.mesos.v1.Protos.Offer.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.Offer.Builder addOffersBuilder(
+ int index) {
+ return getOffersFieldBuilder().addBuilder(
+ index, org.apache.mesos.v1.Protos.Offer.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.v1.Offer offers = 1;</code>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.Offer.Builder>
+ getOffersBuilderList() {
+ return getOffersFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.Offer, org.apache.mesos.v1.Protos.Offer.Builder, org.apache.mesos.v1.Protos.OfferOrBuilder>
+ getOffersFieldBuilder() {
+ if (offersBuilder_ == null) {
+ offersBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.Offer, org.apache.mesos.v1.Protos.Offer.Builder, org.apache.mesos.v1.Protos.OfferOrBuilder>(
+ offers_,
+ ((bitField0_ & 0x00000001) == 0x00000001),
+ getParentForChildren(),
+ isClean());
+ offers_ = null;
+ }
+ return offersBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.scheduler.Event.Offers)
+ }
+
+ static {
+ defaultInstance = new Offers(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.scheduler.Event.Offers)
+ }
+
+ public interface InverseOffersOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // repeated .mesos.v1.InverseOffer inverse_offers = 1;
+ /**
+ * <code>repeated .mesos.v1.InverseOffer inverse_offers = 1;</code>
+ */
+ java.util.List<org.apache.mesos.v1.Protos.InverseOffer>
+ getInverseOffersList();
+ /**
+ * <code>repeated .mesos.v1.InverseOffer inverse_offers = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.InverseOffer getInverseOffers(int index);
+ /**
+ * <code>repeated .mesos.v1.InverseOffer inverse_offers = 1;</code>
+ */
+ int getInverseOffersCount();
+ /**
+ * <code>repeated .mesos.v1.InverseOffer inverse_offers = 1;</code>
+ */
+ java.util.List<? extends org.apache.mesos.v1.Protos.InverseOfferOrBuilder>
+ getInverseOffersOrBuilderList();
+ /**
+ * <code>repeated .mesos.v1.InverseOffer inverse_offers = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.InverseOfferOrBuilder getInverseOffersOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code mesos.v1.scheduler.Event.InverseOffers}
+ *
+ * <pre>
+ * Received whenever there are resources requested back from the
+ * scheduler. Each inverse offer specifies the agent, and
+ * optionally specific resources. Accepting or Declining an inverse
+ * offer informs the allocator of the scheduler's ability to release
+ * the specified resources without violating an SLA. If no resources
+ * are specified then all resources on the agent are requested to be
+ * released.
+ * </pre>
+ */
+ public static final class InverseOffers extends
+ com.google.protobuf.GeneratedMessage
+ implements InverseOffersOrBuilder {
+ // Use InverseOffers.newBuilder() to construct.
+ private InverseOffers(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private InverseOffers(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final InverseOffers defaultInstance;
+ public static InverseOffers getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public InverseOffers getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private InverseOffers(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.Exten
<TRUNCATED>
[06/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/state/AbstractState.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/state/AbstractState.java b/myriad-commons/src/main/java/org/apache/mesos/state/AbstractState.java
new file mode 100644
index 0000000..8ac1498
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/state/AbstractState.java
@@ -0,0 +1,403 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.state;
+
+import java.util.Iterator;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeoutException;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.mesos.MesosNativeLibrary;
+
+/**
+ * Abstract implementation of State that provides operations on
+ * futures to make concrete classes easier to create.
+ */
+public abstract class AbstractState implements State {
+ static {
+ MesosNativeLibrary.load();
+ }
+
+ @Override
+ public Future<Variable> fetch(final String name) {
+ if (!MesosNativeLibrary.version().before(MESOS_2161_JIRA_FIX_VERSION)) {
+ return new FetchFuture(name);
+ }
+
+ // TODO(jmlvanre): Deprecate anonymous future in 0.24 (MESOS-2161).
+ final long future = __fetch(name); // Asynchronously start the operation.
+ return new Future<Variable>() {
+ @Override
+ public boolean cancel(boolean mayInterruptIfRunning) {
+ if (mayInterruptIfRunning) {
+ return __fetch_cancel(future);
+ }
+ return false; // Should not interrupt and already running (or finished).
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return __fetch_is_cancelled(future);
+ }
+
+ @Override
+ public boolean isDone() {
+ return __fetch_is_done(future);
+ }
+
+ @Override
+ public Variable get() throws InterruptedException, ExecutionException {
+ return __fetch_get(future);
+ }
+
+ @Override
+ public Variable get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ return __fetch_get_timeout(future, timeout, unit);
+ }
+
+ @Override
+ protected void finalize() {
+ __fetch_finalize(future);
+ }
+ };
+ }
+
+ @Override
+ public Future<Variable> store(Variable variable) {
+ if (!MesosNativeLibrary.version().before(MESOS_2161_JIRA_FIX_VERSION)) {
+ return new StoreFuture(variable);
+ }
+
+ // TODO(jmlvanre): Deprecate anonymous future in 0.24 (MESOS-2161).
+ final long future = __store(variable); // Asynchronously start the operation.
+ return new Future<Variable>() {
+ @Override
+ public boolean cancel(boolean mayInterruptIfRunning) {
+ if (mayInterruptIfRunning) {
+ return __store_cancel(future);
+ }
+ return false; // Should not interrupt and already running (or finished).
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return __store_is_cancelled(future);
+ }
+
+ @Override
+ public boolean isDone() {
+ return __store_is_done(future);
+ }
+
+ @Override
+ public Variable get() throws InterruptedException, ExecutionException {
+ return __store_get(future);
+ }
+
+ @Override
+ public Variable get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ return __store_get_timeout(future, timeout, unit);
+ }
+
+ @Override
+ protected void finalize() {
+ __store_finalize(future);
+ }
+ };
+ }
+
+ @Override
+ public Future<Boolean> expunge(Variable variable) {
+ if (!MesosNativeLibrary.version().before(MESOS_2161_JIRA_FIX_VERSION)) {
+ return new ExpungeFuture(variable);
+ }
+
+ // TODO(jmlvanre): Deprecate anonymous future in 0.24 (MESOS-2161).
+ final long future = __expunge(variable); // Asynchronously start the operation.
+ return new Future<Boolean>() {
+ @Override
+ public boolean cancel(boolean mayInterruptIfRunning) {
+ if (mayInterruptIfRunning) {
+ return __expunge_cancel(future);
+ }
+ return false; // Should not interrupt and already running (or finished).
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return __expunge_is_cancelled(future);
+ }
+
+ @Override
+ public boolean isDone() {
+ return __expunge_is_done(future);
+ }
+
+ @Override
+ public Boolean get() throws InterruptedException, ExecutionException {
+ return __expunge_get(future);
+ }
+
+ @Override
+ public Boolean get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ return __expunge_get_timeout(future, timeout, unit);
+ }
+
+ @Override
+ protected void finalize() {
+ __expunge_finalize(future);
+ }
+ };
+ }
+
+ public Future<Iterator<String>> names() {
+ if (!MesosNativeLibrary.version().before(MESOS_2161_JIRA_FIX_VERSION)) {
+ return new NamesFuture();
+ }
+
+ // TODO(jmlvanre): Deprecate anonymous future in 0.24 (MESOS-2161).
+ final long future = __names(); // Asynchronously start the operation.
+ return new Future<Iterator<String>>() {
+ @Override
+ public boolean cancel(boolean mayInterruptIfRunning) {
+ if (mayInterruptIfRunning) {
+ return __names_cancel(future);
+ }
+ return false; // Should not interrupt and already running (or finished).
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return __names_is_cancelled(future);
+ }
+
+ @Override
+ public boolean isDone() {
+ return __names_is_done(future);
+ }
+
+ @Override
+ public Iterator<String> get() throws InterruptedException,
+ ExecutionException {
+ return __names_get(future);
+ }
+
+ @Override
+ public Iterator<String> get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ return __names_get_timeout(future, timeout, unit);
+ }
+
+ @Override
+ protected void finalize() {
+ __names_finalize(future);
+ }
+ };
+ }
+
+ protected native void finalize();
+
+ // Native implementations of 'fetch', 'store', 'expunge', and 'names'. We wrap
+ // them in classes to carry the java references correctly through the JNI
+ // bindings (MESOS-2161). The native functions in AbstractState will be
+ // deprecated in 0.24.
+
+ private class FetchFuture implements Future<Variable> {
+
+ public FetchFuture(String name) {
+ future = __fetch(name);
+ }
+
+ @Override
+ public native boolean cancel(boolean mayInterruptIfRunning);
+
+ @Override
+ public native boolean isCancelled();
+
+ @Override
+ public native boolean isDone();
+
+ @Override
+ public native Variable get()
+ throws InterruptedException, ExecutionException;
+
+ @Override
+ public native Variable get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException;
+
+ @Override
+ protected native void finalize();
+
+ private long future;
+ }
+
+ private native long __fetch(String name);
+
+ // TODO(jmlvanre): Deprecate below functions in 0.24 because we can't track
+ // the java object references correctly. (MESOS-2161). The above 'FetchFuture'
+ // class fixes this bug. We leave the below functions for backwards
+ // compatibility.
+ private native boolean __fetch_cancel(long future);
+ private native boolean __fetch_is_cancelled(long future);
+ private native boolean __fetch_is_done(long future);
+ private native Variable __fetch_get(long future);
+ private native Variable __fetch_get_timeout(
+ long future, long timeout, TimeUnit unit);
+ private native void __fetch_finalize(long future);
+
+ private class StoreFuture implements Future<Variable> {
+
+ public StoreFuture(Variable variable) {
+ future = __store(variable);
+ }
+
+ @Override
+ public native boolean cancel(boolean mayInterruptIfRunning);
+
+ @Override
+ public native boolean isCancelled();
+
+ @Override
+ public native boolean isDone();
+
+ @Override
+ public native Variable get()
+ throws InterruptedException, ExecutionException;
+
+ @Override
+ public native Variable get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException;
+
+ @Override
+ protected native void finalize();
+
+ private long future;
+ }
+
+ private native long __store(Variable variable);
+
+ // TODO(jmlvanre): Deprecate below functions in 0.24 because we can't track
+ // the java object references correctly. (MESOS-2161). The above 'StoreFuture'
+ // class fixes this bug. We leave the below functions for backwards
+ // compatibility.
+ private native boolean __store_cancel(long future);
+ private native boolean __store_is_cancelled(long future);
+ private native boolean __store_is_done(long future);
+ private native Variable __store_get(long future);
+ private native Variable __store_get_timeout(
+ long future, long timeout, TimeUnit unit);
+ private native void __store_finalize(long future);
+
+ private class ExpungeFuture implements Future<Boolean> {
+
+ public ExpungeFuture(Variable variable) {
+ future = __expunge(variable);
+ }
+
+ @Override
+ public native boolean cancel(boolean mayInterruptIfRunning);
+
+ @Override
+ public native boolean isCancelled();
+
+ @Override
+ public native boolean isDone();
+
+ @Override
+ public native Boolean get()
+ throws InterruptedException, ExecutionException;
+
+ @Override
+ public native Boolean get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException;
+
+ @Override
+ protected native void finalize();
+
+ private long future;
+ }
+
+ private native long __expunge(Variable variable);
+
+ // TODO(jmlvanre): Deprecate below functions in 0.24 because we can't track
+ // the java object references correctly. (MESOS-2161). The above
+ // 'ExpungeFuture' class fixes this bug. We leave the below functions for
+ // backwards compatibility.
+ private native boolean __expunge_cancel(long future);
+ private native boolean __expunge_is_cancelled(long future);
+ private native boolean __expunge_is_done(long future);
+ private native Boolean __expunge_get(long future);
+ private native Boolean __expunge_get_timeout(
+ long future, long timeout, TimeUnit unit);
+ private native void __expunge_finalize(long future);
+
+ private class NamesFuture implements Future<Iterator<String>> {
+
+ public NamesFuture() {
+ future = __names();
+ }
+
+ @Override
+ public native boolean cancel(boolean mayInterruptIfRunning);
+
+ @Override
+ public native boolean isCancelled();
+
+ @Override
+ public native boolean isDone();
+
+ @Override
+ public native Iterator<String> get()
+ throws InterruptedException, ExecutionException;
+
+ @Override
+ public native Iterator<String> get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException;
+
+ @Override
+ protected native void finalize();
+
+ private long future;
+ }
+
+ private native long __names();
+
+ // TODO(jmlvanre): Deprecate below functions in 0.24 because we can't track
+ // the java object references correctly. (MESOS-2161). The above 'NamesFuture'
+ // class fixes this bug. We leave the below functions for backwards
+ // compatibility.
+ private native boolean __names_cancel(long future);
+ private native boolean __names_is_cancelled(long future);
+ private native boolean __names_is_done(long future);
+ private native Iterator<String> __names_get(long future);
+ private native Iterator<String> __names_get_timeout(
+ long future, long timeout, TimeUnit unit);
+ private native void __names_finalize(long future);
+
+ private long __storage;
+ private long __state;
+
+ private final static MesosNativeLibrary.Version MESOS_2161_JIRA_FIX_VERSION =
+ new MesosNativeLibrary.Version(0, 22, 1);
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/state/InMemoryState.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/state/InMemoryState.java b/myriad-commons/src/main/java/org/apache/mesos/state/InMemoryState.java
new file mode 100644
index 0000000..ebc82cc
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/state/InMemoryState.java
@@ -0,0 +1,143 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.state;
+
+import java.util.Iterator;
+import java.util.UUID;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
+
+/**
+ * An in-memory implementation of state.
+ */
+public class InMemoryState implements State {
+ @Override
+ public Future<Variable> fetch(String name) {
+ Entry entry = entries.get(name); // Is null if doesn't exist.
+
+ if (entry == null) {
+ entry = new Entry();
+ entry.name = name;
+ entry.uuid = UUID.randomUUID();
+ entry.value = new byte[0];
+
+ // We use 'putIfAbsent' because multiple threads might be
+ // attempting to fetch a "new" variable at the same time.
+ if (entries.putIfAbsent(name, entry) != null) {
+ return fetch(name);
+ }
+ }
+
+ assert entry != null;
+
+ return futureFrom((Variable) new InMemoryVariable(entry));
+ }
+
+ @Override
+ public Future<Variable> store(Variable v) {
+ InMemoryVariable variable = (InMemoryVariable) v;
+
+ Entry entry = new Entry();
+ entry.name = variable.entry.name;
+ entry.uuid = UUID.randomUUID();
+ entry.value = variable.value;
+
+ if (entries.replace(entry.name, variable.entry, entry)) {
+ return futureFrom((Variable) new InMemoryVariable(entry));
+ }
+
+ return futureFrom((Variable) null);
+ }
+
+ @Override
+ public Future<Boolean> expunge(Variable v) {
+ InMemoryVariable variable = (InMemoryVariable) v;
+
+ return futureFrom(entries.remove(variable.entry.name, variable.entry));
+ }
+
+ @Override
+ public Future<Iterator<String>> names() {
+ return futureFrom(entries.keySet().iterator());
+ }
+
+ private static class InMemoryVariable extends Variable {
+ private InMemoryVariable(Entry entry) {
+ this(entry, null);
+ }
+
+ private InMemoryVariable(Entry entry, byte[] value) {
+ this.entry = entry;
+ this.value = value;
+ }
+
+ @Override
+ public byte[] value() {
+ if (this.value != null) {
+ return this.value;
+ } else {
+ return this.entry.value;
+ }
+ }
+
+ @Override
+ public Variable mutate(byte[] value) {
+ return new InMemoryVariable(entry, value);
+ }
+
+ final Entry entry;
+ final byte[] value;
+ }
+
+ private static class Entry {
+ @Override
+ public boolean equals(Object that) {
+ if (that instanceof Entry) {
+ return uuid.equals(((Entry) that).uuid);
+ }
+
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return uuid.hashCode();
+ }
+
+ String name;
+ UUID uuid;
+ byte[] value;
+ }
+
+ private static <T> Future<T> futureFrom(final T t) {
+ FutureTask<T> future = new FutureTask<T>(new Callable<T>() {
+ public T call() {
+ return t;
+ }});
+ future.run();
+ return future;
+ }
+
+ private final ConcurrentMap<String, Entry> entries =
+ new ConcurrentHashMap<String, Entry>();
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/state/LevelDBState.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/state/LevelDBState.java b/myriad-commons/src/main/java/org/apache/mesos/state/LevelDBState.java
new file mode 100644
index 0000000..d462dd7
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/state/LevelDBState.java
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.state;
+
+/**
+ * Implementation of State that uses LevelDB to store
+ * variables/values.
+ */
+public class LevelDBState extends AbstractState {
+ /**
+ * Constructs a new instance of LevelDBState.
+ *
+ * @param path Absolute path to database.
+ */
+ public LevelDBState(String path) {
+ initialize(path);
+ }
+
+ protected native void initialize(String path);
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/state/LogState.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/state/LogState.java b/myriad-commons/src/main/java/org/apache/mesos/state/LogState.java
new file mode 100644
index 0000000..7df56b5
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/state/LogState.java
@@ -0,0 +1,79 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.state;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Implementation of State that uses a replicated log to store
+ * variables/values.
+ */
+public class LogState extends AbstractState {
+ /**
+ * Constructs a new instance of LogState.
+ *
+ * @param servers List of ZooKeeper servers, e.g., 'ip1:port1,ip2:port2'.
+ * @param timeout ZooKeeper session timeout.
+ * @param unit Unit for session timeout.
+ * @param znode Path to znode where log replicas should be found.
+ * @param quorum Number of replicas necessary to persist a write.
+ * @param path Path the local replica uses to read/write data.
+ */
+ public LogState(String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode,
+ long quorum,
+ String path) {
+ initialize(servers, timeout, unit, znode, quorum, path, 0);
+ }
+
+ /**
+ * Constructs a new instance of LogState.
+ *
+ * @param servers List of ZooKeeper servers, e.g., 'ip1:port1,ip2:port2'.
+ * @param timeout ZooKeeper session timeout.
+ * @param unit Unit for session timeout.
+ * @param znode Path to znode where log replicas should be found.
+ * @param quorum Number of replicas necessary to persist a write.
+ * @param path Path the local replica uses to read/write data.
+ * @param diffsBetweenSnapshots Number of diffs to write between snapshots.
+ */
+ public LogState(String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode,
+ long quorum,
+ String path,
+ int diffsBetweenSnapshots) {
+ initialize(servers, timeout, unit, znode, quorum, path, diffsBetweenSnapshots);
+ }
+
+ protected native void initialize(String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode,
+ long quorum,
+ String path,
+ int diffsBetweenSnapshots);
+
+ protected native void finalize();
+
+ private long __log;
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/state/State.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/state/State.java b/myriad-commons/src/main/java/org/apache/mesos/state/State.java
new file mode 100644
index 0000000..3050401
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/state/State.java
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.state;
+
+import java.util.Iterator;
+
+import java.util.concurrent.Future;
+
+/**
+ * An abstraction of "state" (possibly between multiple distributed
+ * components) represented by "variables" (effectively key/value
+ * pairs). Variables are versioned such that setting a variable in the
+ * state will only succeed if the variable has not changed since last
+ * fetched. Varying implementations of state provide varying
+ * replicated guarantees.
+ * <p>
+ * Note that the semantics of 'fetch' and 'store' provide
+ * atomicity. That is, you cannot store a variable that has changed
+ * since you did the last fetch. That is, if a store succeeds then no
+ * other writes have been performed on the variable since your fetch.
+ *
+ * Example:
+ * <pre>
+ * {@code
+ * State state = new ZooKeeperState();
+ * Future<Variable> variable = state.fetch("machines");
+ * Variable machines = variable.get();
+ * machines = machines.mutate(...);
+ * variable = state.store(machines);
+ * machines = variable.get();
+ * }
+ * </pre>
+ */
+public interface State {
+ /**
+ * Returns an immutable "variable" representing the current value
+ * from the state associated with the specified name.
+ *
+ * @param name The name of the variable.
+ *
+ * @return A future of the variable.
+ *
+ * @see Variable
+ */
+ Future<Variable> fetch(String name);
+
+ /**
+ * Returns an immutable "variable" representing the current value in
+ * the state if updating the specified variable in the state was
+ * successful, otherwise returns null.
+ *
+ * @param variable The variable to be stored.
+ *
+ * @return A future of a variable with the new value on success,
+ * or null on failure.
+ *
+ * @see Variable
+ */
+ Future<Variable> store(Variable variable);
+
+ /**
+ * Returns true if successfully expunged the variable from the state
+ * or false if the variable did not exist or was no longer valid.
+ *
+ * @param variable The variable to be expunged.
+ *
+ * @return A future of true on success, false on failure.
+ *
+ * @see Variable
+ */
+ Future<Boolean> expunge(Variable variable);
+
+ /**
+ * Returns an iterator of variable names in the state.
+ *
+ * @return A future of an iterator over all variable names in the state.
+ */
+ Future<Iterator<String>> names();
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/state/Variable.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/state/Variable.java b/myriad-commons/src/main/java/org/apache/mesos/state/Variable.java
new file mode 100644
index 0000000..0be3e3d
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/state/Variable.java
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.state;
+
+/**
+ * Represents a key/value pair stored in the {@link State}. Variables
+ * are versioned such that setting a variable in the state will only
+ * succeed if the variable has not changed since last fetched.
+ */
+public class Variable {
+ protected Variable() {}
+
+ /**
+ * Returns the current value of this variable.
+ *
+ * @return The current value.
+ */
+ public native byte[] value();
+
+ /**
+ * Updates the current value of this variable.
+ *
+ * @param value The new value.
+ *
+ * @return A variable representing the new value.
+ */
+ public native Variable mutate(byte[] value);
+
+ protected native void finalize();
+
+ private long __variable;
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/state/ZooKeeperState.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/state/ZooKeeperState.java b/myriad-commons/src/main/java/org/apache/mesos/state/ZooKeeperState.java
new file mode 100644
index 0000000..4855236
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/state/ZooKeeperState.java
@@ -0,0 +1,75 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.state;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Implementation of State that uses ZooKeeper to store
+ * variables/values. Note that this means the values associated with
+ * variables cannot be more than 1 MB (actually slightly less since
+ * we store some bookkeeping information).
+ */
+public class ZooKeeperState extends AbstractState {
+ /**
+ * Constructs a new instance of ZooKeeperState.
+ *
+ * @param servers List of ZooKeeper servers, e.g., 'ip1:port1,ip2:port2'.
+ * @param timeout ZooKeeper session timeout.
+ * @param unit Unit for session timeout.
+ * @param znode Path to znode where "state" should be rooted.
+ */
+ public ZooKeeperState(String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode) {
+ initialize(servers, timeout, unit, znode);
+ }
+
+ /**
+ * Constructs a new instance of ZooKeeperState.
+ *
+ * @param servers List of ZooKeeper servers (e.g., 'ip1:port1,ip2:port2').
+ * @param timeout ZooKeeper session timeout.
+ * @param unit Unit for session timeout.
+ * @param znode Path to znode where "state" should be rooted.
+ * @param scheme Authentication scheme (e.g., "digest").
+ * @param credentials Authentication credentials (e.g., "user:pass").
+ */
+ public ZooKeeperState(String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode,
+ String scheme,
+ byte[] credentials) {
+ initialize(servers, timeout, unit, znode, scheme, credentials);
+ }
+
+ protected native void initialize(String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode);
+
+ protected native void initialize(String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode,
+ String scheme,
+ byte[] credentials);
+}
[20/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/src/main/java/org/apache/mesos/v1/allocator/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/allocator/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/allocator/Protos.java
new file mode 100644
index 0000000..fd004b8
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/allocator/Protos.java
@@ -0,0 +1,1089 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/v1/allocator/allocator.proto
+
+package org.apache.mesos.v1.allocator;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface InverseOfferStatusOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;
+ /**
+ * <code>required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;</code>
+ */
+ boolean hasStatus();
+ /**
+ * <code>required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;</code>
+ */
+ org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status getStatus();
+
+ // required .mesos.v1.FrameworkID framework_id = 2;
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ boolean hasFrameworkId();
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ org.apache.mesos.v1.Protos.FrameworkID getFrameworkId();
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ org.apache.mesos.v1.Protos.FrameworkIDOrBuilder getFrameworkIdOrBuilder();
+
+ // required .mesos.v1.TimeInfo timestamp = 3;
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ boolean hasTimestamp();
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.TimeInfo getTimestamp();
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.TimeInfoOrBuilder getTimestampOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.allocator.InverseOfferStatus}
+ *
+ * <pre>
+ **
+ * Describes the status of an inverse offer.
+ *
+ * This is a protobuf so as to be able to share the status to inverse offers
+ * through endpoints such as the maintenance status endpoint.
+ * </pre>
+ */
+ public static final class InverseOfferStatus extends
+ com.google.protobuf.GeneratedMessage
+ implements InverseOfferStatusOrBuilder {
+ // Use InverseOfferStatus.newBuilder() to construct.
+ private InverseOfferStatus(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private InverseOfferStatus(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final InverseOfferStatus defaultInstance;
+ public static InverseOfferStatus getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public InverseOfferStatus getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private InverseOfferStatus(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ int rawValue = input.readEnum();
+ org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status value = org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(1, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ status_ = value;
+ }
+ break;
+ }
+ case 18: {
+ org.apache.mesos.v1.Protos.FrameworkID.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = frameworkId_.toBuilder();
+ }
+ frameworkId_ = input.readMessage(org.apache.mesos.v1.Protos.FrameworkID.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(frameworkId_);
+ frameworkId_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.apache.mesos.v1.Protos.TimeInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = timestamp_.toBuilder();
+ }
+ timestamp_ = input.readMessage(org.apache.mesos.v1.Protos.TimeInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(timestamp_);
+ timestamp_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.allocator.Protos.internal_static_mesos_v1_allocator_InverseOfferStatus_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.allocator.Protos.internal_static_mesos_v1_allocator_InverseOfferStatus_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.class, org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<InverseOfferStatus> PARSER =
+ new com.google.protobuf.AbstractParser<InverseOfferStatus>() {
+ public InverseOfferStatus parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new InverseOfferStatus(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<InverseOfferStatus> getParserForType() {
+ return PARSER;
+ }
+
+ /**
+ * Protobuf enum {@code mesos.v1.allocator.InverseOfferStatus.Status}
+ */
+ public enum Status
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN = 1;</code>
+ *
+ * <pre>
+ * We have not received a response yet. This is the default state before
+ * receiving a response.
+ * </pre>
+ */
+ UNKNOWN(0, 1),
+ /**
+ * <code>ACCEPT = 2;</code>
+ *
+ * <pre>
+ * The framework is ok with the inverse offer. This means it will not
+ * violate any SLAs and will attempt to evacuate any tasks running on the
+ * agent. If the tasks are not evacuated by the framework, the operator can
+ * manually shut down the slave knowing that the framework will not have
+ * violated its SLAs.
+ * </pre>
+ */
+ ACCEPT(1, 2),
+ /**
+ * <code>DECLINE = 3;</code>
+ *
+ * <pre>
+ * The framework wants to block the maintenance operation from happening. An
+ * example would be that it cannot meet its SLA by losing resources.
+ * </pre>
+ */
+ DECLINE(2, 3),
+ ;
+
+ /**
+ * <code>UNKNOWN = 1;</code>
+ *
+ * <pre>
+ * We have not received a response yet. This is the default state before
+ * receiving a response.
+ * </pre>
+ */
+ public static final int UNKNOWN_VALUE = 1;
+ /**
+ * <code>ACCEPT = 2;</code>
+ *
+ * <pre>
+ * The framework is ok with the inverse offer. This means it will not
+ * violate any SLAs and will attempt to evacuate any tasks running on the
+ * agent. If the tasks are not evacuated by the framework, the operator can
+ * manually shut down the slave knowing that the framework will not have
+ * violated its SLAs.
+ * </pre>
+ */
+ public static final int ACCEPT_VALUE = 2;
+ /**
+ * <code>DECLINE = 3;</code>
+ *
+ * <pre>
+ * The framework wants to block the maintenance operation from happening. An
+ * example would be that it cannot meet its SLA by losing resources.
+ * </pre>
+ */
+ public static final int DECLINE_VALUE = 3;
+
+
+ public final int getNumber() { return value; }
+
+ public static Status valueOf(int value) {
+ switch (value) {
+ case 1: return UNKNOWN;
+ case 2: return ACCEPT;
+ case 3: return DECLINE;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Status>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<Status>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Status>() {
+ public Status findValueByNumber(int number) {
+ return Status.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Status[] VALUES = values();
+
+ public static Status valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private Status(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.v1.allocator.InverseOfferStatus.Status)
+ }
+
+ private int bitField0_;
+ // required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;
+ public static final int STATUS_FIELD_NUMBER = 1;
+ private org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status status_;
+ /**
+ * <code>required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;</code>
+ */
+ public boolean hasStatus() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;</code>
+ */
+ public org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status getStatus() {
+ return status_;
+ }
+
+ // required .mesos.v1.FrameworkID framework_id = 2;
+ public static final int FRAMEWORK_ID_FIELD_NUMBER = 2;
+ private org.apache.mesos.v1.Protos.FrameworkID frameworkId_;
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public boolean hasFrameworkId() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkID getFrameworkId() {
+ return frameworkId_;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkIDOrBuilder getFrameworkIdOrBuilder() {
+ return frameworkId_;
+ }
+
+ // required .mesos.v1.TimeInfo timestamp = 3;
+ public static final int TIMESTAMP_FIELD_NUMBER = 3;
+ private org.apache.mesos.v1.Protos.TimeInfo timestamp_;
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public boolean hasTimestamp() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.TimeInfo getTimestamp() {
+ return timestamp_;
+ }
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.TimeInfoOrBuilder getTimestampOrBuilder() {
+ return timestamp_;
+ }
+
+ private void initFields() {
+ status_ = org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status.UNKNOWN;
+ frameworkId_ = org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance();
+ timestamp_ = org.apache.mesos.v1.Protos.TimeInfo.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasStatus()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasFrameworkId()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasTimestamp()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getFrameworkId().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getTimestamp().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeEnum(1, status_.getNumber());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeMessage(2, frameworkId_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeMessage(3, timestamp_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(1, status_.getNumber());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, frameworkId_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, timestamp_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.allocator.Protos.InverseOfferStatus prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.allocator.InverseOfferStatus}
+ *
+ * <pre>
+ **
+ * Describes the status of an inverse offer.
+ *
+ * This is a protobuf so as to be able to share the status to inverse offers
+ * through endpoints such as the maintenance status endpoint.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.allocator.Protos.InverseOfferStatusOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.allocator.Protos.internal_static_mesos_v1_allocator_InverseOfferStatus_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.allocator.Protos.internal_static_mesos_v1_allocator_InverseOfferStatus_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.class, org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getFrameworkIdFieldBuilder();
+ getTimestampFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ status_ = org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status.UNKNOWN;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (frameworkIdBuilder_ == null) {
+ frameworkId_ = org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance();
+ } else {
+ frameworkIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (timestampBuilder_ == null) {
+ timestamp_ = org.apache.mesos.v1.Protos.TimeInfo.getDefaultInstance();
+ } else {
+ timestampBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.allocator.Protos.internal_static_mesos_v1_allocator_InverseOfferStatus_descriptor;
+ }
+
+ public org.apache.mesos.v1.allocator.Protos.InverseOfferStatus getDefaultInstanceForType() {
+ return org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.allocator.Protos.InverseOfferStatus build() {
+ org.apache.mesos.v1.allocator.Protos.InverseOfferStatus result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.allocator.Protos.InverseOfferStatus buildPartial() {
+ org.apache.mesos.v1.allocator.Protos.InverseOfferStatus result = new org.apache.mesos.v1.allocator.Protos.InverseOfferStatus(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.status_ = status_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ if (frameworkIdBuilder_ == null) {
+ result.frameworkId_ = frameworkId_;
+ } else {
+ result.frameworkId_ = frameworkIdBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ if (timestampBuilder_ == null) {
+ result.timestamp_ = timestamp_;
+ } else {
+ result.timestamp_ = timestampBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.allocator.Protos.InverseOfferStatus) {
+ return mergeFrom((org.apache.mesos.v1.allocator.Protos.InverseOfferStatus)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.allocator.Protos.InverseOfferStatus other) {
+ if (other == org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.getDefaultInstance()) return this;
+ if (other.hasStatus()) {
+ setStatus(other.getStatus());
+ }
+ if (other.hasFrameworkId()) {
+ mergeFrameworkId(other.getFrameworkId());
+ }
+ if (other.hasTimestamp()) {
+ mergeTimestamp(other.getTimestamp());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasStatus()) {
+
+ return false;
+ }
+ if (!hasFrameworkId()) {
+
+ return false;
+ }
+ if (!hasTimestamp()) {
+
+ return false;
+ }
+ if (!getFrameworkId().isInitialized()) {
+
+ return false;
+ }
+ if (!getTimestamp().isInitialized()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.allocator.Protos.InverseOfferStatus parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.allocator.Protos.InverseOfferStatus) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;
+ private org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status status_ = org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status.UNKNOWN;
+ /**
+ * <code>required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;</code>
+ */
+ public boolean hasStatus() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;</code>
+ */
+ public org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status getStatus() {
+ return status_;
+ }
+ /**
+ * <code>required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;</code>
+ */
+ public Builder setStatus(org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ status_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.allocator.InverseOfferStatus.Status status = 1;</code>
+ */
+ public Builder clearStatus() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ status_ = org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.Status.UNKNOWN;
+ onChanged();
+ return this;
+ }
+
+ // required .mesos.v1.FrameworkID framework_id = 2;
+ private org.apache.mesos.v1.Protos.FrameworkID frameworkId_ = org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.FrameworkID, org.apache.mesos.v1.Protos.FrameworkID.Builder, org.apache.mesos.v1.Protos.FrameworkIDOrBuilder> frameworkIdBuilder_;
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public boolean hasFrameworkId() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkID getFrameworkId() {
+ if (frameworkIdBuilder_ == null) {
+ return frameworkId_;
+ } else {
+ return frameworkIdBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public Builder setFrameworkId(org.apache.mesos.v1.Protos.FrameworkID value) {
+ if (frameworkIdBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ frameworkId_ = value;
+ onChanged();
+ } else {
+ frameworkIdBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public Builder setFrameworkId(
+ org.apache.mesos.v1.Protos.FrameworkID.Builder builderForValue) {
+ if (frameworkIdBuilder_ == null) {
+ frameworkId_ = builderForValue.build();
+ onChanged();
+ } else {
+ frameworkIdBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public Builder mergeFrameworkId(org.apache.mesos.v1.Protos.FrameworkID value) {
+ if (frameworkIdBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002) &&
+ frameworkId_ != org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance()) {
+ frameworkId_ =
+ org.apache.mesos.v1.Protos.FrameworkID.newBuilder(frameworkId_).mergeFrom(value).buildPartial();
+ } else {
+ frameworkId_ = value;
+ }
+ onChanged();
+ } else {
+ frameworkIdBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public Builder clearFrameworkId() {
+ if (frameworkIdBuilder_ == null) {
+ frameworkId_ = org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance();
+ onChanged();
+ } else {
+ frameworkIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkID.Builder getFrameworkIdBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getFrameworkIdFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkIDOrBuilder getFrameworkIdOrBuilder() {
+ if (frameworkIdBuilder_ != null) {
+ return frameworkIdBuilder_.getMessageOrBuilder();
+ } else {
+ return frameworkId_;
+ }
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkID framework_id = 2;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.FrameworkID, org.apache.mesos.v1.Protos.FrameworkID.Builder, org.apache.mesos.v1.Protos.FrameworkIDOrBuilder>
+ getFrameworkIdFieldBuilder() {
+ if (frameworkIdBuilder_ == null) {
+ frameworkIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.FrameworkID, org.apache.mesos.v1.Protos.FrameworkID.Builder, org.apache.mesos.v1.Protos.FrameworkIDOrBuilder>(
+ frameworkId_,
+ getParentForChildren(),
+ isClean());
+ frameworkId_ = null;
+ }
+ return frameworkIdBuilder_;
+ }
+
+ // required .mesos.v1.TimeInfo timestamp = 3;
+ private org.apache.mesos.v1.Protos.TimeInfo timestamp_ = org.apache.mesos.v1.Protos.TimeInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.TimeInfo, org.apache.mesos.v1.Protos.TimeInfo.Builder, org.apache.mesos.v1.Protos.TimeInfoOrBuilder> timestampBuilder_;
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public boolean hasTimestamp() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.TimeInfo getTimestamp() {
+ if (timestampBuilder_ == null) {
+ return timestamp_;
+ } else {
+ return timestampBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public Builder setTimestamp(org.apache.mesos.v1.Protos.TimeInfo value) {
+ if (timestampBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ timestamp_ = value;
+ onChanged();
+ } else {
+ timestampBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public Builder setTimestamp(
+ org.apache.mesos.v1.Protos.TimeInfo.Builder builderForValue) {
+ if (timestampBuilder_ == null) {
+ timestamp_ = builderForValue.build();
+ onChanged();
+ } else {
+ timestampBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public Builder mergeTimestamp(org.apache.mesos.v1.Protos.TimeInfo value) {
+ if (timestampBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) == 0x00000004) &&
+ timestamp_ != org.apache.mesos.v1.Protos.TimeInfo.getDefaultInstance()) {
+ timestamp_ =
+ org.apache.mesos.v1.Protos.TimeInfo.newBuilder(timestamp_).mergeFrom(value).buildPartial();
+ } else {
+ timestamp_ = value;
+ }
+ onChanged();
+ } else {
+ timestampBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public Builder clearTimestamp() {
+ if (timestampBuilder_ == null) {
+ timestamp_ = org.apache.mesos.v1.Protos.TimeInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ timestampBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.TimeInfo.Builder getTimestampBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getTimestampFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.TimeInfoOrBuilder getTimestampOrBuilder() {
+ if (timestampBuilder_ != null) {
+ return timestampBuilder_.getMessageOrBuilder();
+ } else {
+ return timestamp_;
+ }
+ }
+ /**
+ * <code>required .mesos.v1.TimeInfo timestamp = 3;</code>
+ *
+ * <pre>
+ * Time, since the epoch, when this status was last updated.
+ * </pre>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.TimeInfo, org.apache.mesos.v1.Protos.TimeInfo.Builder, org.apache.mesos.v1.Protos.TimeInfoOrBuilder>
+ getTimestampFieldBuilder() {
+ if (timestampBuilder_ == null) {
+ timestampBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.TimeInfo, org.apache.mesos.v1.Protos.TimeInfo.Builder, org.apache.mesos.v1.Protos.TimeInfoOrBuilder>(
+ timestamp_,
+ getParentForChildren(),
+ isClean());
+ timestamp_ = null;
+ }
+ return timestampBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.allocator.InverseOfferStatus)
+ }
+
+ static {
+ defaultInstance = new InverseOfferStatus(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.allocator.InverseOfferStatus)
+ }
+
+ private static com.google.protobuf.Descriptors.Descriptor
+ internal_static_mesos_v1_allocator_InverseOfferStatus_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_mesos_v1_allocator_InverseOfferStatus_fieldAccessorTable;
+
+ public static com.google.protobuf.Descriptors.FileDescriptor
+ getDescriptor() {
+ return descriptor;
+ }
+ private static com.google.protobuf.Descriptors.FileDescriptor
+ descriptor;
+ static {
+ java.lang.String[] descriptorData = {
+ "\n\"mesos/v1/allocator/allocator.proto\022\022me" +
+ "sos.v1.allocator\032\024mesos/v1/mesos.proto\"\327" +
+ "\001\n\022InverseOfferStatus\022=\n\006status\030\001 \002(\0162-." +
+ "mesos.v1.allocator.InverseOfferStatus.St" +
+ "atus\022+\n\014framework_id\030\002 \002(\0132\025.mesos.v1.Fr" +
+ "ameworkID\022%\n\ttimestamp\030\003 \002(\0132\022.mesos.v1." +
+ "TimeInfo\".\n\006Status\022\013\n\007UNKNOWN\020\001\022\n\n\006ACCEP" +
+ "T\020\002\022\013\n\007DECLINE\020\003B\'\n\035org.apache.mesos.v1." +
+ "allocatorB\006Protos"
+ };
+ com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
+ new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
+ public com.google.protobuf.ExtensionRegistry assignDescriptors(
+ com.google.protobuf.Descriptors.FileDescriptor root) {
+ descriptor = root;
+ internal_static_mesos_v1_allocator_InverseOfferStatus_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_mesos_v1_allocator_InverseOfferStatus_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_mesos_v1_allocator_InverseOfferStatus_descriptor,
+ new java.lang.String[] { "Status", "FrameworkId", "Timestamp", });
+ return null;
+ }
+ };
+ com.google.protobuf.Descriptors.FileDescriptor
+ .internalBuildGeneratedFileFrom(descriptorData,
+ new com.google.protobuf.Descriptors.FileDescriptor[] {
+ org.apache.mesos.v1.Protos.getDescriptor(),
+ }, assigner);
+ }
+
+ // @@protoc_insertion_point(outer_class_scope)
+}
[23/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/proto/mesos/v1/mesos.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/v1/mesos.proto b/myriad-commons/proto/mesos/v1/mesos.proto
deleted file mode 100644
index 4d905d3..0000000
--- a/myriad-commons/proto/mesos/v1/mesos.proto
+++ /dev/null
@@ -1,3173 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto2";
-
-package mesos.v1;
-
-option java_package = "org.apache.mesos.v1";
-option java_outer_classname = "Protos";
-
-
-/**
- * Status is used to indicate the state of the scheduler and executor
- * driver after function calls.
- */
-enum Status {
- DRIVER_NOT_STARTED = 1;
- DRIVER_RUNNING = 2;
- DRIVER_ABORTED = 3;
- DRIVER_STOPPED = 4;
-}
-
-
-/**
- * A unique ID assigned to a framework. A framework can reuse this ID
- * in order to do failover (see MesosSchedulerDriver).
- */
-message FrameworkID {
- required string value = 1;
-}
-
-
-/**
- * A unique ID assigned to an offer.
- */
-message OfferID {
- required string value = 1;
-}
-
-
-/**
- * A unique ID assigned to an agent. Currently, an agent gets a new ID
- * whenever it (re)registers with Mesos. Framework writers shouldn't
- * assume any binding between an agent ID and and a hostname.
- */
-message AgentID {
- required string value = 1;
-}
-
-
-/**
- * A framework-generated ID to distinguish a task. The ID must remain
- * unique while the task is active. A framework can reuse an ID _only_
- * if the previous task with the same ID has reached a terminal state
- * (e.g., TASK_FINISHED, TASK_KILLED, etc.). However, reusing task IDs
- * is strongly discouraged (MESOS-2198).
- */
-message TaskID {
- required string value = 1;
-}
-
-
-/**
- * A framework-generated ID to distinguish an executor. Only one
- * executor with the same ID can be active on the same agent at a
- * time. However, reusing executor IDs is discouraged.
- */
-message ExecutorID {
- required string value = 1;
-}
-
-
-/**
- * ID used to uniquely identify a container. If the `parent` is not
- * specified, the ID is a UUID generated by the agent to uniquely
- * identify the container of an executor run. If the `parent` field is
- * specified, it represents a nested container.
- */
-message ContainerID {
- required string value = 1;
- optional ContainerID parent = 2;
-}
-
-
-/**
- * A unique ID assigned to a resource provider. Currently, a resource
- * provider gets a new ID whenever it (re)registers with Mesos.
- */
-message ResourceProviderID {
- required string value = 1;
-}
-
-
-/**
- * Represents time since the epoch, in nanoseconds.
- */
-message TimeInfo {
- required int64 nanoseconds = 1;
-}
-
-
-/**
- * Represents duration in nanoseconds.
- */
-message DurationInfo {
- required int64 nanoseconds = 1;
-}
-
-
-/**
- * A network address.
- *
- * TODO(bmahler): Use this more widely.
- */
-message Address {
- // May contain a hostname, IP address, or both.
- optional string hostname = 1;
- optional string ip = 2;
-
- required int32 port = 3;
-}
-
-
-/**
- * Represents a URL.
- */
-message URL {
- required string scheme = 1;
- required Address address = 2;
- optional string path = 3;
- repeated Parameter query = 4;
- optional string fragment = 5;
-}
-
-
-/**
- * Represents an interval, from a given start time over a given duration.
- * This interval pertains to an unavailability event, such as maintenance,
- * and is not a generic interval.
- */
-message Unavailability {
- required TimeInfo start = 1;
-
- // When added to `start`, this represents the end of the interval.
- // If unspecified, the duration is assumed to be infinite.
- optional DurationInfo duration = 2;
-
- // TODO(josephw): Add additional fields for expressing the purpose and
- // urgency of the unavailability event.
-}
-
-
-/**
- * Represents a single machine, which may hold one or more agents.
- *
- * NOTE: In order to match an agent to a machine, both the `hostname` and
- * `ip` must match the values advertised by the agent to the master.
- * Hostname is not case-sensitive.
- */
-message MachineID {
- optional string hostname = 1;
- optional string ip = 2;
-}
-
-
-/**
- * Holds information about a single machine, its `mode`, and any other
- * relevant information which may affect the behavior of the machine.
- */
-message MachineInfo {
- // Describes the several states that a machine can be in. A `Mode`
- // applies to a machine and to all associated agents on the machine.
- enum Mode {
- // In this mode, a machine is behaving normally;
- // offering resources, executing tasks, etc.
- UP = 1;
-
- // In this mode, all agents on the machine are expected to cooperate with
- // frameworks to drain resources. In general, draining is done ahead of
- // a pending `unavailability`. The resources should be drained so as to
- // maximize utilization prior to the maintenance but without knowingly
- // violating the frameworks' requirements.
- DRAINING = 2;
-
- // In this mode, a machine is not running any tasks and will not offer
- // any of its resources. Agents on the machine will not be allowed to
- // register with the master.
- DOWN = 3;
- }
-
- required MachineID id = 1;
- optional Mode mode = 2;
-
- // Signifies that the machine may be unavailable during the given interval.
- // See comments in `Unavailability` and for the `unavailability` fields
- // in `Offer` and `InverseOffer` for more information.
- optional Unavailability unavailability = 3;
-}
-
-
-/**
- * Describes a framework.
- */
-message FrameworkInfo {
- // Used to determine the Unix user that an executor or task should be
- // launched as.
- //
- // When using the MesosSchedulerDriver, if the field is set to an
- // empty string, it will automagically set it to the current user.
- //
- // When using the HTTP Scheduler API, the user has to be set
- // explicitly.
- required string user = 1;
-
- // Name of the framework that shows up in the Mesos Web UI.
- required string name = 2;
-
- // Note that 'id' is only available after a framework has
- // registered, however, it is included here in order to facilitate
- // scheduler failover (i.e., if it is set then the
- // MesosSchedulerDriver expects the scheduler is performing
- // failover).
- optional FrameworkID id = 3;
-
- // The amount of time (in seconds) that the master will wait for the
- // scheduler to failover before it tears down the framework by
- // killing all its tasks/executors. This should be non-zero if a
- // framework expects to reconnect after a failure and not lose its
- // tasks/executors.
- //
- // NOTE: To avoid accidental destruction of tasks, production
- // frameworks typically set this to a large value (e.g., 1 week).
- optional double failover_timeout = 4 [default = 0.0];
-
- // If set, agents running tasks started by this framework will write
- // the framework pid, executor pids and status updates to disk. If
- // the agent exits (e.g., due to a crash or as part of upgrading
- // Mesos), this checkpointed data allows the restarted agent to
- // reconnect to executors that were started by the old instance of
- // the agent. Enabling checkpointing improves fault tolerance, at
- // the cost of a (usually small) increase in disk I/O.
- optional bool checkpoint = 5 [default = false];
-
- // Roles are the entities to which allocations are made.
- // The framework must have at least one role in order to
- // be offered resources. Note that `role` is deprecated
- // in favor of `roles` and only one of these fields must
- // be used. Since we cannot distinguish between empty
- // `roles` and the default unset `role`, we require that
- // frameworks set the `MULTI_ROLE` capability if
- // setting the `roles` field.
- optional string role = 6 [default = "*", deprecated=true];
- repeated string roles = 12;
-
- // Used to indicate the current host from which the scheduler is
- // registered in the Mesos Web UI. If set to an empty string Mesos
- // will automagically set it to the current hostname if one is
- // available.
- optional string hostname = 7;
-
- // This field should match the credential's principal the framework
- // uses for authentication. This field is used for framework API
- // rate limiting and dynamic reservations. It should be set even
- // if authentication is not enabled if these features are desired.
- optional string principal = 8;
-
- // This field allows a framework to advertise its web UI, so that
- // the Mesos web UI can link to it. It is expected to be a full URL,
- // for example http://my-scheduler.example.com:8080/.
- optional string webui_url = 9;
-
- message Capability {
- enum Type {
- // This must be the first enum value in this list, to
- // ensure that if 'type' is not set, the default value
- // is UNKNOWN. This enables enum values to be added
- // in a backwards-compatible way. See: MESOS-4997.
- UNKNOWN = 0;
-
- // Receive offers with revocable resources. See 'Resource'
- // message for details.
- REVOCABLE_RESOURCES = 1;
-
- // Receive the TASK_KILLING TaskState when a task is being
- // killed by an executor. The executor will examine this
- // capability to determine whether it can send TASK_KILLING.
- TASK_KILLING_STATE = 2;
-
- // Indicates whether the framework is aware of GPU resources.
- // Frameworks that are aware of GPU resources are expected to
- // avoid placing non-GPU workloads on GPU agents, in order
- // to avoid occupying a GPU agent and preventing GPU workloads
- // from running! Currently, if a framework is unaware of GPU
- // resources, it will not be offered *any* of the resources on
- // an agent with GPUs. This restriction is in place because we
- // do not have a revocation mechanism that ensures GPU workloads
- // can evict GPU agent occupants if necessary.
- //
- // TODO(bmahler): As we add revocation we can relax the
- // restriction here. See MESOS-5634 for more information.
- GPU_RESOURCES = 3;
-
- // Receive offers with resources that are shared.
- SHARED_RESOURCES = 4;
-
- // Indicates that (1) the framework is prepared to handle the
- // following TaskStates: TASK_UNREACHABLE, TASK_DROPPED,
- // TASK_GONE, TASK_GONE_BY_OPERATOR, and TASK_UNKNOWN, and (2)
- // the framework will assume responsibility for managing
- // partitioned tasks that reregister with the master.
- //
- // Frameworks that enable this capability can define how they
- // would like to handle partitioned tasks. Frameworks will
- // receive TASK_UNREACHABLE for tasks on agents that are
- // partitioned from the master. If/when a partitioned agent
- // reregisters, tasks on the agent that were started by
- // PARTITION_AWARE frameworks will not killed.
- //
- // Without this capability, frameworks will receive TASK_LOST
- // for tasks on partitioned agents; such tasks will be killed by
- // Mesos when the agent reregisters (unless the master has
- // failed over).
- PARTITION_AWARE = 5;
-
- // This expresses the ability for the framework to be
- // "multi-tenant" via using the newly introduced `roles`
- // field, and examining `Offer.allocation_info` to determine
- // which role the offers are being made to. We also
- // expect that "single-tenant" schedulers eventually
- // provide this and move away from the deprecated
- // `role` field.
- MULTI_ROLE = 6;
-
- // This capability has two effects for a framework.
- //
- // (1) The framework is offered resources in a new format.
- //
- // The offered resources have the `Resource.reservations` field set
- // rather than `Resource.role` and `Resource.reservation`. In short,
- // an empty `reservations` field denotes unreserved resources, and
- // each `ReservationInfo` in the `reservations` field denotes a
- // reservation that refines the previous one.
- //
- // See the 'Resource Format' section for more details.
- //
- // (2) The framework can create refined reservations.
- //
- // A framework can refine an existing reservation via the
- // `Resource.reservations` field. For example, a reservation for role
- // `eng` can be refined to `eng/front_end`.
- //
- // See `ReservationInfo.reservations` for more details.
- //
- // NOTE: Without this capability, a framework is not offered resources
- // that have refined reservations. A resource is said to have refined
- // reservations if it uses the `Resource.reservations` field, and
- // `Resource.reservations_size() > 1`.
- RESERVATION_REFINEMENT = 7; // EXPERIMENTAL.
-
- // Indicates that the framework is prepared to receive offers
- // for agents whose region is different from the master's
- // region. Network links between hosts in different regions
- // typically have higher latency and lower bandwidth than
- // network links within a region, so frameworks should be
- // careful to only place suitable workloads in remote regions.
- // Frameworks that are not region-aware will never receive
- // offers for remote agents; region-aware frameworks are assumed
- // to implement their own logic to decide which workloads (if
- // any) are suitable for placement on remote agents.
- REGION_AWARE = 8;
- }
-
- // Enum fields should be optional, see: MESOS-4997.
- optional Type type = 1;
- }
-
- // This field allows a framework to advertise its set of
- // capabilities (e.g., ability to receive offers for revocable
- // resources).
- repeated Capability capabilities = 10;
-
- // Labels are free-form key value pairs supplied by the framework
- // scheduler (e.g., to describe additional functionality offered by
- // the framework). These labels are not interpreted by Mesos itself.
- // Labels should not contain duplicate key-value pairs.
- optional Labels labels = 11;
-}
-
-
-/**
- * Describes a general non-interpreting non-killing check for a task or
- * executor (or any arbitrary process/command). A type is picked by
- * specifying one of the optional fields. Specifying more than one type
- * is an error.
- *
- * NOTE: This API is unstable and the related feature is experimental.
- */
-message CheckInfo {
- enum Type {
- UNKNOWN = 0;
- COMMAND = 1;
- HTTP = 2;
- TCP = 3;
-
- // TODO(alexr): Consider supporting custom user checks. They should
- // probably be paired with a `data` field and complemented by a
- // `data` response in `CheckStatusInfo`.
- }
-
- // Describes a command check. If applicable, enters mount and/or network
- // namespaces of the task.
- message Command {
- required CommandInfo command = 1;
- }
-
- // Describes an HTTP check. Sends a GET request to
- // http://<host>:port/path. Note that <host> is not configurable and is
- // resolved automatically to 127.0.0.1.
- message Http {
- // Port to send the HTTP request.
- required uint32 port = 1;
-
- // HTTP request path.
- optional string path = 2;
-
- // TODO(alexr): Add support for HTTP method. While adding POST
- // and PUT is simple, supporting payload is more involved.
-
- // TODO(alexr): Add support for custom HTTP headers.
-
- // TODO(alexr): Consider adding an optional message to describe TLS
- // options and thus enabling https. Such message might contain certificate
- // validation, TLS version.
- }
-
- // Describes a TCP check, i.e. based on establishing a TCP connection to
- // the specified port. Note that <host> is not configurable and is resolved
- // automatically to 127.0.0.1.
- message Tcp {
- required uint32 port = 1;
- }
-
- // The type of the check.
- optional Type type = 1;
-
- // Command check.
- optional Command command = 2;
-
- // HTTP check.
- optional Http http = 3;
-
- // TCP check.
- optional Tcp tcp = 7;
-
- // Amount of time to wait to start checking the task after it
- // transitions to `TASK_RUNNING` or `TASK_STARTING` if the latter
- // is used by the executor.
- optional double delay_seconds = 4 [default = 15.0];
-
- // Interval between check attempts, i.e., amount of time to wait after
- // the previous check finished or timed out to start the next check.
- optional double interval_seconds = 5 [default = 10.0];
-
- // Amount of time to wait for the check to complete. Zero means infinite
- // timeout.
- //
- // After this timeout, the check attempt is aborted and no result is
- // reported. Note that this may be considered a state change and hence
- // may trigger a check status change delivery to the corresponding
- // scheduler. See `CheckStatusInfo` for more details.
- optional double timeout_seconds = 6 [default = 20.0];
-}
-
-
-/**
- * Describes a health check for a task or executor (or any arbitrary
- * process/command). A type is picked by specifying one of the
- * optional fields. Specifying more than one type is an error.
- */
-message HealthCheck {
- enum Type {
- UNKNOWN = 0;
- COMMAND = 1;
- HTTP = 2;
- TCP = 3;
- }
-
- // Describes an HTTP health check. Sends a GET request to
- // scheme://<host>:port/path. Note that <host> is not configurable and is
- // resolved automatically, in most cases to 127.0.0.1. Default executors
- // treat return codes between 200 and 399 as success; custom executors
- // may employ a different strategy, e.g. leveraging the `statuses` field.
- message HTTPCheckInfo {
- // Currently "http" and "https" are supported.
- optional string scheme = 3;
-
- // Port to send the HTTP request.
- required uint32 port = 1;
-
- // HTTP request path.
- optional string path = 2;
-
- // TODO(alexr): Add support for HTTP method. While adding POST
- // and PUT is simple, supporting payload is more involved.
-
- // TODO(alexr): Add support for custom HTTP headers.
-
- // TODO(alexr): Add support for success and possibly failure
- // statuses.
-
- // NOTE: It is up to the custom executor to interpret and act on this
- // field. Setting this field has no effect on the default executors.
- //
- // TODO(haosdent): Deprecate this field when we add better support for
- // success and possibly failure statuses, e.g. ranges of success and
- // failure statuses.
- repeated uint32 statuses = 4;
-
- // TODO(haosdent): Consider adding a flag to enable task's certificate
- // validation for HTTPS health checks, see MESOS-5997.
-
- // TODO(benh): Include an 'optional bytes data' field for checking
- // for specific data in the response.
- }
-
- // Describes a TCP health check, i.e. based on establishing
- // a TCP connection to the specified port.
- message TCPCheckInfo {
- // Port expected to be open.
- required uint32 port = 1;
- }
-
- // TODO(benh): Consider adding a URL health check strategy which
- // allows doing something similar to the HTTP strategy but
- // encapsulates all the details in a single string field.
-
- // Amount of time to wait to start health checking the task after it
- // transitions to `TASK_RUNNING` or `TASK_STATING` if the latter is
- // used by the executor.
- optional double delay_seconds = 2 [default = 15.0];
-
- // Interval between health checks, i.e., amount of time to wait after
- // the previous health check finished or timed out to start the next
- // health check.
- optional double interval_seconds = 3 [default = 10.0];
-
- // Amount of time to wait for the health check to complete. After this
- // timeout, the health check is aborted and treated as a failure. Zero
- // means infinite timeout.
- optional double timeout_seconds = 4 [default = 20.0];
-
- // Number of consecutive failures until the task is killed by the executor.
- optional uint32 consecutive_failures = 5 [default = 3];
-
- // Amount of time after the task is launched during which health check
- // failures are ignored. Once a check succeeds for the first time,
- // the grace period does not apply anymore. Note that it includes
- // `delay_seconds`, i.e., setting `grace_period_seconds` < `delay_seconds`
- // has no effect.
- optional double grace_period_seconds = 6 [default = 10.0];
-
- // TODO(alexr): Add an optional `KillPolicy` that should be used
- // if the task is killed because of a health check failure.
-
- // The type of health check.
- optional Type type = 8;
-
- // Command health check.
- optional CommandInfo command = 7;
-
- // HTTP health check.
- optional HTTPCheckInfo http = 1;
-
- // TCP health check.
- optional TCPCheckInfo tcp = 9;
-}
-
-
-/**
- * Describes a kill policy for a task. Currently does not express
- * different policies (e.g. hitting HTTP endpoints), only controls
- * how long to wait between graceful and forcible task kill:
- *
- * graceful kill --------------> forcible kill
- * grace_period
- *
- * Kill policies are best-effort, because machine failures / forcible
- * terminations may occur.
- *
- * NOTE: For executor-less command-based tasks, the kill is performed
- * via sending a signal to the task process: SIGTERM for the graceful
- * kill and SIGKILL for the forcible kill. For the docker executor-less
- * tasks the grace period is passed to 'docker stop --time'.
- */
-message KillPolicy {
- // The grace period specifies how long to wait before forcibly
- // killing the task. It is recommended to attempt to gracefully
- // kill the task (and send TASK_KILLING) to indicate that the
- // graceful kill is in progress. Once the grace period elapses,
- // if the task has not terminated, a forcible kill should occur.
- // The task should not assume that it will always be allotted
- // the full grace period. For example, the executor may be
- // shutdown more quickly by the agent, or failures / forcible
- // terminations may occur.
- optional DurationInfo grace_period = 1;
-}
-
-
-/**
- * Describes a command, executed via: '/bin/sh -c value'. Any URIs specified
- * are fetched before executing the command. If the executable field for an
- * uri is set, executable file permission is set on the downloaded file.
- * Otherwise, if the downloaded file has a recognized archive extension
- * (currently [compressed] tar and zip) it is extracted into the executor's
- * working directory. This extraction can be disabled by setting `extract` to
- * false. In addition, any environment variables are set before executing
- * the command (so they can be used to "parameterize" your command).
- */
-message CommandInfo {
- message URI {
- required string value = 1;
- optional bool executable = 2;
-
- // In case the fetched file is recognized as an archive, extract
- // its contents into the sandbox. Note that a cached archive is
- // not copied from the cache to the sandbox in case extraction
- // originates from an archive in the cache.
- optional bool extract = 3 [default = true];
-
- // If this field is "true", the fetcher cache will be used. If not,
- // fetching bypasses the cache and downloads directly into the
- // sandbox directory, no matter whether a suitable cache file is
- // available or not. The former directs the fetcher to download to
- // the file cache, then copy from there to the sandbox. Subsequent
- // fetch attempts with the same URI will omit downloading and copy
- // from the cache as long as the file is resident there. Cache files
- // may get evicted at any time, which then leads to renewed
- // downloading. See also "docs/fetcher.md" and
- // "docs/fetcher-cache-internals.md".
- optional bool cache = 4;
-
- // The fetcher's default behavior is to use the URI string's basename to
- // name the local copy. If this field is provided, the local copy will be
- // named with its value instead. If there is a directory component (which
- // must be a relative path), the local copy will be stored in that
- // subdirectory inside the sandbox.
- optional string output_file = 5;
- }
-
- repeated URI uris = 1;
-
- optional Environment environment = 2;
-
- // There are two ways to specify the command:
- // 1) If 'shell == true', the command will be launched via shell
- // (i.e., /bin/sh -c 'value'). The 'value' specified will be
- // treated as the shell command. The 'arguments' will be ignored.
- // 2) If 'shell == false', the command will be launched by passing
- // arguments to an executable. The 'value' specified will be
- // treated as the filename of the executable. The 'arguments'
- // will be treated as the arguments to the executable. This is
- // similar to how POSIX exec families launch processes (i.e.,
- // execlp(value, arguments(0), arguments(1), ...)).
- // NOTE: The field 'value' is changed from 'required' to 'optional'
- // in 0.20.0. It will only cause issues if a new framework is
- // connecting to an old master.
- optional bool shell = 6 [default = true];
- optional string value = 3;
- repeated string arguments = 7;
-
- // Enables executor and tasks to run as a specific user. If the user
- // field is present both in FrameworkInfo and here, the CommandInfo
- // user value takes precedence.
- optional string user = 5;
-}
-
-
-/**
- * Describes information about an executor.
- */
-message ExecutorInfo {
- enum Type {
- UNKNOWN = 0;
-
- // Mesos provides a simple built-in default executor that frameworks can
- // leverage to run shell commands and containers.
- //
- // NOTES:
- //
- // 1) `command` must not be set when using a default executor.
- //
- // 2) Default executor only accepts a *single* `LAUNCH` or `LAUNCH_GROUP`
- // offer operation.
- //
- // 3) If `container` is set, `container.type` must be `MESOS`
- // and `container.mesos.image` must not be set.
- DEFAULT = 1;
-
- // For frameworks that need custom functionality to run tasks, a `CUSTOM`
- // executor can be used. Note that `command` must be set when using a
- // `CUSTOM` executor.
- CUSTOM = 2;
- }
-
- // For backwards compatibility, if this field is not set when using `LAUNCH`
- // offer operation, Mesos will infer the type by checking if `command` is
- // set (`CUSTOM`) or unset (`DEFAULT`). `type` must be set when using
- // `LAUNCH_GROUP` offer operation.
- //
- // TODO(vinod): Add support for explicitly setting `type` to `DEFAULT `
- // in `LAUNCH` offer operation.
- optional Type type = 15;
-
- required ExecutorID executor_id = 1;
- optional FrameworkID framework_id = 8; // TODO(benh): Make this required.
- optional CommandInfo command = 7;
-
- // Executor provided with a container will launch the container
- // with the executor's CommandInfo and we expect the container to
- // act as a Mesos executor.
- optional ContainerInfo container = 11;
-
- repeated Resource resources = 5;
- optional string name = 9;
-
- // 'source' is an identifier style string used by frameworks to
- // track the source of an executor. This is useful when it's
- // possible for different executor ids to be related semantically.
- //
- // NOTE: 'source' is exposed alongside the resource usage of the
- // executor via JSON on the agent. This allows users to import usage
- // information into a time series database for monitoring.
- //
- // This field is deprecated since 1.0. Please use labels for
- // free-form metadata instead.
- optional string source = 10 [deprecated = true]; // Since 1.0.
-
- // This field can be used to pass arbitrary bytes to an executor.
- optional bytes data = 4;
-
- // Service discovery information for the executor. It is not
- // interpreted or acted upon by Mesos. It is up to a service
- // discovery system to use this information as needed and to handle
- // executors without service discovery information.
- optional DiscoveryInfo discovery = 12;
-
- // When shutting down an executor the agent will wait in a
- // best-effort manner for the grace period specified here
- // before forcibly destroying the container. The executor
- // must not assume that it will always be allotted the full
- // grace period, as the agent may decide to allot a shorter
- // period and failures / forcible terminations may occur.
- optional DurationInfo shutdown_grace_period = 13;
-
- // Labels are free-form key value pairs which are exposed through
- // master and agent endpoints. Labels will not be interpreted or
- // acted upon by Mesos itself. As opposed to the data field, labels
- // will be kept in memory on master and agent processes. Therefore,
- // labels should be used to tag executors with lightweight metadata.
- // Labels should not contain duplicate key-value pairs.
- optional Labels labels = 14;
-}
-
-
-/**
- * Describes a domain. A domain is a collection of hosts that have
- * similar characteristics. Mesos currently only supports "fault
- * domains", which identify groups of hosts with similar failure
- * characteristics.
- *
- * Frameworks can generally assume that network links between hosts in
- * the same fault domain have lower latency, higher bandwidth, and better
- * availability than network links between hosts in different domains.
- * Schedulers may prefer to place network-intensive workloads in the
- * same domain, as this may improve performance. Conversely, a single
- * failure that affects a host in a domain may be more likely to
- * affect other hosts in the same domain; hence, schedulers may prefer
- * to place workloads that require high availability in multiple
- * domains. (For example, all the hosts in a single rack might lose
- * power or network connectivity simultaneously.)
- *
- * There are two kinds of fault domains: regions and zones. Regions
- * offer the highest degree of fault isolation, but network latency
- * between regions is typically high (typically >50 ms). Zones offer a
- * modest degree of fault isolation along with reasonably low network
- * latency (typically <10 ms).
- *
- * The mapping from fault domains to physical infrastructure is up to
- * the operator to configure. In cloud environments, regions and zones
- * can be mapped to the "region" and "availability zone" concepts
- * exposed by most cloud providers, respectively. In on-premise
- * deployments, regions and zones can be mapped to data centers and
- * racks, respectively.
- *
- * Both masters and agents can be configured with domains. Frameworks
- * can compare the domains of two hosts to determine if the hosts are
- * in the same zone, in different zones in the same region, or in
- * different regions. Note that all masters in a given Mesos cluster
- * must be in the same region.
- */
-message DomainInfo {
- message FaultDomain {
- message RegionInfo {
- required string name = 1;
- }
-
- message ZoneInfo {
- required string name = 1;
- }
-
- required RegionInfo region = 1;
- required ZoneInfo zone = 2;
- }
-
- optional FaultDomain fault_domain = 1;
-}
-
-
-/**
- * Describes a master. This will probably have more fields in the
- * future which might be used, for example, to link a framework webui
- * to a master webui.
- */
-message MasterInfo {
- required string id = 1;
-
- // The IP address (only IPv4) as a packed 4-bytes integer,
- // stored in network order. Deprecated, use `address.ip` instead.
- required uint32 ip = 2;
-
- // The TCP port the Master is listening on for incoming
- // HTTP requests; deprecated, use `address.port` instead.
- required uint32 port = 3 [default = 5050];
-
- // In the default implementation, this will contain information
- // about both the IP address, port and Master name; it should really
- // not be relied upon by external tooling/frameworks and be
- // considered an "internal" implementation field.
- optional string pid = 4;
-
- // The server's hostname, if available; it may be unreliable
- // in environments where the DNS configuration does not resolve
- // internal hostnames (eg, some public cloud providers).
- // Deprecated, use `address.hostname` instead.
- optional string hostname = 5;
-
- // The running Master version, as a string; taken from the
- // generated "master/version.hpp".
- optional string version = 6;
-
- // The full IP address (supports both IPv4 and IPv6 formats)
- // and supersedes the use of `ip`, `port` and `hostname`.
- // Since Mesos 0.24.
- optional Address address = 7;
-
- // The domain that this master belongs to. All masters in a Mesos
- // cluster should belong to the same region.
- optional DomainInfo domain = 8;
-}
-
-
-/**
- * Describes an agent. Note that the 'id' field is only available
- * after an agent is registered with the master, and is made available
- * here to facilitate re-registration.
- */
-message AgentInfo {
- required string hostname = 1;
- optional int32 port = 8 [default = 5051];
-
- // The configured resources at the agent. This does not include any
- // dynamic reservations or persistent volumes that may currently
- // exist at the agent.
- repeated Resource resources = 3;
-
- repeated Attribute attributes = 5;
- optional AgentID id = 6;
-
- // The domain that this agent belongs to. If the agent's region
- // differs from the master's region, it will not appear in resource
- // offers to frameworks that have not enabled the REGION_AWARE
- // capability.
- optional DomainInfo domain = 10;
-
- message Capability {
- enum Type {
- // This must be the first enum value in this list, to
- // ensure that if 'type' is not set, the default value
- // is UNKNOWN. This enables enum values to be added
- // in a backwards-compatible way. See: MESOS-4997.
- UNKNOWN = 0;
-
- // This expresses the ability for the agent to be able
- // to launch tasks of a 'multi-role' framework.
- MULTI_ROLE = 1;
-
- // This expresses the ability for the agent to be able to launch
- // tasks, reserve resources, and create volumes using resources
- // allocated to a 'hierarchical-role'.
- // NOTE: This capability is required specifically for creating
- // volumes because a hierchical role includes '/' (slashes) in them.
- // Agents with this capability know to transform the '/' (slashes)
- // into ' ' (spaces).
- HIERARCHICAL_ROLE = 2;
-
- // This capability has three effects for an agent.
- //
- // (1) The format of the checkpointed resources, and
- // the resources reported to master.
- //
- // These resources are reported in the "pre-reservation-refinement"
- // format if none of the resources have refined reservations. If any
- // of the resources have refined reservations, they are reported in
- // the "post-reservation-refinement" format. The purpose is to allow
- // downgrading of an agent as well as communication with a pre-1.4.0
- // master until the reservation refinement feature is actually used.
- //
- // See the 'Resource Format' section for more details.
- //
- // (2) The format of the resources reported by the HTTP endpoints.
- //
- // For resources reported by agent endpoints, the
- // "pre-reservation-refinement" format is "injected" if possible.
- // That is, resources without refined reservations will have the
- // `Resource.role` and `Resource.reservation` set, whereas
- // resources with refined reservations will not.
- //
- // See the 'Resource Format' section for more details.
- //
- // (3) The ability for the agent to launch tasks, reserve resources, and
- // create volumes using resources that have refined reservations.
- //
- // See `ReservationInfo.reservations` section for more details.
- //
- // NOTE: Resources are said to have refined reservations if it uses the
- // `Resource.reservations` field, and `Resource.reservations_size() > 1`.
- RESERVATION_REFINEMENT = 3;
- }
-
- // Enum fields should be optional, see: MESOS-4997.
- optional Type type = 1;
- }
-}
-
-
-/**
- * Describes a resource provider. Note that the 'id' field is only available
- * after a resource provider is registered with the master, and is made
- * available here to facilitate re-registration.
- */
-message ResourceProviderInfo {
- optional ResourceProviderID id = 1;
- repeated Attribute attributes = 2;
-
- // The type of the resource provider. This uniquely identifies a
- // resource provider implementation. For instance:
- // org.apache.mesos.rp.local.storage
- //
- // Please follow to Java package naming convention
- // (https://en.wikipedia.org/wiki/Java_package#Package_naming_conventions)
- // to avoid conflicts on type names.
- required string type = 3;
-
- // The name of the resource provider. There could be multiple
- // instances of a type of resource provider. The name field is used
- // to distinguish these instances.
- required string name = 4;
-}
-
-
-/**
- * Describes an Attribute or Resource "value". A value is described
- * using the standard protocol buffer "union" trick.
- */
-message Value {
- enum Type {
- SCALAR = 0;
- RANGES = 1;
- SET = 2;
- TEXT = 3;
- }
-
- message Scalar {
- // Scalar values are represented using floating point. To reduce
- // the chance of unpredictable floating point behavior due to
- // roundoff error, Mesos only supports three decimal digits of
- // precision for scalar resource values. That is, floating point
- // values are converted to a fixed point format that supports
- // three decimal digits of precision, and then converted back to
- // floating point on output. Any additional precision in scalar
- // resource values is discarded (via rounding).
- required double value = 1;
- }
-
- message Range {
- required uint64 begin = 1;
- required uint64 end = 2;
- }
-
- message Ranges {
- repeated Range range = 1;
- }
-
- message Set {
- repeated string item = 1;
- }
-
- message Text {
- required string value = 1;
- }
-
- required Type type = 1;
- optional Scalar scalar = 2;
- optional Ranges ranges = 3;
- optional Set set = 4;
- optional Text text = 5;
-}
-
-
-/**
- * Describes an attribute that can be set on a machine. For now,
- * attributes and resources share the same "value" type, but this may
- * change in the future and attributes may only be string based.
- */
-message Attribute {
- required string name = 1;
- required Value.Type type = 2;
- optional Value.Scalar scalar = 3;
- optional Value.Ranges ranges = 4;
- optional Value.Set set = 6;
- optional Value.Text text = 5;
-}
-
-
-/**
- * Describes a resource from a resource provider. The `name` field is
- * a string like "cpus" or "mem" that indicates which kind of resource
- * this is; the rest of the fields describe the properties of the
- * resource. A resource can take on one of three types: scalar
- * (double), a list of finite and discrete ranges (e.g., [1-10,
- * 20-30]), or a set of items. A resource is described using the
- * standard protocol buffer "union" trick.
- *
- * Note that "disk" and "mem" resources are scalar values expressed in
- * megabytes. Fractional "cpus" values are allowed (e.g., "0.5"),
- * which correspond to partial shares of a CPU.
- */
-message Resource {
- optional ResourceProviderID provider_id = 12;
-
- required string name = 1;
- required Value.Type type = 2;
- optional Value.Scalar scalar = 3;
- optional Value.Ranges ranges = 4;
- optional Value.Set set = 5;
-
- // The role that this resource is reserved for. If "*", this indicates
- // that the resource is unreserved. Otherwise, the resource will only
- // be offered to frameworks that belong to this role.
- //
- // NOTE: Frameworks must not set this field if `reservations` is set.
- // See the 'Resource Format' section for more details.
- //
- // TODO(mpark): Deprecate once `reservations` is no longer experimental.
- optional string role = 6 [default = "*", deprecated=true];
-
- // This was initially introduced to support MULTI_ROLE capable
- // frameworks. Frameworks that are not MULTI_ROLE capable can
- // continue to assume that the offered resources are allocated
- // to their role.
- message AllocationInfo {
- // If set, this resource is allocated to a role. Note that in the
- // future, this may be unset and the scheduler may be responsible
- // for allocating to one of its roles.
- optional string role = 1;
-
- // In the future, we may add additional fields here, e.g. priority
- // tier, type of allocation (quota / fair share).
- }
-
- optional AllocationInfo allocation_info = 11;
-
- // Resource Format:
- //
- // Frameworks receive resource offers in one of two formats, depending on
- // whether the RESERVATION_REFINEMENT capability is enabled.
- //
- // __WITHOUT__ the RESERVATION_REFINEMENT capability, the framework is offered
- // resources in the "pre-reservation-refinement" format. In this format, the
- // `Resource.role` and `Resource.reservation` fields are used in conjunction
- // to describe the reservation state of a `Resource` message.
- //
- // The following is an overview of the possible reservation states:
- //
- // +------------+------------------------------------------------------------+
- // | unreserved | { |
- // | | role: "*", |
- // | | reservation: <not set>, |
- // | | reservations: <unused> |
- // | | } |
- // +------------+------------------------------------------------------------+
- // | static | { |
- // | | role: "eng", |
- // | | reservation: <not set>, |
- // | | reservations: <unused> |
- // | | } |
- // +------------+------------------------------------------------------------+
- // | dynamic | { |
- // | | role: "eng", |
- // | | reservation: { |
- // | | type: <unused>, |
- // | | role: <unused>, |
- // | | principal: <optional>, |
- // | | labels: <optional> |
- // | | }, |
- // | | reservations: <unused> |
- // | | } |
- // +------------+------------------------------------------------------------+
- //
- // __WITH__ the RESERVATION_REFINEMENT capability, the framework is offered
- // resources in the "post-reservation-refinement" format. In this format, the
- // reservation state of a `Resource` message is expressed solely in
- // `Resource.reservations` field.
- //
- // The following is an overview of the possible reservation states:
- //
- // +------------+------------------------------------------------------------+
- // | unreserved | { |
- // | | role: <unused>, |
- // | | reservation: <unused>, |
- // | | reservations: [] |
- // | | } |
- // +------------+------------------------------------------------------------+
- // | static | { |
- // | | role: <unused>, |
- // | | reservation: <unused>, |
- // | | reservations: [ |
- // | | { |
- // | | type: STATIC, |
- // | | role: "eng", |
- // | | principal: <optional>, |
- // | | labels: <optional> |
- // | | } |
- // | | ] |
- // | | } |
- // +------------+------------------------------------------------------------+
- // | dynamic | { |
- // | | role: <unused>, |
- // | | reservation: <unused>, |
- // | | reservations: [ |
- // | | { |
- // | | type: DYNAMIC, |
- // | | role: "eng", |
- // | | principal: <optional>, |
- // | | labels: <optional> |
- // | | } |
- // | | ] |
- // | | } |
- // +------------+------------------------------------------------------------+
- //
- // We can also __refine__ reservations with this capability like so:
- //
- // +------------+------------------------------------------------------------+
- // | refined | { |
- // | | role: <unused>, |
- // | | reservation: <unused>, |
- // | | reservations: [ |
- // | | { |
- // | | type: STATIC or DYNAMIC, |
- // | | role: "eng", |
- // | | principal: <optional>, |
- // | | labels: <optional> |
- // | | }, |
- // | | { |
- // | | type: DYNAMIC, |
- // | | role: "eng/front_end", |
- // | | principal: <optional>, |
- // | | labels: <optional> |
- // | | } |
- // | | ] |
- // | | } |
- // +------------+------------------------------------------------------------+
- //
- // NOTE: Each `ReservationInfo` in the `reservations` field denotes
- // a reservation that refines the previous `ReservationInfo`.
-
- message ReservationInfo {
- // TODO(mpark): Explain the two resource formats.
-
- // Describes a reservation. A static reservation is set by the operator on
- // the command-line and they are immutable without agent restart. A dynamic
- // reservation is acquired by an operator via the '/reserve' HTTP endpoint
- // or by a framework via the offer cycle by sending back an
- // 'Offer::Operation::Reserve' message.
- // NOTE: We currently do not allow frameworks with role "*" to make dynamic
- // reservations.
-
- enum Type {
- UNKNOWN = 0;
- STATIC = 1;
- DYNAMIC = 2;
- }
-
- // The type of this reservation.
- // NOTE: This field must not be set for `Resource.reservation`.
- optional Type type = 4;
-
- // The role to which this reservation is made for.
- // NOTE: This field must not be set for `Resource.reservation`.
- optional string role = 3;
-
- // Indicates the principal, if any, of the framework or operator
- // that reserved this resource. If reserved by a framework, the
- // field should match the `FrameworkInfo.principal`. It is used in
- // conjunction with the `UnreserveResources` ACL to determine
- // whether the entity attempting to unreserve this resource is
- // permitted to do so.
- optional string principal = 1;
-
- // Labels are free-form key value pairs that can be used to
- // associate arbitrary metadata with a reserved resource. For
- // example, frameworks can use labels to identify the intended
- // purpose for a portion of the resources the framework has
- // reserved at a given agent. Labels should not contain duplicate
- // key-value pairs.
- optional Labels labels = 2;
- }
-
- // If this is set, this resource was dynamically reserved by an
- // operator or a framework. Otherwise, this resource is either unreserved
- // or statically reserved by an operator via the --resources flag.
- // NOTE: Frameworks must not set this field if `reservations` is set.
- optional ReservationInfo reservation = 8;
-
- // The stack of reservations. If this field is empty, it indicates that this
- // resource is unreserved. Otherwise, the resource is reserved. The first
- // `ReservationInfo` may have type `STATIC` or `DYNAMIC`, but the rest must
- // have `DYNAMIC`. One can create a new reservation on top of an existing
- // one by pushing a new `ReservationInfo` to the back. The last
- // `ReservationInfo` in this stack is the "current" reservation. The new
- // reservation's role must be a child of the current reservation's role.
- // NOTE: Frameworks must not set this field if `reservation` is set.
- repeated ReservationInfo reservations = 13; // EXPERIMENTAL.
-
- message DiskInfo {
- // Describes a persistent disk volume.
- //
- // A persistent disk volume will not be automatically garbage
- // collected if the task/executor/agent terminates, but will be
- // re-offered to the framework(s) belonging to the 'role'.
- //
- // NOTE: Currently, we do not allow persistent disk volumes
- // without a reservation (i.e., 'role' cannot be '*').
- message Persistence {
- // A unique ID for the persistent disk volume. This ID must be
- // unique per role on each agent. Although it is possible to use
- // the same ID on different agents in the cluster and to reuse
- // IDs after a volume with that ID has been destroyed, both
- // practices are discouraged.
- required string id = 1;
-
- // This field indicates the principal of the operator or
- // framework that created this volume. It is used in conjunction
- // with the "destroy" ACL to determine whether an entity
- // attempting to destroy the volume is permitted to do so.
- //
- // NOTE: This field should match the FrameworkInfo.principal of
- // the framework that created the volume.
- optional string principal = 2;
- }
-
- optional Persistence persistence = 1;
-
- // Describes how this disk resource will be mounted in the
- // container. If not set, the disk resource will be used as the
- // sandbox. Otherwise, it will be mounted according to the
- // 'container_path' inside 'volume'. The 'host_path' inside
- // 'volume' is ignored.
- // NOTE: If 'volume' is set but 'persistence' is not set, the
- // volume will be automatically garbage collected after
- // task/executor terminates. Currently, if 'persistence' is set,
- // 'volume' must be set.
- optional Volume volume = 2;
-
- // Describes where a disk originates from.
- // TODO(jmlvanre): Add support for BLOCK devices.
- message Source {
- enum Type {
- UNKNOWN = 0;
- PATH = 1;
- MOUNT = 2;
- }
-
- // A folder that can be located on a separate disk device. This
- // can be shared and carved up as necessary between frameworks.
- message Path {
- // Path to the folder (e.g., /mnt/raid/disk0).
- optional string root = 1;
- }
-
- // A mounted file-system set up by the Agent administrator. This
- // can only be used exclusively: a framework cannot accept a
- // partial amount of this disk.
- message Mount {
- // Path to mount point (e.g., /mnt/raid/disk0).
- optional string root = 1;
- }
-
- required Type type = 1;
- optional Path path = 2;
- optional Mount mount = 3;
- }
-
- optional Source source = 3;
- }
-
- optional DiskInfo disk = 7;
-
- message RevocableInfo {}
-
- // If this is set, the resources are revocable, i.e., any tasks or
- // executors launched using these resources could get preempted or
- // throttled at any time. This could be used by frameworks to run
- // best effort tasks that do not need strict uptime or performance
- // guarantees. Note that if this is set, 'disk' or 'reservation'
- // cannot be set.
- optional RevocableInfo revocable = 9;
-
- // Allow the resource to be shared across tasks.
- message SharedInfo {}
-
- // If this is set, the resources are shared, i.e. multiple tasks
- // can be launched using this resource and all of them shall refer
- // to the same physical resource on the cluster. Note that only
- // persistent volumes can be shared currently.
- optional SharedInfo shared = 10;
-}
-
-
-/**
- * When the network bandwidth caps are enabled and the container
- * is over its limit, outbound packets may be either delayed or
- * dropped completely either because it exceeds the maximum bandwidth
- * allocation for a single container (the cap) or because the combined
- * network traffic of multiple containers on the host exceeds the
- * transmit capacity of the host (the share). We can report the
- * following statistics for each of these conditions exported directly
- * from the Linux Traffic Control Queueing Discipline.
- *
- * id : name of the limiter, e.g. 'tx_bw_cap'
- * backlog : number of packets currently delayed
- * bytes : total bytes seen
- * drops : number of packets dropped in total
- * overlimits : number of packets which exceeded allocation
- * packets : total packets seen
- * qlen : number of packets currently queued
- * rate_bps : throughput in bytes/sec
- * rate_pps : throughput in packets/sec
- * requeues : number of times a packet has been delayed due to
- * locking or device contention issues
- *
- * More information on the operation of Linux Traffic Control can be
- * found at http://www.lartc.org/lartc.html.
- */
-message TrafficControlStatistics {
- required string id = 1;
- optional uint64 backlog = 2;
- optional uint64 bytes = 3;
- optional uint64 drops = 4;
- optional uint64 overlimits = 5;
- optional uint64 packets = 6;
- optional uint64 qlen = 7;
- optional uint64 ratebps = 8;
- optional uint64 ratepps = 9;
- optional uint64 requeues = 10;
-}
-
-
-message IpStatistics {
- optional int64 Forwarding = 1;
- optional int64 DefaultTTL = 2;
- optional int64 InReceives = 3;
- optional int64 InHdrErrors = 4;
- optional int64 InAddrErrors = 5;
- optional int64 ForwDatagrams = 6;
- optional int64 InUnknownProtos = 7;
- optional int64 InDiscards = 8;
- optional int64 InDelivers = 9;
- optional int64 OutRequests = 10;
- optional int64 OutDiscards = 11;
- optional int64 OutNoRoutes = 12;
- optional int64 ReasmTimeout = 13;
- optional int64 ReasmReqds = 14;
- optional int64 ReasmOKs = 15;
- optional int64 ReasmFails = 16;
- optional int64 FragOKs = 17;
- optional int64 FragFails = 18;
- optional int64 FragCreates = 19;
-}
-
-
-message IcmpStatistics {
- optional int64 InMsgs = 1;
- optional int64 InErrors = 2;
- optional int64 InCsumErrors = 3;
- optional int64 InDestUnreachs = 4;
- optional int64 InTimeExcds = 5;
- optional int64 InParmProbs = 6;
- optional int64 InSrcQuenchs = 7;
- optional int64 InRedirects = 8;
- optional int64 InEchos = 9;
- optional int64 InEchoReps = 10;
- optional int64 InTimestamps = 11;
- optional int64 InTimestampReps = 12;
- optional int64 InAddrMasks = 13;
- optional int64 InAddrMaskReps = 14;
- optional int64 OutMsgs = 15;
- optional int64 OutErrors = 16;
- optional int64 OutDestUnreachs = 17;
- optional int64 OutTimeExcds = 18;
- optional int64 OutParmProbs = 19;
- optional int64 OutSrcQuenchs = 20;
- optional int64 OutRedirects = 21;
- optional int64 OutEchos = 22;
- optional int64 OutEchoReps = 23;
- optional int64 OutTimestamps = 24;
- optional int64 OutTimestampReps = 25;
- optional int64 OutAddrMasks = 26;
- optional int64 OutAddrMaskReps = 27;
-}
-
-
-message TcpStatistics {
- optional int64 RtoAlgorithm = 1;
- optional int64 RtoMin = 2;
- optional int64 RtoMax = 3;
- optional int64 MaxConn = 4;
- optional int64 ActiveOpens = 5;
- optional int64 PassiveOpens = 6;
- optional int64 AttemptFails = 7;
- optional int64 EstabResets = 8;
- optional int64 CurrEstab = 9;
- optional int64 InSegs = 10;
- optional int64 OutSegs = 11;
- optional int64 RetransSegs = 12;
- optional int64 InErrs = 13;
- optional int64 OutRsts = 14;
- optional int64 InCsumErrors = 15;
-}
-
-
-message UdpStatistics {
- optional int64 InDatagrams = 1;
- optional int64 NoPorts = 2;
- optional int64 InErrors = 3;
- optional int64 OutDatagrams = 4;
- optional int64 RcvbufErrors = 5;
- optional int64 SndbufErrors = 6;
- optional int64 InCsumErrors = 7;
- optional int64 IgnoredMulti = 8;
-}
-
-
-message SNMPStatistics {
- optional IpStatistics ip_stats = 1;
- optional IcmpStatistics icmp_stats = 2;
- optional TcpStatistics tcp_stats = 3;
- optional UdpStatistics udp_stats = 4;
-}
-
-
-message DiskStatistics {
- optional Resource.DiskInfo.Source source = 1;
- optional Resource.DiskInfo.Persistence persistence = 2;
- optional uint64 limit_bytes = 3;
- optional uint64 used_bytes = 4;
-}
-
-
-/**
- * A snapshot of resource usage statistics.
- */
-message ResourceStatistics {
- required double timestamp = 1; // Snapshot time, in seconds since the Epoch.
-
- optional uint32 processes = 30;
- optional uint32 threads = 31;
-
- // CPU Usage Information:
- // Total CPU time spent in user mode, and kernel mode.
- optional double cpus_user_time_secs = 2;
- optional double cpus_system_time_secs = 3;
-
- // Number of CPUs allocated.
- optional double cpus_limit = 4;
-
- // cpu.stat on process throttling (for contention issues).
- optional uint32 cpus_nr_periods = 7;
- optional uint32 cpus_nr_throttled = 8;
- optional double cpus_throttled_time_secs = 9;
-
- // Memory Usage Information:
-
- // mem_total_bytes was added in 0.23.0 to represent the total memory
- // of a process in RAM (as opposed to in Swap). This was previously
- // reported as mem_rss_bytes, which was also changed in 0.23.0 to
- // represent only the anonymous memory usage, to keep in sync with
- // Linux kernel's (arguably erroneous) use of terminology.
- optional uint64 mem_total_bytes = 36;
-
- // Total memory + swap usage. This is set if swap is enabled.
- optional uint64 mem_total_memsw_bytes = 37;
-
- // Hard memory limit for a container.
- optional uint64 mem_limit_bytes = 6;
-
- // Soft memory limit for a container.
- optional uint64 mem_soft_limit_bytes = 38;
-
- // Broken out memory usage information: pagecache, rss (anonymous),
- // mmaped files and swap.
-
- // TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in
- // 0.23.0 and will be removed in 0.24.0.
- optional uint64 mem_file_bytes = 10;
- optional uint64 mem_anon_bytes = 11;
-
- // mem_cache_bytes is added in 0.23.0 to represent page cache usage.
- optional uint64 mem_cache_bytes = 39;
-
- // Since 0.23.0, mem_rss_bytes is changed to represent only
- // anonymous memory usage. Note that neither its requiredness, type,
- // name nor numeric tag has been changed.
- optional uint64 mem_rss_bytes = 5;
-
- optional uint64 mem_mapped_file_bytes = 12;
- // This is only set if swap is enabled.
- optional uint64 mem_swap_bytes = 40;
- optional uint64 mem_unevictable_bytes = 41;
-
- // Number of occurrences of different levels of memory pressure
- // events reported by memory cgroup. Pressure listening (re)starts
- // with these values set to 0 when agent (re)starts. See
- // https://www.kernel.org/doc/Documentation/cgroups/memory.txt for
- // more details.
- optional uint64 mem_low_pressure_counter = 32;
- optional uint64 mem_medium_pressure_counter = 33;
- optional uint64 mem_critical_pressure_counter = 34;
-
- // Disk Usage Information for executor working directory.
- optional uint64 disk_limit_bytes = 26;
- optional uint64 disk_used_bytes = 27;
-
- // Per disk (resource) statistics.
- repeated DiskStatistics disk_statistics = 43;
-
- // Cgroups blkio statistics.
- optional CgroupInfo.Blkio.Statistics blkio_statistics = 44;
-
- // Perf statistics.
- optional PerfStatistics perf = 13;
-
- // Network Usage Information:
- optional uint64 net_rx_packets = 14;
- optional uint64 net_rx_bytes = 15;
- optional uint64 net_rx_errors = 16;
- optional uint64 net_rx_dropped = 17;
- optional uint64 net_tx_packets = 18;
- optional uint64 net_tx_bytes = 19;
- optional uint64 net_tx_errors = 20;
- optional uint64 net_tx_dropped = 21;
-
- // The kernel keeps track of RTT (round-trip time) for its TCP
- // sockets. RTT is a way to tell the latency of a container.
- optional double net_tcp_rtt_microsecs_p50 = 22;
- optional double net_tcp_rtt_microsecs_p90 = 23;
- optional double net_tcp_rtt_microsecs_p95 = 24;
- optional double net_tcp_rtt_microsecs_p99 = 25;
-
- optional double net_tcp_active_connections = 28;
- optional double net_tcp_time_wait_connections = 29;
-
- // Network traffic flowing into or out of a container can be delayed
- // or dropped due to congestion or policy inside and outside the
- // container.
- repeated TrafficControlStatistics net_traffic_control_statistics = 35;
-
- // Network SNMP statistics for each container.
- optional SNMPStatistics net_snmp_statistics = 42;
-}
-
-
-/**
- * Describes a snapshot of the resource usage for executors.
- */
-message ResourceUsage {
- message Executor {
- required ExecutorInfo executor_info = 1;
-
- // This includes resources used by the executor itself
- // as well as its active tasks.
- repeated Resource allocated = 2;
-
- // Current resource usage. If absent, the containerizer
- // cannot provide resource usage.
- optional ResourceStatistics statistics = 3;
-
- // The container id for the executor specified in the executor_info field.
- required ContainerID container_id = 4;
-
- message Task {
- required string name = 1;
- required TaskID id = 2;
- repeated Resource resources = 3;
- optional Labels labels = 4;
- }
-
- // Non-terminal tasks.
- repeated Task tasks = 5;
- }
-
- repeated Executor executors = 1;
-
- // Agent's total resources including checkpointed dynamic
- // reservations and persistent volumes.
- repeated Resource total = 2;
-}
-
-
-/**
- * Describes a sample of events from "perf stat". Only available on
- * Linux.
- *
- * NOTE: Each optional field matches the name of a perf event (see
- * "perf list") with the following changes:
- * 1. Names are downcased.
- * 2. Hyphens ('-') are replaced with underscores ('_').
- * 3. Events with alternate names use the name "perf stat" returns,
- * e.g., for the event "cycles OR cpu-cycles" perf always returns
- * cycles.
- */
-message PerfStatistics {
- required double timestamp = 1; // Start of sample interval, in seconds since the Epoch.
- required double duration = 2; // Duration of sample interval, in seconds.
-
- // Hardware event.
- optional uint64 cycles = 3;
- optional uint64 stalled_cycles_frontend = 4;
- optional uint64 stalled_cycles_backend = 5;
- optional uint64 instructions = 6;
- optional uint64 cache_references = 7;
- optional uint64 cache_misses = 8;
- optional uint64 branches = 9;
- optional uint64 branch_misses = 10;
- optional uint64 bus_cycles = 11;
- optional uint64 ref_cycles = 12;
-
- // Software event.
- optional double cpu_clock = 13;
- optional double task_clock = 14;
- optional uint64 page_faults = 15;
- optional uint64 minor_faults = 16;
- optional uint64 major_faults = 17;
- optional uint64 context_switches = 18;
- optional uint64 cpu_migrations = 19;
- optional uint64 alignment_faults = 20;
- optional uint64 emulation_faults = 21;
-
- // Hardware cache event.
- optional uint64 l1_dcache_loads = 22;
- optional uint64 l1_dcache_load_misses = 23;
- optional uint64 l1_dcache_stores = 24;
- optional uint64 l1_dcache_store_misses = 25;
- optional uint64 l1_dcache_prefetches = 26;
- optional uint64 l1_dcache_prefetch_misses = 27;
- optional uint64 l1_icache_loads = 28;
- optional uint64 l1_icache_load_misses = 29;
- optional uint64 l1_icache_prefetches = 30;
- optional uint64 l1_icache_prefetch_misses = 31;
- optional uint64 llc_loads = 32;
- optional uint64 llc_load_misses = 33;
- optional uint64 llc_stores = 34;
- optional uint64 llc_store_misses = 35;
- optional uint64 llc_prefetches = 36;
- optional uint64 llc_prefetch_misses = 37;
- optional uint64 dtlb_loads = 38;
- optional uint64 dtlb_load_misses = 39;
- optional uint64 dtlb_stores = 40;
- optional uint64 dtlb_store_misses = 41;
- optional uint64 dtlb_prefetches = 42;
- optional uint64 dtlb_prefetch_misses = 43;
- optional uint64 itlb_loads = 44;
- optional uint64 itlb_load_misses = 45;
- optional uint64 branch_loads = 46;
- optional uint64 branch_load_misses = 47;
- optional uint64 node_loads = 48;
- optional uint64 node_load_misses = 49;
- optional uint64 node_stores = 50;
- optional uint64 node_store_misses = 51;
- optional uint64 node_prefetches = 52;
- optional uint64 node_prefetch_misses = 53;
-}
-
-
-/**
- * Describes a request for resources that can be used by a framework
- * to proactively influence the allocator. If 'agent_id' is provided
- * then this request is assumed to only apply to resources on that
- * agent.
- */
-message Request {
- optional AgentID agent_id = 1;
- repeated Resource resources = 2;
-}
-
-
-/**
- * Describes some resources available on an agent. An offer only
- * contains resources from a single agent.
- */
-message Offer {
- required OfferID id = 1;
- required FrameworkID framework_id = 2;
- required AgentID agent_id = 3;
- required string hostname = 4;
-
- // URL for reaching the agent running on the host.
- optional URL url = 8;
-
- // The domain of the agent.
- optional DomainInfo domain = 11;
-
- repeated Resource resources = 5;
- repeated Attribute attributes = 7;
- repeated ExecutorID executor_ids = 6;
-
- // Signifies that the resources in this Offer may be unavailable during
- // the given interval. Any tasks launched using these resources may be
- // killed when the interval arrives. For example, these resources may be
- // part of a planned maintenance schedule.
- //
- // This field only provides information about a planned unavailability.
- // The unavailability interval may not necessarily start at exactly this
- // interval, nor last for exactly the duration of this interval.
- // The unavailability may also be forever! See comments in
- // `Unavailability` for more details.
- optional Unavailability unavailability = 9;
-
- // An offer represents resources allocated to *one* of the
- // roles managed by the scheduler. (Therefore, each
- // `Offer.resources[i].allocation_info` will match the
- // top level `Offer.allocation_info`).
- optional Resource.AllocationInfo allocation_info = 10;
-
- // Defines an operation that can be performed against offers.
- message Operation {
- enum Type {
- UNKNOWN = 0;
- LAUNCH = 1;
- LAUNCH_GROUP = 6;
- RESERVE = 2;
- UNRESERVE = 3;
- CREATE = 4;
- DESTROY = 5;
- }
-
- // TODO(vinod): Deprecate this in favor of `LaunchGroup` below.
- message Launch {
- repeated TaskInfo task_infos = 1;
- }
-
- // Unlike `Launch` above, all the tasks in a `task_group` are
- // atomically delivered to an executor.
- //
- // `NetworkInfo` set on executor will be shared by all tasks in
- // the task group.
- //
- // TODO(vinod): Any volumes set on executor could be used by a
- // task by explicitly setting `Volume.source` in its resources.
- message LaunchGroup {
- required ExecutorInfo executor = 1;
- required TaskGroupInfo task_group = 2;
- }
-
- message Reserve {
- repeated Resource resources = 1;
- }
-
- message Unreserve {
- repeated Resource resources = 1;
- }
-
- message Create {
- repeated Resource volumes = 1;
- }
-
- message Destroy {
- repeated Resource volumes = 1;
- }
-
- optional Type type = 1;
- optional Launch launch = 2;
- optional LaunchGroup launch_group = 7;
- optional Reserve reserve = 3;
- optional Unreserve unreserve = 4;
- optional Create create = 5;
- optional Destroy destroy = 6;
- }
-}
-
-
-/**
- * A request to return some resources occupied by a framework.
- */
-message InverseOffer {
- // This is the same OfferID as found in normal offers, which allows
- // re-use of some of the OfferID-only messages.
- required OfferID id = 1;
-
- // URL for reaching the agent running on the host. This enables some
- // optimizations as described in MESOS-3012, such as allowing the
- // scheduler driver to bypass the master and talk directly with an agent.
- optional URL url = 2;
-
- // The framework that should release its resources.
- // If no specifics are provided (i.e. which agent), all the framework's
- // resources are requested back.
- required FrameworkID framework_id = 3;
-
- // Specified if the resources need to be released from a particular agent.
- // All the framework's resources on this agent are requested back,
- // unless further qualified by the `resources` field.
- optional AgentID agent_id = 4;
-
- // This InverseOffer represents a planned unavailability event in the
- // specified interval. Any tasks running on the given framework or agent
- // may be killed when the interval arrives. Therefore, frameworks should
- // aim to gracefully terminate tasks prior to the arrival of the interval.
- //
- // For reserved resources, the resources are expected to be returned to the
- // framework after the unavailability interval. This is an expectation,
- // not a guarantee. For example, if the unavailability duration is not set,
- // the resources may be removed permanently.
- //
- // For other resources, there is no guarantee that requested resources will
- // be returned after the unavailability interval. The allocator has no
- // obligation to re-offer these resources to the prior framework after
- // the unavailability.
- required Unavailability unavailability = 5;
-
- // A list of resources being requested back from the framework,
- // on the agent identified by `agent_id`. If no resources are specified
- // then all resources are being requested back. For the purpose of
- // maintenance, this field is always empty (maintenance always requests
- // all resources back).
- repeated Resource resources = 6;
-
- // TODO(josephw): Add additional options for narrowing down the resources
- // being requested back. Such as specific executors, tasks, etc.
-}
-
-
-/**
- * Describes a task. Passed from the scheduler all the way to an
- * executor (see SchedulerDriver::launchTasks and
- * Executor::launchTask). Either ExecutorInfo or CommandInfo should be set.
- * A different executor can be used to launch this task, and subsequent tasks
- * meant for the same executor can reuse the same ExecutorInfo struct.
- */
-message TaskInfo {
- required string name = 1;
- required TaskID task_id = 2;
- required AgentID agent_id = 3;
- repeated Resource resources = 4;
- optional ExecutorInfo executor = 5;
- optional CommandInfo command = 7;
-
- // Task provided with a container will launch the container as part
- // of this task paired with the task's CommandInfo.
- optional ContainerInfo container = 9;
-
- // A health check for the task. Implemented for executor-less
- // command-based tasks. For tasks that specify an executor, it is
- // the executor's responsibility to implement the health checking.
- optional HealthCheck health_check = 8;
-
- // A general check for the task. Implemented for all built-in executors.
- // For tasks that specify an executor, it is the executor's responsibility
- // to implement checking support. Executors should (all built-in executors
- // will) neither interpret nor act on the check's result.
- //
- // NOTE: Check support in built-in executors is experimental.
- //
- // TODO(alexr): Consider supporting multiple checks per task.
- optional CheckInfo check = 13;
-
- // A kill policy for the task. Implemented for executor-less
- // command-based and docker tasks. For tasks that specify an
- // executor, it is the executor's responsibility to implement
- // the kill policy.
- optional KillPolicy kill_policy = 12;
-
- optional bytes data = 6;
-
- // Labels are free-form key value pairs which are exposed through
- // master and agent endpoints. Labels will not be interpreted or
- // acted upon by Mesos itself. As opposed to the data field, labels
- // will be kept in memory on master and agent processes. Therefore,
- // labels should be used to tag tasks with light-weight meta-data.
- // Labels should not contain duplicate key-value pairs.
- optional Labels labels = 10;
-
- // Service discovery information for the task. It is not interpreted
- // or acted upon by Mesos. It is up to a service discovery system
- // to use this information as needed and to handle tasks without
- // service discovery information.
- optional DiscoveryInfo discovery = 11;
-}
-
-
-/**
- * Describes a group of tasks that belong to an executor. The
- * executor will receive the task group in a single message to
- * allow the group to be launched "atomically".
- *
- * NOTES:
- * 1) `NetworkInfo` must not be set inside task's `ContainerInfo`.
- * 2) `TaskInfo.executor` doesn't need to set. If set, it should match
- * `LaunchGroup.executor`.
- */
-message TaskGroupInfo {
- repeated TaskInfo tasks = 1;
-}
-
-
-// TODO(bmahler): Add executor_uuid here, and send it to the master. This will
-// allow us to expose executor work directories for tasks in the webui when
-// looking from the master level. Currently only the agent knows which run the
-// task belongs to.
-/**
- * Describes a task, similar to `TaskInfo`.
- *
- * `Task` is used in some of the Mesos messages found below.
- * `Task` is used instead of `TaskInfo` if:
- * 1) we need additional IDs, such as a specific
- * framework, executor, or agent; or
- * 2) we do not need the additional data, such as the command run by the
- * task or the health checks. These additional fields may be large and
- * unnecessary for some Mesos messages.
- *
- * `Task` is generally constructed from a `TaskInfo`. See protobuf::createTask.
- */
-message Task {
- required string name = 1;
- required TaskID task_id = 2;
- required FrameworkID framework_id = 3;
- optional ExecutorID executor_id = 4;
- required AgentID agent_id = 5;
- required TaskState state = 6; // Latest state of the task.
- repeated Resource resources = 7;
- repeated TaskStatus statuses = 8;
-
- // These fields correspond to the state and uuid of the latest
- // status update forwarded to the master.
- // NOTE: Either both the fields must be set or both must be unset.
- optional TaskState status_update_state = 9;
- optional bytes status_update_uuid = 10;
-
- optional Labels labels = 11;
-
- // Service discovery information for the task. It is not interpreted
- // or acted upon by Mesos. It is up to a service discovery system
- // to use this information as needed and to handle tasks without
- // service discovery information.
- optional DiscoveryInfo discovery = 12;
-
- // Container information for the task.
- optional ContainerInfo container = 13;
-
- // Specific user under which task is running.
- optional string user = 14;
-}
-
-
-/**
- * Describes possible task states. IMPORTANT: Mesos assumes tasks that
- * enter terminal states (see below) imply the task is no longer
- * running and thus clean up any thing associated with the task
- * (ultimately offering any resources being consumed by that task to
- * another task).
- */
-enum TaskState {
- TASK_STAGING = 6; // Initial state. Framework status updates should not use.
- TASK_STARTING = 0; // The task is being launched by the executor.
- TASK_RUNNING = 1;
-
- // NOTE: This should only be sent when the framework has
- // the TASK_KILLING_STATE capability.
- TASK_KILLING = 8; // The task is being killed by the executor.
-
- TASK_FINISHED = 2; // TERMINAL: The task finished successfully.
- TASK_FAILED = 3; // TERMINAL: The task failed to finish successfully.
- TASK_KILLED = 4; // TERMINAL: The task was killed by the executor.
- TASK_ERROR = 7; // TERMINAL: The task description contains an error.
-
- // In Mesos 1.3, this will only be sent when the framework does NOT
- // opt-in to the PARTITION_AWARE capability.
- //
- // NOTE: This state is not always terminal. For example, tasks might
- // transition from TASK_LOST to TASK_RUNNING or other states when a
- // partitioned agent re-registers.
- TASK_LOST = 5; // The task failed but can be rescheduled.
-
- // The following task states are only sent when the framework
- // opts-in to the PARTITION_AWARE capability.
-
- // The task failed to launch because of a transient error. The
- // task's executor never started running. Unlike TASK_ERROR, the
- // task description is valid -- attempting to launch the task again
- // may be successful.
- TASK_DROPPED = 9; // TERMINAL.
-
- // The task was running on an agent that has lost contact with the
- // master, typically due to a network failure or partition. The task
- // may or may not still be running.
- TASK_UNREACHABLE = 10;
-
- // The task is no longer running. This can occur if the agent has
- // been terminated along with all of its tasks (e.g., the host that
- // was running the agent was rebooted). It might also occur if the
- // task was terminated due to an agent or containerizer error, or if
- // the task was preempted by the QoS controller in an
- // oversubscription scenario.
- TASK_GONE = 11; // TERMINAL.
-
- // The task was running on an agent that the master cannot contact;
- // the operator has asserted that the agent has been shutdown, but
- // this has not been directly confirmed by the master. If the
- // operator is correct, the task is not running and this is a
- // terminal state; if the operator is mistaken, the task may still
- // be running and might return to RUNNING in the future.
- TASK_GONE_BY_OPERATOR = 12;
-
- // The master has no knowledge of the task. This is typically
- // because either (a) the master never had knowledge of the task, or
- // (b) the master forgot about the task because it garbage collected
- // its metadata about the task. The task may or may not still be
- // running.
- TASK_UNKNOWN = 13;
-}
-
-
-/**
-* Describes the status of a check. Type and the corresponding field, i.e.,
-* `command` or `http` must be set. If the result of the check is not available
-* (e.g., the check timed out), these fields must contain empty messages, i.e.,
-* `exit_code` or `status_code` will be unset.
-*
-* NOTE: This API is unstable and the related feature is experimental.
-*/
-message CheckStatusInfo {
- message Command {
- // Exit code of a command check. It is the result of calling
- // `WEXITSTATUS()` on `waitpid()` termination information on
- // Posix and calling `GetExitCodeProcess()` on Windows.
- optional int32 exit_code = 1;
- }
-
- message Http {
- // HTTP status code of an HTTP check.
- optional uint32 status_code = 1;
- }
-
- message Tcp {
- // Whether a TCP connection succeeded.
- optional bool succeeded = 1;
- }
-
- // TODO(alexr): Consider adding a `data` field, which can contain, e.g.,
- // truncated stdout/stderr output for command checks or HTTP response body
- // for HTTP checks. Alternatively, it can be an even shorter `message` field
- // containing the last line of stdout or Reason-Phrase of the status line of
- // the HTTP response.
-
- // The type of the check this status corresponds to.
- optional CheckInfo.Type type = 1;
-
- // Status of a command check.
- optional Command command = 2;
-
- // Status of an HTTP check.
- optional Http http = 3;
-
- // Status of a TCP check.
- optional Tcp tcp = 4;
-
- // TODO(alexr): Consider introducing a "last changed at" timestamp, since
- // task status update's timestamp may not correspond to the last check's
- // state, e.g., for reconciliation.
-
- // TODO(alexr): Consider introducing a `reason` enum here to explicitly
- // distinguish between completed, delayed, and timed out checks.
-}
-
-
-/**
- * Describes the current status of a task.
- */
-message TaskStatus {
- // Describes the source of the task status update.
- enum Source {
- SOURCE_MASTER = 0;
- SOURCE_AGENT = 1;
- SOURCE_EXECUTOR = 2;
- }
-
- // Detailed reason for the task status update.
- //
- // TODO(bmahler): Differentiate between agent removal reasons
- // (e.g. unhealthy vs. unregistered for maintenance).
- enum Reason {
- // TODO(jieyu): The default value when a caller doesn't check for
- // presence is 0 and so ideally the 0 reason is not a valid one.
- // Since this is not used anywhere, consider removing this reason.
- REASON_COMMAND_EXECUTOR_FAILED = 0;
-
- REASON_CONTAINER_LAUNCH_FAILED = 21;
- REASON_CONTAINER_LIMITATION = 19;
- REASON_CONTAINER_LIMITATION_DISK = 20;
- REASON_CONTAINER_LIMITATION_MEMORY = 8;
- REASON_CONTAINER_PREEMPTED = 17;
- REASON_CONTAINER_UPDATE_FAILED = 22;
- REASON_EXECUTOR_REGISTRATION_TIMEOUT = 23;
- REASON_EXECUTOR_REREGISTRATION_TIMEOUT = 24;
- REASON_EXECUTOR_TERMINATED = 1;
- REASON_EXECUTOR_UNREGISTERED = 2; // No longer used.
- REASON_FRAMEWORK_REMOVED = 3;
- REASON_GC_ERROR = 4;
- REASON_INVALID_FRAMEWORKID = 5;
- REASON_INVALID_OFFERS = 6;
- REASON_IO_SWITCHBOARD_EXITED = 27;
- REASON_MASTER_DISCONNECTED = 7;
- REASON_RECONCILIATION = 9;
- REASON_RESOURCES_UNKNOWN = 18;
- REASON_AGENT_DISCONNECTED = 10;
- REASON_AGENT_REMOVED = 11;
- REASON_AGENT_RESTARTED = 12;
- REASON_AGENT_UNKNOWN = 13;
- REASON_TASK_KILLED_DURING_LAUNCH = 30;
- REASON_TASK_CHECK_STATUS_UPDATED = 28;
- REASON_TASK_HEALTH_CHECK_STATUS_UPDATED = 29;
- REASON_TASK_GROUP_INVALID = 25;
- REASON_TASK_GROUP_UNAUTHORIZED = 26;
- REASON_TASK_INVALID = 14;
- REASON_TASK_UNAUTHORIZED = 15;
- REASON_TASK_UNKNOWN = 16;
- }
-
- required TaskID task_id = 1;
- required TaskState state = 2;
- optional string message = 4; // Possible message explaining state.
- optional Source source = 9;
- optional Reason reason = 10;
- optional bytes data = 3;
- optional AgentID agent_id = 5;
- optional ExecutorID executor_id = 7; // TODO(benh): Use in master/agent.
- optional double timestamp = 6;
-
- // Statuses that are delivered reliably to the scheduler will
- // include a 'uuid'. The status is considered delivered once
- // it is acknowledged by the scheduler. Schedulers can choose
- // to either explicitly acknowledge statuses or let the scheduler
- // driver implicitly acknowledge (default).
- //
- // TODO(bmahler): This is currently overwritten in the scheduler
- // driver and executor driver, but executors will need to set this
- // to a valid RFC-4122 UUID if using the HTTP API.
- optional bytes uuid = 11;
-
- // Describes whether the task has been determined to be healthy (true) or
- // unhealthy (false) according to the `health_check` field in `TaskInfo`.
- optional bool healthy = 8;
-
- // Contains check status for the check specified in the corresponding
- // `TaskInfo`. If no check has been specified, this field must be
- // absent, otherwise it must be present even if the check status is
- // not available yet. If the status update is triggered for a different
- // reason than `REASON_TASK_CHECK_STATUS_UPDATED`, this field will contain
- // the last known value.
- //
- // NOTE: A check-related task status update is triggered if and only if
- // the value or presence of any field in `CheckStatusInfo` changes.
- //
- // NOTE: Check support in built-in executors is experimental.
- optional CheckStatusInfo check_status = 15;
-
- // Labels are free-form key value pairs which are exposed through
- // master and agent endpoints. Labels will not be interpreted or
- // acted upon by Mesos itself. As opposed to the data field, labels
- // will be kept in memory on master and agent processes. Therefore,
- // labels should be used to tag TaskStatus message with light-weight
- // meta-data. Labels should not contain duplicate key-value pairs.
- optional Labels labels = 12;
-
- // Container related information that is resolved dynamically such as
- // network address.
- optional ContainerStatus container_status = 13;
-
- // The time (according to the master's clock) when the agent where
- // this task was running became unreachable. This is only set on
- // status updates for tasks running on agents that are unreachable
- // (e.g., partitioned away from the master).
- optional TimeInfo unreachable_time = 14;
-}
-
-
-/**
- * Describes possible filters that can be applied to unused resources
- * (see SchedulerDriver::launchTasks) to influence the allocator.
- */
-message Filters {
- // Time to consider unused resources refused. Note that all unused
- // resources will be considered refused and use the default value
- // (below) regardless of whether Filters was passed to
- // SchedulerDriver::launchTasks. You MUST pass Filters with this
- // field set to change this behavior (i.e., get another offer which
- // includes unused resources sooner or later than the default).
- optional double refuse_seconds = 1 [default = 5.0];
-}
-
-
-/**
-* Describes a collection of environment variables. This is used with
-* CommandInfo in order to set environment variables before running a
-* command. The contents of each variable may be specified as a string
-* or a Secret; only one of `value` and `secret` must be set.
-*/
-message Environment {
- message Variable {
- required string name = 1;
-
- enum Type {
- UNKNOWN = 0;
- VALUE = 1;
- SECRET = 2;
- }
-
- // In Mesos 1.2, the `Environment.variables.value` message was made
- // optional. The default type for `Environment.variables.type` is now VALUE,
- // which requires `value` to be set, maintaining backward compatibility.
- //
- // TODO(greggomann): The default can be removed in Mesos 2.1 (MESOS-7134).
- optional Type type = 3 [default = VALUE];
-
- // Only
<TRUNCATED>
[21/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/src/main/java/org/apache/mesos/v1/agent/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/agent/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/agent/Protos.java
new file mode 100644
index 0000000..ca2ccd2
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/agent/Protos.java
@@ -0,0 +1,31858 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/v1/agent/agent.proto
+
+package org.apache.mesos.v1.agent;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface CallOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.v1.agent.Call.Type type = 1;
+ /**
+ * <code>optional .mesos.v1.agent.Call.Type type = 1;</code>
+ */
+ boolean hasType();
+ /**
+ * <code>optional .mesos.v1.agent.Call.Type type = 1;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.Type getType();
+
+ // optional .mesos.v1.agent.Call.GetMetrics get_metrics = 2;
+ /**
+ * <code>optional .mesos.v1.agent.Call.GetMetrics get_metrics = 2;</code>
+ */
+ boolean hasGetMetrics();
+ /**
+ * <code>optional .mesos.v1.agent.Call.GetMetrics get_metrics = 2;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.GetMetrics getGetMetrics();
+ /**
+ * <code>optional .mesos.v1.agent.Call.GetMetrics get_metrics = 2;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.GetMetricsOrBuilder getGetMetricsOrBuilder();
+
+ // optional .mesos.v1.agent.Call.SetLoggingLevel set_logging_level = 3;
+ /**
+ * <code>optional .mesos.v1.agent.Call.SetLoggingLevel set_logging_level = 3;</code>
+ */
+ boolean hasSetLoggingLevel();
+ /**
+ * <code>optional .mesos.v1.agent.Call.SetLoggingLevel set_logging_level = 3;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel getSetLoggingLevel();
+ /**
+ * <code>optional .mesos.v1.agent.Call.SetLoggingLevel set_logging_level = 3;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevelOrBuilder getSetLoggingLevelOrBuilder();
+
+ // optional .mesos.v1.agent.Call.ListFiles list_files = 4;
+ /**
+ * <code>optional .mesos.v1.agent.Call.ListFiles list_files = 4;</code>
+ */
+ boolean hasListFiles();
+ /**
+ * <code>optional .mesos.v1.agent.Call.ListFiles list_files = 4;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.ListFiles getListFiles();
+ /**
+ * <code>optional .mesos.v1.agent.Call.ListFiles list_files = 4;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.ListFilesOrBuilder getListFilesOrBuilder();
+
+ // optional .mesos.v1.agent.Call.ReadFile read_file = 5;
+ /**
+ * <code>optional .mesos.v1.agent.Call.ReadFile read_file = 5;</code>
+ */
+ boolean hasReadFile();
+ /**
+ * <code>optional .mesos.v1.agent.Call.ReadFile read_file = 5;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.ReadFile getReadFile();
+ /**
+ * <code>optional .mesos.v1.agent.Call.ReadFile read_file = 5;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.ReadFileOrBuilder getReadFileOrBuilder();
+
+ // optional .mesos.v1.agent.Call.LaunchNestedContainer launch_nested_container = 6;
+ /**
+ * <code>optional .mesos.v1.agent.Call.LaunchNestedContainer launch_nested_container = 6;</code>
+ */
+ boolean hasLaunchNestedContainer();
+ /**
+ * <code>optional .mesos.v1.agent.Call.LaunchNestedContainer launch_nested_container = 6;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.LaunchNestedContainer getLaunchNestedContainer();
+ /**
+ * <code>optional .mesos.v1.agent.Call.LaunchNestedContainer launch_nested_container = 6;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.LaunchNestedContainerOrBuilder getLaunchNestedContainerOrBuilder();
+
+ // optional .mesos.v1.agent.Call.WaitNestedContainer wait_nested_container = 7;
+ /**
+ * <code>optional .mesos.v1.agent.Call.WaitNestedContainer wait_nested_container = 7;</code>
+ */
+ boolean hasWaitNestedContainer();
+ /**
+ * <code>optional .mesos.v1.agent.Call.WaitNestedContainer wait_nested_container = 7;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.WaitNestedContainer getWaitNestedContainer();
+ /**
+ * <code>optional .mesos.v1.agent.Call.WaitNestedContainer wait_nested_container = 7;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.WaitNestedContainerOrBuilder getWaitNestedContainerOrBuilder();
+
+ // optional .mesos.v1.agent.Call.KillNestedContainer kill_nested_container = 8;
+ /**
+ * <code>optional .mesos.v1.agent.Call.KillNestedContainer kill_nested_container = 8;</code>
+ */
+ boolean hasKillNestedContainer();
+ /**
+ * <code>optional .mesos.v1.agent.Call.KillNestedContainer kill_nested_container = 8;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.KillNestedContainer getKillNestedContainer();
+ /**
+ * <code>optional .mesos.v1.agent.Call.KillNestedContainer kill_nested_container = 8;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.KillNestedContainerOrBuilder getKillNestedContainerOrBuilder();
+
+ // optional .mesos.v1.agent.Call.RemoveNestedContainer remove_nested_container = 12;
+ /**
+ * <code>optional .mesos.v1.agent.Call.RemoveNestedContainer remove_nested_container = 12;</code>
+ */
+ boolean hasRemoveNestedContainer();
+ /**
+ * <code>optional .mesos.v1.agent.Call.RemoveNestedContainer remove_nested_container = 12;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.RemoveNestedContainer getRemoveNestedContainer();
+ /**
+ * <code>optional .mesos.v1.agent.Call.RemoveNestedContainer remove_nested_container = 12;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.RemoveNestedContainerOrBuilder getRemoveNestedContainerOrBuilder();
+
+ // optional .mesos.v1.agent.Call.LaunchNestedContainerSession launch_nested_container_session = 9;
+ /**
+ * <code>optional .mesos.v1.agent.Call.LaunchNestedContainerSession launch_nested_container_session = 9;</code>
+ */
+ boolean hasLaunchNestedContainerSession();
+ /**
+ * <code>optional .mesos.v1.agent.Call.LaunchNestedContainerSession launch_nested_container_session = 9;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.LaunchNestedContainerSession getLaunchNestedContainerSession();
+ /**
+ * <code>optional .mesos.v1.agent.Call.LaunchNestedContainerSession launch_nested_container_session = 9;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.LaunchNestedContainerSessionOrBuilder getLaunchNestedContainerSessionOrBuilder();
+
+ // optional .mesos.v1.agent.Call.AttachContainerInput attach_container_input = 10;
+ /**
+ * <code>optional .mesos.v1.agent.Call.AttachContainerInput attach_container_input = 10;</code>
+ */
+ boolean hasAttachContainerInput();
+ /**
+ * <code>optional .mesos.v1.agent.Call.AttachContainerInput attach_container_input = 10;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.AttachContainerInput getAttachContainerInput();
+ /**
+ * <code>optional .mesos.v1.agent.Call.AttachContainerInput attach_container_input = 10;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.AttachContainerInputOrBuilder getAttachContainerInputOrBuilder();
+
+ // optional .mesos.v1.agent.Call.AttachContainerOutput attach_container_output = 11;
+ /**
+ * <code>optional .mesos.v1.agent.Call.AttachContainerOutput attach_container_output = 11;</code>
+ */
+ boolean hasAttachContainerOutput();
+ /**
+ * <code>optional .mesos.v1.agent.Call.AttachContainerOutput attach_container_output = 11;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.AttachContainerOutput getAttachContainerOutput();
+ /**
+ * <code>optional .mesos.v1.agent.Call.AttachContainerOutput attach_container_output = 11;</code>
+ */
+ org.apache.mesos.v1.agent.Protos.Call.AttachContainerOutputOrBuilder getAttachContainerOutputOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.agent.Call}
+ *
+ * <pre>
+ **
+ * Calls that can be sent to the v1 agent API.
+ *
+ * A call is described using the standard protocol buffer "union"
+ * trick, see
+ * https://developers.google.com/protocol-buffers/docs/techniques#union.
+ * </pre>
+ */
+ public static final class Call extends
+ com.google.protobuf.GeneratedMessage
+ implements CallOrBuilder {
+ // Use Call.newBuilder() to construct.
+ private Call(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Call(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Call defaultInstance;
+ public static Call getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Call getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Call(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ int rawValue = input.readEnum();
+ org.apache.mesos.v1.agent.Protos.Call.Type value = org.apache.mesos.v1.agent.Protos.Call.Type.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(1, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ type_ = value;
+ }
+ break;
+ }
+ case 18: {
+ org.apache.mesos.v1.agent.Protos.Call.GetMetrics.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = getMetrics_.toBuilder();
+ }
+ getMetrics_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.GetMetrics.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(getMetrics_);
+ getMetrics_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = setLoggingLevel_.toBuilder();
+ }
+ setLoggingLevel_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(setLoggingLevel_);
+ setLoggingLevel_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ org.apache.mesos.v1.agent.Protos.Call.ListFiles.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ subBuilder = listFiles_.toBuilder();
+ }
+ listFiles_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.ListFiles.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(listFiles_);
+ listFiles_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 42: {
+ org.apache.mesos.v1.agent.Protos.Call.ReadFile.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ subBuilder = readFile_.toBuilder();
+ }
+ readFile_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.ReadFile.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(readFile_);
+ readFile_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
+ case 50: {
+ org.apache.mesos.v1.agent.Protos.Call.LaunchNestedContainer.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ subBuilder = launchNestedContainer_.toBuilder();
+ }
+ launchNestedContainer_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.LaunchNestedContainer.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(launchNestedContainer_);
+ launchNestedContainer_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000020;
+ break;
+ }
+ case 58: {
+ org.apache.mesos.v1.agent.Protos.Call.WaitNestedContainer.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
+ subBuilder = waitNestedContainer_.toBuilder();
+ }
+ waitNestedContainer_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.WaitNestedContainer.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(waitNestedContainer_);
+ waitNestedContainer_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000040;
+ break;
+ }
+ case 66: {
+ org.apache.mesos.v1.agent.Protos.Call.KillNestedContainer.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ subBuilder = killNestedContainer_.toBuilder();
+ }
+ killNestedContainer_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.KillNestedContainer.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(killNestedContainer_);
+ killNestedContainer_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000080;
+ break;
+ }
+ case 74: {
+ org.apache.mesos.v1.agent.Protos.Call.LaunchNestedContainerSession.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000200) == 0x00000200)) {
+ subBuilder = launchNestedContainerSession_.toBuilder();
+ }
+ launchNestedContainerSession_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.LaunchNestedContainerSession.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(launchNestedContainerSession_);
+ launchNestedContainerSession_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000200;
+ break;
+ }
+ case 82: {
+ org.apache.mesos.v1.agent.Protos.Call.AttachContainerInput.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000400) == 0x00000400)) {
+ subBuilder = attachContainerInput_.toBuilder();
+ }
+ attachContainerInput_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.AttachContainerInput.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(attachContainerInput_);
+ attachContainerInput_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000400;
+ break;
+ }
+ case 90: {
+ org.apache.mesos.v1.agent.Protos.Call.AttachContainerOutput.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000800) == 0x00000800)) {
+ subBuilder = attachContainerOutput_.toBuilder();
+ }
+ attachContainerOutput_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.AttachContainerOutput.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(attachContainerOutput_);
+ attachContainerOutput_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000800;
+ break;
+ }
+ case 98: {
+ org.apache.mesos.v1.agent.Protos.Call.RemoveNestedContainer.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000100) == 0x00000100)) {
+ subBuilder = removeNestedContainer_.toBuilder();
+ }
+ removeNestedContainer_ = input.readMessage(org.apache.mesos.v1.agent.Protos.Call.RemoveNestedContainer.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(removeNestedContainer_);
+ removeNestedContainer_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000100;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.agent.Protos.Call.class, org.apache.mesos.v1.agent.Protos.Call.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Call> PARSER =
+ new com.google.protobuf.AbstractParser<Call>() {
+ public Call parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Call(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Call> getParserForType() {
+ return PARSER;
+ }
+
+ /**
+ * Protobuf enum {@code mesos.v1.agent.Call.Type}
+ *
+ * <pre>
+ * If a call of type `Call::FOO` requires additional parameters they can be
+ * included in the corresponding `Call::Foo` message. Similarly, if a call
+ * receives a synchronous response it will be returned as a `Response`
+ * message of type `Response::FOO`; see `Call::LaunchNestedContainerSession`
+ * and `Call::AttachContainerOutput` for exceptions.
+ * </pre>
+ */
+ public enum Type
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN = 0;</code>
+ */
+ UNKNOWN(0, 0),
+ /**
+ * <code>GET_HEALTH = 1;</code>
+ *
+ * <pre>
+ * Retrieves the agent's health status.
+ * </pre>
+ */
+ GET_HEALTH(1, 1),
+ /**
+ * <code>GET_FLAGS = 2;</code>
+ *
+ * <pre>
+ * Retrieves the agent's flag configuration.
+ * </pre>
+ */
+ GET_FLAGS(2, 2),
+ /**
+ * <code>GET_VERSION = 3;</code>
+ *
+ * <pre>
+ * Retrieves the agent's version information.
+ * </pre>
+ */
+ GET_VERSION(3, 3),
+ /**
+ * <code>GET_METRICS = 4;</code>
+ *
+ * <pre>
+ * See 'GetMetrics' below.
+ * </pre>
+ */
+ GET_METRICS(4, 4),
+ /**
+ * <code>GET_LOGGING_LEVEL = 5;</code>
+ *
+ * <pre>
+ * Retrieves the agent's logging level.
+ * </pre>
+ */
+ GET_LOGGING_LEVEL(5, 5),
+ /**
+ * <code>SET_LOGGING_LEVEL = 6;</code>
+ *
+ * <pre>
+ * See 'SetLoggingLevel' below.
+ * </pre>
+ */
+ SET_LOGGING_LEVEL(6, 6),
+ /**
+ * <code>LIST_FILES = 7;</code>
+ */
+ LIST_FILES(7, 7),
+ /**
+ * <code>READ_FILE = 8;</code>
+ *
+ * <pre>
+ * See 'ReadFile' below.
+ * </pre>
+ */
+ READ_FILE(8, 8),
+ /**
+ * <code>GET_STATE = 9;</code>
+ */
+ GET_STATE(9, 9),
+ /**
+ * <code>GET_CONTAINERS = 10;</code>
+ */
+ GET_CONTAINERS(10, 10),
+ /**
+ * <code>GET_FRAMEWORKS = 11;</code>
+ *
+ * <pre>
+ * Retrieves the information about known frameworks.
+ * </pre>
+ */
+ GET_FRAMEWORKS(11, 11),
+ /**
+ * <code>GET_EXECUTORS = 12;</code>
+ *
+ * <pre>
+ * Retrieves the information about known executors.
+ * </pre>
+ */
+ GET_EXECUTORS(12, 12),
+ /**
+ * <code>GET_TASKS = 13;</code>
+ *
+ * <pre>
+ * Retrieves the information about known tasks.
+ * </pre>
+ */
+ GET_TASKS(13, 13),
+ /**
+ * <code>GET_AGENT = 20;</code>
+ *
+ * <pre>
+ * Retrieves the agent information.
+ * </pre>
+ */
+ GET_AGENT(14, 20),
+ /**
+ * <code>LAUNCH_NESTED_CONTAINER = 14;</code>
+ *
+ * <pre>
+ * Calls for managing nested containers underneath an executor's container.
+ * </pre>
+ */
+ LAUNCH_NESTED_CONTAINER(15, 14),
+ /**
+ * <code>WAIT_NESTED_CONTAINER = 15;</code>
+ *
+ * <pre>
+ * See 'WaitNestedContainer' below.
+ * </pre>
+ */
+ WAIT_NESTED_CONTAINER(16, 15),
+ /**
+ * <code>KILL_NESTED_CONTAINER = 16;</code>
+ *
+ * <pre>
+ * See 'KillNestedContainer' below.
+ * </pre>
+ */
+ KILL_NESTED_CONTAINER(17, 16),
+ /**
+ * <code>REMOVE_NESTED_CONTAINER = 21;</code>
+ *
+ * <pre>
+ * See 'RemoveNestedContainer' below.
+ * </pre>
+ */
+ REMOVE_NESTED_CONTAINER(18, 21),
+ /**
+ * <code>LAUNCH_NESTED_CONTAINER_SESSION = 17;</code>
+ *
+ * <pre>
+ * See 'LaunchNestedContainerSession' below.
+ * </pre>
+ */
+ LAUNCH_NESTED_CONTAINER_SESSION(19, 17),
+ /**
+ * <code>ATTACH_CONTAINER_INPUT = 18;</code>
+ *
+ * <pre>
+ * See 'AttachContainerInput' below.
+ * </pre>
+ */
+ ATTACH_CONTAINER_INPUT(20, 18),
+ /**
+ * <code>ATTACH_CONTAINER_OUTPUT = 19;</code>
+ *
+ * <pre>
+ * see 'AttachContainerOutput' below.
+ * </pre>
+ */
+ ATTACH_CONTAINER_OUTPUT(21, 19),
+ ;
+
+ /**
+ * <code>UNKNOWN = 0;</code>
+ */
+ public static final int UNKNOWN_VALUE = 0;
+ /**
+ * <code>GET_HEALTH = 1;</code>
+ *
+ * <pre>
+ * Retrieves the agent's health status.
+ * </pre>
+ */
+ public static final int GET_HEALTH_VALUE = 1;
+ /**
+ * <code>GET_FLAGS = 2;</code>
+ *
+ * <pre>
+ * Retrieves the agent's flag configuration.
+ * </pre>
+ */
+ public static final int GET_FLAGS_VALUE = 2;
+ /**
+ * <code>GET_VERSION = 3;</code>
+ *
+ * <pre>
+ * Retrieves the agent's version information.
+ * </pre>
+ */
+ public static final int GET_VERSION_VALUE = 3;
+ /**
+ * <code>GET_METRICS = 4;</code>
+ *
+ * <pre>
+ * See 'GetMetrics' below.
+ * </pre>
+ */
+ public static final int GET_METRICS_VALUE = 4;
+ /**
+ * <code>GET_LOGGING_LEVEL = 5;</code>
+ *
+ * <pre>
+ * Retrieves the agent's logging level.
+ * </pre>
+ */
+ public static final int GET_LOGGING_LEVEL_VALUE = 5;
+ /**
+ * <code>SET_LOGGING_LEVEL = 6;</code>
+ *
+ * <pre>
+ * See 'SetLoggingLevel' below.
+ * </pre>
+ */
+ public static final int SET_LOGGING_LEVEL_VALUE = 6;
+ /**
+ * <code>LIST_FILES = 7;</code>
+ */
+ public static final int LIST_FILES_VALUE = 7;
+ /**
+ * <code>READ_FILE = 8;</code>
+ *
+ * <pre>
+ * See 'ReadFile' below.
+ * </pre>
+ */
+ public static final int READ_FILE_VALUE = 8;
+ /**
+ * <code>GET_STATE = 9;</code>
+ */
+ public static final int GET_STATE_VALUE = 9;
+ /**
+ * <code>GET_CONTAINERS = 10;</code>
+ */
+ public static final int GET_CONTAINERS_VALUE = 10;
+ /**
+ * <code>GET_FRAMEWORKS = 11;</code>
+ *
+ * <pre>
+ * Retrieves the information about known frameworks.
+ * </pre>
+ */
+ public static final int GET_FRAMEWORKS_VALUE = 11;
+ /**
+ * <code>GET_EXECUTORS = 12;</code>
+ *
+ * <pre>
+ * Retrieves the information about known executors.
+ * </pre>
+ */
+ public static final int GET_EXECUTORS_VALUE = 12;
+ /**
+ * <code>GET_TASKS = 13;</code>
+ *
+ * <pre>
+ * Retrieves the information about known tasks.
+ * </pre>
+ */
+ public static final int GET_TASKS_VALUE = 13;
+ /**
+ * <code>GET_AGENT = 20;</code>
+ *
+ * <pre>
+ * Retrieves the agent information.
+ * </pre>
+ */
+ public static final int GET_AGENT_VALUE = 20;
+ /**
+ * <code>LAUNCH_NESTED_CONTAINER = 14;</code>
+ *
+ * <pre>
+ * Calls for managing nested containers underneath an executor's container.
+ * </pre>
+ */
+ public static final int LAUNCH_NESTED_CONTAINER_VALUE = 14;
+ /**
+ * <code>WAIT_NESTED_CONTAINER = 15;</code>
+ *
+ * <pre>
+ * See 'WaitNestedContainer' below.
+ * </pre>
+ */
+ public static final int WAIT_NESTED_CONTAINER_VALUE = 15;
+ /**
+ * <code>KILL_NESTED_CONTAINER = 16;</code>
+ *
+ * <pre>
+ * See 'KillNestedContainer' below.
+ * </pre>
+ */
+ public static final int KILL_NESTED_CONTAINER_VALUE = 16;
+ /**
+ * <code>REMOVE_NESTED_CONTAINER = 21;</code>
+ *
+ * <pre>
+ * See 'RemoveNestedContainer' below.
+ * </pre>
+ */
+ public static final int REMOVE_NESTED_CONTAINER_VALUE = 21;
+ /**
+ * <code>LAUNCH_NESTED_CONTAINER_SESSION = 17;</code>
+ *
+ * <pre>
+ * See 'LaunchNestedContainerSession' below.
+ * </pre>
+ */
+ public static final int LAUNCH_NESTED_CONTAINER_SESSION_VALUE = 17;
+ /**
+ * <code>ATTACH_CONTAINER_INPUT = 18;</code>
+ *
+ * <pre>
+ * See 'AttachContainerInput' below.
+ * </pre>
+ */
+ public static final int ATTACH_CONTAINER_INPUT_VALUE = 18;
+ /**
+ * <code>ATTACH_CONTAINER_OUTPUT = 19;</code>
+ *
+ * <pre>
+ * see 'AttachContainerOutput' below.
+ * </pre>
+ */
+ public static final int ATTACH_CONTAINER_OUTPUT_VALUE = 19;
+
+
+ public final int getNumber() { return value; }
+
+ public static Type valueOf(int value) {
+ switch (value) {
+ case 0: return UNKNOWN;
+ case 1: return GET_HEALTH;
+ case 2: return GET_FLAGS;
+ case 3: return GET_VERSION;
+ case 4: return GET_METRICS;
+ case 5: return GET_LOGGING_LEVEL;
+ case 6: return SET_LOGGING_LEVEL;
+ case 7: return LIST_FILES;
+ case 8: return READ_FILE;
+ case 9: return GET_STATE;
+ case 10: return GET_CONTAINERS;
+ case 11: return GET_FRAMEWORKS;
+ case 12: return GET_EXECUTORS;
+ case 13: return GET_TASKS;
+ case 20: return GET_AGENT;
+ case 14: return LAUNCH_NESTED_CONTAINER;
+ case 15: return WAIT_NESTED_CONTAINER;
+ case 16: return KILL_NESTED_CONTAINER;
+ case 21: return REMOVE_NESTED_CONTAINER;
+ case 17: return LAUNCH_NESTED_CONTAINER_SESSION;
+ case 18: return ATTACH_CONTAINER_INPUT;
+ case 19: return ATTACH_CONTAINER_OUTPUT;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Type>() {
+ public Type findValueByNumber(int number) {
+ return Type.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.agent.Protos.Call.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Type[] VALUES = values();
+
+ public static Type valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private Type(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.v1.agent.Call.Type)
+ }
+
+ public interface GetMetricsOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.v1.DurationInfo timeout = 1;
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ boolean hasTimeout();
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.DurationInfo getTimeout();
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.DurationInfoOrBuilder getTimeoutOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.agent.Call.GetMetrics}
+ *
+ * <pre>
+ * Provides a snapshot of the current metrics tracked by the agent.
+ * </pre>
+ */
+ public static final class GetMetrics extends
+ com.google.protobuf.GeneratedMessage
+ implements GetMetricsOrBuilder {
+ // Use GetMetrics.newBuilder() to construct.
+ private GetMetrics(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private GetMetrics(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final GetMetrics defaultInstance;
+ public static GetMetrics getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public GetMetrics getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private GetMetrics(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.v1.Protos.DurationInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = timeout_.toBuilder();
+ }
+ timeout_ = input.readMessage(org.apache.mesos.v1.Protos.DurationInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(timeout_);
+ timeout_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_GetMetrics_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_GetMetrics_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.agent.Protos.Call.GetMetrics.class, org.apache.mesos.v1.agent.Protos.Call.GetMetrics.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<GetMetrics> PARSER =
+ new com.google.protobuf.AbstractParser<GetMetrics>() {
+ public GetMetrics parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new GetMetrics(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<GetMetrics> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // optional .mesos.v1.DurationInfo timeout = 1;
+ public static final int TIMEOUT_FIELD_NUMBER = 1;
+ private org.apache.mesos.v1.Protos.DurationInfo timeout_;
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public boolean hasTimeout() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo getTimeout() {
+ return timeout_;
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfoOrBuilder getTimeoutOrBuilder() {
+ return timeout_;
+ }
+
+ private void initFields() {
+ timeout_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (hasTimeout()) {
+ if (!getTimeout().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, timeout_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, timeout_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.agent.Protos.Call.GetMetrics parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.GetMetrics parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.GetMetrics parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.GetMetrics parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.GetMetrics parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.GetMetrics parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.GetMetrics parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.GetMetrics parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.GetMetrics parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.GetMetrics parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.agent.Protos.Call.GetMetrics prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.agent.Call.GetMetrics}
+ *
+ * <pre>
+ * Provides a snapshot of the current metrics tracked by the agent.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.agent.Protos.Call.GetMetricsOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_GetMetrics_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_GetMetrics_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.agent.Protos.Call.GetMetrics.class, org.apache.mesos.v1.agent.Protos.Call.GetMetrics.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.agent.Protos.Call.GetMetrics.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getTimeoutFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (timeoutBuilder_ == null) {
+ timeout_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ } else {
+ timeoutBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_GetMetrics_descriptor;
+ }
+
+ public org.apache.mesos.v1.agent.Protos.Call.GetMetrics getDefaultInstanceForType() {
+ return org.apache.mesos.v1.agent.Protos.Call.GetMetrics.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.agent.Protos.Call.GetMetrics build() {
+ org.apache.mesos.v1.agent.Protos.Call.GetMetrics result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.agent.Protos.Call.GetMetrics buildPartial() {
+ org.apache.mesos.v1.agent.Protos.Call.GetMetrics result = new org.apache.mesos.v1.agent.Protos.Call.GetMetrics(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (timeoutBuilder_ == null) {
+ result.timeout_ = timeout_;
+ } else {
+ result.timeout_ = timeoutBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.agent.Protos.Call.GetMetrics) {
+ return mergeFrom((org.apache.mesos.v1.agent.Protos.Call.GetMetrics)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.agent.Protos.Call.GetMetrics other) {
+ if (other == org.apache.mesos.v1.agent.Protos.Call.GetMetrics.getDefaultInstance()) return this;
+ if (other.hasTimeout()) {
+ mergeTimeout(other.getTimeout());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (hasTimeout()) {
+ if (!getTimeout().isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.agent.Protos.Call.GetMetrics parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.agent.Protos.Call.GetMetrics) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // optional .mesos.v1.DurationInfo timeout = 1;
+ private org.apache.mesos.v1.Protos.DurationInfo timeout_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.DurationInfo, org.apache.mesos.v1.Protos.DurationInfo.Builder, org.apache.mesos.v1.Protos.DurationInfoOrBuilder> timeoutBuilder_;
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public boolean hasTimeout() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo getTimeout() {
+ if (timeoutBuilder_ == null) {
+ return timeout_;
+ } else {
+ return timeoutBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public Builder setTimeout(org.apache.mesos.v1.Protos.DurationInfo value) {
+ if (timeoutBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ timeout_ = value;
+ onChanged();
+ } else {
+ timeoutBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public Builder setTimeout(
+ org.apache.mesos.v1.Protos.DurationInfo.Builder builderForValue) {
+ if (timeoutBuilder_ == null) {
+ timeout_ = builderForValue.build();
+ onChanged();
+ } else {
+ timeoutBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public Builder mergeTimeout(org.apache.mesos.v1.Protos.DurationInfo value) {
+ if (timeoutBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ timeout_ != org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance()) {
+ timeout_ =
+ org.apache.mesos.v1.Protos.DurationInfo.newBuilder(timeout_).mergeFrom(value).buildPartial();
+ } else {
+ timeout_ = value;
+ }
+ onChanged();
+ } else {
+ timeoutBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public Builder clearTimeout() {
+ if (timeoutBuilder_ == null) {
+ timeout_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ timeoutBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo.Builder getTimeoutBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getTimeoutFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfoOrBuilder getTimeoutOrBuilder() {
+ if (timeoutBuilder_ != null) {
+ return timeoutBuilder_.getMessageOrBuilder();
+ } else {
+ return timeout_;
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.DurationInfo, org.apache.mesos.v1.Protos.DurationInfo.Builder, org.apache.mesos.v1.Protos.DurationInfoOrBuilder>
+ getTimeoutFieldBuilder() {
+ if (timeoutBuilder_ == null) {
+ timeoutBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.DurationInfo, org.apache.mesos.v1.Protos.DurationInfo.Builder, org.apache.mesos.v1.Protos.DurationInfoOrBuilder>(
+ timeout_,
+ getParentForChildren(),
+ isClean());
+ timeout_ = null;
+ }
+ return timeoutBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.agent.Call.GetMetrics)
+ }
+
+ static {
+ defaultInstance = new GetMetrics(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.agent.Call.GetMetrics)
+ }
+
+ public interface SetLoggingLevelOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required uint32 level = 1;
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ boolean hasLevel();
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ int getLevel();
+
+ // required .mesos.v1.DurationInfo duration = 2;
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ boolean hasDuration();
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.DurationInfo getDuration();
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.DurationInfoOrBuilder getDurationOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.agent.Call.SetLoggingLevel}
+ *
+ * <pre>
+ * Sets the logging verbosity level for a specified duration. Mesos uses
+ * [glog](https://github.com/google/glog) for logging. The library only uses
+ * verbose logging which means nothing will be output unless the verbosity
+ * level is set (by default it's 0, libprocess uses levels 1, 2, and 3).
+ * </pre>
+ */
+ public static final class SetLoggingLevel extends
+ com.google.protobuf.GeneratedMessage
+ implements SetLoggingLevelOrBuilder {
+ // Use SetLoggingLevel.newBuilder() to construct.
+ private SetLoggingLevel(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private SetLoggingLevel(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final SetLoggingLevel defaultInstance;
+ public static SetLoggingLevel getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public SetLoggingLevel getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private SetLoggingLevel(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ bitField0_ |= 0x00000001;
+ level_ = input.readUInt32();
+ break;
+ }
+ case 18: {
+ org.apache.mesos.v1.Protos.DurationInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = duration_.toBuilder();
+ }
+ duration_ = input.readMessage(org.apache.mesos.v1.Protos.DurationInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(duration_);
+ duration_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_SetLoggingLevel_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_SetLoggingLevel_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel.class, org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<SetLoggingLevel> PARSER =
+ new com.google.protobuf.AbstractParser<SetLoggingLevel>() {
+ public SetLoggingLevel parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new SetLoggingLevel(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<SetLoggingLevel> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required uint32 level = 1;
+ public static final int LEVEL_FIELD_NUMBER = 1;
+ private int level_;
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public boolean hasLevel() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public int getLevel() {
+ return level_;
+ }
+
+ // required .mesos.v1.DurationInfo duration = 2;
+ public static final int DURATION_FIELD_NUMBER = 2;
+ private org.apache.mesos.v1.Protos.DurationInfo duration_;
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public boolean hasDuration() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo getDuration() {
+ return duration_;
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfoOrBuilder getDurationOrBuilder() {
+ return duration_;
+ }
+
+ private void initFields() {
+ level_ = 0;
+ duration_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasLevel()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasDuration()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getDuration().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeUInt32(1, level_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeMessage(2, duration_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(1, level_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, duration_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.agent.Call.SetLoggingLevel}
+ *
+ * <pre>
+ * Sets the logging verbosity level for a specified duration. Mesos uses
+ * [glog](https://github.com/google/glog) for logging. The library only uses
+ * verbose logging which means nothing will be output unless the verbosity
+ * level is set (by default it's 0, libprocess uses levels 1, 2, and 3).
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevelOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_SetLoggingLevel_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_SetLoggingLevel_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel.class, org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getDurationFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ level_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (durationBuilder_ == null) {
+ duration_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ } else {
+ durationBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_SetLoggingLevel_descriptor;
+ }
+
+ public org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel getDefaultInstanceForType() {
+ return org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel build() {
+ org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel buildPartial() {
+ org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel result = new org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.level_ = level_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ if (durationBuilder_ == null) {
+ result.duration_ = duration_;
+ } else {
+ result.duration_ = durationBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel) {
+ return mergeFrom((org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel other) {
+ if (other == org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel.getDefaultInstance()) return this;
+ if (other.hasLevel()) {
+ setLevel(other.getLevel());
+ }
+ if (other.hasDuration()) {
+ mergeDuration(other.getDuration());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasLevel()) {
+
+ return false;
+ }
+ if (!hasDuration()) {
+
+ return false;
+ }
+ if (!getDuration().isInitialized()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.agent.Protos.Call.SetLoggingLevel) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required uint32 level = 1;
+ private int level_ ;
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public boolean hasLevel() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public int getLevel() {
+ return level_;
+ }
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public Builder setLevel(int value) {
+ bitField0_ |= 0x00000001;
+ level_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public Builder clearLevel() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ level_ = 0;
+ onChanged();
+ return this;
+ }
+
+ // required .mesos.v1.DurationInfo duration = 2;
+ private org.apache.mesos.v1.Protos.DurationInfo duration_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.DurationInfo, org.apache.mesos.v1.Protos.DurationInfo.Builder, org.apache.mesos.v1.Protos.DurationInfoOrBuilder> durationBuilder_;
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public boolean hasDuration() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo getDuration() {
+ if (durationBuilder_ == null) {
+ return duration_;
+ } else {
+ return durationBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public Builder setDuration(org.apache.mesos.v1.Protos.DurationInfo value) {
+ if (durationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ duration_ = value;
+ onChanged();
+ } else {
+ durationBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public Builder setDuration(
+ org.apache.mesos.v1.Protos.DurationInfo.Builder builderForValue) {
+ if (durationBuilder_ == null) {
+ duration_ = builderForValue.build();
+ onChanged();
+ } else {
+ durationBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public Builder mergeDuration(org.apache.mesos.v1.Protos.DurationInfo value) {
+ if (durationBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002) &&
+ duration_ != org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance()) {
+ duration_ =
+ org.apache.mesos.v1.Protos.DurationInfo.newBuilder(duration_).mergeFrom(value).buildPartial();
+ } else {
+ duration_ = value;
+ }
+ onChanged();
+ } else {
+ durationBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public Builder clearDuration() {
+ if (durationBuilder_ == null) {
+ duration_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ durationBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo.Builder getDurationBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getDurationFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfoOrBuilder getDurationOrBuilder() {
+ if (durationBuilder_ != null) {
+ return durationBuilder_.getMessageOrBuilder();
+ } else {
+ return duration_;
+ }
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.DurationInfo, org.apache.mesos.v1.Protos.DurationInfo.Builder, org.apache.mesos.v1.Protos.DurationInfoOrBuilder>
+ getDurationFieldBuilder() {
+ if (durationBuilder_ == null) {
+ durationBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.DurationInfo, org.apache.mesos.v1.Protos.DurationInfo.Builder, org.apache.mesos.v1.Protos.DurationInfoOrBuilder>(
+ duration_,
+ getParentForChildren(),
+ isClean());
+ duration_ = null;
+ }
+ return durationBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.agent.Call.SetLoggingLevel)
+ }
+
+ static {
+ defaultInstance = new SetLoggingLevel(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.agent.Call.SetLoggingLevel)
+ }
+
+ public interface ListFilesOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string path = 1;
+ /**
+ * <code>required string path = 1;</code>
+ */
+ boolean hasPath();
+ /**
+ * <code>required string path = 1;</code>
+ */
+ java.lang.String getPath();
+ /**
+ * <code>required string path = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getPathBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.agent.Call.ListFiles}
+ *
+ * <pre>
+ * Provides the file listing for a directory.
+ * </pre>
+ */
+ public static final class ListFiles extends
+ com.google.protobuf.GeneratedMessage
+ implements ListFilesOrBuilder {
+ // Use ListFiles.newBuilder() to construct.
+ private ListFiles(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private ListFiles(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final ListFiles defaultInstance;
+ public static ListFiles getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public ListFiles getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private ListFiles(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ path_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_ListFiles_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.agent.Protos.internal_static_mesos_v1_agent_Call_ListFiles_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.agent.Protos.Call.ListFiles.class, org.apache.mesos.v1.agent.Protos.Call.ListFiles.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<ListFiles> PARSER =
+ new com.google.protobuf.AbstractParser<ListFiles>() {
+ public ListFiles parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new ListFiles(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<ListFiles> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string path = 1;
+ public static final int PATH_FIELD_NUMBER = 1;
+ private java.lang.Object path_;
+ /**
+ * <code>required string path = 1;</code>
+ */
+ public boolean hasPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string path = 1;</code>
+ */
+ public java.lang.String getPath() {
+ java.lang.Object ref = path_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toSt
<TRUNCATED>
[15/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
Upgrade mesos driver to Mesos 1.5 with protobuf 2.5
Project: http://git-wip-us.apache.org/repos/asf/incubator-myriad/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-myriad/commit/b5b468b9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-myriad/tree/b5b468b9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-myriad/diff/b5b468b9
Branch: refs/heads/upgrademesos1.5
Commit: b5b468b96f3cab34e8f8b87d87e22f31130ec72b
Parents: 6af9d37
Author: jpgilaberte <jp...@stratio.com>
Authored: Thu Sep 6 15:42:31 2018 +0200
Committer: jpgilaberte <jp...@stratio.com>
Committed: Thu Sep 6 15:42:31 2018 +0200
----------------------------------------------------------------------
build.gradle | 6 +-
gradle/quality.gradle | 16 +
myriad-commons/build.gradle | 22 +
myriad-commons/proto/mesos/executor.proto | 212 +
myriad-commons/proto/mesos/mesos.proto | 3190 +
myriad-commons/proto/mesos/scheduler.proto | 433 +
myriad-commons/proto/mesos/v1/executor.proto | 214 +
myriad-commons/proto/mesos/v1/mesos.proto | 3173 +
myriad-commons/proto/mesos/v1/scheduler.proto | 420 +
.../main/java/org/apache/mesos/Executor.java | 149 +
.../java/org/apache/mesos/ExecutorDriver.java | 112 +
.../src/main/java/org/apache/mesos/Log.java | 468 +
.../org/apache/mesos/MesosExecutorDriver.java | 97 +
.../org/apache/mesos/MesosNativeLibrary.java | 245 +
.../org/apache/mesos/MesosSchedulerDriver.java | 307 +
.../src/main/java/org/apache/mesos/Protos.java | 162923 ++++++++++++++++
.../main/java/org/apache/mesos/Scheduler.java | 211 +
.../java/org/apache/mesos/SchedulerDriver.java | 323 +
.../java/org/apache/mesos/executor/Protos.java | 10759 +
.../java/org/apache/mesos/scheduler/Protos.java | 24780 +++
.../org/apache/mesos/state/AbstractState.java | 403 +
.../org/apache/mesos/state/InMemoryState.java | 143 +
.../org/apache/mesos/state/LevelDBState.java | 36 +
.../java/org/apache/mesos/state/LogState.java | 79 +
.../main/java/org/apache/mesos/state/State.java | 95 +
.../java/org/apache/mesos/state/Variable.java | 48 +
.../org/apache/mesos/state/ZooKeeperState.java | 75 +
.../main/java/org/apache/mesos/v1/Protos.java | 162577 +++++++++++++++
.../org/apache/mesos/v1/executor/Protos.java | 10785 +
.../org/apache/mesos/v1/scheduler/Mesos.java | 58 +
.../org/apache/mesos/v1/scheduler/Protos.java | 24570 +++
.../apache/mesos/v1/scheduler/Scheduler.java | 53 +
.../org/apache/mesos/v1/scheduler/V0Mesos.java | 84 +
.../org/apache/mesos/v1/scheduler/V1Mesos.java | 84 +
34 files changed, 407148 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 075b768..575f1b6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -52,6 +52,7 @@ idea {
}
}
+
subprojects {
apply plugin: 'java'
@@ -69,7 +70,7 @@ subprojects {
version = "0.2.0"
ext {
- mesosVer = "0.28.1"
+ //mesosVer = "1.5.0"
//Allows passing -PhadoopVer=2.6.0 from command line
if(!project.hasProperty('hadoopVer')) {
hadoopVer = "2.7.0"
@@ -102,7 +103,7 @@ subprojects {
capsule "co.paralleluniverse:capsule:0.7.1"
myriadExecutorConf 'org.slf4j:slf4j-log4j12:1.7.10'
- compile "org.apache.mesos:mesos:${mesosVer}"
+ //compile "org.apache.mesos:mesos:${mesosVer}"
compile 'com.google.code.gson:gson:2.3.1' // marshalling between the scheduler and executor
testCompile 'org.apache.zookeeper:zookeeper:3.4.6' // to resolve temporary mavenlocal issue
@@ -115,4 +116,5 @@ subprojects {
run {
systemProperty "myriad.config", "build/resources/main/myriad-config-default.yml"
}
+
}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/gradle/quality.gradle
----------------------------------------------------------------------
diff --git a/gradle/quality.gradle b/gradle/quality.gradle
index c013d7d..e58d9ef 100644
--- a/gradle/quality.gradle
+++ b/gradle/quality.gradle
@@ -25,6 +25,22 @@ tasks.withType(FindBugs) {
excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml")
}
+tasks.withType(FindBugs) {
+ exclude '**/org/apache/mesos/*'
+ classes = classes.filter {
+ !it.path.contains(new File("org/apache/mesos/").path)
+ }
+}
+
+tasks.withType(Pmd) {
+ exclude 'org/apache/mesos/**'
+}
+
+tasks.withType(Checkstyle) {
+ exclude 'org/apache/mesos/**'
+}
+
+
pmd {
ruleSets = [
// 'java-basic', // need brandon's http config to add in
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/build.gradle
----------------------------------------------------------------------
diff --git a/myriad-commons/build.gradle b/myriad-commons/build.gradle
new file mode 100644
index 0000000..c66e8f7
--- /dev/null
+++ b/myriad-commons/build.gradle
@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+dependencies {
+ compile group: 'com.google.protobuf', name: 'protobuf-java', version: '2.5.0'
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/proto/mesos/executor.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/executor.proto b/myriad-commons/proto/mesos/executor.proto
new file mode 100644
index 0000000..1b5fa5d
--- /dev/null
+++ b/myriad-commons/proto/mesos/executor.proto
@@ -0,0 +1,212 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto2";
+
+import "mesos/mesos.proto";
+
+package mesos.executor;
+
+option java_package = "org.apache.mesos.executor";
+option java_outer_classname = "Protos";
+
+
+/**
+ * Executor event API.
+ *
+ * An event is described using the standard protocol buffer "union"
+ * trick, see https://developers.google.com/protocol-buffers/docs/techniques#union.
+ */
+message Event {
+ // Possible event types, followed by message definitions if
+ // applicable.
+ enum Type {
+ // This must be the first enum value in this list, to
+ // ensure that if 'type' is not set, the default value
+ // is UNKNOWN. This enables enum values to be added
+ // in a backwards-compatible way. See: MESOS-4997.
+ UNKNOWN = 0;
+
+ SUBSCRIBED = 1; // See 'Subscribed' below.
+ LAUNCH = 2; // See 'Launch' below.
+ LAUNCH_GROUP = 8; // See 'LaunchGroup' below.
+ KILL = 3; // See 'Kill' below.
+ ACKNOWLEDGED = 4; // See 'Acknowledged' below.
+ MESSAGE = 5; // See 'Message' below.
+ ERROR = 6; // See 'Error' below.
+
+ // Received when the agent asks the executor to shutdown/kill itself.
+ // The executor is then required to kill all its active tasks, send
+ // `TASK_KILLED` status updates and gracefully exit. The executor
+ // should terminate within a `MESOS_EXECUTOR_SHUTDOWN_GRACE_PERIOD`
+ // (an environment variable set by the agent upon executor startup);
+ // it can be configured via `ExecutorInfo.shutdown_grace_period`. If
+ // the executor fails to do so, the agent will forcefully destroy the
+ // container where the executor is running. The agent would then send
+ // `TASK_LOST` updates for any remaining active tasks of this executor.
+ //
+ // NOTE: The executor must not assume that it will always be allotted
+ // the full grace period, as the agent may decide to allot a shorter
+ // period and failures / forcible terminations may occur.
+ //
+ // TODO(alexr): Consider adding a duration field into the `Shutdown`
+ // message so that the agent can communicate when a shorter period
+ // has been allotted.
+ SHUTDOWN = 7;
+ }
+
+ // First event received when the executor subscribes.
+ // The 'id' field in the 'framework_info' will be set.
+ message Subscribed {
+ required ExecutorInfo executor_info = 1;
+ required FrameworkInfo framework_info = 2;
+ required SlaveInfo slave_info = 3;
+
+ // Uniquely identifies the container of an executor run.
+ optional ContainerID container_id = 4;
+ }
+
+ // Received when the framework attempts to launch a task. Once
+ // the task is successfuly launched, the executor must respond with
+ // a TASK_RUNNING update (See TaskState in mesos.proto).
+ message Launch {
+ required TaskInfo task = 1;
+ }
+
+ // Received when the framework attempts to launch a group of tasks atomically.
+ // Similar to `Launch` above the executor must send TASK_RUNNING updates for
+ // tasks that are successfully launched.
+ message LaunchGroup {
+ required TaskGroupInfo task_group = 1;
+ }
+
+ // Received when the scheduler wants to kill a specific task. Once
+ // the task is terminated, the executor should send a TASK_KILLED
+ // (or TASK_FAILED) update. The terminal update is necessary so
+ // Mesos can release the resources associated with the task.
+ message Kill {
+ required TaskID task_id = 1;
+
+ // If set, overrides any previously specified kill policy for this task.
+ // This includes 'TaskInfo.kill_policy' and 'Executor.kill.kill_policy'.
+ optional KillPolicy kill_policy = 2;
+ }
+
+ // Received when the slave acknowledges the receipt of status
+ // update. Schedulers are responsible for explicitly acknowledging
+ // the receipt of status updates that have 'update.status().uuid()'
+ // field set. Unacknowledged updates can be retried by the executor.
+ // They should also be sent by the executor whenever it
+ // re-subscribes.
+ message Acknowledged {
+ required TaskID task_id = 1;
+ required bytes uuid = 2;
+ }
+
+ // Received when a custom message generated by the scheduler is
+ // forwarded by the slave. Note that this message is not
+ // interpreted by Mesos and is only forwarded (without reliability
+ // guarantees) to the executor. It is up to the scheduler to retry
+ // if the message is dropped for any reason.
+ message Message {
+ required bytes data = 1;
+ }
+
+ // Received in case the executor sends invalid calls (e.g.,
+ // required values not set).
+ // TODO(arojas): Remove this once the old executor driver is no
+ // longer supported. With HTTP API all errors will be signaled via
+ // HTTP response codes.
+ message Error {
+ required string message = 1;
+ }
+
+ // Type of the event, indicates which optional field below should be
+ // present if that type has a nested message definition.
+ // Enum fields should be optional, see: MESOS-4997.
+ optional Type type = 1;
+
+ optional Subscribed subscribed = 2;
+ optional Acknowledged acknowledged = 3;
+ optional Launch launch = 4;
+ optional LaunchGroup launch_group = 8;
+ optional Kill kill = 5;
+ optional Message message = 6;
+ optional Error error = 7;
+}
+
+
+/**
+ * Executor call API.
+ *
+ * Like Event, a Call is described using the standard protocol buffer
+ * "union" trick (see above).
+ */
+message Call {
+ // Possible call types, followed by message definitions if
+ // applicable.
+ enum Type {
+ // See comments above on `Event::Type` for more details on this enum value.
+ UNKNOWN = 0;
+
+ SUBSCRIBE = 1; // See 'Subscribe' below.
+ UPDATE = 2; // See 'Update' below.
+ MESSAGE = 3; // See 'Message' below.
+ }
+
+ // Request to subscribe with the slave. If subscribing after a disconnection,
+ // it must include a list of all the tasks and updates which haven't been
+ // acknowledged by the scheduler.
+ message Subscribe {
+ repeated TaskInfo unacknowledged_tasks = 1;
+ repeated Update unacknowledged_updates = 2;
+ }
+
+ // Notifies the scheduler that a task has transitioned from one
+ // state to another. Status updates should be used by executors
+ // to reliably communicate the status of the tasks that they
+ // manage. It is crucial that a terminal update (see TaskState
+ // in mesos.proto) is sent to the scheduler as soon as the task
+ // terminates, in order for Mesos to release the resources allocated
+ // to the task. It is the responsibility of the scheduler to
+ // explicitly acknowledge the receipt of a status update. See
+ // 'Acknowledged' in the 'Events' section above for the semantics.
+ message Update {
+ required TaskStatus status = 1;
+ }
+
+ // Sends arbitrary binary data to the scheduler. Note that Mesos
+ // neither interprets this data nor makes any guarantees about the
+ // delivery of this message to the scheduler.
+ // See 'Message' in the 'Events' section.
+ message Message {
+ required bytes data = 2;
+ }
+
+ // Identifies the executor which generated this call.
+ required ExecutorID executor_id = 1;
+ required FrameworkID framework_id = 2;
+
+ // Type of the call, indicates which optional field below should be
+ // present if that type has a nested message definition.
+ // In case type is SUBSCRIBED, no message needs to be set.
+ // See comments on `Event::Type` above on the reasoning behind this field being optional.
+ optional Type type = 3;
+
+ optional Subscribe subscribe = 4;
+ optional Update update = 5;
+ optional Message message = 6;
+}
[08/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/executor/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/executor/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/executor/Protos.java
new file mode 100644
index 0000000..3ef8253
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/executor/Protos.java
@@ -0,0 +1,10759 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/executor.proto
+
+package org.apache.mesos.executor;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface EventOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.executor.Event.Type type = 1;
+ /**
+ * <code>optional .mesos.executor.Event.Type type = 1;</code>
+ *
+ * <pre>
+ * Type of the event, indicates which optional field below should be
+ * present if that type has a nested message definition.
+ * Enum fields should be optional, see: MESOS-4997.
+ * </pre>
+ */
+ boolean hasType();
+ /**
+ * <code>optional .mesos.executor.Event.Type type = 1;</code>
+ *
+ * <pre>
+ * Type of the event, indicates which optional field below should be
+ * present if that type has a nested message definition.
+ * Enum fields should be optional, see: MESOS-4997.
+ * </pre>
+ */
+ org.apache.mesos.executor.Protos.Event.Type getType();
+
+ // optional .mesos.executor.Event.Subscribed subscribed = 2;
+ /**
+ * <code>optional .mesos.executor.Event.Subscribed subscribed = 2;</code>
+ */
+ boolean hasSubscribed();
+ /**
+ * <code>optional .mesos.executor.Event.Subscribed subscribed = 2;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.Subscribed getSubscribed();
+ /**
+ * <code>optional .mesos.executor.Event.Subscribed subscribed = 2;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.SubscribedOrBuilder getSubscribedOrBuilder();
+
+ // optional .mesos.executor.Event.Acknowledged acknowledged = 3;
+ /**
+ * <code>optional .mesos.executor.Event.Acknowledged acknowledged = 3;</code>
+ */
+ boolean hasAcknowledged();
+ /**
+ * <code>optional .mesos.executor.Event.Acknowledged acknowledged = 3;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.Acknowledged getAcknowledged();
+ /**
+ * <code>optional .mesos.executor.Event.Acknowledged acknowledged = 3;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.AcknowledgedOrBuilder getAcknowledgedOrBuilder();
+
+ // optional .mesos.executor.Event.Launch launch = 4;
+ /**
+ * <code>optional .mesos.executor.Event.Launch launch = 4;</code>
+ */
+ boolean hasLaunch();
+ /**
+ * <code>optional .mesos.executor.Event.Launch launch = 4;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.Launch getLaunch();
+ /**
+ * <code>optional .mesos.executor.Event.Launch launch = 4;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.LaunchOrBuilder getLaunchOrBuilder();
+
+ // optional .mesos.executor.Event.LaunchGroup launch_group = 8;
+ /**
+ * <code>optional .mesos.executor.Event.LaunchGroup launch_group = 8;</code>
+ */
+ boolean hasLaunchGroup();
+ /**
+ * <code>optional .mesos.executor.Event.LaunchGroup launch_group = 8;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.LaunchGroup getLaunchGroup();
+ /**
+ * <code>optional .mesos.executor.Event.LaunchGroup launch_group = 8;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.LaunchGroupOrBuilder getLaunchGroupOrBuilder();
+
+ // optional .mesos.executor.Event.Kill kill = 5;
+ /**
+ * <code>optional .mesos.executor.Event.Kill kill = 5;</code>
+ */
+ boolean hasKill();
+ /**
+ * <code>optional .mesos.executor.Event.Kill kill = 5;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.Kill getKill();
+ /**
+ * <code>optional .mesos.executor.Event.Kill kill = 5;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.KillOrBuilder getKillOrBuilder();
+
+ // optional .mesos.executor.Event.Message message = 6;
+ /**
+ * <code>optional .mesos.executor.Event.Message message = 6;</code>
+ */
+ boolean hasMessage();
+ /**
+ * <code>optional .mesos.executor.Event.Message message = 6;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.Message getMessage();
+ /**
+ * <code>optional .mesos.executor.Event.Message message = 6;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.MessageOrBuilder getMessageOrBuilder();
+
+ // optional .mesos.executor.Event.Error error = 7;
+ /**
+ * <code>optional .mesos.executor.Event.Error error = 7;</code>
+ */
+ boolean hasError();
+ /**
+ * <code>optional .mesos.executor.Event.Error error = 7;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.Error getError();
+ /**
+ * <code>optional .mesos.executor.Event.Error error = 7;</code>
+ */
+ org.apache.mesos.executor.Protos.Event.ErrorOrBuilder getErrorOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.executor.Event}
+ *
+ * <pre>
+ **
+ * Executor event API.
+ *
+ * An event is described using the standard protocol buffer "union"
+ * trick, see https://developers.google.com/protocol-buffers/docs/techniques#union.
+ * </pre>
+ */
+ public static final class Event extends
+ com.google.protobuf.GeneratedMessage
+ implements EventOrBuilder {
+ // Use Event.newBuilder() to construct.
+ private Event(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Event(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Event defaultInstance;
+ public static Event getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Event getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Event(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ int rawValue = input.readEnum();
+ org.apache.mesos.executor.Protos.Event.Type value = org.apache.mesos.executor.Protos.Event.Type.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(1, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ type_ = value;
+ }
+ break;
+ }
+ case 18: {
+ org.apache.mesos.executor.Protos.Event.Subscribed.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = subscribed_.toBuilder();
+ }
+ subscribed_ = input.readMessage(org.apache.mesos.executor.Protos.Event.Subscribed.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(subscribed_);
+ subscribed_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.apache.mesos.executor.Protos.Event.Acknowledged.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = acknowledged_.toBuilder();
+ }
+ acknowledged_ = input.readMessage(org.apache.mesos.executor.Protos.Event.Acknowledged.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(acknowledged_);
+ acknowledged_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ org.apache.mesos.executor.Protos.Event.Launch.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ subBuilder = launch_.toBuilder();
+ }
+ launch_ = input.readMessage(org.apache.mesos.executor.Protos.Event.Launch.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(launch_);
+ launch_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 42: {
+ org.apache.mesos.executor.Protos.Event.Kill.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ subBuilder = kill_.toBuilder();
+ }
+ kill_ = input.readMessage(org.apache.mesos.executor.Protos.Event.Kill.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(kill_);
+ kill_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000020;
+ break;
+ }
+ case 50: {
+ org.apache.mesos.executor.Protos.Event.Message.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
+ subBuilder = message_.toBuilder();
+ }
+ message_ = input.readMessage(org.apache.mesos.executor.Protos.Event.Message.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(message_);
+ message_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000040;
+ break;
+ }
+ case 58: {
+ org.apache.mesos.executor.Protos.Event.Error.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ subBuilder = error_.toBuilder();
+ }
+ error_ = input.readMessage(org.apache.mesos.executor.Protos.Event.Error.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(error_);
+ error_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000080;
+ break;
+ }
+ case 66: {
+ org.apache.mesos.executor.Protos.Event.LaunchGroup.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ subBuilder = launchGroup_.toBuilder();
+ }
+ launchGroup_ = input.readMessage(org.apache.mesos.executor.Protos.Event.LaunchGroup.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(launchGroup_);
+ launchGroup_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.executor.Protos.Event.class, org.apache.mesos.executor.Protos.Event.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Event> PARSER =
+ new com.google.protobuf.AbstractParser<Event>() {
+ public Event parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Event(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Event> getParserForType() {
+ return PARSER;
+ }
+
+ /**
+ * Protobuf enum {@code mesos.executor.Event.Type}
+ *
+ * <pre>
+ * Possible event types, followed by message definitions if
+ * applicable.
+ * </pre>
+ */
+ public enum Type
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * This must be the first enum value in this list, to
+ * ensure that if 'type' is not set, the default value
+ * is UNKNOWN. This enables enum values to be added
+ * in a backwards-compatible way. See: MESOS-4997.
+ * </pre>
+ */
+ UNKNOWN(0, 0),
+ /**
+ * <code>SUBSCRIBED = 1;</code>
+ *
+ * <pre>
+ * See 'Subscribed' below.
+ * </pre>
+ */
+ SUBSCRIBED(1, 1),
+ /**
+ * <code>LAUNCH = 2;</code>
+ *
+ * <pre>
+ * See 'Launch' below.
+ * </pre>
+ */
+ LAUNCH(2, 2),
+ /**
+ * <code>LAUNCH_GROUP = 8;</code>
+ *
+ * <pre>
+ * See 'LaunchGroup' below.
+ * </pre>
+ */
+ LAUNCH_GROUP(3, 8),
+ /**
+ * <code>KILL = 3;</code>
+ *
+ * <pre>
+ * See 'Kill' below.
+ * </pre>
+ */
+ KILL(4, 3),
+ /**
+ * <code>ACKNOWLEDGED = 4;</code>
+ *
+ * <pre>
+ * See 'Acknowledged' below.
+ * </pre>
+ */
+ ACKNOWLEDGED(5, 4),
+ /**
+ * <code>MESSAGE = 5;</code>
+ *
+ * <pre>
+ * See 'Message' below.
+ * </pre>
+ */
+ MESSAGE(6, 5),
+ /**
+ * <code>ERROR = 6;</code>
+ *
+ * <pre>
+ * See 'Error' below.
+ * </pre>
+ */
+ ERROR(7, 6),
+ /**
+ * <code>SHUTDOWN = 7;</code>
+ *
+ * <pre>
+ * Received when the agent asks the executor to shutdown/kill itself.
+ * The executor is then required to kill all its active tasks, send
+ * `TASK_KILLED` status updates and gracefully exit. The executor
+ * should terminate within a `MESOS_EXECUTOR_SHUTDOWN_GRACE_PERIOD`
+ * (an environment variable set by the agent upon executor startup);
+ * it can be configured via `ExecutorInfo.shutdown_grace_period`. If
+ * the executor fails to do so, the agent will forcefully destroy the
+ * container where the executor is running. The agent would then send
+ * `TASK_LOST` updates for any remaining active tasks of this executor.
+ *
+ * NOTE: The executor must not assume that it will always be allotted
+ * the full grace period, as the agent may decide to allot a shorter
+ * period and failures / forcible terminations may occur.
+ *
+ * TODO(alexr): Consider adding a duration field into the `Shutdown`
+ * message so that the agent can communicate when a shorter period
+ * has been allotted.
+ * </pre>
+ */
+ SHUTDOWN(8, 7),
+ ;
+
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * This must be the first enum value in this list, to
+ * ensure that if 'type' is not set, the default value
+ * is UNKNOWN. This enables enum values to be added
+ * in a backwards-compatible way. See: MESOS-4997.
+ * </pre>
+ */
+ public static final int UNKNOWN_VALUE = 0;
+ /**
+ * <code>SUBSCRIBED = 1;</code>
+ *
+ * <pre>
+ * See 'Subscribed' below.
+ * </pre>
+ */
+ public static final int SUBSCRIBED_VALUE = 1;
+ /**
+ * <code>LAUNCH = 2;</code>
+ *
+ * <pre>
+ * See 'Launch' below.
+ * </pre>
+ */
+ public static final int LAUNCH_VALUE = 2;
+ /**
+ * <code>LAUNCH_GROUP = 8;</code>
+ *
+ * <pre>
+ * See 'LaunchGroup' below.
+ * </pre>
+ */
+ public static final int LAUNCH_GROUP_VALUE = 8;
+ /**
+ * <code>KILL = 3;</code>
+ *
+ * <pre>
+ * See 'Kill' below.
+ * </pre>
+ */
+ public static final int KILL_VALUE = 3;
+ /**
+ * <code>ACKNOWLEDGED = 4;</code>
+ *
+ * <pre>
+ * See 'Acknowledged' below.
+ * </pre>
+ */
+ public static final int ACKNOWLEDGED_VALUE = 4;
+ /**
+ * <code>MESSAGE = 5;</code>
+ *
+ * <pre>
+ * See 'Message' below.
+ * </pre>
+ */
+ public static final int MESSAGE_VALUE = 5;
+ /**
+ * <code>ERROR = 6;</code>
+ *
+ * <pre>
+ * See 'Error' below.
+ * </pre>
+ */
+ public static final int ERROR_VALUE = 6;
+ /**
+ * <code>SHUTDOWN = 7;</code>
+ *
+ * <pre>
+ * Received when the agent asks the executor to shutdown/kill itself.
+ * The executor is then required to kill all its active tasks, send
+ * `TASK_KILLED` status updates and gracefully exit. The executor
+ * should terminate within a `MESOS_EXECUTOR_SHUTDOWN_GRACE_PERIOD`
+ * (an environment variable set by the agent upon executor startup);
+ * it can be configured via `ExecutorInfo.shutdown_grace_period`. If
+ * the executor fails to do so, the agent will forcefully destroy the
+ * container where the executor is running. The agent would then send
+ * `TASK_LOST` updates for any remaining active tasks of this executor.
+ *
+ * NOTE: The executor must not assume that it will always be allotted
+ * the full grace period, as the agent may decide to allot a shorter
+ * period and failures / forcible terminations may occur.
+ *
+ * TODO(alexr): Consider adding a duration field into the `Shutdown`
+ * message so that the agent can communicate when a shorter period
+ * has been allotted.
+ * </pre>
+ */
+ public static final int SHUTDOWN_VALUE = 7;
+
+
+ public final int getNumber() { return value; }
+
+ public static Type valueOf(int value) {
+ switch (value) {
+ case 0: return UNKNOWN;
+ case 1: return SUBSCRIBED;
+ case 2: return LAUNCH;
+ case 8: return LAUNCH_GROUP;
+ case 3: return KILL;
+ case 4: return ACKNOWLEDGED;
+ case 5: return MESSAGE;
+ case 6: return ERROR;
+ case 7: return SHUTDOWN;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Type>() {
+ public Type findValueByNumber(int number) {
+ return Type.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.executor.Protos.Event.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Type[] VALUES = values();
+
+ public static Type valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private Type(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.executor.Event.Type)
+ }
+
+ public interface SubscribedOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .mesos.ExecutorInfo executor_info = 1;
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ boolean hasExecutorInfo();
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ org.apache.mesos.Protos.ExecutorInfo getExecutorInfo();
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ org.apache.mesos.Protos.ExecutorInfoOrBuilder getExecutorInfoOrBuilder();
+
+ // required .mesos.FrameworkInfo framework_info = 2;
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ boolean hasFrameworkInfo();
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ org.apache.mesos.Protos.FrameworkInfo getFrameworkInfo();
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ org.apache.mesos.Protos.FrameworkInfoOrBuilder getFrameworkInfoOrBuilder();
+
+ // required .mesos.SlaveInfo slave_info = 3;
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ boolean hasSlaveInfo();
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ org.apache.mesos.Protos.SlaveInfo getSlaveInfo();
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ org.apache.mesos.Protos.SlaveInfoOrBuilder getSlaveInfoOrBuilder();
+
+ // optional .mesos.ContainerID container_id = 4;
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ boolean hasContainerId();
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ org.apache.mesos.Protos.ContainerID getContainerId();
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ org.apache.mesos.Protos.ContainerIDOrBuilder getContainerIdOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.executor.Event.Subscribed}
+ *
+ * <pre>
+ * First event received when the executor subscribes.
+ * The 'id' field in the 'framework_info' will be set.
+ * </pre>
+ */
+ public static final class Subscribed extends
+ com.google.protobuf.GeneratedMessage
+ implements SubscribedOrBuilder {
+ // Use Subscribed.newBuilder() to construct.
+ private Subscribed(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Subscribed(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Subscribed defaultInstance;
+ public static Subscribed getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Subscribed getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Subscribed(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.Protos.ExecutorInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = executorInfo_.toBuilder();
+ }
+ executorInfo_ = input.readMessage(org.apache.mesos.Protos.ExecutorInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(executorInfo_);
+ executorInfo_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 18: {
+ org.apache.mesos.Protos.FrameworkInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = frameworkInfo_.toBuilder();
+ }
+ frameworkInfo_ = input.readMessage(org.apache.mesos.Protos.FrameworkInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(frameworkInfo_);
+ frameworkInfo_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.apache.mesos.Protos.SlaveInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = slaveInfo_.toBuilder();
+ }
+ slaveInfo_ = input.readMessage(org.apache.mesos.Protos.SlaveInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(slaveInfo_);
+ slaveInfo_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ org.apache.mesos.Protos.ContainerID.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ subBuilder = containerId_.toBuilder();
+ }
+ containerId_ = input.readMessage(org.apache.mesos.Protos.ContainerID.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(containerId_);
+ containerId_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_Subscribed_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_Subscribed_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.executor.Protos.Event.Subscribed.class, org.apache.mesos.executor.Protos.Event.Subscribed.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Subscribed> PARSER =
+ new com.google.protobuf.AbstractParser<Subscribed>() {
+ public Subscribed parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Subscribed(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Subscribed> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required .mesos.ExecutorInfo executor_info = 1;
+ public static final int EXECUTOR_INFO_FIELD_NUMBER = 1;
+ private org.apache.mesos.Protos.ExecutorInfo executorInfo_;
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public boolean hasExecutorInfo() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public org.apache.mesos.Protos.ExecutorInfo getExecutorInfo() {
+ return executorInfo_;
+ }
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public org.apache.mesos.Protos.ExecutorInfoOrBuilder getExecutorInfoOrBuilder() {
+ return executorInfo_;
+ }
+
+ // required .mesos.FrameworkInfo framework_info = 2;
+ public static final int FRAMEWORK_INFO_FIELD_NUMBER = 2;
+ private org.apache.mesos.Protos.FrameworkInfo frameworkInfo_;
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public boolean hasFrameworkInfo() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public org.apache.mesos.Protos.FrameworkInfo getFrameworkInfo() {
+ return frameworkInfo_;
+ }
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public org.apache.mesos.Protos.FrameworkInfoOrBuilder getFrameworkInfoOrBuilder() {
+ return frameworkInfo_;
+ }
+
+ // required .mesos.SlaveInfo slave_info = 3;
+ public static final int SLAVE_INFO_FIELD_NUMBER = 3;
+ private org.apache.mesos.Protos.SlaveInfo slaveInfo_;
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public boolean hasSlaveInfo() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public org.apache.mesos.Protos.SlaveInfo getSlaveInfo() {
+ return slaveInfo_;
+ }
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public org.apache.mesos.Protos.SlaveInfoOrBuilder getSlaveInfoOrBuilder() {
+ return slaveInfo_;
+ }
+
+ // optional .mesos.ContainerID container_id = 4;
+ public static final int CONTAINER_ID_FIELD_NUMBER = 4;
+ private org.apache.mesos.Protos.ContainerID containerId_;
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public boolean hasContainerId() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public org.apache.mesos.Protos.ContainerID getContainerId() {
+ return containerId_;
+ }
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public org.apache.mesos.Protos.ContainerIDOrBuilder getContainerIdOrBuilder() {
+ return containerId_;
+ }
+
+ private void initFields() {
+ executorInfo_ = org.apache.mesos.Protos.ExecutorInfo.getDefaultInstance();
+ frameworkInfo_ = org.apache.mesos.Protos.FrameworkInfo.getDefaultInstance();
+ slaveInfo_ = org.apache.mesos.Protos.SlaveInfo.getDefaultInstance();
+ containerId_ = org.apache.mesos.Protos.ContainerID.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasExecutorInfo()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasFrameworkInfo()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasSlaveInfo()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getExecutorInfo().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getFrameworkInfo().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getSlaveInfo().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (hasContainerId()) {
+ if (!getContainerId().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, executorInfo_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeMessage(2, frameworkInfo_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeMessage(3, slaveInfo_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ output.writeMessage(4, containerId_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, executorInfo_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, frameworkInfo_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, slaveInfo_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, containerId_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.executor.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Subscribed parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Subscribed parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Subscribed parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Subscribed parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Subscribed parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Subscribed parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.executor.Protos.Event.Subscribed prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.executor.Event.Subscribed}
+ *
+ * <pre>
+ * First event received when the executor subscribes.
+ * The 'id' field in the 'framework_info' will be set.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.executor.Protos.Event.SubscribedOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_Subscribed_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_Subscribed_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.executor.Protos.Event.Subscribed.class, org.apache.mesos.executor.Protos.Event.Subscribed.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.executor.Protos.Event.Subscribed.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getExecutorInfoFieldBuilder();
+ getFrameworkInfoFieldBuilder();
+ getSlaveInfoFieldBuilder();
+ getContainerIdFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (executorInfoBuilder_ == null) {
+ executorInfo_ = org.apache.mesos.Protos.ExecutorInfo.getDefaultInstance();
+ } else {
+ executorInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (frameworkInfoBuilder_ == null) {
+ frameworkInfo_ = org.apache.mesos.Protos.FrameworkInfo.getDefaultInstance();
+ } else {
+ frameworkInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (slaveInfoBuilder_ == null) {
+ slaveInfo_ = org.apache.mesos.Protos.SlaveInfo.getDefaultInstance();
+ } else {
+ slaveInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ if (containerIdBuilder_ == null) {
+ containerId_ = org.apache.mesos.Protos.ContainerID.getDefaultInstance();
+ } else {
+ containerIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_Subscribed_descriptor;
+ }
+
+ public org.apache.mesos.executor.Protos.Event.Subscribed getDefaultInstanceForType() {
+ return org.apache.mesos.executor.Protos.Event.Subscribed.getDefaultInstance();
+ }
+
+ public org.apache.mesos.executor.Protos.Event.Subscribed build() {
+ org.apache.mesos.executor.Protos.Event.Subscribed result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.executor.Protos.Event.Subscribed buildPartial() {
+ org.apache.mesos.executor.Protos.Event.Subscribed result = new org.apache.mesos.executor.Protos.Event.Subscribed(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (executorInfoBuilder_ == null) {
+ result.executorInfo_ = executorInfo_;
+ } else {
+ result.executorInfo_ = executorInfoBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ if (frameworkInfoBuilder_ == null) {
+ result.frameworkInfo_ = frameworkInfo_;
+ } else {
+ result.frameworkInfo_ = frameworkInfoBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ if (slaveInfoBuilder_ == null) {
+ result.slaveInfo_ = slaveInfo_;
+ } else {
+ result.slaveInfo_ = slaveInfoBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+ to_bitField0_ |= 0x00000008;
+ }
+ if (containerIdBuilder_ == null) {
+ result.containerId_ = containerId_;
+ } else {
+ result.containerId_ = containerIdBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.executor.Protos.Event.Subscribed) {
+ return mergeFrom((org.apache.mesos.executor.Protos.Event.Subscribed)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.executor.Protos.Event.Subscribed other) {
+ if (other == org.apache.mesos.executor.Protos.Event.Subscribed.getDefaultInstance()) return this;
+ if (other.hasExecutorInfo()) {
+ mergeExecutorInfo(other.getExecutorInfo());
+ }
+ if (other.hasFrameworkInfo()) {
+ mergeFrameworkInfo(other.getFrameworkInfo());
+ }
+ if (other.hasSlaveInfo()) {
+ mergeSlaveInfo(other.getSlaveInfo());
+ }
+ if (other.hasContainerId()) {
+ mergeContainerId(other.getContainerId());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasExecutorInfo()) {
+
+ return false;
+ }
+ if (!hasFrameworkInfo()) {
+
+ return false;
+ }
+ if (!hasSlaveInfo()) {
+
+ return false;
+ }
+ if (!getExecutorInfo().isInitialized()) {
+
+ return false;
+ }
+ if (!getFrameworkInfo().isInitialized()) {
+
+ return false;
+ }
+ if (!getSlaveInfo().isInitialized()) {
+
+ return false;
+ }
+ if (hasContainerId()) {
+ if (!getContainerId().isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.executor.Protos.Event.Subscribed parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.executor.Protos.Event.Subscribed) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required .mesos.ExecutorInfo executor_info = 1;
+ private org.apache.mesos.Protos.ExecutorInfo executorInfo_ = org.apache.mesos.Protos.ExecutorInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.ExecutorInfo, org.apache.mesos.Protos.ExecutorInfo.Builder, org.apache.mesos.Protos.ExecutorInfoOrBuilder> executorInfoBuilder_;
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public boolean hasExecutorInfo() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public org.apache.mesos.Protos.ExecutorInfo getExecutorInfo() {
+ if (executorInfoBuilder_ == null) {
+ return executorInfo_;
+ } else {
+ return executorInfoBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public Builder setExecutorInfo(org.apache.mesos.Protos.ExecutorInfo value) {
+ if (executorInfoBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ executorInfo_ = value;
+ onChanged();
+ } else {
+ executorInfoBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public Builder setExecutorInfo(
+ org.apache.mesos.Protos.ExecutorInfo.Builder builderForValue) {
+ if (executorInfoBuilder_ == null) {
+ executorInfo_ = builderForValue.build();
+ onChanged();
+ } else {
+ executorInfoBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public Builder mergeExecutorInfo(org.apache.mesos.Protos.ExecutorInfo value) {
+ if (executorInfoBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ executorInfo_ != org.apache.mesos.Protos.ExecutorInfo.getDefaultInstance()) {
+ executorInfo_ =
+ org.apache.mesos.Protos.ExecutorInfo.newBuilder(executorInfo_).mergeFrom(value).buildPartial();
+ } else {
+ executorInfo_ = value;
+ }
+ onChanged();
+ } else {
+ executorInfoBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public Builder clearExecutorInfo() {
+ if (executorInfoBuilder_ == null) {
+ executorInfo_ = org.apache.mesos.Protos.ExecutorInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ executorInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public org.apache.mesos.Protos.ExecutorInfo.Builder getExecutorInfoBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getExecutorInfoFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ public org.apache.mesos.Protos.ExecutorInfoOrBuilder getExecutorInfoOrBuilder() {
+ if (executorInfoBuilder_ != null) {
+ return executorInfoBuilder_.getMessageOrBuilder();
+ } else {
+ return executorInfo_;
+ }
+ }
+ /**
+ * <code>required .mesos.ExecutorInfo executor_info = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.ExecutorInfo, org.apache.mesos.Protos.ExecutorInfo.Builder, org.apache.mesos.Protos.ExecutorInfoOrBuilder>
+ getExecutorInfoFieldBuilder() {
+ if (executorInfoBuilder_ == null) {
+ executorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.ExecutorInfo, org.apache.mesos.Protos.ExecutorInfo.Builder, org.apache.mesos.Protos.ExecutorInfoOrBuilder>(
+ executorInfo_,
+ getParentForChildren(),
+ isClean());
+ executorInfo_ = null;
+ }
+ return executorInfoBuilder_;
+ }
+
+ // required .mesos.FrameworkInfo framework_info = 2;
+ private org.apache.mesos.Protos.FrameworkInfo frameworkInfo_ = org.apache.mesos.Protos.FrameworkInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.FrameworkInfo, org.apache.mesos.Protos.FrameworkInfo.Builder, org.apache.mesos.Protos.FrameworkInfoOrBuilder> frameworkInfoBuilder_;
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public boolean hasFrameworkInfo() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public org.apache.mesos.Protos.FrameworkInfo getFrameworkInfo() {
+ if (frameworkInfoBuilder_ == null) {
+ return frameworkInfo_;
+ } else {
+ return frameworkInfoBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public Builder setFrameworkInfo(org.apache.mesos.Protos.FrameworkInfo value) {
+ if (frameworkInfoBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ frameworkInfo_ = value;
+ onChanged();
+ } else {
+ frameworkInfoBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public Builder setFrameworkInfo(
+ org.apache.mesos.Protos.FrameworkInfo.Builder builderForValue) {
+ if (frameworkInfoBuilder_ == null) {
+ frameworkInfo_ = builderForValue.build();
+ onChanged();
+ } else {
+ frameworkInfoBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public Builder mergeFrameworkInfo(org.apache.mesos.Protos.FrameworkInfo value) {
+ if (frameworkInfoBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002) &&
+ frameworkInfo_ != org.apache.mesos.Protos.FrameworkInfo.getDefaultInstance()) {
+ frameworkInfo_ =
+ org.apache.mesos.Protos.FrameworkInfo.newBuilder(frameworkInfo_).mergeFrom(value).buildPartial();
+ } else {
+ frameworkInfo_ = value;
+ }
+ onChanged();
+ } else {
+ frameworkInfoBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public Builder clearFrameworkInfo() {
+ if (frameworkInfoBuilder_ == null) {
+ frameworkInfo_ = org.apache.mesos.Protos.FrameworkInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ frameworkInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public org.apache.mesos.Protos.FrameworkInfo.Builder getFrameworkInfoBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getFrameworkInfoFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ public org.apache.mesos.Protos.FrameworkInfoOrBuilder getFrameworkInfoOrBuilder() {
+ if (frameworkInfoBuilder_ != null) {
+ return frameworkInfoBuilder_.getMessageOrBuilder();
+ } else {
+ return frameworkInfo_;
+ }
+ }
+ /**
+ * <code>required .mesos.FrameworkInfo framework_info = 2;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.FrameworkInfo, org.apache.mesos.Protos.FrameworkInfo.Builder, org.apache.mesos.Protos.FrameworkInfoOrBuilder>
+ getFrameworkInfoFieldBuilder() {
+ if (frameworkInfoBuilder_ == null) {
+ frameworkInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.FrameworkInfo, org.apache.mesos.Protos.FrameworkInfo.Builder, org.apache.mesos.Protos.FrameworkInfoOrBuilder>(
+ frameworkInfo_,
+ getParentForChildren(),
+ isClean());
+ frameworkInfo_ = null;
+ }
+ return frameworkInfoBuilder_;
+ }
+
+ // required .mesos.SlaveInfo slave_info = 3;
+ private org.apache.mesos.Protos.SlaveInfo slaveInfo_ = org.apache.mesos.Protos.SlaveInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.SlaveInfo, org.apache.mesos.Protos.SlaveInfo.Builder, org.apache.mesos.Protos.SlaveInfoOrBuilder> slaveInfoBuilder_;
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public boolean hasSlaveInfo() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public org.apache.mesos.Protos.SlaveInfo getSlaveInfo() {
+ if (slaveInfoBuilder_ == null) {
+ return slaveInfo_;
+ } else {
+ return slaveInfoBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public Builder setSlaveInfo(org.apache.mesos.Protos.SlaveInfo value) {
+ if (slaveInfoBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ slaveInfo_ = value;
+ onChanged();
+ } else {
+ slaveInfoBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public Builder setSlaveInfo(
+ org.apache.mesos.Protos.SlaveInfo.Builder builderForValue) {
+ if (slaveInfoBuilder_ == null) {
+ slaveInfo_ = builderForValue.build();
+ onChanged();
+ } else {
+ slaveInfoBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public Builder mergeSlaveInfo(org.apache.mesos.Protos.SlaveInfo value) {
+ if (slaveInfoBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) == 0x00000004) &&
+ slaveInfo_ != org.apache.mesos.Protos.SlaveInfo.getDefaultInstance()) {
+ slaveInfo_ =
+ org.apache.mesos.Protos.SlaveInfo.newBuilder(slaveInfo_).mergeFrom(value).buildPartial();
+ } else {
+ slaveInfo_ = value;
+ }
+ onChanged();
+ } else {
+ slaveInfoBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public Builder clearSlaveInfo() {
+ if (slaveInfoBuilder_ == null) {
+ slaveInfo_ = org.apache.mesos.Protos.SlaveInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ slaveInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public org.apache.mesos.Protos.SlaveInfo.Builder getSlaveInfoBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getSlaveInfoFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ public org.apache.mesos.Protos.SlaveInfoOrBuilder getSlaveInfoOrBuilder() {
+ if (slaveInfoBuilder_ != null) {
+ return slaveInfoBuilder_.getMessageOrBuilder();
+ } else {
+ return slaveInfo_;
+ }
+ }
+ /**
+ * <code>required .mesos.SlaveInfo slave_info = 3;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.SlaveInfo, org.apache.mesos.Protos.SlaveInfo.Builder, org.apache.mesos.Protos.SlaveInfoOrBuilder>
+ getSlaveInfoFieldBuilder() {
+ if (slaveInfoBuilder_ == null) {
+ slaveInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.SlaveInfo, org.apache.mesos.Protos.SlaveInfo.Builder, org.apache.mesos.Protos.SlaveInfoOrBuilder>(
+ slaveInfo_,
+ getParentForChildren(),
+ isClean());
+ slaveInfo_ = null;
+ }
+ return slaveInfoBuilder_;
+ }
+
+ // optional .mesos.ContainerID container_id = 4;
+ private org.apache.mesos.Protos.ContainerID containerId_ = org.apache.mesos.Protos.ContainerID.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.ContainerID, org.apache.mesos.Protos.ContainerID.Builder, org.apache.mesos.Protos.ContainerIDOrBuilder> containerIdBuilder_;
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public boolean hasContainerId() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public org.apache.mesos.Protos.ContainerID getContainerId() {
+ if (containerIdBuilder_ == null) {
+ return containerId_;
+ } else {
+ return containerIdBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public Builder setContainerId(org.apache.mesos.Protos.ContainerID value) {
+ if (containerIdBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ containerId_ = value;
+ onChanged();
+ } else {
+ containerIdBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public Builder setContainerId(
+ org.apache.mesos.Protos.ContainerID.Builder builderForValue) {
+ if (containerIdBuilder_ == null) {
+ containerId_ = builderForValue.build();
+ onChanged();
+ } else {
+ containerIdBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public Builder mergeContainerId(org.apache.mesos.Protos.ContainerID value) {
+ if (containerIdBuilder_ == null) {
+ if (((bitField0_ & 0x00000008) == 0x00000008) &&
+ containerId_ != org.apache.mesos.Protos.ContainerID.getDefaultInstance()) {
+ containerId_ =
+ org.apache.mesos.Protos.ContainerID.newBuilder(containerId_).mergeFrom(value).buildPartial();
+ } else {
+ containerId_ = value;
+ }
+ onChanged();
+ } else {
+ containerIdBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public Builder clearContainerId() {
+ if (containerIdBuilder_ == null) {
+ containerId_ = org.apache.mesos.Protos.ContainerID.getDefaultInstance();
+ onChanged();
+ } else {
+ containerIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ return this;
+ }
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public org.apache.mesos.Protos.ContainerID.Builder getContainerIdBuilder() {
+ bitField0_ |= 0x00000008;
+ onChanged();
+ return getContainerIdFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public org.apache.mesos.Protos.ContainerIDOrBuilder getContainerIdOrBuilder() {
+ if (containerIdBuilder_ != null) {
+ return containerIdBuilder_.getMessageOrBuilder();
+ } else {
+ return containerId_;
+ }
+ }
+ /**
+ * <code>optional .mesos.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.ContainerID, org.apache.mesos.Protos.ContainerID.Builder, org.apache.mesos.Protos.ContainerIDOrBuilder>
+ getContainerIdFieldBuilder() {
+ if (containerIdBuilder_ == null) {
+ containerIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.ContainerID, org.apache.mesos.Protos.ContainerID.Builder, org.apache.mesos.Protos.ContainerIDOrBuilder>(
+ containerId_,
+ getParentForChildren(),
+ isClean());
+ containerId_ = null;
+ }
+ return containerIdBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.executor.Event.Subscribed)
+ }
+
+ static {
+ defaultInstance = new Subscribed(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.executor.Event.Subscribed)
+ }
+
+ public interface LaunchOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .mesos.TaskInfo task = 1;
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ boolean hasTask();
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ org.apache.mesos.Protos.TaskInfo getTask();
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ org.apache.mesos.Protos.TaskInfoOrBuilder getTaskOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.executor.Event.Launch}
+ *
+ * <pre>
+ * Received when the framework attempts to launch a task. Once
+ * the task is successfuly launched, the executor must respond with
+ * a TASK_RUNNING update (See TaskState in mesos.proto).
+ * </pre>
+ */
+ public static final class Launch extends
+ com.google.protobuf.GeneratedMessage
+ implements LaunchOrBuilder {
+ // Use Launch.newBuilder() to construct.
+ private Launch(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Launch(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Launch defaultInstance;
+ public static Launch getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Launch getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Launch(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.Protos.TaskInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = task_.toBuilder();
+ }
+ task_ = input.readMessage(org.apache.mesos.Protos.TaskInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(task_);
+ task_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_Launch_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_Launch_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.executor.Protos.Event.Launch.class, org.apache.mesos.executor.Protos.Event.Launch.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Launch> PARSER =
+ new com.google.protobuf.AbstractParser<Launch>() {
+ public Launch parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Launch(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Launch> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required .mesos.TaskInfo task = 1;
+ public static final int TASK_FIELD_NUMBER = 1;
+ private org.apache.mesos.Protos.TaskInfo task_;
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public boolean hasTask() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public org.apache.mesos.Protos.TaskInfo getTask() {
+ return task_;
+ }
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public org.apache.mesos.Protos.TaskInfoOrBuilder getTaskOrBuilder() {
+ return task_;
+ }
+
+ private void initFields() {
+ task_ = org.apache.mesos.Protos.TaskInfo.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasTask()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getTask().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, task_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, task_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.executor.Protos.Event.Launch parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Launch parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Launch parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Launch parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Launch parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Launch parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Launch parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Launch parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Launch parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.executor.Protos.Event.Launch parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.executor.Protos.Event.Launch prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.executor.Event.Launch}
+ *
+ * <pre>
+ * Received when the framework attempts to launch a task. Once
+ * the task is successfuly launched, the executor must respond with
+ * a TASK_RUNNING update (See TaskState in mesos.proto).
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.executor.Protos.Event.LaunchOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_Launch_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_Launch_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.executor.Protos.Event.Launch.class, org.apache.mesos.executor.Protos.Event.Launch.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.executor.Protos.Event.Launch.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getTaskFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (taskBuilder_ == null) {
+ task_ = org.apache.mesos.Protos.TaskInfo.getDefaultInstance();
+ } else {
+ taskBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.executor.Protos.internal_static_mesos_executor_Event_Launch_descriptor;
+ }
+
+ public org.apache.mesos.executor.Protos.Event.Launch getDefaultInstanceForType() {
+ return org.apache.mesos.executor.Protos.Event.Launch.getDefaultInstance();
+ }
+
+ public org.apache.mesos.executor.Protos.Event.Launch build() {
+ org.apache.mesos.executor.Protos.Event.Launch result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.executor.Protos.Event.Launch buildPartial() {
+ org.apache.mesos.executor.Protos.Event.Launch result = new org.apache.mesos.executor.Protos.Event.Launch(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (taskBuilder_ == null) {
+ result.task_ = task_;
+ } else {
+ result.task_ = taskBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.executor.Protos.Event.Launch) {
+ return mergeFrom((org.apache.mesos.executor.Protos.Event.Launch)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.executor.Protos.Event.Launch other) {
+ if (other == org.apache.mesos.executor.Protos.Event.Launch.getDefaultInstance()) return this;
+ if (other.hasTask()) {
+ mergeTask(other.getTask());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasTask()) {
+
+ return false;
+ }
+ if (!getTask().isInitialized()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.executor.Protos.Event.Launch parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.executor.Protos.Event.Launch) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required .mesos.TaskInfo task = 1;
+ private org.apache.mesos.Protos.TaskInfo task_ = org.apache.mesos.Protos.TaskInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.TaskInfo, org.apache.mesos.Protos.TaskInfo.Builder, org.apache.mesos.Protos.TaskInfoOrBuilder> taskBuilder_;
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public boolean hasTask() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public org.apache.mesos.Protos.TaskInfo getTask() {
+ if (taskBuilder_ == null) {
+ return task_;
+ } else {
+ return taskBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public Builder setTask(org.apache.mesos.Protos.TaskInfo value) {
+ if (taskBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ task_ = value;
+ onChanged();
+ } else {
+ taskBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public Builder setTask(
+ org.apache.mesos.Protos.TaskInfo.Builder builderForValue) {
+ if (taskBuilder_ == null) {
+ task_ = builderForValue.build();
+ onChanged();
+ } else {
+ taskBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public Builder mergeTask(org.apache.mesos.Protos.TaskInfo value) {
+ if (taskBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ task_ != org.apache.mesos.Protos.TaskInfo.getDefaultInstance()) {
+ task_ =
+ org.apache.mesos.Protos.TaskInfo.newBuilder(task_).mergeFrom(value).buildPartial();
+ } else {
+ task_ = value;
+ }
+ onChanged();
+ } else {
+ taskBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public Builder clearTask() {
+ if (taskBuilder_ == null) {
+ task_ = org.apache.mesos.Protos.TaskInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ taskBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public org.apache.mesos.Protos.TaskInfo.Builder getTaskBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getTaskFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ public org.apache.mesos.Protos.TaskInfoOrBuilder getTaskOrBuilder() {
+ if (taskBuilder_ != null) {
+ return taskBuilder_.getMessageOrBuilder();
+ } else {
+ return task_;
+ }
+ }
+ /**
+ * <code>required .mesos.TaskInfo task = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.TaskInfo, org.apache.mesos.Protos.TaskInfo.Builder, org.apache.mesos.Protos.TaskInfoOrBuilder>
+ getTaskFieldBuilder() {
+
<TRUNCATED>
[24/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/proto/mesos/scheduler.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/scheduler.proto b/myriad-commons/proto/mesos/scheduler.proto
deleted file mode 100644
index 0528a7e..0000000
--- a/myriad-commons/proto/mesos/scheduler.proto
+++ /dev/null
@@ -1,433 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto2";
-
-import "mesos/mesos.proto";
-
-package mesos.scheduler;
-
-option java_package = "org.apache.mesos.scheduler";
-option java_outer_classname = "Protos";
-
-
-/**
- * Scheduler event API.
- *
- * An event is described using the standard protocol buffer "union"
- * trick, see:
- * https://developers.google.com/protocol-buffers/docs/techniques#union.
- */
-message Event {
- // Possible event types, followed by message definitions if
- // applicable.
- enum Type {
- // This must be the first enum value in this list, to
- // ensure that if 'type' is not set, the default value
- // is UNKNOWN. This enables enum values to be added
- // in a backwards-compatible way. See: MESOS-4997.
- UNKNOWN = 0;
-
- SUBSCRIBED = 1; // See 'Subscribed' below.
- OFFERS = 2; // See 'Offers' below.
- INVERSE_OFFERS = 9; // See 'InverseOffers' below.
- RESCIND = 3; // See 'Rescind' below.
- RESCIND_INVERSE_OFFER = 10; // See 'RescindInverseOffer' below.
- UPDATE = 4; // See 'Update' below.
- MESSAGE = 5; // See 'Message' below.
- FAILURE = 6; // See 'Failure' below.
- ERROR = 7; // See 'Error' below.
-
- // Periodic message sent by the Mesos master according to
- // 'Subscribed.heartbeat_interval_seconds'. If the scheduler does
- // not receive any events (including heartbeats) for an extended
- // period of time (e.g., 5 x heartbeat_interval_seconds), there is
- // likely a network partition. In such a case the scheduler should
- // close the existing subscription connection and resubscribe
- // using a backoff strategy.
- HEARTBEAT = 8;
- }
-
- // First event received when the scheduler subscribes.
- message Subscribed {
- required FrameworkID framework_id = 1;
-
- // This value will be set if the master is sending heartbeats. See
- // the comment above on 'HEARTBEAT' for more details.
- optional double heartbeat_interval_seconds = 2;
-
- // Since Mesos 1.1.
- optional MasterInfo master_info = 3;
- }
-
- // Received whenever there are new resources that are offered to the
- // scheduler. Each offer corresponds to a set of resources on an
- // agent. Until the scheduler accepts or declines an offer the
- // resources are considered allocated to the scheduler.
- message Offers {
- repeated Offer offers = 1;
- }
-
- // Received whenever there are resources requested back from the
- // scheduler. Each inverse offer specifies the agent, and
- // optionally specific resources. Accepting or Declining an inverse
- // offer informs the allocator of the scheduler's ability to release
- // the specified resources without violating an SLA. If no resources
- // are specified then all resources on the agent are requested to be
- // released.
- message InverseOffers {
- repeated InverseOffer inverse_offers = 1;
- }
-
- // Received when a particular offer is no longer valid (e.g., the
- // slave corresponding to the offer has been removed) and hence
- // needs to be rescinded. Any future calls ('Accept' / 'Decline') made
- // by the scheduler regarding this offer will be invalid.
- message Rescind {
- required OfferID offer_id = 1;
- }
-
- // Received when a particular inverse offer is no longer valid
- // (e.g., the agent corresponding to the offer has been removed)
- // and hence needs to be rescinded. Any future calls ('Accept' /
- // 'Decline') made by the scheduler regarding this inverse offer
- // will be invalid.
- message RescindInverseOffer {
- required OfferID inverse_offer_id = 1;
- }
-
- // Received whenever there is a status update that is generated by
- // the executor or slave or master. Status updates should be used by
- // executors to reliably communicate the status of the tasks that
- // they manage. It is crucial that a terminal update (see TaskState
- // in mesos.proto) is sent by the executor as soon as the task
- // terminates, in order for Mesos to release the resources allocated
- // to the task. It is also the responsibility of the scheduler to
- // explicitly acknowledge the receipt of a status update. See
- // 'Acknowledge' in the 'Call' section below for the semantics.
- //
- // A task status update may be used for guaranteed delivery of some
- // task-related information, e.g., task's health update. Such
- // information may be shadowed by subsequent task status updates, that
- // do not preserve fields of the previously sent message.
- message Update {
- required TaskStatus status = 1;
- }
-
- // Received when a custom message generated by the executor is
- // forwarded by the master. Note that this message is not
- // interpreted by Mesos and is only forwarded (without reliability
- // guarantees) to the scheduler. It is up to the executor to retry
- // if the message is dropped for any reason.
- message Message {
- required SlaveID slave_id = 1;
- required ExecutorID executor_id = 2;
- required bytes data = 3;
- }
-
- // Received when a slave is removed from the cluster (e.g., failed
- // health checks) or when an executor is terminated. Note that, this
- // event coincides with receipt of terminal UPDATE events for any
- // active tasks belonging to the slave or executor and receipt of
- // 'Rescind' events for any outstanding offers belonging to the
- // slave. Note that there is no guaranteed order between the
- // 'Failure', 'Update' and 'Rescind' events when a slave or executor
- // is removed.
- // TODO(vinod): Consider splitting the lost slave and terminated
- // executor into separate events and ensure it's reliably generated.
- message Failure {
- optional SlaveID slave_id = 1;
-
- // If this was just a failure of an executor on a slave then
- // 'executor_id' will be set and possibly 'status' (if we were
- // able to determine the exit status).
- optional ExecutorID executor_id = 2;
-
- // On Posix, `status` corresponds to termination information in the
- // `stat_loc` area returned from a `waitpid` call. On Windows, `status`
- // is obtained via calling the `GetExitCodeProcess()` function. For
- // messages coming from Posix agents, schedulers need to apply
- // `WEXITSTATUS` family macros or equivalent transformations to obtain
- // exit codes.
- //
- // TODO(alexr): Consider unifying Windows and Posix behavior by returning
- // exit code here, see MESOS-7241.
- optional int32 status = 3;
- }
-
- // Received when there is an unrecoverable error in the scheduler (e.g.,
- // scheduler failed over, rate limiting, authorization errors etc.). The
- // scheduler should abort on receiving this event.
- message Error {
- required string message = 1;
- }
-
- // Type of the event, indicates which optional field below should be
- // present if that type has a nested message definition.
- // Enum fields should be optional, see: MESOS-4997.
- optional Type type = 1;
-
- optional Subscribed subscribed = 2;
- optional Offers offers = 3;
- optional InverseOffers inverse_offers = 9;
- optional Rescind rescind = 4;
- optional RescindInverseOffer rescind_inverse_offer = 10;
- optional Update update = 5;
- optional Message message = 6;
- optional Failure failure = 7;
- optional Error error = 8;
-}
-
-
-/**
- * Scheduler call API.
- *
- * Like Event, a Call is described using the standard protocol buffer
- * "union" trick (see above).
- */
-message Call {
- // Possible call types, followed by message definitions if
- // applicable.
- enum Type {
- // See comments above on `Event::Type` for more details on this enum value.
- UNKNOWN = 0;
-
- SUBSCRIBE = 1; // See 'Subscribe' below.
- TEARDOWN = 2; // Shuts down all tasks/executors and removes framework.
- ACCEPT = 3; // See 'Accept' below.
- DECLINE = 4; // See 'Decline' below.
- ACCEPT_INVERSE_OFFERS = 13; // See 'AcceptInverseOffers' below.
- DECLINE_INVERSE_OFFERS = 14; // See 'DeclineInverseOffers' below.
- REVIVE = 5; // Removes any previous filters set via ACCEPT or DECLINE.
- KILL = 6; // See 'Kill' below.
- SHUTDOWN = 7; // See 'Shutdown' below.
- ACKNOWLEDGE = 8; // See 'Acknowledge' below.
- RECONCILE = 9; // See 'Reconcile' below.
- MESSAGE = 10; // See 'Message' below.
- REQUEST = 11; // See 'Request' below.
- SUPPRESS = 12; // Inform master to stop sending offers to the framework.
-
- // TODO(benh): Consider adding an 'ACTIVATE' and 'DEACTIVATE' for
- // already subscribed frameworks as a way of stopping offers from
- // being generated and other events from being sent by the master.
- // Note that this functionality existed originally to support
- // SchedulerDriver::abort which was only necessary to handle
- // exceptions getting thrown from within Scheduler callbacks,
- // something that is not an issue with the Event/Call API.
- }
-
- // Subscribes the scheduler with the master to receive events. A
- // scheduler must send other calls only after it has received the
- // SUBCRIBED event.
- message Subscribe {
- // See the comments below on 'framework_id' on the semantics for
- // 'framework_info.id'.
- required FrameworkInfo framework_info = 1;
-
- // NOTE: 'force' field is not present in v1/scheduler.proto because it is
- // only used by the scheduler driver. The driver sets it to true when the
- // scheduler re-registers for the first time after a failover. Once
- // re-registered all subsequent re-registration attempts (e.g., due to ZK
- // blip) will have 'force' set to false. This is important because master
- // uses this field to know when it needs to send FrameworkRegisteredMessage
- // vs FrameworkReregisteredMessage.
- optional bool force = 2;
-
- // List of suppressed roles for which the framework does not wish to be
- // offered resources. The framework can decide to suppress all or a subset
- // of roles the framework (re)registers as.
- //
- // Note: This field is not set by scheduler driver, so will always be
- // empty. It is added here for transformation from `v1::Call::Subscribe`.
- repeated string suppressed_roles = 3;
- }
-
- // Accepts an offer, performing the specified operations
- // in a sequential manner.
- //
- // E.g. Launch a task with a newly reserved persistent volume:
- //
- // Accept {
- // offer_ids: [ ... ]
- // operations: [
- // { type: RESERVE,
- // reserve: { resources: [ disk(role):2 ] } }
- // { type: CREATE,
- // create: { volumes: [ disk(role):1+persistence ] } }
- // { type: LAUNCH,
- // launch: { task_infos ... disk(role):1;disk(role):1+persistence } }
- // ]
- // }
- //
- // NOTE: Any of the offer’s resources not used in the `Accept` call
- // (e.g., to launch a task) are considered unused and might be
- // reoffered to other frameworks. In other words, the same `OfferID`
- // cannot be used in more than one `Accept` call.
- // NOTE: All offers must belong to the same agent.
- message Accept {
- repeated OfferID offer_ids = 1;
- repeated Offer.Operation operations = 2;
- optional Filters filters = 3;
- }
-
- // Declines an offer, signaling the master to potentially reoffer
- // the resources to a different framework. Note that this is same
- // as sending an Accept call with no operations. See comments on
- // top of 'Accept' for semantics.
- message Decline {
- repeated OfferID offer_ids = 1;
- optional Filters filters = 2;
- }
-
- // Accepts an inverse offer. Inverse offers should only be accepted
- // if the resources in the offer can be safely evacuated before the
- // provided unavailability.
- message AcceptInverseOffers {
- repeated OfferID inverse_offer_ids = 1;
- optional Filters filters = 2;
- }
-
- // Declines an inverse offer. Inverse offers should be declined if
- // the resources in the offer might not be safely evacuated before
- // the provided unavailability.
- message DeclineInverseOffers {
- repeated OfferID inverse_offer_ids = 1;
- optional Filters filters = 2;
- }
-
- // Revive offers for the specified roles. If `roles` is empty,
- // the `REVIVE` call will revive offers for all of the roles
- // the framework is currently subscribed to.
- message Revive {
- repeated string roles = 1;
- }
-
- // Kills a specific task. If the scheduler has a custom executor,
- // the kill is forwarded to the executor and it is up to the
- // executor to kill the task and send a TASK_KILLED (or TASK_FAILED)
- // update. Note that Mesos releases the resources for a task once it
- // receives a terminal update (See TaskState in mesos.proto) for it.
- // If the task is unknown to the master, a TASK_LOST update is
- // generated.
- //
- // If a task within a task group is killed before the group is
- // delivered to the executor, all tasks in the task group are
- // killed. When a task group has been delivered to the executor,
- // it is up to the executor to decide how to deal with the kill.
- // Note The default Mesos executor will currently kill all the
- // tasks in the task group if it gets a kill for any task.
- message Kill {
- required TaskID task_id = 1;
- optional SlaveID slave_id = 2;
-
- // If set, overrides any previously specified kill policy for this task.
- // This includes 'TaskInfo.kill_policy' and 'Executor.kill.kill_policy'.
- // Can be used to forcefully kill a task which is already being killed.
- optional KillPolicy kill_policy = 3;
- }
-
- // Shuts down a custom executor. When the executor gets a shutdown
- // event, it is expected to kill all its tasks (and send TASK_KILLED
- // updates) and terminate. If the executor doesn’t terminate within
- // a certain timeout (configurable via
- // '--executor_shutdown_grace_period' slave flag), the slave will
- // forcefully destroy the container (executor and its tasks) and
- // transition its active tasks to TASK_LOST.
- message Shutdown {
- required ExecutorID executor_id = 1;
- required SlaveID slave_id = 2;
- }
-
- // Acknowledges the receipt of status update. Schedulers are
- // responsible for explicitly acknowledging the receipt of status
- // updates that have 'Update.status().uuid()' field set. Such status
- // updates are retried by the slave until they are acknowledged by
- // the scheduler.
- message Acknowledge {
- required SlaveID slave_id = 1;
- required TaskID task_id = 2;
- required bytes uuid = 3;
- }
-
- // Allows the scheduler to query the status for non-terminal tasks.
- // This causes the master to send back the latest task status for
- // each task in 'tasks', if possible. Tasks that are no longer known
- // will result in a TASK_LOST, TASK_UNKNOWN, or TASK_UNREACHABLE update.
- // If 'tasks' is empty, then the master will send the latest status
- // for each task currently known.
- message Reconcile {
- // TODO(vinod): Support arbitrary queries than just state of tasks.
- message Task {
- required TaskID task_id = 1;
- optional SlaveID slave_id = 2;
- }
-
- repeated Task tasks = 1;
- }
-
- // Sends arbitrary binary data to the executor. Note that Mesos
- // neither interprets this data nor makes any guarantees about the
- // delivery of this message to the executor.
- message Message {
- required SlaveID slave_id = 1;
- required ExecutorID executor_id = 2;
- required bytes data = 3;
- }
-
- // Requests a specific set of resources from Mesos's allocator. If
- // the allocator has support for this, corresponding offers will be
- // sent asynchronously via the OFFERS event(s).
- //
- // NOTE: The built-in hierarchical allocator doesn't have support
- // for this call and hence simply ignores it.
- message Request {
- repeated mesos.Request requests = 1;
- }
-
- // Suppress offers for the specified roles. If `roles` is empty,
- // the `SUPPRESS` call will suppress offers for all of the roles
- // the framework is currently subscribed to.
- message Suppress {
- repeated string roles = 1;
- }
-
- // Identifies who generated this call. Master assigns a framework id
- // when a new scheduler subscribes for the first time. Once assigned,
- // the scheduler must set the 'framework_id' here and within its
- // FrameworkInfo (in any further 'Subscribe' calls). This allows the
- // master to identify a scheduler correctly across disconnections,
- // failovers, etc.
- optional FrameworkID framework_id = 1;
-
- // Type of the call, indicates which optional field below should be
- // present if that type has a nested message definition.
- // See comments on `Event::Type` above on the reasoning behind this field being optional.
- optional Type type = 2;
-
- optional Subscribe subscribe = 3;
- optional Accept accept = 4;
- optional Decline decline = 5;
- optional AcceptInverseOffers accept_inverse_offers = 13;
- optional DeclineInverseOffers decline_inverse_offers = 14;
- optional Revive revive = 15;
- optional Kill kill = 6;
- optional Shutdown shutdown = 7;
- optional Acknowledge acknowledge = 8;
- optional Reconcile reconcile = 9;
- optional Message message = 10;
- optional Request request = 11;
- optional Suppress suppress = 16;
-}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/proto/mesos/v1/executor.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/v1/executor.proto b/myriad-commons/proto/mesos/v1/executor.proto
deleted file mode 100644
index b2ef325..0000000
--- a/myriad-commons/proto/mesos/v1/executor.proto
+++ /dev/null
@@ -1,214 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto2";
-
-import "mesos/v1/mesos.proto";
-
-package mesos.v1.executor;
-
-option java_package = "org.apache.mesos.v1.executor";
-option java_outer_classname = "Protos";
-
-
-/**
- * Executor event API.
- *
- * An event is described using the standard protocol buffer "union"
- * trick, see https://developers.google.com/protocol-buffers/docs/techniques#union.
- */
-message Event {
- // Possible event types, followed by message definitions if
- // applicable.
- enum Type {
- // This must be the first enum value in this list, to
- // ensure that if 'type' is not set, the default value
- // is UNKNOWN. This enables enum values to be added
- // in a backwards-compatible way. See: MESOS-4997.
- UNKNOWN = 0;
-
- SUBSCRIBED = 1; // See 'Subscribed' below.
- LAUNCH = 2; // See 'Launch' below.
- LAUNCH_GROUP = 8; // See 'LaunchGroup' below.
- KILL = 3; // See 'Kill' below.
- ACKNOWLEDGED = 4; // See 'Acknowledged' below.
- MESSAGE = 5; // See 'Message' below.
- ERROR = 6; // See 'Error' below.
-
- // Received when the agent asks the executor to shutdown/kill itself.
- // The executor is then required to kill all its active tasks, send
- // `TASK_KILLED` status updates and gracefully exit. The executor
- // should terminate within a `MESOS_EXECUTOR_SHUTDOWN_GRACE_PERIOD`
- // (an environment variable set by the agent upon executor startup);
- // it can be configured via `ExecutorInfo.shutdown_grace_period`. If
- // the executor fails to do so, the agent will forcefully destroy the
- // container where the executor is running. The agent would then send
- // `TASK_LOST` updates for any remaining active tasks of this executor.
- //
- // NOTE: The executor must not assume that it will always be allotted
- // the full grace period, as the agent may decide to allot a shorter
- // period and failures / forcible terminations may occur.
- //
- // TODO(alexr): Consider adding a duration field into the `Shutdown`
- // message so that the agent can communicate when a shorter period
- // has been allotted.
- SHUTDOWN = 7;
- }
-
- // First event received when the executor subscribes.
- // The 'id' field in the 'framework_info' will be set.
- message Subscribed {
- required ExecutorInfo executor_info = 1;
- required FrameworkInfo framework_info = 2;
- required AgentInfo agent_info = 3;
-
- // Uniquely identifies the container of an executor run.
- optional ContainerID container_id = 4;
- }
-
- // Received when the framework attempts to launch a task. Once
- // the task is successfully launched, the executor must respond with
- // a TASK_RUNNING update (See TaskState in v1/mesos.proto).
- message Launch {
- required TaskInfo task = 1;
- }
-
- // Received when the framework attempts to launch a group of tasks atomically.
- // Similar to `Launch` above the executor must send TASK_RUNNING updates for
- // tasks that are successfully launched.
- message LaunchGroup {
- required TaskGroupInfo task_group = 1;
- }
-
- // Received when the scheduler wants to kill a specific task. Once
- // the task is terminated, the executor should send a TASK_KILLED
- // (or TASK_FAILED) update. The terminal update is necessary so
- // Mesos can release the resources associated with the task.
- message Kill {
- required TaskID task_id = 1;
-
- // If set, overrides any previously specified kill policy for this task.
- // This includes 'TaskInfo.kill_policy' and 'Executor.kill.kill_policy'.
- // Can be used to forcefully kill a task which is already being killed.
- optional KillPolicy kill_policy = 2;
- }
-
- // Received when the agent acknowledges the receipt of status
- // update. Schedulers are responsible for explicitly acknowledging
- // the receipt of status updates that have 'update.status().uuid()'
- // field set. Unacknowledged updates can be retried by the executor.
- // They should also be sent by the executor whenever it
- // re-subscribes.
- message Acknowledged {
- required TaskID task_id = 1;
- required bytes uuid = 2;
- }
-
- // Received when a custom message generated by the scheduler is
- // forwarded by the agent. Note that this message is not
- // interpreted by Mesos and is only forwarded (without reliability
- // guarantees) to the executor. It is up to the scheduler to retry
- // if the message is dropped for any reason.
- message Message {
- required bytes data = 1;
- }
-
- // Received in case the executor sends invalid calls (e.g.,
- // required values not set).
- // TODO(arojas): Remove this once the old executor driver is no
- // longer supported. With HTTP API all errors will be signaled via
- // HTTP response codes.
- message Error {
- required string message = 1;
- }
-
- // Type of the event, indicates which optional field below should be
- // present if that type has a nested message definition.
- // Enum fields should be optional, see: MESOS-4997.
- optional Type type = 1;
-
- optional Subscribed subscribed = 2;
- optional Acknowledged acknowledged = 3;
- optional Launch launch = 4;
- optional LaunchGroup launch_group = 8;
- optional Kill kill = 5;
- optional Message message = 6;
- optional Error error = 7;
-}
-
-
-/**
- * Executor call API.
- *
- * Like Event, a Call is described using the standard protocol buffer
- * "union" trick (see above).
- */
- message Call {
- // Possible call types, followed by message definitions if
- // applicable.
- enum Type {
- // See comments above on `Event::Type` for more details on this enum value.
- UNKNOWN = 0;
-
- SUBSCRIBE = 1; // See 'Subscribe' below.
- UPDATE = 2; // See 'Update' below.
- MESSAGE = 3; // See 'Message' below.
- }
-
- // Request to subscribe with the agent. If subscribing after a disconnection,
- // it must include a list of all the tasks and updates which haven't been
- // acknowledged by the scheduler.
- message Subscribe {
- repeated TaskInfo unacknowledged_tasks = 1;
- repeated Update unacknowledged_updates = 2;
- }
-
- // Notifies the scheduler that a task has transitioned from one
- // state to another. Status updates should be used by executors
- // to reliably communicate the status of the tasks that they
- // manage. It is crucial that a terminal update (see TaskState
- // in v1/mesos.proto) is sent to the scheduler as soon as the task
- // terminates, in order for Mesos to release the resources allocated
- // to the task. It is the responsibility of the scheduler to
- // explicitly acknowledge the receipt of a status update. See
- // 'Acknowledged' in the 'Events' section above for the semantics.
- message Update {
- required TaskStatus status = 1;
- }
-
- // Sends arbitrary binary data to the scheduler. Note that Mesos
- // neither interprets this data nor makes any guarantees about the
- // delivery of this message to the scheduler.
- // See 'Message' in the 'Events' section.
- message Message {
- required bytes data = 2;
- }
-
- // Identifies the executor which generated this call.
- required ExecutorID executor_id = 1;
- required FrameworkID framework_id = 2;
-
- // Type of the call, indicates which optional field below should be
- // present if that type has a nested message definition.
- // In case type is SUBSCRIBED, no message needs to be set.
- // See comments on `Event::Type` above on the reasoning behind this
- // field being optional.
- optional Type type = 3;
-
- optional Subscribe subscribe = 4;
- optional Update update = 5;
- optional Message message = 6;
-}
[12/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/proto/mesos/v1/mesos.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/v1/mesos.proto b/myriad-commons/proto/mesos/v1/mesos.proto
new file mode 100644
index 0000000..4d905d3
--- /dev/null
+++ b/myriad-commons/proto/mesos/v1/mesos.proto
@@ -0,0 +1,3173 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto2";
+
+package mesos.v1;
+
+option java_package = "org.apache.mesos.v1";
+option java_outer_classname = "Protos";
+
+
+/**
+ * Status is used to indicate the state of the scheduler and executor
+ * driver after function calls.
+ */
+enum Status {
+ DRIVER_NOT_STARTED = 1;
+ DRIVER_RUNNING = 2;
+ DRIVER_ABORTED = 3;
+ DRIVER_STOPPED = 4;
+}
+
+
+/**
+ * A unique ID assigned to a framework. A framework can reuse this ID
+ * in order to do failover (see MesosSchedulerDriver).
+ */
+message FrameworkID {
+ required string value = 1;
+}
+
+
+/**
+ * A unique ID assigned to an offer.
+ */
+message OfferID {
+ required string value = 1;
+}
+
+
+/**
+ * A unique ID assigned to an agent. Currently, an agent gets a new ID
+ * whenever it (re)registers with Mesos. Framework writers shouldn't
+ * assume any binding between an agent ID and and a hostname.
+ */
+message AgentID {
+ required string value = 1;
+}
+
+
+/**
+ * A framework-generated ID to distinguish a task. The ID must remain
+ * unique while the task is active. A framework can reuse an ID _only_
+ * if the previous task with the same ID has reached a terminal state
+ * (e.g., TASK_FINISHED, TASK_KILLED, etc.). However, reusing task IDs
+ * is strongly discouraged (MESOS-2198).
+ */
+message TaskID {
+ required string value = 1;
+}
+
+
+/**
+ * A framework-generated ID to distinguish an executor. Only one
+ * executor with the same ID can be active on the same agent at a
+ * time. However, reusing executor IDs is discouraged.
+ */
+message ExecutorID {
+ required string value = 1;
+}
+
+
+/**
+ * ID used to uniquely identify a container. If the `parent` is not
+ * specified, the ID is a UUID generated by the agent to uniquely
+ * identify the container of an executor run. If the `parent` field is
+ * specified, it represents a nested container.
+ */
+message ContainerID {
+ required string value = 1;
+ optional ContainerID parent = 2;
+}
+
+
+/**
+ * A unique ID assigned to a resource provider. Currently, a resource
+ * provider gets a new ID whenever it (re)registers with Mesos.
+ */
+message ResourceProviderID {
+ required string value = 1;
+}
+
+
+/**
+ * Represents time since the epoch, in nanoseconds.
+ */
+message TimeInfo {
+ required int64 nanoseconds = 1;
+}
+
+
+/**
+ * Represents duration in nanoseconds.
+ */
+message DurationInfo {
+ required int64 nanoseconds = 1;
+}
+
+
+/**
+ * A network address.
+ *
+ * TODO(bmahler): Use this more widely.
+ */
+message Address {
+ // May contain a hostname, IP address, or both.
+ optional string hostname = 1;
+ optional string ip = 2;
+
+ required int32 port = 3;
+}
+
+
+/**
+ * Represents a URL.
+ */
+message URL {
+ required string scheme = 1;
+ required Address address = 2;
+ optional string path = 3;
+ repeated Parameter query = 4;
+ optional string fragment = 5;
+}
+
+
+/**
+ * Represents an interval, from a given start time over a given duration.
+ * This interval pertains to an unavailability event, such as maintenance,
+ * and is not a generic interval.
+ */
+message Unavailability {
+ required TimeInfo start = 1;
+
+ // When added to `start`, this represents the end of the interval.
+ // If unspecified, the duration is assumed to be infinite.
+ optional DurationInfo duration = 2;
+
+ // TODO(josephw): Add additional fields for expressing the purpose and
+ // urgency of the unavailability event.
+}
+
+
+/**
+ * Represents a single machine, which may hold one or more agents.
+ *
+ * NOTE: In order to match an agent to a machine, both the `hostname` and
+ * `ip` must match the values advertised by the agent to the master.
+ * Hostname is not case-sensitive.
+ */
+message MachineID {
+ optional string hostname = 1;
+ optional string ip = 2;
+}
+
+
+/**
+ * Holds information about a single machine, its `mode`, and any other
+ * relevant information which may affect the behavior of the machine.
+ */
+message MachineInfo {
+ // Describes the several states that a machine can be in. A `Mode`
+ // applies to a machine and to all associated agents on the machine.
+ enum Mode {
+ // In this mode, a machine is behaving normally;
+ // offering resources, executing tasks, etc.
+ UP = 1;
+
+ // In this mode, all agents on the machine are expected to cooperate with
+ // frameworks to drain resources. In general, draining is done ahead of
+ // a pending `unavailability`. The resources should be drained so as to
+ // maximize utilization prior to the maintenance but without knowingly
+ // violating the frameworks' requirements.
+ DRAINING = 2;
+
+ // In this mode, a machine is not running any tasks and will not offer
+ // any of its resources. Agents on the machine will not be allowed to
+ // register with the master.
+ DOWN = 3;
+ }
+
+ required MachineID id = 1;
+ optional Mode mode = 2;
+
+ // Signifies that the machine may be unavailable during the given interval.
+ // See comments in `Unavailability` and for the `unavailability` fields
+ // in `Offer` and `InverseOffer` for more information.
+ optional Unavailability unavailability = 3;
+}
+
+
+/**
+ * Describes a framework.
+ */
+message FrameworkInfo {
+ // Used to determine the Unix user that an executor or task should be
+ // launched as.
+ //
+ // When using the MesosSchedulerDriver, if the field is set to an
+ // empty string, it will automagically set it to the current user.
+ //
+ // When using the HTTP Scheduler API, the user has to be set
+ // explicitly.
+ required string user = 1;
+
+ // Name of the framework that shows up in the Mesos Web UI.
+ required string name = 2;
+
+ // Note that 'id' is only available after a framework has
+ // registered, however, it is included here in order to facilitate
+ // scheduler failover (i.e., if it is set then the
+ // MesosSchedulerDriver expects the scheduler is performing
+ // failover).
+ optional FrameworkID id = 3;
+
+ // The amount of time (in seconds) that the master will wait for the
+ // scheduler to failover before it tears down the framework by
+ // killing all its tasks/executors. This should be non-zero if a
+ // framework expects to reconnect after a failure and not lose its
+ // tasks/executors.
+ //
+ // NOTE: To avoid accidental destruction of tasks, production
+ // frameworks typically set this to a large value (e.g., 1 week).
+ optional double failover_timeout = 4 [default = 0.0];
+
+ // If set, agents running tasks started by this framework will write
+ // the framework pid, executor pids and status updates to disk. If
+ // the agent exits (e.g., due to a crash or as part of upgrading
+ // Mesos), this checkpointed data allows the restarted agent to
+ // reconnect to executors that were started by the old instance of
+ // the agent. Enabling checkpointing improves fault tolerance, at
+ // the cost of a (usually small) increase in disk I/O.
+ optional bool checkpoint = 5 [default = false];
+
+ // Roles are the entities to which allocations are made.
+ // The framework must have at least one role in order to
+ // be offered resources. Note that `role` is deprecated
+ // in favor of `roles` and only one of these fields must
+ // be used. Since we cannot distinguish between empty
+ // `roles` and the default unset `role`, we require that
+ // frameworks set the `MULTI_ROLE` capability if
+ // setting the `roles` field.
+ optional string role = 6 [default = "*", deprecated=true];
+ repeated string roles = 12;
+
+ // Used to indicate the current host from which the scheduler is
+ // registered in the Mesos Web UI. If set to an empty string Mesos
+ // will automagically set it to the current hostname if one is
+ // available.
+ optional string hostname = 7;
+
+ // This field should match the credential's principal the framework
+ // uses for authentication. This field is used for framework API
+ // rate limiting and dynamic reservations. It should be set even
+ // if authentication is not enabled if these features are desired.
+ optional string principal = 8;
+
+ // This field allows a framework to advertise its web UI, so that
+ // the Mesos web UI can link to it. It is expected to be a full URL,
+ // for example http://my-scheduler.example.com:8080/.
+ optional string webui_url = 9;
+
+ message Capability {
+ enum Type {
+ // This must be the first enum value in this list, to
+ // ensure that if 'type' is not set, the default value
+ // is UNKNOWN. This enables enum values to be added
+ // in a backwards-compatible way. See: MESOS-4997.
+ UNKNOWN = 0;
+
+ // Receive offers with revocable resources. See 'Resource'
+ // message for details.
+ REVOCABLE_RESOURCES = 1;
+
+ // Receive the TASK_KILLING TaskState when a task is being
+ // killed by an executor. The executor will examine this
+ // capability to determine whether it can send TASK_KILLING.
+ TASK_KILLING_STATE = 2;
+
+ // Indicates whether the framework is aware of GPU resources.
+ // Frameworks that are aware of GPU resources are expected to
+ // avoid placing non-GPU workloads on GPU agents, in order
+ // to avoid occupying a GPU agent and preventing GPU workloads
+ // from running! Currently, if a framework is unaware of GPU
+ // resources, it will not be offered *any* of the resources on
+ // an agent with GPUs. This restriction is in place because we
+ // do not have a revocation mechanism that ensures GPU workloads
+ // can evict GPU agent occupants if necessary.
+ //
+ // TODO(bmahler): As we add revocation we can relax the
+ // restriction here. See MESOS-5634 for more information.
+ GPU_RESOURCES = 3;
+
+ // Receive offers with resources that are shared.
+ SHARED_RESOURCES = 4;
+
+ // Indicates that (1) the framework is prepared to handle the
+ // following TaskStates: TASK_UNREACHABLE, TASK_DROPPED,
+ // TASK_GONE, TASK_GONE_BY_OPERATOR, and TASK_UNKNOWN, and (2)
+ // the framework will assume responsibility for managing
+ // partitioned tasks that reregister with the master.
+ //
+ // Frameworks that enable this capability can define how they
+ // would like to handle partitioned tasks. Frameworks will
+ // receive TASK_UNREACHABLE for tasks on agents that are
+ // partitioned from the master. If/when a partitioned agent
+ // reregisters, tasks on the agent that were started by
+ // PARTITION_AWARE frameworks will not killed.
+ //
+ // Without this capability, frameworks will receive TASK_LOST
+ // for tasks on partitioned agents; such tasks will be killed by
+ // Mesos when the agent reregisters (unless the master has
+ // failed over).
+ PARTITION_AWARE = 5;
+
+ // This expresses the ability for the framework to be
+ // "multi-tenant" via using the newly introduced `roles`
+ // field, and examining `Offer.allocation_info` to determine
+ // which role the offers are being made to. We also
+ // expect that "single-tenant" schedulers eventually
+ // provide this and move away from the deprecated
+ // `role` field.
+ MULTI_ROLE = 6;
+
+ // This capability has two effects for a framework.
+ //
+ // (1) The framework is offered resources in a new format.
+ //
+ // The offered resources have the `Resource.reservations` field set
+ // rather than `Resource.role` and `Resource.reservation`. In short,
+ // an empty `reservations` field denotes unreserved resources, and
+ // each `ReservationInfo` in the `reservations` field denotes a
+ // reservation that refines the previous one.
+ //
+ // See the 'Resource Format' section for more details.
+ //
+ // (2) The framework can create refined reservations.
+ //
+ // A framework can refine an existing reservation via the
+ // `Resource.reservations` field. For example, a reservation for role
+ // `eng` can be refined to `eng/front_end`.
+ //
+ // See `ReservationInfo.reservations` for more details.
+ //
+ // NOTE: Without this capability, a framework is not offered resources
+ // that have refined reservations. A resource is said to have refined
+ // reservations if it uses the `Resource.reservations` field, and
+ // `Resource.reservations_size() > 1`.
+ RESERVATION_REFINEMENT = 7; // EXPERIMENTAL.
+
+ // Indicates that the framework is prepared to receive offers
+ // for agents whose region is different from the master's
+ // region. Network links between hosts in different regions
+ // typically have higher latency and lower bandwidth than
+ // network links within a region, so frameworks should be
+ // careful to only place suitable workloads in remote regions.
+ // Frameworks that are not region-aware will never receive
+ // offers for remote agents; region-aware frameworks are assumed
+ // to implement their own logic to decide which workloads (if
+ // any) are suitable for placement on remote agents.
+ REGION_AWARE = 8;
+ }
+
+ // Enum fields should be optional, see: MESOS-4997.
+ optional Type type = 1;
+ }
+
+ // This field allows a framework to advertise its set of
+ // capabilities (e.g., ability to receive offers for revocable
+ // resources).
+ repeated Capability capabilities = 10;
+
+ // Labels are free-form key value pairs supplied by the framework
+ // scheduler (e.g., to describe additional functionality offered by
+ // the framework). These labels are not interpreted by Mesos itself.
+ // Labels should not contain duplicate key-value pairs.
+ optional Labels labels = 11;
+}
+
+
+/**
+ * Describes a general non-interpreting non-killing check for a task or
+ * executor (or any arbitrary process/command). A type is picked by
+ * specifying one of the optional fields. Specifying more than one type
+ * is an error.
+ *
+ * NOTE: This API is unstable and the related feature is experimental.
+ */
+message CheckInfo {
+ enum Type {
+ UNKNOWN = 0;
+ COMMAND = 1;
+ HTTP = 2;
+ TCP = 3;
+
+ // TODO(alexr): Consider supporting custom user checks. They should
+ // probably be paired with a `data` field and complemented by a
+ // `data` response in `CheckStatusInfo`.
+ }
+
+ // Describes a command check. If applicable, enters mount and/or network
+ // namespaces of the task.
+ message Command {
+ required CommandInfo command = 1;
+ }
+
+ // Describes an HTTP check. Sends a GET request to
+ // http://<host>:port/path. Note that <host> is not configurable and is
+ // resolved automatically to 127.0.0.1.
+ message Http {
+ // Port to send the HTTP request.
+ required uint32 port = 1;
+
+ // HTTP request path.
+ optional string path = 2;
+
+ // TODO(alexr): Add support for HTTP method. While adding POST
+ // and PUT is simple, supporting payload is more involved.
+
+ // TODO(alexr): Add support for custom HTTP headers.
+
+ // TODO(alexr): Consider adding an optional message to describe TLS
+ // options and thus enabling https. Such message might contain certificate
+ // validation, TLS version.
+ }
+
+ // Describes a TCP check, i.e. based on establishing a TCP connection to
+ // the specified port. Note that <host> is not configurable and is resolved
+ // automatically to 127.0.0.1.
+ message Tcp {
+ required uint32 port = 1;
+ }
+
+ // The type of the check.
+ optional Type type = 1;
+
+ // Command check.
+ optional Command command = 2;
+
+ // HTTP check.
+ optional Http http = 3;
+
+ // TCP check.
+ optional Tcp tcp = 7;
+
+ // Amount of time to wait to start checking the task after it
+ // transitions to `TASK_RUNNING` or `TASK_STARTING` if the latter
+ // is used by the executor.
+ optional double delay_seconds = 4 [default = 15.0];
+
+ // Interval between check attempts, i.e., amount of time to wait after
+ // the previous check finished or timed out to start the next check.
+ optional double interval_seconds = 5 [default = 10.0];
+
+ // Amount of time to wait for the check to complete. Zero means infinite
+ // timeout.
+ //
+ // After this timeout, the check attempt is aborted and no result is
+ // reported. Note that this may be considered a state change and hence
+ // may trigger a check status change delivery to the corresponding
+ // scheduler. See `CheckStatusInfo` for more details.
+ optional double timeout_seconds = 6 [default = 20.0];
+}
+
+
+/**
+ * Describes a health check for a task or executor (or any arbitrary
+ * process/command). A type is picked by specifying one of the
+ * optional fields. Specifying more than one type is an error.
+ */
+message HealthCheck {
+ enum Type {
+ UNKNOWN = 0;
+ COMMAND = 1;
+ HTTP = 2;
+ TCP = 3;
+ }
+
+ // Describes an HTTP health check. Sends a GET request to
+ // scheme://<host>:port/path. Note that <host> is not configurable and is
+ // resolved automatically, in most cases to 127.0.0.1. Default executors
+ // treat return codes between 200 and 399 as success; custom executors
+ // may employ a different strategy, e.g. leveraging the `statuses` field.
+ message HTTPCheckInfo {
+ // Currently "http" and "https" are supported.
+ optional string scheme = 3;
+
+ // Port to send the HTTP request.
+ required uint32 port = 1;
+
+ // HTTP request path.
+ optional string path = 2;
+
+ // TODO(alexr): Add support for HTTP method. While adding POST
+ // and PUT is simple, supporting payload is more involved.
+
+ // TODO(alexr): Add support for custom HTTP headers.
+
+ // TODO(alexr): Add support for success and possibly failure
+ // statuses.
+
+ // NOTE: It is up to the custom executor to interpret and act on this
+ // field. Setting this field has no effect on the default executors.
+ //
+ // TODO(haosdent): Deprecate this field when we add better support for
+ // success and possibly failure statuses, e.g. ranges of success and
+ // failure statuses.
+ repeated uint32 statuses = 4;
+
+ // TODO(haosdent): Consider adding a flag to enable task's certificate
+ // validation for HTTPS health checks, see MESOS-5997.
+
+ // TODO(benh): Include an 'optional bytes data' field for checking
+ // for specific data in the response.
+ }
+
+ // Describes a TCP health check, i.e. based on establishing
+ // a TCP connection to the specified port.
+ message TCPCheckInfo {
+ // Port expected to be open.
+ required uint32 port = 1;
+ }
+
+ // TODO(benh): Consider adding a URL health check strategy which
+ // allows doing something similar to the HTTP strategy but
+ // encapsulates all the details in a single string field.
+
+ // Amount of time to wait to start health checking the task after it
+ // transitions to `TASK_RUNNING` or `TASK_STATING` if the latter is
+ // used by the executor.
+ optional double delay_seconds = 2 [default = 15.0];
+
+ // Interval between health checks, i.e., amount of time to wait after
+ // the previous health check finished or timed out to start the next
+ // health check.
+ optional double interval_seconds = 3 [default = 10.0];
+
+ // Amount of time to wait for the health check to complete. After this
+ // timeout, the health check is aborted and treated as a failure. Zero
+ // means infinite timeout.
+ optional double timeout_seconds = 4 [default = 20.0];
+
+ // Number of consecutive failures until the task is killed by the executor.
+ optional uint32 consecutive_failures = 5 [default = 3];
+
+ // Amount of time after the task is launched during which health check
+ // failures are ignored. Once a check succeeds for the first time,
+ // the grace period does not apply anymore. Note that it includes
+ // `delay_seconds`, i.e., setting `grace_period_seconds` < `delay_seconds`
+ // has no effect.
+ optional double grace_period_seconds = 6 [default = 10.0];
+
+ // TODO(alexr): Add an optional `KillPolicy` that should be used
+ // if the task is killed because of a health check failure.
+
+ // The type of health check.
+ optional Type type = 8;
+
+ // Command health check.
+ optional CommandInfo command = 7;
+
+ // HTTP health check.
+ optional HTTPCheckInfo http = 1;
+
+ // TCP health check.
+ optional TCPCheckInfo tcp = 9;
+}
+
+
+/**
+ * Describes a kill policy for a task. Currently does not express
+ * different policies (e.g. hitting HTTP endpoints), only controls
+ * how long to wait between graceful and forcible task kill:
+ *
+ * graceful kill --------------> forcible kill
+ * grace_period
+ *
+ * Kill policies are best-effort, because machine failures / forcible
+ * terminations may occur.
+ *
+ * NOTE: For executor-less command-based tasks, the kill is performed
+ * via sending a signal to the task process: SIGTERM for the graceful
+ * kill and SIGKILL for the forcible kill. For the docker executor-less
+ * tasks the grace period is passed to 'docker stop --time'.
+ */
+message KillPolicy {
+ // The grace period specifies how long to wait before forcibly
+ // killing the task. It is recommended to attempt to gracefully
+ // kill the task (and send TASK_KILLING) to indicate that the
+ // graceful kill is in progress. Once the grace period elapses,
+ // if the task has not terminated, a forcible kill should occur.
+ // The task should not assume that it will always be allotted
+ // the full grace period. For example, the executor may be
+ // shutdown more quickly by the agent, or failures / forcible
+ // terminations may occur.
+ optional DurationInfo grace_period = 1;
+}
+
+
+/**
+ * Describes a command, executed via: '/bin/sh -c value'. Any URIs specified
+ * are fetched before executing the command. If the executable field for an
+ * uri is set, executable file permission is set on the downloaded file.
+ * Otherwise, if the downloaded file has a recognized archive extension
+ * (currently [compressed] tar and zip) it is extracted into the executor's
+ * working directory. This extraction can be disabled by setting `extract` to
+ * false. In addition, any environment variables are set before executing
+ * the command (so they can be used to "parameterize" your command).
+ */
+message CommandInfo {
+ message URI {
+ required string value = 1;
+ optional bool executable = 2;
+
+ // In case the fetched file is recognized as an archive, extract
+ // its contents into the sandbox. Note that a cached archive is
+ // not copied from the cache to the sandbox in case extraction
+ // originates from an archive in the cache.
+ optional bool extract = 3 [default = true];
+
+ // If this field is "true", the fetcher cache will be used. If not,
+ // fetching bypasses the cache and downloads directly into the
+ // sandbox directory, no matter whether a suitable cache file is
+ // available or not. The former directs the fetcher to download to
+ // the file cache, then copy from there to the sandbox. Subsequent
+ // fetch attempts with the same URI will omit downloading and copy
+ // from the cache as long as the file is resident there. Cache files
+ // may get evicted at any time, which then leads to renewed
+ // downloading. See also "docs/fetcher.md" and
+ // "docs/fetcher-cache-internals.md".
+ optional bool cache = 4;
+
+ // The fetcher's default behavior is to use the URI string's basename to
+ // name the local copy. If this field is provided, the local copy will be
+ // named with its value instead. If there is a directory component (which
+ // must be a relative path), the local copy will be stored in that
+ // subdirectory inside the sandbox.
+ optional string output_file = 5;
+ }
+
+ repeated URI uris = 1;
+
+ optional Environment environment = 2;
+
+ // There are two ways to specify the command:
+ // 1) If 'shell == true', the command will be launched via shell
+ // (i.e., /bin/sh -c 'value'). The 'value' specified will be
+ // treated as the shell command. The 'arguments' will be ignored.
+ // 2) If 'shell == false', the command will be launched by passing
+ // arguments to an executable. The 'value' specified will be
+ // treated as the filename of the executable. The 'arguments'
+ // will be treated as the arguments to the executable. This is
+ // similar to how POSIX exec families launch processes (i.e.,
+ // execlp(value, arguments(0), arguments(1), ...)).
+ // NOTE: The field 'value' is changed from 'required' to 'optional'
+ // in 0.20.0. It will only cause issues if a new framework is
+ // connecting to an old master.
+ optional bool shell = 6 [default = true];
+ optional string value = 3;
+ repeated string arguments = 7;
+
+ // Enables executor and tasks to run as a specific user. If the user
+ // field is present both in FrameworkInfo and here, the CommandInfo
+ // user value takes precedence.
+ optional string user = 5;
+}
+
+
+/**
+ * Describes information about an executor.
+ */
+message ExecutorInfo {
+ enum Type {
+ UNKNOWN = 0;
+
+ // Mesos provides a simple built-in default executor that frameworks can
+ // leverage to run shell commands and containers.
+ //
+ // NOTES:
+ //
+ // 1) `command` must not be set when using a default executor.
+ //
+ // 2) Default executor only accepts a *single* `LAUNCH` or `LAUNCH_GROUP`
+ // offer operation.
+ //
+ // 3) If `container` is set, `container.type` must be `MESOS`
+ // and `container.mesos.image` must not be set.
+ DEFAULT = 1;
+
+ // For frameworks that need custom functionality to run tasks, a `CUSTOM`
+ // executor can be used. Note that `command` must be set when using a
+ // `CUSTOM` executor.
+ CUSTOM = 2;
+ }
+
+ // For backwards compatibility, if this field is not set when using `LAUNCH`
+ // offer operation, Mesos will infer the type by checking if `command` is
+ // set (`CUSTOM`) or unset (`DEFAULT`). `type` must be set when using
+ // `LAUNCH_GROUP` offer operation.
+ //
+ // TODO(vinod): Add support for explicitly setting `type` to `DEFAULT `
+ // in `LAUNCH` offer operation.
+ optional Type type = 15;
+
+ required ExecutorID executor_id = 1;
+ optional FrameworkID framework_id = 8; // TODO(benh): Make this required.
+ optional CommandInfo command = 7;
+
+ // Executor provided with a container will launch the container
+ // with the executor's CommandInfo and we expect the container to
+ // act as a Mesos executor.
+ optional ContainerInfo container = 11;
+
+ repeated Resource resources = 5;
+ optional string name = 9;
+
+ // 'source' is an identifier style string used by frameworks to
+ // track the source of an executor. This is useful when it's
+ // possible for different executor ids to be related semantically.
+ //
+ // NOTE: 'source' is exposed alongside the resource usage of the
+ // executor via JSON on the agent. This allows users to import usage
+ // information into a time series database for monitoring.
+ //
+ // This field is deprecated since 1.0. Please use labels for
+ // free-form metadata instead.
+ optional string source = 10 [deprecated = true]; // Since 1.0.
+
+ // This field can be used to pass arbitrary bytes to an executor.
+ optional bytes data = 4;
+
+ // Service discovery information for the executor. It is not
+ // interpreted or acted upon by Mesos. It is up to a service
+ // discovery system to use this information as needed and to handle
+ // executors without service discovery information.
+ optional DiscoveryInfo discovery = 12;
+
+ // When shutting down an executor the agent will wait in a
+ // best-effort manner for the grace period specified here
+ // before forcibly destroying the container. The executor
+ // must not assume that it will always be allotted the full
+ // grace period, as the agent may decide to allot a shorter
+ // period and failures / forcible terminations may occur.
+ optional DurationInfo shutdown_grace_period = 13;
+
+ // Labels are free-form key value pairs which are exposed through
+ // master and agent endpoints. Labels will not be interpreted or
+ // acted upon by Mesos itself. As opposed to the data field, labels
+ // will be kept in memory on master and agent processes. Therefore,
+ // labels should be used to tag executors with lightweight metadata.
+ // Labels should not contain duplicate key-value pairs.
+ optional Labels labels = 14;
+}
+
+
+/**
+ * Describes a domain. A domain is a collection of hosts that have
+ * similar characteristics. Mesos currently only supports "fault
+ * domains", which identify groups of hosts with similar failure
+ * characteristics.
+ *
+ * Frameworks can generally assume that network links between hosts in
+ * the same fault domain have lower latency, higher bandwidth, and better
+ * availability than network links between hosts in different domains.
+ * Schedulers may prefer to place network-intensive workloads in the
+ * same domain, as this may improve performance. Conversely, a single
+ * failure that affects a host in a domain may be more likely to
+ * affect other hosts in the same domain; hence, schedulers may prefer
+ * to place workloads that require high availability in multiple
+ * domains. (For example, all the hosts in a single rack might lose
+ * power or network connectivity simultaneously.)
+ *
+ * There are two kinds of fault domains: regions and zones. Regions
+ * offer the highest degree of fault isolation, but network latency
+ * between regions is typically high (typically >50 ms). Zones offer a
+ * modest degree of fault isolation along with reasonably low network
+ * latency (typically <10 ms).
+ *
+ * The mapping from fault domains to physical infrastructure is up to
+ * the operator to configure. In cloud environments, regions and zones
+ * can be mapped to the "region" and "availability zone" concepts
+ * exposed by most cloud providers, respectively. In on-premise
+ * deployments, regions and zones can be mapped to data centers and
+ * racks, respectively.
+ *
+ * Both masters and agents can be configured with domains. Frameworks
+ * can compare the domains of two hosts to determine if the hosts are
+ * in the same zone, in different zones in the same region, or in
+ * different regions. Note that all masters in a given Mesos cluster
+ * must be in the same region.
+ */
+message DomainInfo {
+ message FaultDomain {
+ message RegionInfo {
+ required string name = 1;
+ }
+
+ message ZoneInfo {
+ required string name = 1;
+ }
+
+ required RegionInfo region = 1;
+ required ZoneInfo zone = 2;
+ }
+
+ optional FaultDomain fault_domain = 1;
+}
+
+
+/**
+ * Describes a master. This will probably have more fields in the
+ * future which might be used, for example, to link a framework webui
+ * to a master webui.
+ */
+message MasterInfo {
+ required string id = 1;
+
+ // The IP address (only IPv4) as a packed 4-bytes integer,
+ // stored in network order. Deprecated, use `address.ip` instead.
+ required uint32 ip = 2;
+
+ // The TCP port the Master is listening on for incoming
+ // HTTP requests; deprecated, use `address.port` instead.
+ required uint32 port = 3 [default = 5050];
+
+ // In the default implementation, this will contain information
+ // about both the IP address, port and Master name; it should really
+ // not be relied upon by external tooling/frameworks and be
+ // considered an "internal" implementation field.
+ optional string pid = 4;
+
+ // The server's hostname, if available; it may be unreliable
+ // in environments where the DNS configuration does not resolve
+ // internal hostnames (eg, some public cloud providers).
+ // Deprecated, use `address.hostname` instead.
+ optional string hostname = 5;
+
+ // The running Master version, as a string; taken from the
+ // generated "master/version.hpp".
+ optional string version = 6;
+
+ // The full IP address (supports both IPv4 and IPv6 formats)
+ // and supersedes the use of `ip`, `port` and `hostname`.
+ // Since Mesos 0.24.
+ optional Address address = 7;
+
+ // The domain that this master belongs to. All masters in a Mesos
+ // cluster should belong to the same region.
+ optional DomainInfo domain = 8;
+}
+
+
+/**
+ * Describes an agent. Note that the 'id' field is only available
+ * after an agent is registered with the master, and is made available
+ * here to facilitate re-registration.
+ */
+message AgentInfo {
+ required string hostname = 1;
+ optional int32 port = 8 [default = 5051];
+
+ // The configured resources at the agent. This does not include any
+ // dynamic reservations or persistent volumes that may currently
+ // exist at the agent.
+ repeated Resource resources = 3;
+
+ repeated Attribute attributes = 5;
+ optional AgentID id = 6;
+
+ // The domain that this agent belongs to. If the agent's region
+ // differs from the master's region, it will not appear in resource
+ // offers to frameworks that have not enabled the REGION_AWARE
+ // capability.
+ optional DomainInfo domain = 10;
+
+ message Capability {
+ enum Type {
+ // This must be the first enum value in this list, to
+ // ensure that if 'type' is not set, the default value
+ // is UNKNOWN. This enables enum values to be added
+ // in a backwards-compatible way. See: MESOS-4997.
+ UNKNOWN = 0;
+
+ // This expresses the ability for the agent to be able
+ // to launch tasks of a 'multi-role' framework.
+ MULTI_ROLE = 1;
+
+ // This expresses the ability for the agent to be able to launch
+ // tasks, reserve resources, and create volumes using resources
+ // allocated to a 'hierarchical-role'.
+ // NOTE: This capability is required specifically for creating
+ // volumes because a hierchical role includes '/' (slashes) in them.
+ // Agents with this capability know to transform the '/' (slashes)
+ // into ' ' (spaces).
+ HIERARCHICAL_ROLE = 2;
+
+ // This capability has three effects for an agent.
+ //
+ // (1) The format of the checkpointed resources, and
+ // the resources reported to master.
+ //
+ // These resources are reported in the "pre-reservation-refinement"
+ // format if none of the resources have refined reservations. If any
+ // of the resources have refined reservations, they are reported in
+ // the "post-reservation-refinement" format. The purpose is to allow
+ // downgrading of an agent as well as communication with a pre-1.4.0
+ // master until the reservation refinement feature is actually used.
+ //
+ // See the 'Resource Format' section for more details.
+ //
+ // (2) The format of the resources reported by the HTTP endpoints.
+ //
+ // For resources reported by agent endpoints, the
+ // "pre-reservation-refinement" format is "injected" if possible.
+ // That is, resources without refined reservations will have the
+ // `Resource.role` and `Resource.reservation` set, whereas
+ // resources with refined reservations will not.
+ //
+ // See the 'Resource Format' section for more details.
+ //
+ // (3) The ability for the agent to launch tasks, reserve resources, and
+ // create volumes using resources that have refined reservations.
+ //
+ // See `ReservationInfo.reservations` section for more details.
+ //
+ // NOTE: Resources are said to have refined reservations if it uses the
+ // `Resource.reservations` field, and `Resource.reservations_size() > 1`.
+ RESERVATION_REFINEMENT = 3;
+ }
+
+ // Enum fields should be optional, see: MESOS-4997.
+ optional Type type = 1;
+ }
+}
+
+
+/**
+ * Describes a resource provider. Note that the 'id' field is only available
+ * after a resource provider is registered with the master, and is made
+ * available here to facilitate re-registration.
+ */
+message ResourceProviderInfo {
+ optional ResourceProviderID id = 1;
+ repeated Attribute attributes = 2;
+
+ // The type of the resource provider. This uniquely identifies a
+ // resource provider implementation. For instance:
+ // org.apache.mesos.rp.local.storage
+ //
+ // Please follow to Java package naming convention
+ // (https://en.wikipedia.org/wiki/Java_package#Package_naming_conventions)
+ // to avoid conflicts on type names.
+ required string type = 3;
+
+ // The name of the resource provider. There could be multiple
+ // instances of a type of resource provider. The name field is used
+ // to distinguish these instances.
+ required string name = 4;
+}
+
+
+/**
+ * Describes an Attribute or Resource "value". A value is described
+ * using the standard protocol buffer "union" trick.
+ */
+message Value {
+ enum Type {
+ SCALAR = 0;
+ RANGES = 1;
+ SET = 2;
+ TEXT = 3;
+ }
+
+ message Scalar {
+ // Scalar values are represented using floating point. To reduce
+ // the chance of unpredictable floating point behavior due to
+ // roundoff error, Mesos only supports three decimal digits of
+ // precision for scalar resource values. That is, floating point
+ // values are converted to a fixed point format that supports
+ // three decimal digits of precision, and then converted back to
+ // floating point on output. Any additional precision in scalar
+ // resource values is discarded (via rounding).
+ required double value = 1;
+ }
+
+ message Range {
+ required uint64 begin = 1;
+ required uint64 end = 2;
+ }
+
+ message Ranges {
+ repeated Range range = 1;
+ }
+
+ message Set {
+ repeated string item = 1;
+ }
+
+ message Text {
+ required string value = 1;
+ }
+
+ required Type type = 1;
+ optional Scalar scalar = 2;
+ optional Ranges ranges = 3;
+ optional Set set = 4;
+ optional Text text = 5;
+}
+
+
+/**
+ * Describes an attribute that can be set on a machine. For now,
+ * attributes and resources share the same "value" type, but this may
+ * change in the future and attributes may only be string based.
+ */
+message Attribute {
+ required string name = 1;
+ required Value.Type type = 2;
+ optional Value.Scalar scalar = 3;
+ optional Value.Ranges ranges = 4;
+ optional Value.Set set = 6;
+ optional Value.Text text = 5;
+}
+
+
+/**
+ * Describes a resource from a resource provider. The `name` field is
+ * a string like "cpus" or "mem" that indicates which kind of resource
+ * this is; the rest of the fields describe the properties of the
+ * resource. A resource can take on one of three types: scalar
+ * (double), a list of finite and discrete ranges (e.g., [1-10,
+ * 20-30]), or a set of items. A resource is described using the
+ * standard protocol buffer "union" trick.
+ *
+ * Note that "disk" and "mem" resources are scalar values expressed in
+ * megabytes. Fractional "cpus" values are allowed (e.g., "0.5"),
+ * which correspond to partial shares of a CPU.
+ */
+message Resource {
+ optional ResourceProviderID provider_id = 12;
+
+ required string name = 1;
+ required Value.Type type = 2;
+ optional Value.Scalar scalar = 3;
+ optional Value.Ranges ranges = 4;
+ optional Value.Set set = 5;
+
+ // The role that this resource is reserved for. If "*", this indicates
+ // that the resource is unreserved. Otherwise, the resource will only
+ // be offered to frameworks that belong to this role.
+ //
+ // NOTE: Frameworks must not set this field if `reservations` is set.
+ // See the 'Resource Format' section for more details.
+ //
+ // TODO(mpark): Deprecate once `reservations` is no longer experimental.
+ optional string role = 6 [default = "*", deprecated=true];
+
+ // This was initially introduced to support MULTI_ROLE capable
+ // frameworks. Frameworks that are not MULTI_ROLE capable can
+ // continue to assume that the offered resources are allocated
+ // to their role.
+ message AllocationInfo {
+ // If set, this resource is allocated to a role. Note that in the
+ // future, this may be unset and the scheduler may be responsible
+ // for allocating to one of its roles.
+ optional string role = 1;
+
+ // In the future, we may add additional fields here, e.g. priority
+ // tier, type of allocation (quota / fair share).
+ }
+
+ optional AllocationInfo allocation_info = 11;
+
+ // Resource Format:
+ //
+ // Frameworks receive resource offers in one of two formats, depending on
+ // whether the RESERVATION_REFINEMENT capability is enabled.
+ //
+ // __WITHOUT__ the RESERVATION_REFINEMENT capability, the framework is offered
+ // resources in the "pre-reservation-refinement" format. In this format, the
+ // `Resource.role` and `Resource.reservation` fields are used in conjunction
+ // to describe the reservation state of a `Resource` message.
+ //
+ // The following is an overview of the possible reservation states:
+ //
+ // +------------+------------------------------------------------------------+
+ // | unreserved | { |
+ // | | role: "*", |
+ // | | reservation: <not set>, |
+ // | | reservations: <unused> |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ // | static | { |
+ // | | role: "eng", |
+ // | | reservation: <not set>, |
+ // | | reservations: <unused> |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ // | dynamic | { |
+ // | | role: "eng", |
+ // | | reservation: { |
+ // | | type: <unused>, |
+ // | | role: <unused>, |
+ // | | principal: <optional>, |
+ // | | labels: <optional> |
+ // | | }, |
+ // | | reservations: <unused> |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ //
+ // __WITH__ the RESERVATION_REFINEMENT capability, the framework is offered
+ // resources in the "post-reservation-refinement" format. In this format, the
+ // reservation state of a `Resource` message is expressed solely in
+ // `Resource.reservations` field.
+ //
+ // The following is an overview of the possible reservation states:
+ //
+ // +------------+------------------------------------------------------------+
+ // | unreserved | { |
+ // | | role: <unused>, |
+ // | | reservation: <unused>, |
+ // | | reservations: [] |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ // | static | { |
+ // | | role: <unused>, |
+ // | | reservation: <unused>, |
+ // | | reservations: [ |
+ // | | { |
+ // | | type: STATIC, |
+ // | | role: "eng", |
+ // | | principal: <optional>, |
+ // | | labels: <optional> |
+ // | | } |
+ // | | ] |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ // | dynamic | { |
+ // | | role: <unused>, |
+ // | | reservation: <unused>, |
+ // | | reservations: [ |
+ // | | { |
+ // | | type: DYNAMIC, |
+ // | | role: "eng", |
+ // | | principal: <optional>, |
+ // | | labels: <optional> |
+ // | | } |
+ // | | ] |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ //
+ // We can also __refine__ reservations with this capability like so:
+ //
+ // +------------+------------------------------------------------------------+
+ // | refined | { |
+ // | | role: <unused>, |
+ // | | reservation: <unused>, |
+ // | | reservations: [ |
+ // | | { |
+ // | | type: STATIC or DYNAMIC, |
+ // | | role: "eng", |
+ // | | principal: <optional>, |
+ // | | labels: <optional> |
+ // | | }, |
+ // | | { |
+ // | | type: DYNAMIC, |
+ // | | role: "eng/front_end", |
+ // | | principal: <optional>, |
+ // | | labels: <optional> |
+ // | | } |
+ // | | ] |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ //
+ // NOTE: Each `ReservationInfo` in the `reservations` field denotes
+ // a reservation that refines the previous `ReservationInfo`.
+
+ message ReservationInfo {
+ // TODO(mpark): Explain the two resource formats.
+
+ // Describes a reservation. A static reservation is set by the operator on
+ // the command-line and they are immutable without agent restart. A dynamic
+ // reservation is acquired by an operator via the '/reserve' HTTP endpoint
+ // or by a framework via the offer cycle by sending back an
+ // 'Offer::Operation::Reserve' message.
+ // NOTE: We currently do not allow frameworks with role "*" to make dynamic
+ // reservations.
+
+ enum Type {
+ UNKNOWN = 0;
+ STATIC = 1;
+ DYNAMIC = 2;
+ }
+
+ // The type of this reservation.
+ // NOTE: This field must not be set for `Resource.reservation`.
+ optional Type type = 4;
+
+ // The role to which this reservation is made for.
+ // NOTE: This field must not be set for `Resource.reservation`.
+ optional string role = 3;
+
+ // Indicates the principal, if any, of the framework or operator
+ // that reserved this resource. If reserved by a framework, the
+ // field should match the `FrameworkInfo.principal`. It is used in
+ // conjunction with the `UnreserveResources` ACL to determine
+ // whether the entity attempting to unreserve this resource is
+ // permitted to do so.
+ optional string principal = 1;
+
+ // Labels are free-form key value pairs that can be used to
+ // associate arbitrary metadata with a reserved resource. For
+ // example, frameworks can use labels to identify the intended
+ // purpose for a portion of the resources the framework has
+ // reserved at a given agent. Labels should not contain duplicate
+ // key-value pairs.
+ optional Labels labels = 2;
+ }
+
+ // If this is set, this resource was dynamically reserved by an
+ // operator or a framework. Otherwise, this resource is either unreserved
+ // or statically reserved by an operator via the --resources flag.
+ // NOTE: Frameworks must not set this field if `reservations` is set.
+ optional ReservationInfo reservation = 8;
+
+ // The stack of reservations. If this field is empty, it indicates that this
+ // resource is unreserved. Otherwise, the resource is reserved. The first
+ // `ReservationInfo` may have type `STATIC` or `DYNAMIC`, but the rest must
+ // have `DYNAMIC`. One can create a new reservation on top of an existing
+ // one by pushing a new `ReservationInfo` to the back. The last
+ // `ReservationInfo` in this stack is the "current" reservation. The new
+ // reservation's role must be a child of the current reservation's role.
+ // NOTE: Frameworks must not set this field if `reservation` is set.
+ repeated ReservationInfo reservations = 13; // EXPERIMENTAL.
+
+ message DiskInfo {
+ // Describes a persistent disk volume.
+ //
+ // A persistent disk volume will not be automatically garbage
+ // collected if the task/executor/agent terminates, but will be
+ // re-offered to the framework(s) belonging to the 'role'.
+ //
+ // NOTE: Currently, we do not allow persistent disk volumes
+ // without a reservation (i.e., 'role' cannot be '*').
+ message Persistence {
+ // A unique ID for the persistent disk volume. This ID must be
+ // unique per role on each agent. Although it is possible to use
+ // the same ID on different agents in the cluster and to reuse
+ // IDs after a volume with that ID has been destroyed, both
+ // practices are discouraged.
+ required string id = 1;
+
+ // This field indicates the principal of the operator or
+ // framework that created this volume. It is used in conjunction
+ // with the "destroy" ACL to determine whether an entity
+ // attempting to destroy the volume is permitted to do so.
+ //
+ // NOTE: This field should match the FrameworkInfo.principal of
+ // the framework that created the volume.
+ optional string principal = 2;
+ }
+
+ optional Persistence persistence = 1;
+
+ // Describes how this disk resource will be mounted in the
+ // container. If not set, the disk resource will be used as the
+ // sandbox. Otherwise, it will be mounted according to the
+ // 'container_path' inside 'volume'. The 'host_path' inside
+ // 'volume' is ignored.
+ // NOTE: If 'volume' is set but 'persistence' is not set, the
+ // volume will be automatically garbage collected after
+ // task/executor terminates. Currently, if 'persistence' is set,
+ // 'volume' must be set.
+ optional Volume volume = 2;
+
+ // Describes where a disk originates from.
+ // TODO(jmlvanre): Add support for BLOCK devices.
+ message Source {
+ enum Type {
+ UNKNOWN = 0;
+ PATH = 1;
+ MOUNT = 2;
+ }
+
+ // A folder that can be located on a separate disk device. This
+ // can be shared and carved up as necessary between frameworks.
+ message Path {
+ // Path to the folder (e.g., /mnt/raid/disk0).
+ optional string root = 1;
+ }
+
+ // A mounted file-system set up by the Agent administrator. This
+ // can only be used exclusively: a framework cannot accept a
+ // partial amount of this disk.
+ message Mount {
+ // Path to mount point (e.g., /mnt/raid/disk0).
+ optional string root = 1;
+ }
+
+ required Type type = 1;
+ optional Path path = 2;
+ optional Mount mount = 3;
+ }
+
+ optional Source source = 3;
+ }
+
+ optional DiskInfo disk = 7;
+
+ message RevocableInfo {}
+
+ // If this is set, the resources are revocable, i.e., any tasks or
+ // executors launched using these resources could get preempted or
+ // throttled at any time. This could be used by frameworks to run
+ // best effort tasks that do not need strict uptime or performance
+ // guarantees. Note that if this is set, 'disk' or 'reservation'
+ // cannot be set.
+ optional RevocableInfo revocable = 9;
+
+ // Allow the resource to be shared across tasks.
+ message SharedInfo {}
+
+ // If this is set, the resources are shared, i.e. multiple tasks
+ // can be launched using this resource and all of them shall refer
+ // to the same physical resource on the cluster. Note that only
+ // persistent volumes can be shared currently.
+ optional SharedInfo shared = 10;
+}
+
+
+/**
+ * When the network bandwidth caps are enabled and the container
+ * is over its limit, outbound packets may be either delayed or
+ * dropped completely either because it exceeds the maximum bandwidth
+ * allocation for a single container (the cap) or because the combined
+ * network traffic of multiple containers on the host exceeds the
+ * transmit capacity of the host (the share). We can report the
+ * following statistics for each of these conditions exported directly
+ * from the Linux Traffic Control Queueing Discipline.
+ *
+ * id : name of the limiter, e.g. 'tx_bw_cap'
+ * backlog : number of packets currently delayed
+ * bytes : total bytes seen
+ * drops : number of packets dropped in total
+ * overlimits : number of packets which exceeded allocation
+ * packets : total packets seen
+ * qlen : number of packets currently queued
+ * rate_bps : throughput in bytes/sec
+ * rate_pps : throughput in packets/sec
+ * requeues : number of times a packet has been delayed due to
+ * locking or device contention issues
+ *
+ * More information on the operation of Linux Traffic Control can be
+ * found at http://www.lartc.org/lartc.html.
+ */
+message TrafficControlStatistics {
+ required string id = 1;
+ optional uint64 backlog = 2;
+ optional uint64 bytes = 3;
+ optional uint64 drops = 4;
+ optional uint64 overlimits = 5;
+ optional uint64 packets = 6;
+ optional uint64 qlen = 7;
+ optional uint64 ratebps = 8;
+ optional uint64 ratepps = 9;
+ optional uint64 requeues = 10;
+}
+
+
+message IpStatistics {
+ optional int64 Forwarding = 1;
+ optional int64 DefaultTTL = 2;
+ optional int64 InReceives = 3;
+ optional int64 InHdrErrors = 4;
+ optional int64 InAddrErrors = 5;
+ optional int64 ForwDatagrams = 6;
+ optional int64 InUnknownProtos = 7;
+ optional int64 InDiscards = 8;
+ optional int64 InDelivers = 9;
+ optional int64 OutRequests = 10;
+ optional int64 OutDiscards = 11;
+ optional int64 OutNoRoutes = 12;
+ optional int64 ReasmTimeout = 13;
+ optional int64 ReasmReqds = 14;
+ optional int64 ReasmOKs = 15;
+ optional int64 ReasmFails = 16;
+ optional int64 FragOKs = 17;
+ optional int64 FragFails = 18;
+ optional int64 FragCreates = 19;
+}
+
+
+message IcmpStatistics {
+ optional int64 InMsgs = 1;
+ optional int64 InErrors = 2;
+ optional int64 InCsumErrors = 3;
+ optional int64 InDestUnreachs = 4;
+ optional int64 InTimeExcds = 5;
+ optional int64 InParmProbs = 6;
+ optional int64 InSrcQuenchs = 7;
+ optional int64 InRedirects = 8;
+ optional int64 InEchos = 9;
+ optional int64 InEchoReps = 10;
+ optional int64 InTimestamps = 11;
+ optional int64 InTimestampReps = 12;
+ optional int64 InAddrMasks = 13;
+ optional int64 InAddrMaskReps = 14;
+ optional int64 OutMsgs = 15;
+ optional int64 OutErrors = 16;
+ optional int64 OutDestUnreachs = 17;
+ optional int64 OutTimeExcds = 18;
+ optional int64 OutParmProbs = 19;
+ optional int64 OutSrcQuenchs = 20;
+ optional int64 OutRedirects = 21;
+ optional int64 OutEchos = 22;
+ optional int64 OutEchoReps = 23;
+ optional int64 OutTimestamps = 24;
+ optional int64 OutTimestampReps = 25;
+ optional int64 OutAddrMasks = 26;
+ optional int64 OutAddrMaskReps = 27;
+}
+
+
+message TcpStatistics {
+ optional int64 RtoAlgorithm = 1;
+ optional int64 RtoMin = 2;
+ optional int64 RtoMax = 3;
+ optional int64 MaxConn = 4;
+ optional int64 ActiveOpens = 5;
+ optional int64 PassiveOpens = 6;
+ optional int64 AttemptFails = 7;
+ optional int64 EstabResets = 8;
+ optional int64 CurrEstab = 9;
+ optional int64 InSegs = 10;
+ optional int64 OutSegs = 11;
+ optional int64 RetransSegs = 12;
+ optional int64 InErrs = 13;
+ optional int64 OutRsts = 14;
+ optional int64 InCsumErrors = 15;
+}
+
+
+message UdpStatistics {
+ optional int64 InDatagrams = 1;
+ optional int64 NoPorts = 2;
+ optional int64 InErrors = 3;
+ optional int64 OutDatagrams = 4;
+ optional int64 RcvbufErrors = 5;
+ optional int64 SndbufErrors = 6;
+ optional int64 InCsumErrors = 7;
+ optional int64 IgnoredMulti = 8;
+}
+
+
+message SNMPStatistics {
+ optional IpStatistics ip_stats = 1;
+ optional IcmpStatistics icmp_stats = 2;
+ optional TcpStatistics tcp_stats = 3;
+ optional UdpStatistics udp_stats = 4;
+}
+
+
+message DiskStatistics {
+ optional Resource.DiskInfo.Source source = 1;
+ optional Resource.DiskInfo.Persistence persistence = 2;
+ optional uint64 limit_bytes = 3;
+ optional uint64 used_bytes = 4;
+}
+
+
+/**
+ * A snapshot of resource usage statistics.
+ */
+message ResourceStatistics {
+ required double timestamp = 1; // Snapshot time, in seconds since the Epoch.
+
+ optional uint32 processes = 30;
+ optional uint32 threads = 31;
+
+ // CPU Usage Information:
+ // Total CPU time spent in user mode, and kernel mode.
+ optional double cpus_user_time_secs = 2;
+ optional double cpus_system_time_secs = 3;
+
+ // Number of CPUs allocated.
+ optional double cpus_limit = 4;
+
+ // cpu.stat on process throttling (for contention issues).
+ optional uint32 cpus_nr_periods = 7;
+ optional uint32 cpus_nr_throttled = 8;
+ optional double cpus_throttled_time_secs = 9;
+
+ // Memory Usage Information:
+
+ // mem_total_bytes was added in 0.23.0 to represent the total memory
+ // of a process in RAM (as opposed to in Swap). This was previously
+ // reported as mem_rss_bytes, which was also changed in 0.23.0 to
+ // represent only the anonymous memory usage, to keep in sync with
+ // Linux kernel's (arguably erroneous) use of terminology.
+ optional uint64 mem_total_bytes = 36;
+
+ // Total memory + swap usage. This is set if swap is enabled.
+ optional uint64 mem_total_memsw_bytes = 37;
+
+ // Hard memory limit for a container.
+ optional uint64 mem_limit_bytes = 6;
+
+ // Soft memory limit for a container.
+ optional uint64 mem_soft_limit_bytes = 38;
+
+ // Broken out memory usage information: pagecache, rss (anonymous),
+ // mmaped files and swap.
+
+ // TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in
+ // 0.23.0 and will be removed in 0.24.0.
+ optional uint64 mem_file_bytes = 10;
+ optional uint64 mem_anon_bytes = 11;
+
+ // mem_cache_bytes is added in 0.23.0 to represent page cache usage.
+ optional uint64 mem_cache_bytes = 39;
+
+ // Since 0.23.0, mem_rss_bytes is changed to represent only
+ // anonymous memory usage. Note that neither its requiredness, type,
+ // name nor numeric tag has been changed.
+ optional uint64 mem_rss_bytes = 5;
+
+ optional uint64 mem_mapped_file_bytes = 12;
+ // This is only set if swap is enabled.
+ optional uint64 mem_swap_bytes = 40;
+ optional uint64 mem_unevictable_bytes = 41;
+
+ // Number of occurrences of different levels of memory pressure
+ // events reported by memory cgroup. Pressure listening (re)starts
+ // with these values set to 0 when agent (re)starts. See
+ // https://www.kernel.org/doc/Documentation/cgroups/memory.txt for
+ // more details.
+ optional uint64 mem_low_pressure_counter = 32;
+ optional uint64 mem_medium_pressure_counter = 33;
+ optional uint64 mem_critical_pressure_counter = 34;
+
+ // Disk Usage Information for executor working directory.
+ optional uint64 disk_limit_bytes = 26;
+ optional uint64 disk_used_bytes = 27;
+
+ // Per disk (resource) statistics.
+ repeated DiskStatistics disk_statistics = 43;
+
+ // Cgroups blkio statistics.
+ optional CgroupInfo.Blkio.Statistics blkio_statistics = 44;
+
+ // Perf statistics.
+ optional PerfStatistics perf = 13;
+
+ // Network Usage Information:
+ optional uint64 net_rx_packets = 14;
+ optional uint64 net_rx_bytes = 15;
+ optional uint64 net_rx_errors = 16;
+ optional uint64 net_rx_dropped = 17;
+ optional uint64 net_tx_packets = 18;
+ optional uint64 net_tx_bytes = 19;
+ optional uint64 net_tx_errors = 20;
+ optional uint64 net_tx_dropped = 21;
+
+ // The kernel keeps track of RTT (round-trip time) for its TCP
+ // sockets. RTT is a way to tell the latency of a container.
+ optional double net_tcp_rtt_microsecs_p50 = 22;
+ optional double net_tcp_rtt_microsecs_p90 = 23;
+ optional double net_tcp_rtt_microsecs_p95 = 24;
+ optional double net_tcp_rtt_microsecs_p99 = 25;
+
+ optional double net_tcp_active_connections = 28;
+ optional double net_tcp_time_wait_connections = 29;
+
+ // Network traffic flowing into or out of a container can be delayed
+ // or dropped due to congestion or policy inside and outside the
+ // container.
+ repeated TrafficControlStatistics net_traffic_control_statistics = 35;
+
+ // Network SNMP statistics for each container.
+ optional SNMPStatistics net_snmp_statistics = 42;
+}
+
+
+/**
+ * Describes a snapshot of the resource usage for executors.
+ */
+message ResourceUsage {
+ message Executor {
+ required ExecutorInfo executor_info = 1;
+
+ // This includes resources used by the executor itself
+ // as well as its active tasks.
+ repeated Resource allocated = 2;
+
+ // Current resource usage. If absent, the containerizer
+ // cannot provide resource usage.
+ optional ResourceStatistics statistics = 3;
+
+ // The container id for the executor specified in the executor_info field.
+ required ContainerID container_id = 4;
+
+ message Task {
+ required string name = 1;
+ required TaskID id = 2;
+ repeated Resource resources = 3;
+ optional Labels labels = 4;
+ }
+
+ // Non-terminal tasks.
+ repeated Task tasks = 5;
+ }
+
+ repeated Executor executors = 1;
+
+ // Agent's total resources including checkpointed dynamic
+ // reservations and persistent volumes.
+ repeated Resource total = 2;
+}
+
+
+/**
+ * Describes a sample of events from "perf stat". Only available on
+ * Linux.
+ *
+ * NOTE: Each optional field matches the name of a perf event (see
+ * "perf list") with the following changes:
+ * 1. Names are downcased.
+ * 2. Hyphens ('-') are replaced with underscores ('_').
+ * 3. Events with alternate names use the name "perf stat" returns,
+ * e.g., for the event "cycles OR cpu-cycles" perf always returns
+ * cycles.
+ */
+message PerfStatistics {
+ required double timestamp = 1; // Start of sample interval, in seconds since the Epoch.
+ required double duration = 2; // Duration of sample interval, in seconds.
+
+ // Hardware event.
+ optional uint64 cycles = 3;
+ optional uint64 stalled_cycles_frontend = 4;
+ optional uint64 stalled_cycles_backend = 5;
+ optional uint64 instructions = 6;
+ optional uint64 cache_references = 7;
+ optional uint64 cache_misses = 8;
+ optional uint64 branches = 9;
+ optional uint64 branch_misses = 10;
+ optional uint64 bus_cycles = 11;
+ optional uint64 ref_cycles = 12;
+
+ // Software event.
+ optional double cpu_clock = 13;
+ optional double task_clock = 14;
+ optional uint64 page_faults = 15;
+ optional uint64 minor_faults = 16;
+ optional uint64 major_faults = 17;
+ optional uint64 context_switches = 18;
+ optional uint64 cpu_migrations = 19;
+ optional uint64 alignment_faults = 20;
+ optional uint64 emulation_faults = 21;
+
+ // Hardware cache event.
+ optional uint64 l1_dcache_loads = 22;
+ optional uint64 l1_dcache_load_misses = 23;
+ optional uint64 l1_dcache_stores = 24;
+ optional uint64 l1_dcache_store_misses = 25;
+ optional uint64 l1_dcache_prefetches = 26;
+ optional uint64 l1_dcache_prefetch_misses = 27;
+ optional uint64 l1_icache_loads = 28;
+ optional uint64 l1_icache_load_misses = 29;
+ optional uint64 l1_icache_prefetches = 30;
+ optional uint64 l1_icache_prefetch_misses = 31;
+ optional uint64 llc_loads = 32;
+ optional uint64 llc_load_misses = 33;
+ optional uint64 llc_stores = 34;
+ optional uint64 llc_store_misses = 35;
+ optional uint64 llc_prefetches = 36;
+ optional uint64 llc_prefetch_misses = 37;
+ optional uint64 dtlb_loads = 38;
+ optional uint64 dtlb_load_misses = 39;
+ optional uint64 dtlb_stores = 40;
+ optional uint64 dtlb_store_misses = 41;
+ optional uint64 dtlb_prefetches = 42;
+ optional uint64 dtlb_prefetch_misses = 43;
+ optional uint64 itlb_loads = 44;
+ optional uint64 itlb_load_misses = 45;
+ optional uint64 branch_loads = 46;
+ optional uint64 branch_load_misses = 47;
+ optional uint64 node_loads = 48;
+ optional uint64 node_load_misses = 49;
+ optional uint64 node_stores = 50;
+ optional uint64 node_store_misses = 51;
+ optional uint64 node_prefetches = 52;
+ optional uint64 node_prefetch_misses = 53;
+}
+
+
+/**
+ * Describes a request for resources that can be used by a framework
+ * to proactively influence the allocator. If 'agent_id' is provided
+ * then this request is assumed to only apply to resources on that
+ * agent.
+ */
+message Request {
+ optional AgentID agent_id = 1;
+ repeated Resource resources = 2;
+}
+
+
+/**
+ * Describes some resources available on an agent. An offer only
+ * contains resources from a single agent.
+ */
+message Offer {
+ required OfferID id = 1;
+ required FrameworkID framework_id = 2;
+ required AgentID agent_id = 3;
+ required string hostname = 4;
+
+ // URL for reaching the agent running on the host.
+ optional URL url = 8;
+
+ // The domain of the agent.
+ optional DomainInfo domain = 11;
+
+ repeated Resource resources = 5;
+ repeated Attribute attributes = 7;
+ repeated ExecutorID executor_ids = 6;
+
+ // Signifies that the resources in this Offer may be unavailable during
+ // the given interval. Any tasks launched using these resources may be
+ // killed when the interval arrives. For example, these resources may be
+ // part of a planned maintenance schedule.
+ //
+ // This field only provides information about a planned unavailability.
+ // The unavailability interval may not necessarily start at exactly this
+ // interval, nor last for exactly the duration of this interval.
+ // The unavailability may also be forever! See comments in
+ // `Unavailability` for more details.
+ optional Unavailability unavailability = 9;
+
+ // An offer represents resources allocated to *one* of the
+ // roles managed by the scheduler. (Therefore, each
+ // `Offer.resources[i].allocation_info` will match the
+ // top level `Offer.allocation_info`).
+ optional Resource.AllocationInfo allocation_info = 10;
+
+ // Defines an operation that can be performed against offers.
+ message Operation {
+ enum Type {
+ UNKNOWN = 0;
+ LAUNCH = 1;
+ LAUNCH_GROUP = 6;
+ RESERVE = 2;
+ UNRESERVE = 3;
+ CREATE = 4;
+ DESTROY = 5;
+ }
+
+ // TODO(vinod): Deprecate this in favor of `LaunchGroup` below.
+ message Launch {
+ repeated TaskInfo task_infos = 1;
+ }
+
+ // Unlike `Launch` above, all the tasks in a `task_group` are
+ // atomically delivered to an executor.
+ //
+ // `NetworkInfo` set on executor will be shared by all tasks in
+ // the task group.
+ //
+ // TODO(vinod): Any volumes set on executor could be used by a
+ // task by explicitly setting `Volume.source` in its resources.
+ message LaunchGroup {
+ required ExecutorInfo executor = 1;
+ required TaskGroupInfo task_group = 2;
+ }
+
+ message Reserve {
+ repeated Resource resources = 1;
+ }
+
+ message Unreserve {
+ repeated Resource resources = 1;
+ }
+
+ message Create {
+ repeated Resource volumes = 1;
+ }
+
+ message Destroy {
+ repeated Resource volumes = 1;
+ }
+
+ optional Type type = 1;
+ optional Launch launch = 2;
+ optional LaunchGroup launch_group = 7;
+ optional Reserve reserve = 3;
+ optional Unreserve unreserve = 4;
+ optional Create create = 5;
+ optional Destroy destroy = 6;
+ }
+}
+
+
+/**
+ * A request to return some resources occupied by a framework.
+ */
+message InverseOffer {
+ // This is the same OfferID as found in normal offers, which allows
+ // re-use of some of the OfferID-only messages.
+ required OfferID id = 1;
+
+ // URL for reaching the agent running on the host. This enables some
+ // optimizations as described in MESOS-3012, such as allowing the
+ // scheduler driver to bypass the master and talk directly with an agent.
+ optional URL url = 2;
+
+ // The framework that should release its resources.
+ // If no specifics are provided (i.e. which agent), all the framework's
+ // resources are requested back.
+ required FrameworkID framework_id = 3;
+
+ // Specified if the resources need to be released from a particular agent.
+ // All the framework's resources on this agent are requested back,
+ // unless further qualified by the `resources` field.
+ optional AgentID agent_id = 4;
+
+ // This InverseOffer represents a planned unavailability event in the
+ // specified interval. Any tasks running on the given framework or agent
+ // may be killed when the interval arrives. Therefore, frameworks should
+ // aim to gracefully terminate tasks prior to the arrival of the interval.
+ //
+ // For reserved resources, the resources are expected to be returned to the
+ // framework after the unavailability interval. This is an expectation,
+ // not a guarantee. For example, if the unavailability duration is not set,
+ // the resources may be removed permanently.
+ //
+ // For other resources, there is no guarantee that requested resources will
+ // be returned after the unavailability interval. The allocator has no
+ // obligation to re-offer these resources to the prior framework after
+ // the unavailability.
+ required Unavailability unavailability = 5;
+
+ // A list of resources being requested back from the framework,
+ // on the agent identified by `agent_id`. If no resources are specified
+ // then all resources are being requested back. For the purpose of
+ // maintenance, this field is always empty (maintenance always requests
+ // all resources back).
+ repeated Resource resources = 6;
+
+ // TODO(josephw): Add additional options for narrowing down the resources
+ // being requested back. Such as specific executors, tasks, etc.
+}
+
+
+/**
+ * Describes a task. Passed from the scheduler all the way to an
+ * executor (see SchedulerDriver::launchTasks and
+ * Executor::launchTask). Either ExecutorInfo or CommandInfo should be set.
+ * A different executor can be used to launch this task, and subsequent tasks
+ * meant for the same executor can reuse the same ExecutorInfo struct.
+ */
+message TaskInfo {
+ required string name = 1;
+ required TaskID task_id = 2;
+ required AgentID agent_id = 3;
+ repeated Resource resources = 4;
+ optional ExecutorInfo executor = 5;
+ optional CommandInfo command = 7;
+
+ // Task provided with a container will launch the container as part
+ // of this task paired with the task's CommandInfo.
+ optional ContainerInfo container = 9;
+
+ // A health check for the task. Implemented for executor-less
+ // command-based tasks. For tasks that specify an executor, it is
+ // the executor's responsibility to implement the health checking.
+ optional HealthCheck health_check = 8;
+
+ // A general check for the task. Implemented for all built-in executors.
+ // For tasks that specify an executor, it is the executor's responsibility
+ // to implement checking support. Executors should (all built-in executors
+ // will) neither interpret nor act on the check's result.
+ //
+ // NOTE: Check support in built-in executors is experimental.
+ //
+ // TODO(alexr): Consider supporting multiple checks per task.
+ optional CheckInfo check = 13;
+
+ // A kill policy for the task. Implemented for executor-less
+ // command-based and docker tasks. For tasks that specify an
+ // executor, it is the executor's responsibility to implement
+ // the kill policy.
+ optional KillPolicy kill_policy = 12;
+
+ optional bytes data = 6;
+
+ // Labels are free-form key value pairs which are exposed through
+ // master and agent endpoints. Labels will not be interpreted or
+ // acted upon by Mesos itself. As opposed to the data field, labels
+ // will be kept in memory on master and agent processes. Therefore,
+ // labels should be used to tag tasks with light-weight meta-data.
+ // Labels should not contain duplicate key-value pairs.
+ optional Labels labels = 10;
+
+ // Service discovery information for the task. It is not interpreted
+ // or acted upon by Mesos. It is up to a service discovery system
+ // to use this information as needed and to handle tasks without
+ // service discovery information.
+ optional DiscoveryInfo discovery = 11;
+}
+
+
+/**
+ * Describes a group of tasks that belong to an executor. The
+ * executor will receive the task group in a single message to
+ * allow the group to be launched "atomically".
+ *
+ * NOTES:
+ * 1) `NetworkInfo` must not be set inside task's `ContainerInfo`.
+ * 2) `TaskInfo.executor` doesn't need to set. If set, it should match
+ * `LaunchGroup.executor`.
+ */
+message TaskGroupInfo {
+ repeated TaskInfo tasks = 1;
+}
+
+
+// TODO(bmahler): Add executor_uuid here, and send it to the master. This will
+// allow us to expose executor work directories for tasks in the webui when
+// looking from the master level. Currently only the agent knows which run the
+// task belongs to.
+/**
+ * Describes a task, similar to `TaskInfo`.
+ *
+ * `Task` is used in some of the Mesos messages found below.
+ * `Task` is used instead of `TaskInfo` if:
+ * 1) we need additional IDs, such as a specific
+ * framework, executor, or agent; or
+ * 2) we do not need the additional data, such as the command run by the
+ * task or the health checks. These additional fields may be large and
+ * unnecessary for some Mesos messages.
+ *
+ * `Task` is generally constructed from a `TaskInfo`. See protobuf::createTask.
+ */
+message Task {
+ required string name = 1;
+ required TaskID task_id = 2;
+ required FrameworkID framework_id = 3;
+ optional ExecutorID executor_id = 4;
+ required AgentID agent_id = 5;
+ required TaskState state = 6; // Latest state of the task.
+ repeated Resource resources = 7;
+ repeated TaskStatus statuses = 8;
+
+ // These fields correspond to the state and uuid of the latest
+ // status update forwarded to the master.
+ // NOTE: Either both the fields must be set or both must be unset.
+ optional TaskState status_update_state = 9;
+ optional bytes status_update_uuid = 10;
+
+ optional Labels labels = 11;
+
+ // Service discovery information for the task. It is not interpreted
+ // or acted upon by Mesos. It is up to a service discovery system
+ // to use this information as needed and to handle tasks without
+ // service discovery information.
+ optional DiscoveryInfo discovery = 12;
+
+ // Container information for the task.
+ optional ContainerInfo container = 13;
+
+ // Specific user under which task is running.
+ optional string user = 14;
+}
+
+
+/**
+ * Describes possible task states. IMPORTANT: Mesos assumes tasks that
+ * enter terminal states (see below) imply the task is no longer
+ * running and thus clean up any thing associated with the task
+ * (ultimately offering any resources being consumed by that task to
+ * another task).
+ */
+enum TaskState {
+ TASK_STAGING = 6; // Initial state. Framework status updates should not use.
+ TASK_STARTING = 0; // The task is being launched by the executor.
+ TASK_RUNNING = 1;
+
+ // NOTE: This should only be sent when the framework has
+ // the TASK_KILLING_STATE capability.
+ TASK_KILLING = 8; // The task is being killed by the executor.
+
+ TASK_FINISHED = 2; // TERMINAL: The task finished successfully.
+ TASK_FAILED = 3; // TERMINAL: The task failed to finish successfully.
+ TASK_KILLED = 4; // TERMINAL: The task was killed by the executor.
+ TASK_ERROR = 7; // TERMINAL: The task description contains an error.
+
+ // In Mesos 1.3, this will only be sent when the framework does NOT
+ // opt-in to the PARTITION_AWARE capability.
+ //
+ // NOTE: This state is not always terminal. For example, tasks might
+ // transition from TASK_LOST to TASK_RUNNING or other states when a
+ // partitioned agent re-registers.
+ TASK_LOST = 5; // The task failed but can be rescheduled.
+
+ // The following task states are only sent when the framework
+ // opts-in to the PARTITION_AWARE capability.
+
+ // The task failed to launch because of a transient error. The
+ // task's executor never started running. Unlike TASK_ERROR, the
+ // task description is valid -- attempting to launch the task again
+ // may be successful.
+ TASK_DROPPED = 9; // TERMINAL.
+
+ // The task was running on an agent that has lost contact with the
+ // master, typically due to a network failure or partition. The task
+ // may or may not still be running.
+ TASK_UNREACHABLE = 10;
+
+ // The task is no longer running. This can occur if the agent has
+ // been terminated along with all of its tasks (e.g., the host that
+ // was running the agent was rebooted). It might also occur if the
+ // task was terminated due to an agent or containerizer error, or if
+ // the task was preempted by the QoS controller in an
+ // oversubscription scenario.
+ TASK_GONE = 11; // TERMINAL.
+
+ // The task was running on an agent that the master cannot contact;
+ // the operator has asserted that the agent has been shutdown, but
+ // this has not been directly confirmed by the master. If the
+ // operator is correct, the task is not running and this is a
+ // terminal state; if the operator is mistaken, the task may still
+ // be running and might return to RUNNING in the future.
+ TASK_GONE_BY_OPERATOR = 12;
+
+ // The master has no knowledge of the task. This is typically
+ // because either (a) the master never had knowledge of the task, or
+ // (b) the master forgot about the task because it garbage collected
+ // its metadata about the task. The task may or may not still be
+ // running.
+ TASK_UNKNOWN = 13;
+}
+
+
+/**
+* Describes the status of a check. Type and the corresponding field, i.e.,
+* `command` or `http` must be set. If the result of the check is not available
+* (e.g., the check timed out), these fields must contain empty messages, i.e.,
+* `exit_code` or `status_code` will be unset.
+*
+* NOTE: This API is unstable and the related feature is experimental.
+*/
+message CheckStatusInfo {
+ message Command {
+ // Exit code of a command check. It is the result of calling
+ // `WEXITSTATUS()` on `waitpid()` termination information on
+ // Posix and calling `GetExitCodeProcess()` on Windows.
+ optional int32 exit_code = 1;
+ }
+
+ message Http {
+ // HTTP status code of an HTTP check.
+ optional uint32 status_code = 1;
+ }
+
+ message Tcp {
+ // Whether a TCP connection succeeded.
+ optional bool succeeded = 1;
+ }
+
+ // TODO(alexr): Consider adding a `data` field, which can contain, e.g.,
+ // truncated stdout/stderr output for command checks or HTTP response body
+ // for HTTP checks. Alternatively, it can be an even shorter `message` field
+ // containing the last line of stdout or Reason-Phrase of the status line of
+ // the HTTP response.
+
+ // The type of the check this status corresponds to.
+ optional CheckInfo.Type type = 1;
+
+ // Status of a command check.
+ optional Command command = 2;
+
+ // Status of an HTTP check.
+ optional Http http = 3;
+
+ // Status of a TCP check.
+ optional Tcp tcp = 4;
+
+ // TODO(alexr): Consider introducing a "last changed at" timestamp, since
+ // task status update's timestamp may not correspond to the last check's
+ // state, e.g., for reconciliation.
+
+ // TODO(alexr): Consider introducing a `reason` enum here to explicitly
+ // distinguish between completed, delayed, and timed out checks.
+}
+
+
+/**
+ * Describes the current status of a task.
+ */
+message TaskStatus {
+ // Describes the source of the task status update.
+ enum Source {
+ SOURCE_MASTER = 0;
+ SOURCE_AGENT = 1;
+ SOURCE_EXECUTOR = 2;
+ }
+
+ // Detailed reason for the task status update.
+ //
+ // TODO(bmahler): Differentiate between agent removal reasons
+ // (e.g. unhealthy vs. unregistered for maintenance).
+ enum Reason {
+ // TODO(jieyu): The default value when a caller doesn't check for
+ // presence is 0 and so ideally the 0 reason is not a valid one.
+ // Since this is not used anywhere, consider removing this reason.
+ REASON_COMMAND_EXECUTOR_FAILED = 0;
+
+ REASON_CONTAINER_LAUNCH_FAILED = 21;
+ REASON_CONTAINER_LIMITATION = 19;
+ REASON_CONTAINER_LIMITATION_DISK = 20;
+ REASON_CONTAINER_LIMITATION_MEMORY = 8;
+ REASON_CONTAINER_PREEMPTED = 17;
+ REASON_CONTAINER_UPDATE_FAILED = 22;
+ REASON_EXECUTOR_REGISTRATION_TIMEOUT = 23;
+ REASON_EXECUTOR_REREGISTRATION_TIMEOUT = 24;
+ REASON_EXECUTOR_TERMINATED = 1;
+ REASON_EXECUTOR_UNREGISTERED = 2; // No longer used.
+ REASON_FRAMEWORK_REMOVED = 3;
+ REASON_GC_ERROR = 4;
+ REASON_INVALID_FRAMEWORKID = 5;
+ REASON_INVALID_OFFERS = 6;
+ REASON_IO_SWITCHBOARD_EXITED = 27;
+ REASON_MASTER_DISCONNECTED = 7;
+ REASON_RECONCILIATION = 9;
+ REASON_RESOURCES_UNKNOWN = 18;
+ REASON_AGENT_DISCONNECTED = 10;
+ REASON_AGENT_REMOVED = 11;
+ REASON_AGENT_RESTARTED = 12;
+ REASON_AGENT_UNKNOWN = 13;
+ REASON_TASK_KILLED_DURING_LAUNCH = 30;
+ REASON_TASK_CHECK_STATUS_UPDATED = 28;
+ REASON_TASK_HEALTH_CHECK_STATUS_UPDATED = 29;
+ REASON_TASK_GROUP_INVALID = 25;
+ REASON_TASK_GROUP_UNAUTHORIZED = 26;
+ REASON_TASK_INVALID = 14;
+ REASON_TASK_UNAUTHORIZED = 15;
+ REASON_TASK_UNKNOWN = 16;
+ }
+
+ required TaskID task_id = 1;
+ required TaskState state = 2;
+ optional string message = 4; // Possible message explaining state.
+ optional Source source = 9;
+ optional Reason reason = 10;
+ optional bytes data = 3;
+ optional AgentID agent_id = 5;
+ optional ExecutorID executor_id = 7; // TODO(benh): Use in master/agent.
+ optional double timestamp = 6;
+
+ // Statuses that are delivered reliably to the scheduler will
+ // include a 'uuid'. The status is considered delivered once
+ // it is acknowledged by the scheduler. Schedulers can choose
+ // to either explicitly acknowledge statuses or let the scheduler
+ // driver implicitly acknowledge (default).
+ //
+ // TODO(bmahler): This is currently overwritten in the scheduler
+ // driver and executor driver, but executors will need to set this
+ // to a valid RFC-4122 UUID if using the HTTP API.
+ optional bytes uuid = 11;
+
+ // Describes whether the task has been determined to be healthy (true) or
+ // unhealthy (false) according to the `health_check` field in `TaskInfo`.
+ optional bool healthy = 8;
+
+ // Contains check status for the check specified in the corresponding
+ // `TaskInfo`. If no check has been specified, this field must be
+ // absent, otherwise it must be present even if the check status is
+ // not available yet. If the status update is triggered for a different
+ // reason than `REASON_TASK_CHECK_STATUS_UPDATED`, this field will contain
+ // the last known value.
+ //
+ // NOTE: A check-related task status update is triggered if and only if
+ // the value or presence of any field in `CheckStatusInfo` changes.
+ //
+ // NOTE: Check support in built-in executors is experimental.
+ optional CheckStatusInfo check_status = 15;
+
+ // Labels are free-form key value pairs which are exposed through
+ // master and agent endpoints. Labels will not be interpreted or
+ // acted upon by Mesos itself. As opposed to the data field, labels
+ // will be kept in memory on master and agent processes. Therefore,
+ // labels should be used to tag TaskStatus message with light-weight
+ // meta-data. Labels should not contain duplicate key-value pairs.
+ optional Labels labels = 12;
+
+ // Container related information that is resolved dynamically such as
+ // network address.
+ optional ContainerStatus container_status = 13;
+
+ // The time (according to the master's clock) when the agent where
+ // this task was running became unreachable. This is only set on
+ // status updates for tasks running on agents that are unreachable
+ // (e.g., partitioned away from the master).
+ optional TimeInfo unreachable_time = 14;
+}
+
+
+/**
+ * Describes possible filters that can be applied to unused resources
+ * (see SchedulerDriver::launchTasks) to influence the allocator.
+ */
+message Filters {
+ // Time to consider unused resources refused. Note that all unused
+ // resources will be considered refused and use the default value
+ // (below) regardless of whether Filters was passed to
+ // SchedulerDriver::launchTasks. You MUST pass Filters with this
+ // field set to change this behavior (i.e., get another offer which
+ // includes unused resources sooner or later than the default).
+ optional double refuse_seconds = 1 [default = 5.0];
+}
+
+
+/**
+* Describes a collection of environment variables. This is used with
+* CommandInfo in order to set environment variables before running a
+* command. The contents of each variable may be specified as a string
+* or a Secret; only one of `value` and `secret` must be set.
+*/
+message Environment {
+ message Variable {
+ required string name = 1;
+
+ enum Type {
+ UNKNOWN = 0;
+ VALUE = 1;
+ SECRET = 2;
+ }
+
+ // In Mesos 1.2, the `Environment.variables.value` message was made
+ // optional. The default type for `Environment.variables.type` is now VALUE,
+ // which requires `value` to be set, maintaining backward compatibility.
+ //
+ // TODO(greggomann): The default can be removed in Mesos 2.1 (MESOS-7134).
+ optional Type type = 3 [default = VALUE];
+
+ // Only one
<TRUNCATED>
[04/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/v1/executor/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/executor/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/executor/Protos.java
new file mode 100644
index 0000000..c83d2a4
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/executor/Protos.java
@@ -0,0 +1,10785 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/v1/executor.proto
+
+package org.apache.mesos.v1.executor;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface EventOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.v1.executor.Event.Type type = 1;
+ /**
+ * <code>optional .mesos.v1.executor.Event.Type type = 1;</code>
+ *
+ * <pre>
+ * Type of the event, indicates which optional field below should be
+ * present if that type has a nested message definition.
+ * Enum fields should be optional, see: MESOS-4997.
+ * </pre>
+ */
+ boolean hasType();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Type type = 1;</code>
+ *
+ * <pre>
+ * Type of the event, indicates which optional field below should be
+ * present if that type has a nested message definition.
+ * Enum fields should be optional, see: MESOS-4997.
+ * </pre>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.Type getType();
+
+ // optional .mesos.v1.executor.Event.Subscribed subscribed = 2;
+ /**
+ * <code>optional .mesos.v1.executor.Event.Subscribed subscribed = 2;</code>
+ */
+ boolean hasSubscribed();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Subscribed subscribed = 2;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.Subscribed getSubscribed();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Subscribed subscribed = 2;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.SubscribedOrBuilder getSubscribedOrBuilder();
+
+ // optional .mesos.v1.executor.Event.Acknowledged acknowledged = 3;
+ /**
+ * <code>optional .mesos.v1.executor.Event.Acknowledged acknowledged = 3;</code>
+ */
+ boolean hasAcknowledged();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Acknowledged acknowledged = 3;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.Acknowledged getAcknowledged();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Acknowledged acknowledged = 3;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.AcknowledgedOrBuilder getAcknowledgedOrBuilder();
+
+ // optional .mesos.v1.executor.Event.Launch launch = 4;
+ /**
+ * <code>optional .mesos.v1.executor.Event.Launch launch = 4;</code>
+ */
+ boolean hasLaunch();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Launch launch = 4;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.Launch getLaunch();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Launch launch = 4;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.LaunchOrBuilder getLaunchOrBuilder();
+
+ // optional .mesos.v1.executor.Event.LaunchGroup launch_group = 8;
+ /**
+ * <code>optional .mesos.v1.executor.Event.LaunchGroup launch_group = 8;</code>
+ */
+ boolean hasLaunchGroup();
+ /**
+ * <code>optional .mesos.v1.executor.Event.LaunchGroup launch_group = 8;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.LaunchGroup getLaunchGroup();
+ /**
+ * <code>optional .mesos.v1.executor.Event.LaunchGroup launch_group = 8;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.LaunchGroupOrBuilder getLaunchGroupOrBuilder();
+
+ // optional .mesos.v1.executor.Event.Kill kill = 5;
+ /**
+ * <code>optional .mesos.v1.executor.Event.Kill kill = 5;</code>
+ */
+ boolean hasKill();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Kill kill = 5;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.Kill getKill();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Kill kill = 5;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.KillOrBuilder getKillOrBuilder();
+
+ // optional .mesos.v1.executor.Event.Message message = 6;
+ /**
+ * <code>optional .mesos.v1.executor.Event.Message message = 6;</code>
+ */
+ boolean hasMessage();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Message message = 6;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.Message getMessage();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Message message = 6;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.MessageOrBuilder getMessageOrBuilder();
+
+ // optional .mesos.v1.executor.Event.Error error = 7;
+ /**
+ * <code>optional .mesos.v1.executor.Event.Error error = 7;</code>
+ */
+ boolean hasError();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Error error = 7;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.Error getError();
+ /**
+ * <code>optional .mesos.v1.executor.Event.Error error = 7;</code>
+ */
+ org.apache.mesos.v1.executor.Protos.Event.ErrorOrBuilder getErrorOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.executor.Event}
+ *
+ * <pre>
+ **
+ * Executor event API.
+ *
+ * An event is described using the standard protocol buffer "union"
+ * trick, see https://developers.google.com/protocol-buffers/docs/techniques#union.
+ * </pre>
+ */
+ public static final class Event extends
+ com.google.protobuf.GeneratedMessage
+ implements EventOrBuilder {
+ // Use Event.newBuilder() to construct.
+ private Event(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Event(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Event defaultInstance;
+ public static Event getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Event getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Event(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ int rawValue = input.readEnum();
+ org.apache.mesos.v1.executor.Protos.Event.Type value = org.apache.mesos.v1.executor.Protos.Event.Type.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(1, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ type_ = value;
+ }
+ break;
+ }
+ case 18: {
+ org.apache.mesos.v1.executor.Protos.Event.Subscribed.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = subscribed_.toBuilder();
+ }
+ subscribed_ = input.readMessage(org.apache.mesos.v1.executor.Protos.Event.Subscribed.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(subscribed_);
+ subscribed_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.apache.mesos.v1.executor.Protos.Event.Acknowledged.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = acknowledged_.toBuilder();
+ }
+ acknowledged_ = input.readMessage(org.apache.mesos.v1.executor.Protos.Event.Acknowledged.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(acknowledged_);
+ acknowledged_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ org.apache.mesos.v1.executor.Protos.Event.Launch.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ subBuilder = launch_.toBuilder();
+ }
+ launch_ = input.readMessage(org.apache.mesos.v1.executor.Protos.Event.Launch.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(launch_);
+ launch_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 42: {
+ org.apache.mesos.v1.executor.Protos.Event.Kill.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ subBuilder = kill_.toBuilder();
+ }
+ kill_ = input.readMessage(org.apache.mesos.v1.executor.Protos.Event.Kill.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(kill_);
+ kill_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000020;
+ break;
+ }
+ case 50: {
+ org.apache.mesos.v1.executor.Protos.Event.Message.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
+ subBuilder = message_.toBuilder();
+ }
+ message_ = input.readMessage(org.apache.mesos.v1.executor.Protos.Event.Message.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(message_);
+ message_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000040;
+ break;
+ }
+ case 58: {
+ org.apache.mesos.v1.executor.Protos.Event.Error.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ subBuilder = error_.toBuilder();
+ }
+ error_ = input.readMessage(org.apache.mesos.v1.executor.Protos.Event.Error.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(error_);
+ error_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000080;
+ break;
+ }
+ case 66: {
+ org.apache.mesos.v1.executor.Protos.Event.LaunchGroup.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ subBuilder = launchGroup_.toBuilder();
+ }
+ launchGroup_ = input.readMessage(org.apache.mesos.v1.executor.Protos.Event.LaunchGroup.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(launchGroup_);
+ launchGroup_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.executor.Protos.Event.class, org.apache.mesos.v1.executor.Protos.Event.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Event> PARSER =
+ new com.google.protobuf.AbstractParser<Event>() {
+ public Event parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Event(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Event> getParserForType() {
+ return PARSER;
+ }
+
+ /**
+ * Protobuf enum {@code mesos.v1.executor.Event.Type}
+ *
+ * <pre>
+ * Possible event types, followed by message definitions if
+ * applicable.
+ * </pre>
+ */
+ public enum Type
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * This must be the first enum value in this list, to
+ * ensure that if 'type' is not set, the default value
+ * is UNKNOWN. This enables enum values to be added
+ * in a backwards-compatible way. See: MESOS-4997.
+ * </pre>
+ */
+ UNKNOWN(0, 0),
+ /**
+ * <code>SUBSCRIBED = 1;</code>
+ *
+ * <pre>
+ * See 'Subscribed' below.
+ * </pre>
+ */
+ SUBSCRIBED(1, 1),
+ /**
+ * <code>LAUNCH = 2;</code>
+ *
+ * <pre>
+ * See 'Launch' below.
+ * </pre>
+ */
+ LAUNCH(2, 2),
+ /**
+ * <code>LAUNCH_GROUP = 8;</code>
+ *
+ * <pre>
+ * See 'LaunchGroup' below.
+ * </pre>
+ */
+ LAUNCH_GROUP(3, 8),
+ /**
+ * <code>KILL = 3;</code>
+ *
+ * <pre>
+ * See 'Kill' below.
+ * </pre>
+ */
+ KILL(4, 3),
+ /**
+ * <code>ACKNOWLEDGED = 4;</code>
+ *
+ * <pre>
+ * See 'Acknowledged' below.
+ * </pre>
+ */
+ ACKNOWLEDGED(5, 4),
+ /**
+ * <code>MESSAGE = 5;</code>
+ *
+ * <pre>
+ * See 'Message' below.
+ * </pre>
+ */
+ MESSAGE(6, 5),
+ /**
+ * <code>ERROR = 6;</code>
+ *
+ * <pre>
+ * See 'Error' below.
+ * </pre>
+ */
+ ERROR(7, 6),
+ /**
+ * <code>SHUTDOWN = 7;</code>
+ *
+ * <pre>
+ * Received when the agent asks the executor to shutdown/kill itself.
+ * The executor is then required to kill all its active tasks, send
+ * `TASK_KILLED` status updates and gracefully exit. The executor
+ * should terminate within a `MESOS_EXECUTOR_SHUTDOWN_GRACE_PERIOD`
+ * (an environment variable set by the agent upon executor startup);
+ * it can be configured via `ExecutorInfo.shutdown_grace_period`. If
+ * the executor fails to do so, the agent will forcefully destroy the
+ * container where the executor is running. The agent would then send
+ * `TASK_LOST` updates for any remaining active tasks of this executor.
+ *
+ * NOTE: The executor must not assume that it will always be allotted
+ * the full grace period, as the agent may decide to allot a shorter
+ * period and failures / forcible terminations may occur.
+ *
+ * TODO(alexr): Consider adding a duration field into the `Shutdown`
+ * message so that the agent can communicate when a shorter period
+ * has been allotted.
+ * </pre>
+ */
+ SHUTDOWN(8, 7),
+ ;
+
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * This must be the first enum value in this list, to
+ * ensure that if 'type' is not set, the default value
+ * is UNKNOWN. This enables enum values to be added
+ * in a backwards-compatible way. See: MESOS-4997.
+ * </pre>
+ */
+ public static final int UNKNOWN_VALUE = 0;
+ /**
+ * <code>SUBSCRIBED = 1;</code>
+ *
+ * <pre>
+ * See 'Subscribed' below.
+ * </pre>
+ */
+ public static final int SUBSCRIBED_VALUE = 1;
+ /**
+ * <code>LAUNCH = 2;</code>
+ *
+ * <pre>
+ * See 'Launch' below.
+ * </pre>
+ */
+ public static final int LAUNCH_VALUE = 2;
+ /**
+ * <code>LAUNCH_GROUP = 8;</code>
+ *
+ * <pre>
+ * See 'LaunchGroup' below.
+ * </pre>
+ */
+ public static final int LAUNCH_GROUP_VALUE = 8;
+ /**
+ * <code>KILL = 3;</code>
+ *
+ * <pre>
+ * See 'Kill' below.
+ * </pre>
+ */
+ public static final int KILL_VALUE = 3;
+ /**
+ * <code>ACKNOWLEDGED = 4;</code>
+ *
+ * <pre>
+ * See 'Acknowledged' below.
+ * </pre>
+ */
+ public static final int ACKNOWLEDGED_VALUE = 4;
+ /**
+ * <code>MESSAGE = 5;</code>
+ *
+ * <pre>
+ * See 'Message' below.
+ * </pre>
+ */
+ public static final int MESSAGE_VALUE = 5;
+ /**
+ * <code>ERROR = 6;</code>
+ *
+ * <pre>
+ * See 'Error' below.
+ * </pre>
+ */
+ public static final int ERROR_VALUE = 6;
+ /**
+ * <code>SHUTDOWN = 7;</code>
+ *
+ * <pre>
+ * Received when the agent asks the executor to shutdown/kill itself.
+ * The executor is then required to kill all its active tasks, send
+ * `TASK_KILLED` status updates and gracefully exit. The executor
+ * should terminate within a `MESOS_EXECUTOR_SHUTDOWN_GRACE_PERIOD`
+ * (an environment variable set by the agent upon executor startup);
+ * it can be configured via `ExecutorInfo.shutdown_grace_period`. If
+ * the executor fails to do so, the agent will forcefully destroy the
+ * container where the executor is running. The agent would then send
+ * `TASK_LOST` updates for any remaining active tasks of this executor.
+ *
+ * NOTE: The executor must not assume that it will always be allotted
+ * the full grace period, as the agent may decide to allot a shorter
+ * period and failures / forcible terminations may occur.
+ *
+ * TODO(alexr): Consider adding a duration field into the `Shutdown`
+ * message so that the agent can communicate when a shorter period
+ * has been allotted.
+ * </pre>
+ */
+ public static final int SHUTDOWN_VALUE = 7;
+
+
+ public final int getNumber() { return value; }
+
+ public static Type valueOf(int value) {
+ switch (value) {
+ case 0: return UNKNOWN;
+ case 1: return SUBSCRIBED;
+ case 2: return LAUNCH;
+ case 8: return LAUNCH_GROUP;
+ case 3: return KILL;
+ case 4: return ACKNOWLEDGED;
+ case 5: return MESSAGE;
+ case 6: return ERROR;
+ case 7: return SHUTDOWN;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Type>() {
+ public Type findValueByNumber(int number) {
+ return Type.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.executor.Protos.Event.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Type[] VALUES = values();
+
+ public static Type valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private Type(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.v1.executor.Event.Type)
+ }
+
+ public interface SubscribedOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .mesos.v1.ExecutorInfo executor_info = 1;
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ boolean hasExecutorInfo();
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.ExecutorInfo getExecutorInfo();
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.ExecutorInfoOrBuilder getExecutorInfoOrBuilder();
+
+ // required .mesos.v1.FrameworkInfo framework_info = 2;
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ boolean hasFrameworkInfo();
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ org.apache.mesos.v1.Protos.FrameworkInfo getFrameworkInfo();
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ org.apache.mesos.v1.Protos.FrameworkInfoOrBuilder getFrameworkInfoOrBuilder();
+
+ // required .mesos.v1.AgentInfo agent_info = 3;
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ boolean hasAgentInfo();
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ org.apache.mesos.v1.Protos.AgentInfo getAgentInfo();
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ org.apache.mesos.v1.Protos.AgentInfoOrBuilder getAgentInfoOrBuilder();
+
+ // optional .mesos.v1.ContainerID container_id = 4;
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ boolean hasContainerId();
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.ContainerID getContainerId();
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.ContainerIDOrBuilder getContainerIdOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.executor.Event.Subscribed}
+ *
+ * <pre>
+ * First event received when the executor subscribes.
+ * The 'id' field in the 'framework_info' will be set.
+ * </pre>
+ */
+ public static final class Subscribed extends
+ com.google.protobuf.GeneratedMessage
+ implements SubscribedOrBuilder {
+ // Use Subscribed.newBuilder() to construct.
+ private Subscribed(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Subscribed(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Subscribed defaultInstance;
+ public static Subscribed getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Subscribed getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Subscribed(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.v1.Protos.ExecutorInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = executorInfo_.toBuilder();
+ }
+ executorInfo_ = input.readMessage(org.apache.mesos.v1.Protos.ExecutorInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(executorInfo_);
+ executorInfo_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 18: {
+ org.apache.mesos.v1.Protos.FrameworkInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = frameworkInfo_.toBuilder();
+ }
+ frameworkInfo_ = input.readMessage(org.apache.mesos.v1.Protos.FrameworkInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(frameworkInfo_);
+ frameworkInfo_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.apache.mesos.v1.Protos.AgentInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = agentInfo_.toBuilder();
+ }
+ agentInfo_ = input.readMessage(org.apache.mesos.v1.Protos.AgentInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(agentInfo_);
+ agentInfo_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ org.apache.mesos.v1.Protos.ContainerID.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ subBuilder = containerId_.toBuilder();
+ }
+ containerId_ = input.readMessage(org.apache.mesos.v1.Protos.ContainerID.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(containerId_);
+ containerId_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_Subscribed_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_Subscribed_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.executor.Protos.Event.Subscribed.class, org.apache.mesos.v1.executor.Protos.Event.Subscribed.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Subscribed> PARSER =
+ new com.google.protobuf.AbstractParser<Subscribed>() {
+ public Subscribed parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Subscribed(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Subscribed> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required .mesos.v1.ExecutorInfo executor_info = 1;
+ public static final int EXECUTOR_INFO_FIELD_NUMBER = 1;
+ private org.apache.mesos.v1.Protos.ExecutorInfo executorInfo_;
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public boolean hasExecutorInfo() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.ExecutorInfo getExecutorInfo() {
+ return executorInfo_;
+ }
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.ExecutorInfoOrBuilder getExecutorInfoOrBuilder() {
+ return executorInfo_;
+ }
+
+ // required .mesos.v1.FrameworkInfo framework_info = 2;
+ public static final int FRAMEWORK_INFO_FIELD_NUMBER = 2;
+ private org.apache.mesos.v1.Protos.FrameworkInfo frameworkInfo_;
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public boolean hasFrameworkInfo() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkInfo getFrameworkInfo() {
+ return frameworkInfo_;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkInfoOrBuilder getFrameworkInfoOrBuilder() {
+ return frameworkInfo_;
+ }
+
+ // required .mesos.v1.AgentInfo agent_info = 3;
+ public static final int AGENT_INFO_FIELD_NUMBER = 3;
+ private org.apache.mesos.v1.Protos.AgentInfo agentInfo_;
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public boolean hasAgentInfo() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public org.apache.mesos.v1.Protos.AgentInfo getAgentInfo() {
+ return agentInfo_;
+ }
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public org.apache.mesos.v1.Protos.AgentInfoOrBuilder getAgentInfoOrBuilder() {
+ return agentInfo_;
+ }
+
+ // optional .mesos.v1.ContainerID container_id = 4;
+ public static final int CONTAINER_ID_FIELD_NUMBER = 4;
+ private org.apache.mesos.v1.Protos.ContainerID containerId_;
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public boolean hasContainerId() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.ContainerID getContainerId() {
+ return containerId_;
+ }
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.ContainerIDOrBuilder getContainerIdOrBuilder() {
+ return containerId_;
+ }
+
+ private void initFields() {
+ executorInfo_ = org.apache.mesos.v1.Protos.ExecutorInfo.getDefaultInstance();
+ frameworkInfo_ = org.apache.mesos.v1.Protos.FrameworkInfo.getDefaultInstance();
+ agentInfo_ = org.apache.mesos.v1.Protos.AgentInfo.getDefaultInstance();
+ containerId_ = org.apache.mesos.v1.Protos.ContainerID.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasExecutorInfo()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasFrameworkInfo()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasAgentInfo()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getExecutorInfo().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getFrameworkInfo().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getAgentInfo().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (hasContainerId()) {
+ if (!getContainerId().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, executorInfo_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeMessage(2, frameworkInfo_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeMessage(3, agentInfo_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ output.writeMessage(4, containerId_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, executorInfo_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, frameworkInfo_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, agentInfo_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, containerId_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.executor.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Subscribed parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Subscribed parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Subscribed parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Subscribed parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Subscribed parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Subscribed parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.executor.Protos.Event.Subscribed prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.executor.Event.Subscribed}
+ *
+ * <pre>
+ * First event received when the executor subscribes.
+ * The 'id' field in the 'framework_info' will be set.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.executor.Protos.Event.SubscribedOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_Subscribed_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_Subscribed_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.executor.Protos.Event.Subscribed.class, org.apache.mesos.v1.executor.Protos.Event.Subscribed.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.executor.Protos.Event.Subscribed.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getExecutorInfoFieldBuilder();
+ getFrameworkInfoFieldBuilder();
+ getAgentInfoFieldBuilder();
+ getContainerIdFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (executorInfoBuilder_ == null) {
+ executorInfo_ = org.apache.mesos.v1.Protos.ExecutorInfo.getDefaultInstance();
+ } else {
+ executorInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (frameworkInfoBuilder_ == null) {
+ frameworkInfo_ = org.apache.mesos.v1.Protos.FrameworkInfo.getDefaultInstance();
+ } else {
+ frameworkInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (agentInfoBuilder_ == null) {
+ agentInfo_ = org.apache.mesos.v1.Protos.AgentInfo.getDefaultInstance();
+ } else {
+ agentInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ if (containerIdBuilder_ == null) {
+ containerId_ = org.apache.mesos.v1.Protos.ContainerID.getDefaultInstance();
+ } else {
+ containerIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_Subscribed_descriptor;
+ }
+
+ public org.apache.mesos.v1.executor.Protos.Event.Subscribed getDefaultInstanceForType() {
+ return org.apache.mesos.v1.executor.Protos.Event.Subscribed.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.executor.Protos.Event.Subscribed build() {
+ org.apache.mesos.v1.executor.Protos.Event.Subscribed result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.executor.Protos.Event.Subscribed buildPartial() {
+ org.apache.mesos.v1.executor.Protos.Event.Subscribed result = new org.apache.mesos.v1.executor.Protos.Event.Subscribed(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (executorInfoBuilder_ == null) {
+ result.executorInfo_ = executorInfo_;
+ } else {
+ result.executorInfo_ = executorInfoBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ if (frameworkInfoBuilder_ == null) {
+ result.frameworkInfo_ = frameworkInfo_;
+ } else {
+ result.frameworkInfo_ = frameworkInfoBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ if (agentInfoBuilder_ == null) {
+ result.agentInfo_ = agentInfo_;
+ } else {
+ result.agentInfo_ = agentInfoBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+ to_bitField0_ |= 0x00000008;
+ }
+ if (containerIdBuilder_ == null) {
+ result.containerId_ = containerId_;
+ } else {
+ result.containerId_ = containerIdBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.executor.Protos.Event.Subscribed) {
+ return mergeFrom((org.apache.mesos.v1.executor.Protos.Event.Subscribed)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.executor.Protos.Event.Subscribed other) {
+ if (other == org.apache.mesos.v1.executor.Protos.Event.Subscribed.getDefaultInstance()) return this;
+ if (other.hasExecutorInfo()) {
+ mergeExecutorInfo(other.getExecutorInfo());
+ }
+ if (other.hasFrameworkInfo()) {
+ mergeFrameworkInfo(other.getFrameworkInfo());
+ }
+ if (other.hasAgentInfo()) {
+ mergeAgentInfo(other.getAgentInfo());
+ }
+ if (other.hasContainerId()) {
+ mergeContainerId(other.getContainerId());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasExecutorInfo()) {
+
+ return false;
+ }
+ if (!hasFrameworkInfo()) {
+
+ return false;
+ }
+ if (!hasAgentInfo()) {
+
+ return false;
+ }
+ if (!getExecutorInfo().isInitialized()) {
+
+ return false;
+ }
+ if (!getFrameworkInfo().isInitialized()) {
+
+ return false;
+ }
+ if (!getAgentInfo().isInitialized()) {
+
+ return false;
+ }
+ if (hasContainerId()) {
+ if (!getContainerId().isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.executor.Protos.Event.Subscribed parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.executor.Protos.Event.Subscribed) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required .mesos.v1.ExecutorInfo executor_info = 1;
+ private org.apache.mesos.v1.Protos.ExecutorInfo executorInfo_ = org.apache.mesos.v1.Protos.ExecutorInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.ExecutorInfo, org.apache.mesos.v1.Protos.ExecutorInfo.Builder, org.apache.mesos.v1.Protos.ExecutorInfoOrBuilder> executorInfoBuilder_;
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public boolean hasExecutorInfo() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.ExecutorInfo getExecutorInfo() {
+ if (executorInfoBuilder_ == null) {
+ return executorInfo_;
+ } else {
+ return executorInfoBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public Builder setExecutorInfo(org.apache.mesos.v1.Protos.ExecutorInfo value) {
+ if (executorInfoBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ executorInfo_ = value;
+ onChanged();
+ } else {
+ executorInfoBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public Builder setExecutorInfo(
+ org.apache.mesos.v1.Protos.ExecutorInfo.Builder builderForValue) {
+ if (executorInfoBuilder_ == null) {
+ executorInfo_ = builderForValue.build();
+ onChanged();
+ } else {
+ executorInfoBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public Builder mergeExecutorInfo(org.apache.mesos.v1.Protos.ExecutorInfo value) {
+ if (executorInfoBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ executorInfo_ != org.apache.mesos.v1.Protos.ExecutorInfo.getDefaultInstance()) {
+ executorInfo_ =
+ org.apache.mesos.v1.Protos.ExecutorInfo.newBuilder(executorInfo_).mergeFrom(value).buildPartial();
+ } else {
+ executorInfo_ = value;
+ }
+ onChanged();
+ } else {
+ executorInfoBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public Builder clearExecutorInfo() {
+ if (executorInfoBuilder_ == null) {
+ executorInfo_ = org.apache.mesos.v1.Protos.ExecutorInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ executorInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.ExecutorInfo.Builder getExecutorInfoBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getExecutorInfoFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.ExecutorInfoOrBuilder getExecutorInfoOrBuilder() {
+ if (executorInfoBuilder_ != null) {
+ return executorInfoBuilder_.getMessageOrBuilder();
+ } else {
+ return executorInfo_;
+ }
+ }
+ /**
+ * <code>required .mesos.v1.ExecutorInfo executor_info = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.ExecutorInfo, org.apache.mesos.v1.Protos.ExecutorInfo.Builder, org.apache.mesos.v1.Protos.ExecutorInfoOrBuilder>
+ getExecutorInfoFieldBuilder() {
+ if (executorInfoBuilder_ == null) {
+ executorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.ExecutorInfo, org.apache.mesos.v1.Protos.ExecutorInfo.Builder, org.apache.mesos.v1.Protos.ExecutorInfoOrBuilder>(
+ executorInfo_,
+ getParentForChildren(),
+ isClean());
+ executorInfo_ = null;
+ }
+ return executorInfoBuilder_;
+ }
+
+ // required .mesos.v1.FrameworkInfo framework_info = 2;
+ private org.apache.mesos.v1.Protos.FrameworkInfo frameworkInfo_ = org.apache.mesos.v1.Protos.FrameworkInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.FrameworkInfo, org.apache.mesos.v1.Protos.FrameworkInfo.Builder, org.apache.mesos.v1.Protos.FrameworkInfoOrBuilder> frameworkInfoBuilder_;
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public boolean hasFrameworkInfo() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkInfo getFrameworkInfo() {
+ if (frameworkInfoBuilder_ == null) {
+ return frameworkInfo_;
+ } else {
+ return frameworkInfoBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public Builder setFrameworkInfo(org.apache.mesos.v1.Protos.FrameworkInfo value) {
+ if (frameworkInfoBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ frameworkInfo_ = value;
+ onChanged();
+ } else {
+ frameworkInfoBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public Builder setFrameworkInfo(
+ org.apache.mesos.v1.Protos.FrameworkInfo.Builder builderForValue) {
+ if (frameworkInfoBuilder_ == null) {
+ frameworkInfo_ = builderForValue.build();
+ onChanged();
+ } else {
+ frameworkInfoBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public Builder mergeFrameworkInfo(org.apache.mesos.v1.Protos.FrameworkInfo value) {
+ if (frameworkInfoBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002) &&
+ frameworkInfo_ != org.apache.mesos.v1.Protos.FrameworkInfo.getDefaultInstance()) {
+ frameworkInfo_ =
+ org.apache.mesos.v1.Protos.FrameworkInfo.newBuilder(frameworkInfo_).mergeFrom(value).buildPartial();
+ } else {
+ frameworkInfo_ = value;
+ }
+ onChanged();
+ } else {
+ frameworkInfoBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public Builder clearFrameworkInfo() {
+ if (frameworkInfoBuilder_ == null) {
+ frameworkInfo_ = org.apache.mesos.v1.Protos.FrameworkInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ frameworkInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkInfo.Builder getFrameworkInfoBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getFrameworkInfoFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ public org.apache.mesos.v1.Protos.FrameworkInfoOrBuilder getFrameworkInfoOrBuilder() {
+ if (frameworkInfoBuilder_ != null) {
+ return frameworkInfoBuilder_.getMessageOrBuilder();
+ } else {
+ return frameworkInfo_;
+ }
+ }
+ /**
+ * <code>required .mesos.v1.FrameworkInfo framework_info = 2;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.FrameworkInfo, org.apache.mesos.v1.Protos.FrameworkInfo.Builder, org.apache.mesos.v1.Protos.FrameworkInfoOrBuilder>
+ getFrameworkInfoFieldBuilder() {
+ if (frameworkInfoBuilder_ == null) {
+ frameworkInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.FrameworkInfo, org.apache.mesos.v1.Protos.FrameworkInfo.Builder, org.apache.mesos.v1.Protos.FrameworkInfoOrBuilder>(
+ frameworkInfo_,
+ getParentForChildren(),
+ isClean());
+ frameworkInfo_ = null;
+ }
+ return frameworkInfoBuilder_;
+ }
+
+ // required .mesos.v1.AgentInfo agent_info = 3;
+ private org.apache.mesos.v1.Protos.AgentInfo agentInfo_ = org.apache.mesos.v1.Protos.AgentInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.AgentInfo, org.apache.mesos.v1.Protos.AgentInfo.Builder, org.apache.mesos.v1.Protos.AgentInfoOrBuilder> agentInfoBuilder_;
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public boolean hasAgentInfo() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public org.apache.mesos.v1.Protos.AgentInfo getAgentInfo() {
+ if (agentInfoBuilder_ == null) {
+ return agentInfo_;
+ } else {
+ return agentInfoBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public Builder setAgentInfo(org.apache.mesos.v1.Protos.AgentInfo value) {
+ if (agentInfoBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ agentInfo_ = value;
+ onChanged();
+ } else {
+ agentInfoBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public Builder setAgentInfo(
+ org.apache.mesos.v1.Protos.AgentInfo.Builder builderForValue) {
+ if (agentInfoBuilder_ == null) {
+ agentInfo_ = builderForValue.build();
+ onChanged();
+ } else {
+ agentInfoBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public Builder mergeAgentInfo(org.apache.mesos.v1.Protos.AgentInfo value) {
+ if (agentInfoBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) == 0x00000004) &&
+ agentInfo_ != org.apache.mesos.v1.Protos.AgentInfo.getDefaultInstance()) {
+ agentInfo_ =
+ org.apache.mesos.v1.Protos.AgentInfo.newBuilder(agentInfo_).mergeFrom(value).buildPartial();
+ } else {
+ agentInfo_ = value;
+ }
+ onChanged();
+ } else {
+ agentInfoBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public Builder clearAgentInfo() {
+ if (agentInfoBuilder_ == null) {
+ agentInfo_ = org.apache.mesos.v1.Protos.AgentInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ agentInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public org.apache.mesos.v1.Protos.AgentInfo.Builder getAgentInfoBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getAgentInfoFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ public org.apache.mesos.v1.Protos.AgentInfoOrBuilder getAgentInfoOrBuilder() {
+ if (agentInfoBuilder_ != null) {
+ return agentInfoBuilder_.getMessageOrBuilder();
+ } else {
+ return agentInfo_;
+ }
+ }
+ /**
+ * <code>required .mesos.v1.AgentInfo agent_info = 3;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.AgentInfo, org.apache.mesos.v1.Protos.AgentInfo.Builder, org.apache.mesos.v1.Protos.AgentInfoOrBuilder>
+ getAgentInfoFieldBuilder() {
+ if (agentInfoBuilder_ == null) {
+ agentInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.AgentInfo, org.apache.mesos.v1.Protos.AgentInfo.Builder, org.apache.mesos.v1.Protos.AgentInfoOrBuilder>(
+ agentInfo_,
+ getParentForChildren(),
+ isClean());
+ agentInfo_ = null;
+ }
+ return agentInfoBuilder_;
+ }
+
+ // optional .mesos.v1.ContainerID container_id = 4;
+ private org.apache.mesos.v1.Protos.ContainerID containerId_ = org.apache.mesos.v1.Protos.ContainerID.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.ContainerID, org.apache.mesos.v1.Protos.ContainerID.Builder, org.apache.mesos.v1.Protos.ContainerIDOrBuilder> containerIdBuilder_;
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public boolean hasContainerId() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.ContainerID getContainerId() {
+ if (containerIdBuilder_ == null) {
+ return containerId_;
+ } else {
+ return containerIdBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public Builder setContainerId(org.apache.mesos.v1.Protos.ContainerID value) {
+ if (containerIdBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ containerId_ = value;
+ onChanged();
+ } else {
+ containerIdBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public Builder setContainerId(
+ org.apache.mesos.v1.Protos.ContainerID.Builder builderForValue) {
+ if (containerIdBuilder_ == null) {
+ containerId_ = builderForValue.build();
+ onChanged();
+ } else {
+ containerIdBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public Builder mergeContainerId(org.apache.mesos.v1.Protos.ContainerID value) {
+ if (containerIdBuilder_ == null) {
+ if (((bitField0_ & 0x00000008) == 0x00000008) &&
+ containerId_ != org.apache.mesos.v1.Protos.ContainerID.getDefaultInstance()) {
+ containerId_ =
+ org.apache.mesos.v1.Protos.ContainerID.newBuilder(containerId_).mergeFrom(value).buildPartial();
+ } else {
+ containerId_ = value;
+ }
+ onChanged();
+ } else {
+ containerIdBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public Builder clearContainerId() {
+ if (containerIdBuilder_ == null) {
+ containerId_ = org.apache.mesos.v1.Protos.ContainerID.getDefaultInstance();
+ onChanged();
+ } else {
+ containerIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.ContainerID.Builder getContainerIdBuilder() {
+ bitField0_ |= 0x00000008;
+ onChanged();
+ return getContainerIdFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.ContainerIDOrBuilder getContainerIdOrBuilder() {
+ if (containerIdBuilder_ != null) {
+ return containerIdBuilder_.getMessageOrBuilder();
+ } else {
+ return containerId_;
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.ContainerID container_id = 4;</code>
+ *
+ * <pre>
+ * Uniquely identifies the container of an executor run.
+ * </pre>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.ContainerID, org.apache.mesos.v1.Protos.ContainerID.Builder, org.apache.mesos.v1.Protos.ContainerIDOrBuilder>
+ getContainerIdFieldBuilder() {
+ if (containerIdBuilder_ == null) {
+ containerIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.ContainerID, org.apache.mesos.v1.Protos.ContainerID.Builder, org.apache.mesos.v1.Protos.ContainerIDOrBuilder>(
+ containerId_,
+ getParentForChildren(),
+ isClean());
+ containerId_ = null;
+ }
+ return containerIdBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.executor.Event.Subscribed)
+ }
+
+ static {
+ defaultInstance = new Subscribed(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.executor.Event.Subscribed)
+ }
+
+ public interface LaunchOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .mesos.v1.TaskInfo task = 1;
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ boolean hasTask();
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.TaskInfo getTask();
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.TaskInfoOrBuilder getTaskOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.executor.Event.Launch}
+ *
+ * <pre>
+ * Received when the framework attempts to launch a task. Once
+ * the task is successfully launched, the executor must respond with
+ * a TASK_RUNNING update (See TaskState in v1/mesos.proto).
+ * </pre>
+ */
+ public static final class Launch extends
+ com.google.protobuf.GeneratedMessage
+ implements LaunchOrBuilder {
+ // Use Launch.newBuilder() to construct.
+ private Launch(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Launch(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Launch defaultInstance;
+ public static Launch getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Launch getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Launch(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.v1.Protos.TaskInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = task_.toBuilder();
+ }
+ task_ = input.readMessage(org.apache.mesos.v1.Protos.TaskInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(task_);
+ task_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_Launch_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_Launch_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.executor.Protos.Event.Launch.class, org.apache.mesos.v1.executor.Protos.Event.Launch.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Launch> PARSER =
+ new com.google.protobuf.AbstractParser<Launch>() {
+ public Launch parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Launch(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Launch> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required .mesos.v1.TaskInfo task = 1;
+ public static final int TASK_FIELD_NUMBER = 1;
+ private org.apache.mesos.v1.Protos.TaskInfo task_;
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ public boolean hasTask() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.TaskInfo getTask() {
+ return task_;
+ }
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.TaskInfoOrBuilder getTaskOrBuilder() {
+ return task_;
+ }
+
+ private void initFields() {
+ task_ = org.apache.mesos.v1.Protos.TaskInfo.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasTask()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getTask().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, task_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, task_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.executor.Protos.Event.Launch parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Launch parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Launch parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Launch parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Launch parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Launch parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Launch parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Launch parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Launch parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.executor.Protos.Event.Launch parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.executor.Protos.Event.Launch prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.executor.Event.Launch}
+ *
+ * <pre>
+ * Received when the framework attempts to launch a task. Once
+ * the task is successfully launched, the executor must respond with
+ * a TASK_RUNNING update (See TaskState in v1/mesos.proto).
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.executor.Protos.Event.LaunchOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_Launch_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_Launch_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.executor.Protos.Event.Launch.class, org.apache.mesos.v1.executor.Protos.Event.Launch.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.executor.Protos.Event.Launch.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getTaskFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (taskBuilder_ == null) {
+ task_ = org.apache.mesos.v1.Protos.TaskInfo.getDefaultInstance();
+ } else {
+ taskBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.executor.Protos.internal_static_mesos_v1_executor_Event_Launch_descriptor;
+ }
+
+ public org.apache.mesos.v1.executor.Protos.Event.Launch getDefaultInstanceForType() {
+ return org.apache.mesos.v1.executor.Protos.Event.Launch.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.executor.Protos.Event.Launch build() {
+ org.apache.mesos.v1.executor.Protos.Event.Launch result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.executor.Protos.Event.Launch buildPartial() {
+ org.apache.mesos.v1.executor.Protos.Event.Launch result = new org.apache.mesos.v1.executor.Protos.Event.Launch(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (taskBuilder_ == null) {
+ result.task_ = task_;
+ } else {
+ result.task_ = taskBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.executor.Protos.Event.Launch) {
+ return mergeFrom((org.apache.mesos.v1.executor.Protos.Event.Launch)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.executor.Protos.Event.Launch other) {
+ if (other == org.apache.mesos.v1.executor.Protos.Event.Launch.getDefaultInstance()) return this;
+ if (other.hasTask()) {
+ mergeTask(other.getTask());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasTask()) {
+
+ return false;
+ }
+ if (!getTask().isInitialized()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.executor.Protos.Event.Launch parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.executor.Protos.Event.Launch) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required .mesos.v1.TaskInfo task = 1;
+ private org.apache.mesos.v1.Protos.TaskInfo task_ = org.apache.mesos.v1.Protos.TaskInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.TaskInfo, org.apache.mesos.v1.Protos.TaskInfo.Builder, org.apache.mesos.v1.Protos.TaskInfoOrBuilder> taskBuilder_;
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ public boolean hasTask() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.TaskInfo getTask() {
+ if (taskBuilder_ == null) {
+ return task_;
+ } else {
+ return taskBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ public Builder setTask(org.apache.mesos.v1.Protos.TaskInfo value) {
+ if (taskBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ task_ = value;
+ onChanged();
+ } else {
+ taskBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ public Builder setTask(
+ org.apache.mesos.v1.Protos.TaskInfo.Builder builderForValue) {
+ if (taskBuilder_ == null) {
+ task_ = builderForValue.build();
+ onChanged();
+ } else {
+ taskBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ public Builder mergeTask(org.apache.mesos.v1.Protos.TaskInfo value) {
+ if (taskBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ task_ != org.apache.mesos.v1.Protos.TaskInfo.getDefaultInstance()) {
+ task_ =
+ org.apache.mesos.v1.Protos.TaskInfo.newBuilder(task_).mergeFrom(value).buildPartial();
+ } else {
+ task_ = value;
+ }
+ onChanged();
+ } else {
+ taskBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.TaskInfo task = 1;</code>
+ */
+ public Builder clearTask() {
+ if (taskBuilder_ == null) {
+ task_ = o
<TRUNCATED>
[16/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/src/main/java/org/apache/mesos/v1/resource_provider/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/resource_provider/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/resource_provider/Protos.java
new file mode 100644
index 0000000..18c0ce0
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/resource_provider/Protos.java
@@ -0,0 +1,5069 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/v1/resource_provider/resource_provider.proto
+
+package org.apache.mesos.v1.resource_provider;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface EventOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.v1.resource_provider.Event.Type type = 1;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Type type = 1;</code>
+ */
+ boolean hasType();
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Type type = 1;</code>
+ */
+ org.apache.mesos.v1.resource_provider.Protos.Event.Type getType();
+
+ // optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ boolean hasSubscribed();
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed getSubscribed();
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ org.apache.mesos.v1.resource_provider.Protos.Event.SubscribedOrBuilder getSubscribedOrBuilder();
+
+ // optional .mesos.v1.resource_provider.Event.Operation operation = 3;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ boolean hasOperation();
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation getOperation();
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ org.apache.mesos.v1.resource_provider.Protos.Event.OperationOrBuilder getOperationOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.resource_provider.Event}
+ */
+ public static final class Event extends
+ com.google.protobuf.GeneratedMessage
+ implements EventOrBuilder {
+ // Use Event.newBuilder() to construct.
+ private Event(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Event(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Event defaultInstance;
+ public static Event getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Event getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Event(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ int rawValue = input.readEnum();
+ org.apache.mesos.v1.resource_provider.Protos.Event.Type value = org.apache.mesos.v1.resource_provider.Protos.Event.Type.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(1, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ type_ = value;
+ }
+ break;
+ }
+ case 18: {
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = subscribed_.toBuilder();
+ }
+ subscribed_ = input.readMessage(org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(subscribed_);
+ subscribed_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = operation_.toBuilder();
+ }
+ operation_ = input.readMessage(org.apache.mesos.v1.resource_provider.Protos.Event.Operation.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(operation_);
+ operation_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.resource_provider.Protos.Event.class, org.apache.mesos.v1.resource_provider.Protos.Event.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Event> PARSER =
+ new com.google.protobuf.AbstractParser<Event>() {
+ public Event parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Event(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Event> getParserForType() {
+ return PARSER;
+ }
+
+ /**
+ * Protobuf enum {@code mesos.v1.resource_provider.Event.Type}
+ */
+ public enum Type
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * This must be the first enum value in this list, to
+ * ensure that if 'type' is not set, the default value
+ * is UNKNOWN. This enables enum values to be added
+ * in a backwards-compatible way. See: MESOS-4997.
+ * </pre>
+ */
+ UNKNOWN(0, 0),
+ /**
+ * <code>SUBSCRIBED = 1;</code>
+ *
+ * <pre>
+ * See 'Subscribed' below.
+ * </pre>
+ */
+ SUBSCRIBED(1, 1),
+ /**
+ * <code>OPERATION = 2;</code>
+ *
+ * <pre>
+ * See 'Operation' below.
+ * </pre>
+ */
+ OPERATION(2, 2),
+ ;
+
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * This must be the first enum value in this list, to
+ * ensure that if 'type' is not set, the default value
+ * is UNKNOWN. This enables enum values to be added
+ * in a backwards-compatible way. See: MESOS-4997.
+ * </pre>
+ */
+ public static final int UNKNOWN_VALUE = 0;
+ /**
+ * <code>SUBSCRIBED = 1;</code>
+ *
+ * <pre>
+ * See 'Subscribed' below.
+ * </pre>
+ */
+ public static final int SUBSCRIBED_VALUE = 1;
+ /**
+ * <code>OPERATION = 2;</code>
+ *
+ * <pre>
+ * See 'Operation' below.
+ * </pre>
+ */
+ public static final int OPERATION_VALUE = 2;
+
+
+ public final int getNumber() { return value; }
+
+ public static Type valueOf(int value) {
+ switch (value) {
+ case 0: return UNKNOWN;
+ case 1: return SUBSCRIBED;
+ case 2: return OPERATION;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Type>() {
+ public Type findValueByNumber(int number) {
+ return Type.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.resource_provider.Protos.Event.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Type[] VALUES = values();
+
+ public static Type valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private Type(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.v1.resource_provider.Event.Type)
+ }
+
+ public interface SubscribedOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .mesos.v1.ResourceProviderID provider_id = 1;
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ boolean hasProviderId();
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.ResourceProviderID getProviderId();
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.ResourceProviderIDOrBuilder getProviderIdOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.resource_provider.Event.Subscribed}
+ *
+ * <pre>
+ * First event received by the resource provider when it subscribes
+ * to the master.
+ * </pre>
+ */
+ public static final class Subscribed extends
+ com.google.protobuf.GeneratedMessage
+ implements SubscribedOrBuilder {
+ // Use Subscribed.newBuilder() to construct.
+ private Subscribed(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Subscribed(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Subscribed defaultInstance;
+ public static Subscribed getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Subscribed getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Subscribed(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.v1.Protos.ResourceProviderID.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = providerId_.toBuilder();
+ }
+ providerId_ = input.readMessage(org.apache.mesos.v1.Protos.ResourceProviderID.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(providerId_);
+ providerId_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_Subscribed_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_Subscribed_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.class, org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Subscribed> PARSER =
+ new com.google.protobuf.AbstractParser<Subscribed>() {
+ public Subscribed parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Subscribed(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Subscribed> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required .mesos.v1.ResourceProviderID provider_id = 1;
+ public static final int PROVIDER_ID_FIELD_NUMBER = 1;
+ private org.apache.mesos.v1.Protos.ResourceProviderID providerId_;
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public boolean hasProviderId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.ResourceProviderID getProviderId() {
+ return providerId_;
+ }
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.ResourceProviderIDOrBuilder getProviderIdOrBuilder() {
+ return providerId_;
+ }
+
+ private void initFields() {
+ providerId_ = org.apache.mesos.v1.Protos.ResourceProviderID.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasProviderId()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getProviderId().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, providerId_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, providerId_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.resource_provider.Event.Subscribed}
+ *
+ * <pre>
+ * First event received by the resource provider when it subscribes
+ * to the master.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.resource_provider.Protos.Event.SubscribedOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_Subscribed_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_Subscribed_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.class, org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getProviderIdFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (providerIdBuilder_ == null) {
+ providerId_ = org.apache.mesos.v1.Protos.ResourceProviderID.getDefaultInstance();
+ } else {
+ providerIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_Subscribed_descriptor;
+ }
+
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed getDefaultInstanceForType() {
+ return org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed build() {
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed buildPartial() {
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed result = new org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (providerIdBuilder_ == null) {
+ result.providerId_ = providerId_;
+ } else {
+ result.providerId_ = providerIdBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed) {
+ return mergeFrom((org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed other) {
+ if (other == org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.getDefaultInstance()) return this;
+ if (other.hasProviderId()) {
+ mergeProviderId(other.getProviderId());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasProviderId()) {
+
+ return false;
+ }
+ if (!getProviderId().isInitialized()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required .mesos.v1.ResourceProviderID provider_id = 1;
+ private org.apache.mesos.v1.Protos.ResourceProviderID providerId_ = org.apache.mesos.v1.Protos.ResourceProviderID.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.ResourceProviderID, org.apache.mesos.v1.Protos.ResourceProviderID.Builder, org.apache.mesos.v1.Protos.ResourceProviderIDOrBuilder> providerIdBuilder_;
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public boolean hasProviderId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.ResourceProviderID getProviderId() {
+ if (providerIdBuilder_ == null) {
+ return providerId_;
+ } else {
+ return providerIdBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public Builder setProviderId(org.apache.mesos.v1.Protos.ResourceProviderID value) {
+ if (providerIdBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ providerId_ = value;
+ onChanged();
+ } else {
+ providerIdBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public Builder setProviderId(
+ org.apache.mesos.v1.Protos.ResourceProviderID.Builder builderForValue) {
+ if (providerIdBuilder_ == null) {
+ providerId_ = builderForValue.build();
+ onChanged();
+ } else {
+ providerIdBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public Builder mergeProviderId(org.apache.mesos.v1.Protos.ResourceProviderID value) {
+ if (providerIdBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ providerId_ != org.apache.mesos.v1.Protos.ResourceProviderID.getDefaultInstance()) {
+ providerId_ =
+ org.apache.mesos.v1.Protos.ResourceProviderID.newBuilder(providerId_).mergeFrom(value).buildPartial();
+ } else {
+ providerId_ = value;
+ }
+ onChanged();
+ } else {
+ providerIdBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public Builder clearProviderId() {
+ if (providerIdBuilder_ == null) {
+ providerId_ = org.apache.mesos.v1.Protos.ResourceProviderID.getDefaultInstance();
+ onChanged();
+ } else {
+ providerIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.ResourceProviderID.Builder getProviderIdBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getProviderIdFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.ResourceProviderIDOrBuilder getProviderIdOrBuilder() {
+ if (providerIdBuilder_ != null) {
+ return providerIdBuilder_.getMessageOrBuilder();
+ } else {
+ return providerId_;
+ }
+ }
+ /**
+ * <code>required .mesos.v1.ResourceProviderID provider_id = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.ResourceProviderID, org.apache.mesos.v1.Protos.ResourceProviderID.Builder, org.apache.mesos.v1.Protos.ResourceProviderIDOrBuilder>
+ getProviderIdFieldBuilder() {
+ if (providerIdBuilder_ == null) {
+ providerIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.ResourceProviderID, org.apache.mesos.v1.Protos.ResourceProviderID.Builder, org.apache.mesos.v1.Protos.ResourceProviderIDOrBuilder>(
+ providerId_,
+ getParentForChildren(),
+ isClean());
+ providerId_ = null;
+ }
+ return providerIdBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.resource_provider.Event.Subscribed)
+ }
+
+ static {
+ defaultInstance = new Subscribed(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.resource_provider.Event.Subscribed)
+ }
+
+ public interface OperationOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.v1.Offer.Operation operation = 1;
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ boolean hasOperation();
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.Offer.Operation getOperation();
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.Offer.OperationOrBuilder getOperationOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.resource_provider.Event.Operation}
+ *
+ * <pre>
+ * Received when the master wants to send an operation to the
+ * resource provider.
+ * </pre>
+ */
+ public static final class Operation extends
+ com.google.protobuf.GeneratedMessage
+ implements OperationOrBuilder {
+ // Use Operation.newBuilder() to construct.
+ private Operation(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Operation(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Operation defaultInstance;
+ public static Operation getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Operation getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Operation(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.v1.Protos.Offer.Operation.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = operation_.toBuilder();
+ }
+ operation_ = input.readMessage(org.apache.mesos.v1.Protos.Offer.Operation.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(operation_);
+ operation_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_Operation_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_Operation_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation.class, org.apache.mesos.v1.resource_provider.Protos.Event.Operation.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Operation> PARSER =
+ new com.google.protobuf.AbstractParser<Operation>() {
+ public Operation parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Operation(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Operation> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // optional .mesos.v1.Offer.Operation operation = 1;
+ public static final int OPERATION_FIELD_NUMBER = 1;
+ private org.apache.mesos.v1.Protos.Offer.Operation operation_;
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public boolean hasOperation() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.Offer.Operation getOperation() {
+ return operation_;
+ }
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.Offer.OperationOrBuilder getOperationOrBuilder() {
+ return operation_;
+ }
+
+ private void initFields() {
+ operation_ = org.apache.mesos.v1.Protos.Offer.Operation.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (hasOperation()) {
+ if (!getOperation().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, operation_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, operation_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Operation parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Operation parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Operation parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Operation parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Operation parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Operation parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Operation parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Operation parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Operation parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event.Operation parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.resource_provider.Protos.Event.Operation prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.resource_provider.Event.Operation}
+ *
+ * <pre>
+ * Received when the master wants to send an operation to the
+ * resource provider.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.resource_provider.Protos.Event.OperationOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_Operation_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_Operation_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation.class, org.apache.mesos.v1.resource_provider.Protos.Event.Operation.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.resource_provider.Protos.Event.Operation.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getOperationFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (operationBuilder_ == null) {
+ operation_ = org.apache.mesos.v1.Protos.Offer.Operation.getDefaultInstance();
+ } else {
+ operationBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_Operation_descriptor;
+ }
+
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Operation getDefaultInstanceForType() {
+ return org.apache.mesos.v1.resource_provider.Protos.Event.Operation.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Operation build() {
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Operation buildPartial() {
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation result = new org.apache.mesos.v1.resource_provider.Protos.Event.Operation(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (operationBuilder_ == null) {
+ result.operation_ = operation_;
+ } else {
+ result.operation_ = operationBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.resource_provider.Protos.Event.Operation) {
+ return mergeFrom((org.apache.mesos.v1.resource_provider.Protos.Event.Operation)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.resource_provider.Protos.Event.Operation other) {
+ if (other == org.apache.mesos.v1.resource_provider.Protos.Event.Operation.getDefaultInstance()) return this;
+ if (other.hasOperation()) {
+ mergeOperation(other.getOperation());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (hasOperation()) {
+ if (!getOperation().isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.resource_provider.Protos.Event.Operation) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // optional .mesos.v1.Offer.Operation operation = 1;
+ private org.apache.mesos.v1.Protos.Offer.Operation operation_ = org.apache.mesos.v1.Protos.Offer.Operation.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.Offer.Operation, org.apache.mesos.v1.Protos.Offer.Operation.Builder, org.apache.mesos.v1.Protos.Offer.OperationOrBuilder> operationBuilder_;
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public boolean hasOperation() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.Offer.Operation getOperation() {
+ if (operationBuilder_ == null) {
+ return operation_;
+ } else {
+ return operationBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public Builder setOperation(org.apache.mesos.v1.Protos.Offer.Operation value) {
+ if (operationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ operation_ = value;
+ onChanged();
+ } else {
+ operationBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public Builder setOperation(
+ org.apache.mesos.v1.Protos.Offer.Operation.Builder builderForValue) {
+ if (operationBuilder_ == null) {
+ operation_ = builderForValue.build();
+ onChanged();
+ } else {
+ operationBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public Builder mergeOperation(org.apache.mesos.v1.Protos.Offer.Operation value) {
+ if (operationBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ operation_ != org.apache.mesos.v1.Protos.Offer.Operation.getDefaultInstance()) {
+ operation_ =
+ org.apache.mesos.v1.Protos.Offer.Operation.newBuilder(operation_).mergeFrom(value).buildPartial();
+ } else {
+ operation_ = value;
+ }
+ onChanged();
+ } else {
+ operationBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public Builder clearOperation() {
+ if (operationBuilder_ == null) {
+ operation_ = org.apache.mesos.v1.Protos.Offer.Operation.getDefaultInstance();
+ onChanged();
+ } else {
+ operationBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.Offer.Operation.Builder getOperationBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getOperationFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.Offer.OperationOrBuilder getOperationOrBuilder() {
+ if (operationBuilder_ != null) {
+ return operationBuilder_.getMessageOrBuilder();
+ } else {
+ return operation_;
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.Offer.Operation operation = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.Offer.Operation, org.apache.mesos.v1.Protos.Offer.Operation.Builder, org.apache.mesos.v1.Protos.Offer.OperationOrBuilder>
+ getOperationFieldBuilder() {
+ if (operationBuilder_ == null) {
+ operationBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.Offer.Operation, org.apache.mesos.v1.Protos.Offer.Operation.Builder, org.apache.mesos.v1.Protos.Offer.OperationOrBuilder>(
+ operation_,
+ getParentForChildren(),
+ isClean());
+ operation_ = null;
+ }
+ return operationBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.resource_provider.Event.Operation)
+ }
+
+ static {
+ defaultInstance = new Operation(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.resource_provider.Event.Operation)
+ }
+
+ private int bitField0_;
+ // optional .mesos.v1.resource_provider.Event.Type type = 1;
+ public static final int TYPE_FIELD_NUMBER = 1;
+ private org.apache.mesos.v1.resource_provider.Protos.Event.Type type_;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Type type = 1;</code>
+ */
+ public boolean hasType() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Type type = 1;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Type getType() {
+ return type_;
+ }
+
+ // optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;
+ public static final int SUBSCRIBED_FIELD_NUMBER = 2;
+ private org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed subscribed_;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public boolean hasSubscribed() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed getSubscribed() {
+ return subscribed_;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.SubscribedOrBuilder getSubscribedOrBuilder() {
+ return subscribed_;
+ }
+
+ // optional .mesos.v1.resource_provider.Event.Operation operation = 3;
+ public static final int OPERATION_FIELD_NUMBER = 3;
+ private org.apache.mesos.v1.resource_provider.Protos.Event.Operation operation_;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public boolean hasOperation() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Operation getOperation() {
+ return operation_;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.OperationOrBuilder getOperationOrBuilder() {
+ return operation_;
+ }
+
+ private void initFields() {
+ type_ = org.apache.mesos.v1.resource_provider.Protos.Event.Type.UNKNOWN;
+ subscribed_ = org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.getDefaultInstance();
+ operation_ = org.apache.mesos.v1.resource_provider.Protos.Event.Operation.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (hasSubscribed()) {
+ if (!getSubscribed().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasOperation()) {
+ if (!getOperation().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeEnum(1, type_.getNumber());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeMessage(2, subscribed_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeMessage(3, operation_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(1, type_.getNumber());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, subscribed_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, operation_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.resource_provider.Protos.Event parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.resource_provider.Protos.Event parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.resource_provider.Protos.Event prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.resource_provider.Event}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.resource_provider.Protos.EventOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.resource_provider.Protos.Event.class, org.apache.mesos.v1.resource_provider.Protos.Event.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.resource_provider.Protos.Event.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getSubscribedFieldBuilder();
+ getOperationFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ type_ = org.apache.mesos.v1.resource_provider.Protos.Event.Type.UNKNOWN;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (subscribedBuilder_ == null) {
+ subscribed_ = org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.getDefaultInstance();
+ } else {
+ subscribedBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (operationBuilder_ == null) {
+ operation_ = org.apache.mesos.v1.resource_provider.Protos.Event.Operation.getDefaultInstance();
+ } else {
+ operationBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.resource_provider.Protos.internal_static_mesos_v1_resource_provider_Event_descriptor;
+ }
+
+ public org.apache.mesos.v1.resource_provider.Protos.Event getDefaultInstanceForType() {
+ return org.apache.mesos.v1.resource_provider.Protos.Event.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.resource_provider.Protos.Event build() {
+ org.apache.mesos.v1.resource_provider.Protos.Event result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.resource_provider.Protos.Event buildPartial() {
+ org.apache.mesos.v1.resource_provider.Protos.Event result = new org.apache.mesos.v1.resource_provider.Protos.Event(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.type_ = type_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ if (subscribedBuilder_ == null) {
+ result.subscribed_ = subscribed_;
+ } else {
+ result.subscribed_ = subscribedBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ if (operationBuilder_ == null) {
+ result.operation_ = operation_;
+ } else {
+ result.operation_ = operationBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.resource_provider.Protos.Event) {
+ return mergeFrom((org.apache.mesos.v1.resource_provider.Protos.Event)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.resource_provider.Protos.Event other) {
+ if (other == org.apache.mesos.v1.resource_provider.Protos.Event.getDefaultInstance()) return this;
+ if (other.hasType()) {
+ setType(other.getType());
+ }
+ if (other.hasSubscribed()) {
+ mergeSubscribed(other.getSubscribed());
+ }
+ if (other.hasOperation()) {
+ mergeOperation(other.getOperation());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (hasSubscribed()) {
+ if (!getSubscribed().isInitialized()) {
+
+ return false;
+ }
+ }
+ if (hasOperation()) {
+ if (!getOperation().isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.resource_provider.Protos.Event parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.resource_provider.Protos.Event) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // optional .mesos.v1.resource_provider.Event.Type type = 1;
+ private org.apache.mesos.v1.resource_provider.Protos.Event.Type type_ = org.apache.mesos.v1.resource_provider.Protos.Event.Type.UNKNOWN;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Type type = 1;</code>
+ */
+ public boolean hasType() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Type type = 1;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Type getType() {
+ return type_;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Type type = 1;</code>
+ */
+ public Builder setType(org.apache.mesos.v1.resource_provider.Protos.Event.Type value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ type_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Type type = 1;</code>
+ */
+ public Builder clearType() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ type_ = org.apache.mesos.v1.resource_provider.Protos.Event.Type.UNKNOWN;
+ onChanged();
+ return this;
+ }
+
+ // optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;
+ private org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed subscribed_ = org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed, org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.Builder, org.apache.mesos.v1.resource_provider.Protos.Event.SubscribedOrBuilder> subscribedBuilder_;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public boolean hasSubscribed() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed getSubscribed() {
+ if (subscribedBuilder_ == null) {
+ return subscribed_;
+ } else {
+ return subscribedBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public Builder setSubscribed(org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed value) {
+ if (subscribedBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ subscribed_ = value;
+ onChanged();
+ } else {
+ subscribedBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public Builder setSubscribed(
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.Builder builderForValue) {
+ if (subscribedBuilder_ == null) {
+ subscribed_ = builderForValue.build();
+ onChanged();
+ } else {
+ subscribedBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public Builder mergeSubscribed(org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed value) {
+ if (subscribedBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002) &&
+ subscribed_ != org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.getDefaultInstance()) {
+ subscribed_ =
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.newBuilder(subscribed_).mergeFrom(value).buildPartial();
+ } else {
+ subscribed_ = value;
+ }
+ onChanged();
+ } else {
+ subscribedBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public Builder clearSubscribed() {
+ if (subscribedBuilder_ == null) {
+ subscribed_ = org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.getDefaultInstance();
+ onChanged();
+ } else {
+ subscribedBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.Builder getSubscribedBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getSubscribedFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.SubscribedOrBuilder getSubscribedOrBuilder() {
+ if (subscribedBuilder_ != null) {
+ return subscribedBuilder_.getMessageOrBuilder();
+ } else {
+ return subscribed_;
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Subscribed subscribed = 2;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed, org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.Builder, org.apache.mesos.v1.resource_provider.Protos.Event.SubscribedOrBuilder>
+ getSubscribedFieldBuilder() {
+ if (subscribedBuilder_ == null) {
+ subscribedBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed, org.apache.mesos.v1.resource_provider.Protos.Event.Subscribed.Builder, org.apache.mesos.v1.resource_provider.Protos.Event.SubscribedOrBuilder>(
+ subscribed_,
+ getParentForChildren(),
+ isClean());
+ subscribed_ = null;
+ }
+ return subscribedBuilder_;
+ }
+
+ // optional .mesos.v1.resource_provider.Event.Operation operation = 3;
+ private org.apache.mesos.v1.resource_provider.Protos.Event.Operation operation_ = org.apache.mesos.v1.resource_provider.Protos.Event.Operation.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation, org.apache.mesos.v1.resource_provider.Protos.Event.Operation.Builder, org.apache.mesos.v1.resource_provider.Protos.Event.OperationOrBuilder> operationBuilder_;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public boolean hasOperation() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Operation getOperation() {
+ if (operationBuilder_ == null) {
+ return operation_;
+ } else {
+ return operationBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public Builder setOperation(org.apache.mesos.v1.resource_provider.Protos.Event.Operation value) {
+ if (operationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ operation_ = value;
+ onChanged();
+ } else {
+ operationBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public Builder setOperation(
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation.Builder builderForValue) {
+ if (operationBuilder_ == null) {
+ operation_ = builderForValue.build();
+ onChanged();
+ } else {
+ operationBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public Builder mergeOperation(org.apache.mesos.v1.resource_provider.Protos.Event.Operation value) {
+ if (operationBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) == 0x00000004) &&
+ operation_ != org.apache.mesos.v1.resource_provider.Protos.Event.Operation.getDefaultInstance()) {
+ operation_ =
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation.newBuilder(operation_).mergeFrom(value).buildPartial();
+ } else {
+ operation_ = value;
+ }
+ onChanged();
+ } else {
+ operationBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public Builder clearOperation() {
+ if (operationBuilder_ == null) {
+ operation_ = org.apache.mesos.v1.resource_provider.Protos.Event.Operation.getDefaultInstance();
+ onChanged();
+ } else {
+ operationBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.Operation.Builder getOperationBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getOperationFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ public org.apache.mesos.v1.resource_provider.Protos.Event.OperationOrBuilder getOperationOrBuilder() {
+ if (operationBuilder_ != null) {
+ return operationBuilder_.getMessageOrBuilder();
+ } else {
+ return operation_;
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.resource_provider.Event.Operation operation = 3;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation, org.apache.mesos.v1.resource_provider.Protos.Event.Operation.Builder, org.apache.mesos.v1.resource_provider.Protos.Event.OperationOrBuilder>
+ getOperationFieldBuilder() {
+ if (operationBuilder_ == null) {
+ operationBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.resource_provider.Protos.Event.Operation, org.apache.mesos.v1.resource_provider.Protos.Event.Operation.Builder, org.apache.mesos.v1.resource_provider.Protos.Event.OperationOrBuilder>(
+ operation_,
+ getParentForChildren(),
+ isClean());
+ operation_ = null;
+ }
+ return operationBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.resource_provider.Event)
+ }
+
+ static {
+ defaultInstance = new Event(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.resource_provider.Event)
+ }
+
+ public interface CallOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.v1.ResourceProviderID resource_provider_id = 1;
+ /**
+ * <code>optional .mesos.v1.ResourceProviderID resource_provider_id = 1;</code>
+ *
+ * <pre>
+ * Identifies who generated this call.
+ * The 'ResourceProviderManager' assigns a resource provider ID when
+ * a new resource provider subscribes for the first time. Once
+ * assigned, the resource provider must set the 'resource_provider_id'
+ * here and within its 'ResourceProviderInfo' (in any further
+ * 'SUBSCRIBE' calls). This allows the 'ResourceProviderManager' to
+ * identify a resource provider correctly across disconnections,
+ * failovers, etc.
+ * </pre>
+ */
+ boolean hasResourceProviderId();
+ /**
+ * <code>optional .mesos.v1.ResourceProviderID resource_provider_id = 1;</code>
+ *
+ * <pre>
+ * Identifies who generated this call.
+ * The 'ResourceProviderManager' assigns a resource provider ID when
+ * a new resource provider subscribes for the first time. Once
+ * assigned, the resource provider must set the 'resource_provider_id'
+ * here and within its 'ResourceProviderInfo' (in any further
+ * 'SUBSCRIBE' calls). This allows the 'ResourceProviderManager' to
+ * identify a resource provider correctly across disconnections,
+ * failovers, etc.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.ResourceProviderID getResourceProviderId();
+ /**
+ * <code>optional .mesos.v1.ResourceProviderID resource_provider_id = 1;</code>
+ *
+ * <pre>
+ * Identifies who generated this call.
+ * The 'ResourceProviderManager' assigns a resource provider ID when
+ * a new resource provider subscribes for the first time. Once
+ * assigned, the resource provider must set the 'resource_provider_id'
+ * here and within its 'ResourceProviderInfo' (in any further
+ * 'SUBSCRIBE' calls). This allows the 'ResourceProviderManager' to
+ * identify a resource provider correctly across disconnections,
+ * failovers, etc.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.ResourceProviderIDOrBuilder getResourceProviderIdOrBuilder();
+
+ // optional .mesos.v1.resource_provider.Call.Type type = 2;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Call.Type type = 2;</code>
+ */
+ boolean hasType();
+ /**
+ * <code>optional .mesos.v1.resource_provider.Call.Type type = 2;</code>
+ */
+ org.apache.mesos.v1.resource_provider.Protos.Call.Type getType();
+
+ // optional .mesos.v1.resource_provider.Call.Subscribe subscribe = 3;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Call.Subscribe subscribe = 3;</code>
+ */
+ boolean hasSubscribe();
+ /**
+ * <code>optional .mesos.v1.resource_provider.Call.Subscribe subscribe = 3;</code>
+ */
+ org.apache.mesos.v1.resource_provider.Protos.Call.Subscribe getSubscribe();
+ /**
+ * <code>optional .mesos.v1.resource_provider.Call.Subscribe subscribe = 3;</code>
+ */
+ org.apache.mesos.v1.resource_provider.Protos.Call.SubscribeOrBuilder getSubscribeOrBuilder();
+
+ // optional .mesos.v1.resource_provider.Call.Update update = 4;
+ /**
+ * <code>optional .mesos.v1.resource_provider.Call.Update update = 4;</code>
+ */
+ boolean hasUpdate();
+ /**
+ * <code>optional .mesos.v1.resource_provider.Call.Update update = 4;</code>
+ */
+ org.apache.mesos.v1.resource_provider.Protos.Call.Update getUpdate();
+ /**
+ * <code>optional .mesos.v1.resource_provider.Call.Update update = 4;</code>
+ */
+ org.apache.mesos.v1.resource_provider.Protos.Call.UpdateOrBuilder getUpdateOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.resource_provider.Call}
+ */
+ public static final class Call extends
+ com.google.protobuf.GeneratedMessage
+ implements CallOrBuilder {
+ // Use Call.newBuilder() to construct.
+ private Call(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Call(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Call defaultInstance;
+ public static Call getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Call getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Call(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.v1.Protos.ResourceProviderID.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = resourceProviderId_.toBuilder();
+ }
+ resourceProviderId_ = input.readMessage(org.apache.mesos.v1.Protos.ResourceProviderID.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(resourceProviderId_);
+ resourceProviderId_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 16: {
+ int rawValue = input.readEnum();
+ org.apache.mesos.v1.resource_provider.Protos.Call.Type value = org.apache.mesos.v1.resource_provider.Protos.Call.Type.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(2, rawValue);
+ } else {
+ bitField0_ |= 0x00000002;
+ type_ = value;
+ }
+ break;
+ }
+ case 26: {
+ org.apache.mesos.v1.resource_provider.Protos.Call.Subscribe.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = subscribe_.toBuilder();
+ }
+ subscribe_ = input.readMessage(org.apache.mesos.v1.resource_provider.Protos.Call.Subscribe.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(subscribe_);
+ subscribe_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x0000
<TRUNCATED>
[11/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/proto/mesos/v1/scheduler.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/v1/scheduler.proto b/myriad-commons/proto/mesos/v1/scheduler.proto
new file mode 100644
index 0000000..1fb0254
--- /dev/null
+++ b/myriad-commons/proto/mesos/v1/scheduler.proto
@@ -0,0 +1,420 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto2";
+
+import "mesos/v1/mesos.proto";
+
+package mesos.v1.scheduler;
+
+option java_package = "org.apache.mesos.v1.scheduler";
+option java_outer_classname = "Protos";
+
+
+/**
+ * Scheduler event API.
+ *
+ * An event is described using the standard protocol buffer "union"
+ * trick, see:
+ * https://developers.google.com/protocol-buffers/docs/techniques#union.
+ */
+message Event {
+ // Possible event types, followed by message definitions if
+ // applicable.
+ enum Type {
+ // This must be the first enum value in this list, to
+ // ensure that if 'type' is not set, the default value
+ // is UNKNOWN. This enables enum values to be added
+ // in a backwards-compatible way. See: MESOS-4997.
+ UNKNOWN = 0;
+
+ SUBSCRIBED = 1; // See 'Subscribed' below.
+ OFFERS = 2; // See 'Offers' below.
+ INVERSE_OFFERS = 9; // See 'InverseOffers' below.
+ RESCIND = 3; // See 'Rescind' below.
+ RESCIND_INVERSE_OFFER = 10; // See 'RescindInverseOffer' below.
+ UPDATE = 4; // See 'Update' below.
+ MESSAGE = 5; // See 'Message' below.
+ FAILURE = 6; // See 'Failure' below.
+ ERROR = 7; // See 'Error' below.
+
+ // Periodic message sent by the Mesos master according to
+ // 'Subscribed.heartbeat_interval_seconds'. If the scheduler does
+ // not receive any events (including heartbeats) for an extended
+ // period of time (e.g., 5 x heartbeat_interval_seconds), there is
+ // likely a network partition. In such a case the scheduler should
+ // close the existing subscription connection and resubscribe
+ // using a backoff strategy.
+ HEARTBEAT = 8;
+ }
+
+ // First event received when the scheduler subscribes.
+ message Subscribed {
+ required FrameworkID framework_id = 1;
+
+ // This value will be set if the master is sending heartbeats. See
+ // the comment above on 'HEARTBEAT' for more details.
+ optional double heartbeat_interval_seconds = 2;
+
+ // Since Mesos 1.1.
+ optional MasterInfo master_info = 3;
+ }
+
+ // Received whenever there are new resources that are offered to the
+ // scheduler. Each offer corresponds to a set of resources on an
+ // agent. Until the scheduler accepts or declines an offer the
+ // resources are considered allocated to the scheduler.
+ message Offers {
+ repeated Offer offers = 1;
+ }
+
+ // Received whenever there are resources requested back from the
+ // scheduler. Each inverse offer specifies the agent, and
+ // optionally specific resources. Accepting or Declining an inverse
+ // offer informs the allocator of the scheduler's ability to release
+ // the specified resources without violating an SLA. If no resources
+ // are specified then all resources on the agent are requested to be
+ // released.
+ message InverseOffers {
+ repeated InverseOffer inverse_offers = 1;
+ }
+
+ // Received when a particular offer is no longer valid (e.g., the
+ // agent corresponding to the offer has been removed) and hence
+ // needs to be rescinded. Any future calls ('Accept' / 'Decline') made
+ // by the scheduler regarding this offer will be invalid.
+ message Rescind {
+ required OfferID offer_id = 1;
+ }
+
+ // Received when a particular inverse offer is no longer valid
+ // (e.g., the agent corresponding to the offer has been removed)
+ // and hence needs to be rescinded. Any future calls ('Accept' /
+ // 'Decline') made by the scheduler regarding this inverse offer
+ // will be invalid.
+ message RescindInverseOffer {
+ required OfferID inverse_offer_id = 1;
+ }
+
+ // Received whenever there is a status update that is generated by
+ // the executor or agent or master. Status updates should be used by
+ // executors to reliably communicate the status of the tasks that
+ // they manage. It is crucial that a terminal update (see TaskState
+ // in v1/mesos.proto) is sent by the executor as soon as the task
+ // terminates, in order for Mesos to release the resources allocated
+ // to the task. It is also the responsibility of the scheduler to
+ // explicitly acknowledge the receipt of a status update. See
+ // 'Acknowledge' in the 'Call' section below for the semantics.
+ //
+ // A task status update may be used for guaranteed delivery of some
+ // task-related information, e.g., task's health update. Such
+ // information may be shadowed by subsequent task status updates, that
+ // do not preserve fields of the previously sent message.
+ message Update {
+ required TaskStatus status = 1;
+ }
+
+ // Received when a custom message generated by the executor is
+ // forwarded by the master. Note that this message is not
+ // interpreted by Mesos and is only forwarded (without reliability
+ // guarantees) to the scheduler. It is up to the executor to retry
+ // if the message is dropped for any reason.
+ message Message {
+ required AgentID agent_id = 1;
+ required ExecutorID executor_id = 2;
+ required bytes data = 3;
+ }
+
+ // Received when an agent is removed from the cluster (e.g., failed
+ // health checks) or when an executor is terminated. Note that, this
+ // event coincides with receipt of terminal UPDATE events for any
+ // active tasks belonging to the agent or executor and receipt of
+ // 'Rescind' events for any outstanding offers belonging to the
+ // agent. Note that there is no guaranteed order between the
+ // 'Failure', 'Update' and 'Rescind' events when an agent or executor
+ // is removed.
+ // TODO(vinod): Consider splitting the lost agent and terminated
+ // executor into separate events and ensure it's reliably generated.
+ message Failure {
+ optional AgentID agent_id = 1;
+
+ // If this was just a failure of an executor on an agent then
+ // 'executor_id' will be set and possibly 'status' (if we were
+ // able to determine the exit status).
+ optional ExecutorID executor_id = 2;
+
+ // On Posix, `status` corresponds to termination information in the
+ // `stat_loc` area returned from a `waitpid` call. On Windows, `status`
+ // is obtained via calling the `GetExitCodeProcess()` function. For
+ // messages coming from Posix agents, schedulers need to apply
+ // `WEXITSTATUS` family macros or equivalent transformations to obtain
+ // exit codes.
+ //
+ // TODO(alexr): Consider unifying Windows and Posix behavior by returning
+ // exit code here, see MESOS-7241.
+ optional int32 status = 3;
+ }
+
+ // Received when there is an unrecoverable error in the scheduler (e.g.,
+ // scheduler failed over, rate limiting, authorization errors etc.). The
+ // scheduler should abort on receiving this event.
+ message Error {
+ required string message = 1;
+ }
+
+ // Type of the event, indicates which optional field below should be
+ // present if that type has a nested message definition.
+ // Enum fields should be optional, see: MESOS-4997.
+ optional Type type = 1;
+
+ optional Subscribed subscribed = 2;
+ optional Offers offers = 3;
+ optional InverseOffers inverse_offers = 9;
+ optional Rescind rescind = 4;
+ optional RescindInverseOffer rescind_inverse_offer = 10;
+ optional Update update = 5;
+ optional Message message = 6;
+ optional Failure failure = 7;
+ optional Error error = 8;
+}
+
+
+/**
+ * Scheduler call API.
+ *
+ * Like Event, a Call is described using the standard protocol buffer
+ * "union" trick (see above).
+ */
+message Call {
+ // Possible call types, followed by message definitions if
+ // applicable.
+ enum Type {
+ // See comments above on `Event::Type` for more details on this enum value.
+ UNKNOWN = 0;
+
+ SUBSCRIBE = 1; // See 'Subscribe' below.
+ TEARDOWN = 2; // Shuts down all tasks/executors and removes framework.
+ ACCEPT = 3; // See 'Accept' below.
+ DECLINE = 4; // See 'Decline' below.
+ ACCEPT_INVERSE_OFFERS = 13; // See 'AcceptInverseOffers' below.
+ DECLINE_INVERSE_OFFERS = 14; // See 'DeclineInverseOffers' below.
+ REVIVE = 5; // Removes any previous filters set via ACCEPT or DECLINE.
+ KILL = 6; // See 'Kill' below.
+ SHUTDOWN = 7; // See 'Shutdown' below.
+ ACKNOWLEDGE = 8; // See 'Acknowledge' below.
+ RECONCILE = 9; // See 'Reconcile' below.
+ MESSAGE = 10; // See 'Message' below.
+ REQUEST = 11; // See 'Request' below.
+ SUPPRESS = 12; // Inform master to stop sending offers to the framework.
+
+ // TODO(benh): Consider adding an 'ACTIVATE' and 'DEACTIVATE' for
+ // already subscribed frameworks as a way of stopping offers from
+ // being generated and other events from being sent by the master.
+ // Note that this functionality existed originally to support
+ // SchedulerDriver::abort which was only necessary to handle
+ // exceptions getting thrown from within Scheduler callbacks,
+ // something that is not an issue with the Event/Call API.
+ }
+
+ // Subscribes the scheduler with the master to receive events. A
+ // scheduler must send other calls only after it has received the
+ // SUBCRIBED event.
+ message Subscribe {
+ // See the comments below on 'framework_id' on the semantics for
+ // 'framework_info.id'.
+ required FrameworkInfo framework_info = 1;
+
+ // List of suppressed roles for which the framework does not wish to be
+ // offered resources. The framework can decide to suppress all or a subset
+ // of roles the framework (re)registers as.
+ repeated string suppressed_roles = 2;
+ }
+
+ // Accepts an offer, performing the specified operations
+ // in a sequential manner.
+ //
+ // E.g. Launch a task with a newly reserved persistent volume:
+ //
+ // Accept {
+ // offer_ids: [ ... ]
+ // operations: [
+ // { type: RESERVE,
+ // reserve: { resources: [ disk(role):2 ] } }
+ // { type: CREATE,
+ // create: { volumes: [ disk(role):1+persistence ] } }
+ // { type: LAUNCH,
+ // launch: { task_infos ... disk(role):1;disk(role):1+persistence } }
+ // ]
+ // }
+ //
+ // Note that any of the offer’s resources not used in the 'Accept'
+ // call (e.g., to launch a task) are considered unused and might be
+ // reoffered to other frameworks. In other words, the same OfferID
+ // cannot be used in more than one 'Accept' call.
+ message Accept {
+ repeated OfferID offer_ids = 1;
+ repeated Offer.Operation operations = 2;
+ optional Filters filters = 3;
+ }
+
+ // Declines an offer, signaling the master to potentially reoffer
+ // the resources to a different framework. Note that this is same
+ // as sending an Accept call with no operations. See comments on
+ // top of 'Accept' for semantics.
+ message Decline {
+ repeated OfferID offer_ids = 1;
+ optional Filters filters = 2;
+ }
+
+ // Accepts an inverse offer. Inverse offers should only be accepted
+ // if the resources in the offer can be safely evacuated before the
+ // provided unavailability.
+ message AcceptInverseOffers {
+ repeated OfferID inverse_offer_ids = 1;
+ optional Filters filters = 2;
+ }
+
+ // Declines an inverse offer. Inverse offers should be declined if
+ // the resources in the offer might not be safely evacuated before
+ // the provided unavailability.
+ message DeclineInverseOffers {
+ repeated OfferID inverse_offer_ids = 1;
+ optional Filters filters = 2;
+ }
+
+ // Revive offers for the specified roles. If `roles` is empty,
+ // the `REVIVE` call will revive offers for all of the roles
+ // the framework is currently subscribed to.
+ message Revive {
+ repeated string roles = 1;
+ }
+
+ // Kills a specific task. If the scheduler has a custom executor,
+ // the kill is forwarded to the executor and it is up to the
+ // executor to kill the task and send a TASK_KILLED (or TASK_FAILED)
+ // update. Note that Mesos releases the resources for a task once it
+ // receives a terminal update (See TaskState in v1/mesos.proto) for
+ // it. If the task is unknown to the master, a TASK_LOST update is
+ // generated.
+ //
+ // If a task within a task group is killed before the group is
+ // delivered to the executor, all tasks in the task group are
+ // killed. When a task group has been delivered to the executor,
+ // it is up to the executor to decide how to deal with the kill.
+ // Note The default Mesos executor will currently kill all the
+ // tasks in the task group if it gets a kill for any task.
+ message Kill {
+ required TaskID task_id = 1;
+ optional AgentID agent_id = 2;
+
+ // If set, overrides any previously specified kill policy for this task.
+ // This includes 'TaskInfo.kill_policy' and 'Executor.kill.kill_policy'.
+ // Can be used to forcefully kill a task which is already being killed.
+ optional KillPolicy kill_policy = 3;
+ }
+
+ // Shuts down a custom executor. When the executor gets a shutdown
+ // event, it is expected to kill all its tasks (and send TASK_KILLED
+ // updates) and terminate. If the executor doesn’t terminate within
+ // a certain timeout (configurable via
+ // '--executor_shutdown_grace_period' agent flag), the agent will
+ // forcefully destroy the container (executor and its tasks) and
+ // transition its active tasks to TASK_LOST.
+ message Shutdown {
+ required ExecutorID executor_id = 1;
+ required AgentID agent_id = 2;
+ }
+
+ // Acknowledges the receipt of status update. Schedulers are
+ // responsible for explicitly acknowledging the receipt of status
+ // updates that have 'Update.status().uuid()' field set. Such status
+ // updates are retried by the agent until they are acknowledged by
+ // the scheduler.
+ message Acknowledge {
+ required AgentID agent_id = 1;
+ required TaskID task_id = 2;
+ required bytes uuid = 3;
+ }
+
+ // Allows the scheduler to query the status for non-terminal tasks.
+ // This causes the master to send back the latest task status for
+ // each task in 'tasks', if possible. Tasks that are no longer known
+ // will result in a TASK_LOST, TASK_UNKNOWN, or TASK_UNREACHABLE update.
+ // If 'tasks' is empty, then the master will send the latest status
+ // for each task currently known.
+ message Reconcile {
+ // TODO(vinod): Support arbitrary queries than just state of tasks.
+ message Task {
+ required TaskID task_id = 1;
+ optional AgentID agent_id = 2;
+ }
+
+ repeated Task tasks = 1;
+ }
+
+ // Sends arbitrary binary data to the executor. Note that Mesos
+ // neither interprets this data nor makes any guarantees about the
+ // delivery of this message to the executor.
+ message Message {
+ required AgentID agent_id = 1;
+ required ExecutorID executor_id = 2;
+ required bytes data = 3;
+ }
+
+ // Requests a specific set of resources from Mesos's allocator. If
+ // the allocator has support for this, corresponding offers will be
+ // sent asynchronously via the OFFERS event(s).
+ //
+ // NOTE: The built-in hierarchical allocator doesn't have support
+ // for this call and hence simply ignores it.
+ message Request {
+ repeated mesos.v1.Request requests = 1;
+ }
+
+ // Suppress offers for the specified roles. If `roles` is empty,
+ // the `SUPPRESS` call will suppress offers for all of the roles
+ // the framework is currently subscribed to.
+ message Suppress {
+ repeated string roles = 1;
+ }
+
+ // Identifies who generated this call. Master assigns a framework id
+ // when a new scheduler subscribes for the first time. Once assigned,
+ // the scheduler must set the 'framework_id' here and within its
+ // FrameworkInfo (in any further 'Subscribe' calls). This allows the
+ // master to identify a scheduler correctly across disconnections,
+ // failovers, etc.
+ optional FrameworkID framework_id = 1;
+
+ // Type of the call, indicates which optional field below should be
+ // present if that type has a nested message definition.
+ // See comments on `Event::Type` above on the reasoning behind this field being optional.
+ optional Type type = 2;
+
+ optional Subscribe subscribe = 3;
+ optional Accept accept = 4;
+ optional Decline decline = 5;
+ optional AcceptInverseOffers accept_inverse_offers = 13;
+ optional DeclineInverseOffers decline_inverse_offers = 14;
+ optional Revive revive = 15;
+ optional Kill kill = 6;
+ optional Shutdown shutdown = 7;
+ optional Acknowledge acknowledge = 8;
+ optional Reconcile reconcile = 9;
+ optional Message message = 10;
+ optional Request request = 11;
+ optional Suppress suppress = 16;
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/Executor.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/Executor.java b/myriad-commons/src/main/java/org/apache/mesos/Executor.java
new file mode 100644
index 0000000..095ca65
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/Executor.java
@@ -0,0 +1,149 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos;
+
+import org.apache.mesos.Protos.*;
+
+/**
+ * Callback interface to be implemented by frameworks' executors.
+ * Note that only one callback will be invoked at a time, so it is not
+ * recommended that you block within a callback because it may cause a
+ * deadlock.
+ * <p>
+ * Each callback includes a reference to the executor driver that was
+ * used to run this executor. The reference will not change for the
+ * duration of an executor (i.e., from the point you do
+ * {@link ExecutorDriver#start} to the point that
+ * {@link ExecutorDriver#join} returns).
+ * This is intended for convenience so that an executor
+ * doesn't need to store a reference to the driver itself.
+ */
+public interface Executor {
+
+ /**
+ * Invoked once the executor driver has been able to successfully
+ * connect with Mesos. In particular, a scheduler can pass some
+ * data to its executors through the {@link ExecutorInfo#getData()}
+ * field.
+ *
+ * @param driver The executor driver that was registered and connected
+ * to the Mesos cluster.
+ * @param executorInfo Describes information about the executor that was
+ * registered.
+ * @param frameworkInfo Describes the framework that was registered.
+ * @param slaveInfo Describes the slave that will be used to launch
+ * the tasks for this executor.
+ *
+ * @see ExecutorDriver
+ * @see MesosSchedulerDriver
+ */
+ // TODO(vinod): Add a new reregistered callback for when the executor
+ // re-connects with a restarted slave.
+ void registered(ExecutorDriver driver,
+ ExecutorInfo executorInfo,
+ FrameworkInfo frameworkInfo,
+ SlaveInfo slaveInfo);
+
+ /**
+ * Invoked when the executor re-registers with a restarted slave.
+ *
+ * @param driver The executor driver that was re-registered with the
+ * Mesos master.
+ * @param slaveInfo Describes the slave that will be used to launch
+ * the tasks for this executor.
+ *
+ * @see ExecutorDriver
+ */
+ void reregistered(ExecutorDriver driver, SlaveInfo slaveInfo);
+
+ /**
+ * Invoked when the executor becomes "disconnected" from the slave
+ * (e.g., the slave is being restarted due to an upgrade).
+ *
+ * @param driver The executor driver that was disconnected.
+ */
+ void disconnected(ExecutorDriver driver);
+
+ /**
+ * Invoked when a task has been launched on this executor (initiated
+ * via {@link SchedulerDriver#launchTasks}. Note that this task can be
+ * realized with a thread, a process, or some simple computation,
+ * however, no other callbacks will be invoked on this executor
+ * until this callback has returned.
+ *
+ * @param driver The executor driver that launched the task.
+ * @param task Describes the task that was launched.
+ *
+ * @see ExecutorDriver
+ * @see TaskInfo
+ */
+ void launchTask(ExecutorDriver driver, TaskInfo task);
+
+ /**
+ * Invoked when a task running within this executor has been killed
+ * (via {@link org.apache.mesos.SchedulerDriver#killTask}). Note that no
+ * status update will be sent on behalf of the executor, the executor is
+ * responsible for creating a new TaskStatus (i.e., with TASK_KILLED)
+ * and invoking {@link ExecutorDriver#sendStatusUpdate}.
+ *
+ * @param driver The executor driver that owned the task that was killed.
+ * @param taskId The ID of the task that was killed.
+ *
+ * @see ExecutorDriver
+ * @see TaskID
+ */
+ void killTask(ExecutorDriver driver, TaskID taskId);
+
+ /**
+ * Invoked when a framework message has arrived for this
+ * executor. These messages are best effort; do not expect a
+ * framework message to be retransmitted in any reliable fashion.
+ *
+ * @param driver The executor driver that received the message.
+ * @param data The message payload.
+ *
+ * @see ExecutorDriver
+ */
+ void frameworkMessage(ExecutorDriver driver, byte[] data);
+
+ /**
+ * Invoked when the executor should terminate all of its currently
+ * running tasks. Note that after Mesos has determined that an
+ * executor has terminated any tasks that the executor did not send
+ * terminal status updates for (e.g. TASK_KILLED, TASK_FINISHED,
+ * TASK_FAILED, etc) a TASK_LOST status update will be created.
+ *
+ * @param driver The executor driver that should terminate.
+ *
+ * @see ExecutorDriver
+ */
+ void shutdown(ExecutorDriver driver);
+
+ /**
+ * Invoked when a fatal error has occurred with the executor and/or
+ * executor driver. The driver will be aborted BEFORE invoking this
+ * callback.
+ *
+ * @param driver The executor driver that was aborted due this error.
+ * @param message The error message.
+ *
+ * @see ExecutorDriver
+ */
+ void error(ExecutorDriver driver, String message);
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/ExecutorDriver.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/ExecutorDriver.java b/myriad-commons/src/main/java/org/apache/mesos/ExecutorDriver.java
new file mode 100644
index 0000000..68d3ea9
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/ExecutorDriver.java
@@ -0,0 +1,112 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos;
+
+import org.apache.mesos.Protos.*;
+
+/**
+ * Abstract interface for connecting an executor to Mesos. This
+ * interface is used both to manage the executor's lifecycle (start
+ * it, stop it, or wait for it to finish) and to interact with Mesos
+ * (e.g., send status updates, send framework messages, etc.).
+ */
+public interface ExecutorDriver {
+ /**
+ * Starts the executor driver. This needs to be called before any
+ * other driver calls are made.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ public Status start();
+
+ /**
+ * Stops the executor driver.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ public Status stop();
+
+ /**
+ * Aborts the driver so that no more callbacks can be made to the
+ * executor. The semantics of abort and stop have deliberately been
+ * separated so that code can detect an aborted driver (i.e., via
+ * the return status of {@link ExecutorDriver#join}, see below),
+ * and instantiate and start another driver if desired (from within
+ * the same process ... although this functionality is currently not
+ * supported for executors).
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ public Status abort();
+
+ /**
+ * Waits for the driver to be stopped or aborted, possibly
+ * _blocking_ the current thread indefinitely. The return status of
+ * this function can be used to determine if the driver was aborted
+ * (see mesos.proto for a description of Status).
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ public Status join();
+
+ /**
+ * Starts and immediately joins (i.e., blocks on) the driver.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ public Status run();
+
+ /**
+ * Sends a status update to the framework scheduler, retrying as
+ * necessary until an acknowledgement has been received or the
+ * executor is terminated (in which case, a TASK_LOST status update
+ * will be sent). See {@link Scheduler#statusUpdate} for more
+ * information about status update acknowledgements.
+ *
+ * @param status The status update to send.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ public Status sendStatusUpdate(TaskStatus status);
+
+ /**
+ * Sends a message to the framework scheduler. These messages are
+ * best effort; do not expect a framework message to be
+ * retransmitted in any reliable fashion.
+ *
+ * @param data The message payload.
+ *
+ * @return The state of the driver after the call.
+ *
+ * @see Status
+ */
+ public Status sendFrameworkMessage(byte[] data);
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/Log.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/Log.java b/myriad-commons/src/main/java/org/apache/mesos/Log.java
new file mode 100644
index 0000000..6603263
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/Log.java
@@ -0,0 +1,468 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos;
+
+import java.io.Closeable;
+import java.io.IOException;
+
+import java.util.List;
+import java.util.Set;
+
+import java.util.concurrent.TimeoutException;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Provides access to a distributed append only log. The log can be
+ * read from using a {@link Log.Reader} and written to using a
+ * {@link Log.Writer}.
+ *
+ * <p>Both the <i>Reader</i> and <i>Writer</i> will require a <i>quorum</i>
+ * which defines the <i>ratio of active Mesos Masters</i> that need to be
+ * available for a successful read or write. The <i>quorum</i> will be satisfied
+ * when the number of <i>active Masters</i> is greater than the given
+ * <i>number</i>:
+ * <pre>{@code
+ * Quorum > (Number of Masters)/2
+ * }</pre>
+ *
+ * <p>If a <i>read</i> or <i>write</i> is executed the operation will wait
+ * until their is <i>quorum</i> to succeed.
+ */
+public class Log {
+ static {
+ MesosNativeLibrary.load();
+ }
+
+ /**
+ * An opaque identifier of a log entry's position within the
+ * log. Can be used to inidicate {@link Log.Reader#read read} ranges and
+ * {@link Log.Writer#truncate truncation} locations.
+ */
+ public static class Position implements Comparable<Position> {
+ @Override
+ public int compareTo(Position that) {
+ return Long.signum(value - that.value);
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ return that instanceof Position && value == ((Position) that).value;
+ }
+
+ @Override
+ public String toString() {
+ return "Position " + value;
+ }
+
+ /**
+ * Returns an "identity" of this position, useful for serializing
+ * to logs or across communication mediums.
+ *
+ * @return The identity in bytes.
+ */
+ public byte[] identity() {
+ byte[] bytes = new byte[8];
+ bytes[0] = (byte) (0xff & (value >> 56));
+ bytes[1] = (byte) (0xff & (value >> 48));
+ bytes[2] = (byte) (0xff & (value >> 40));
+ bytes[3] = (byte) (0xff & (value >> 32));
+ bytes[4] = (byte) (0xff & (value >> 24));
+ bytes[5] = (byte) (0xff & (value >> 16));
+ bytes[6] = (byte) (0xff & (value >> 8));
+ bytes[7] = (byte) (0xff & value);
+ return bytes;
+ }
+
+ /**
+ * Creates a position identified by an integral {@code value}.
+ * <p>
+ * Positions are typically only created by the log implementation. Log
+ * users should only ever need to call this constructor in unit tests.
+ *
+ * @param value The marker for this position in the log.
+ */
+ public Position(long value) {
+ this.value = value;
+ }
+
+ private final long value;
+ }
+
+ /**
+ * Represents an opaque data entry in the {@link Log} with a
+ * {@link Log.Position}.
+ */
+ public static class Entry {
+ /**
+ * The position of this entry.
+ * @see Position
+ */
+ public final Position position;
+ /** The data at the given position.*/
+ public final byte[] data;
+
+ /**
+ * Creates a log entry.
+ * <p>
+ * Entries are typically only created by the log implementation. Log
+ * users should only ever need to call this constructor in unit tests.
+ *
+ * @param position The unique position of this entry within the log.
+ * @param data The content stored in this entry.
+ */
+ public Entry(Position position, byte[] data) {
+ this.position = position;
+ this.data = data;
+ }
+ }
+
+ /**
+ * An exception that gets thrown when an error occurs while
+ * performing a read or write operation.
+ */
+ public static class OperationFailedException extends Exception {
+ /**
+ * @param message The message for this exception.
+ */
+ public OperationFailedException(String message) {
+ super(message);
+ }
+
+ /**
+ * @param message The message for this exception.
+ * @param cause The underlying reason this exception was generated.
+ */
+ public OperationFailedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+ }
+
+ /**
+ * An exception that gets thrown when a writer no longer has the
+ * ability to perform operations (e.g., because it was superseded by
+ * another writer).
+ */
+ public static class WriterFailedException extends Exception {
+ /**
+ * @param message The message for this exception.
+ */
+ public WriterFailedException(String message) {
+ super(message);
+ }
+
+ /**
+ * @param message The message for this exception.
+ * @param cause The underlying reason this exception was generated.
+ */
+ public WriterFailedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+ }
+
+ /**
+ * Provides read access to the {@link Log}. This class is safe for
+ * use from multiple threads and for the life of the log regardless
+ * of any exceptions thrown from its methods.
+ */
+ public static class Reader {
+ /**
+ * Returns an instance of a reader that will access the given instance of
+ * the Log.
+ * @param log The log that this reader will access.
+ */
+ public Reader(Log log) {
+ this.log = log;
+ initialize(log);
+ }
+
+ /**
+ * Attempts to read from the log between the specified positions
+ * (inclusive). If either of the positions are invalid, an
+ * {@link OperationFailedException} will get thrown. Unfortunately, this
+ * will also get thrown in other circumstances (e.g., disk
+ * failure) and therefore it is currently impossible to tell these
+ * two cases apart.
+ *
+ * @param from Where to start reading.
+ * @param to Where to finish reading.
+ * @param timeout Max number of time units to wait before a
+ * {@link TimeoutException}.
+ * @param unit Type of units used for the timeout, e.g. seconds,
+ * minutes, etc.
+ *
+ * @return The list of entries fetched from the Log.
+ *
+ * @throws TimeoutException If the read doesn't happen before the
+ * timeout.
+ * @throws OperationFailedException If the read fails due that the read no
+ * longer has the ability to perform its
+ * operations.
+ * @see Position
+ * @see TimeUnit
+ */
+ public native List<Entry> read(Position from,
+ Position to,
+ long timeout,
+ TimeUnit unit)
+ throws TimeoutException, OperationFailedException;
+
+ /**
+ * Returns the beginning position of the log (might be out of date
+ * with respect to another replica).
+ *
+ * @return The beginning position of the log.
+ */
+ public native Position beginning();
+
+ /**
+ * Returns the ending position of the log (might be out of date
+ * with respect to another replica).
+ *
+ * @return The ending position of the log
+ */
+ public native Position ending();
+
+ /**
+ * Attempts to catch-up positions from the log for reading.
+ *
+ * @param timeout Max number of time units to wait before a
+ * {@link TimeoutException}.
+ * @param unit Type of time units used for the timeout, e.g. seconds,
+ * minutes, etc.
+ *
+ * @return The ending position of the caught-up range.
+ *
+ * @throws TimeoutException If the catch-up doesn't happen before
+ * the timeout.
+ * @throws OperationFailedException If the catch-up fails.
+ */
+ public native Position catchup(long timeout, TimeUnit unit)
+ throws TimeoutException, OperationFailedException;
+
+ protected native void initialize(Log log);
+
+ protected native void finalize();
+
+ private Log log; // Keeps the log from getting garbage collected.
+ private long __log;
+ private long __reader;
+ }
+
+ /**
+ * Provides write access to the {@link Log}. This class is not safe
+ * for use from multiple threads and instances should be thrown out
+ * after any {@link WriterFailedException} is thrown.
+ */
+ public static class Writer {
+ /**
+ * Constructs a writer linked the given {@link Log}.
+ *
+ * @param log The log that this writer will access.
+ * @param timeout Max number of time units to wait before a
+ * {@link TimeoutException}.
+ * @param unit Type of time units used for the timeout, e.g. seconds,
+ * minutes, etc.
+ * @param retries Number of retries
+ *
+ * @see TimeUnit
+ */
+ public Writer(Log log, long timeout, TimeUnit unit, int retries) {
+ this.log = log;
+ initialize(log, timeout, unit, retries);
+ }
+
+ /**
+ * Attempts to append to the log with the specified data returning
+ * the new end position of the log if successful.
+ *
+ * @param data Data to append to the log.
+ * @param timeout Max number of time units to wait before a
+ * {@link TimeoutException}.
+ * @param unit Type of time units used for the timeout, e.g. seconds,
+ * minutes, etc.
+ *
+ * @return The new end-position.
+ *
+ * @throws TimeoutException If the append doesn't happen before the
+ * timeout.
+ * @throws WriterFailedException If the append fails due that the writer
+ * no longer has the ability to perform its
+ * operations (e.g., because it was
+ * superseded by another writer).
+ * @see TimeUnit
+ * @see WriterFailedException
+ */
+ public native Position append(byte[] data, long timeout, TimeUnit unit)
+ throws TimeoutException, WriterFailedException;
+
+ /**
+ * Attempts to truncate the log (from the beginning to the
+ * specified position exclusive) If the position is invalid, an
+ * {@link WriterFailedException} will get thrown. Unfortunately, this will
+ * also get thrown in other circumstances (e.g., disk failure) and
+ * therefore it is currently impossible to tell these two cases
+ * apart.
+ *
+
+ * @param to The log will be truncated up to this point.
+ * @param timeout Max number of time units to wait before a
+ * {@link TimeoutException}.
+ * @param unit Type of time units used for the timeout, e.g. seconds,
+ * minutes, etc.
+ *
+ * @return The position after the truncation.
+ *
+ * @throws TimeoutException If the truncation doesn't happen before
+ * the timeout.
+ * @throws WriterFailedException If the truncation fails due an invalid
+ * position or if the writer no longer has
+ * the ability to perform its operations
+ * (e.g., because it was superseded by
+ * another writer).
+ */
+ // TODO(benh): Throw both OperationFailedException and WriterFailedException
+ // to differentiate the need for a new writer from a bad
+ // position, or a bad disk, etc.
+ public native Position truncate(Position to, long timeout, TimeUnit unit)
+ throws TimeoutException, WriterFailedException;
+
+ protected native void initialize(Log log,
+ long timeout,
+ TimeUnit unit,
+ int retries);
+
+ protected native void finalize();
+
+ private Log log; // Keeps the log from getting garbage collected.
+ private long __log;
+ private long __writer;
+ }
+
+ /**
+ * Creates a new replicated log that assumes the specified quorum
+ * size, is backed by a file at the specified path, and coordiantes
+ * with other replicas via the set of process PIDs.
+ *
+ * @param quorum The quorum size.
+ * @param path Path to the file backing this log.
+ * @param pids PIDs of the replicas to coordinate with.
+ */
+ public Log(int quorum,
+ String path,
+ Set<String> pids) {
+ initialize(quorum, path, pids);
+ }
+
+ /**
+ * Creates a new replicated log that assumes the specified quorum
+ * size, is backed by a file at the specified path, and coordiantes
+ * with other replicas associated with the specified ZooKeeper
+ * servers, timeout, and znode (or Zookeeper name space).
+ *
+ * @param quorum The quorum size.
+ * @param path Path to the file backing this log.
+ * @param servers List of ZooKeeper servers (e.g., 'ip1:port1,ip2:port2').
+ * @param timeout Max number of time units to wait before a
+ * {@link TimeoutException}.
+ * @param unit Type of time units used for the timeout, e.g. seconds,
+ * minutes, etc.
+ * @param znode Path to znode where "state" should be rooted.
+ */
+ public Log(int quorum,
+ String path,
+ String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode) {
+ initialize(quorum, path, servers, timeout, unit, znode);
+ }
+
+ /**
+ * Creates a new replicated log that assumes the specified quorum
+ * size, is backed by a file at the specified path, and coordiantes
+ * with other replicas associated with the specified ZooKeeper
+ * servers, timeout, and znode (or Zookeeper name space).
+ *
+ * @param quorum The quorum size.
+ * @param path Path to the file backing this log.
+ * @param servers Zookeper servers/connection string.
+ * @param timeout Max number of time units to wait before a
+ * {@link TimeoutException}.
+ * @param unit Type of time units used for the timeout, e.g. seconds,
+ * minutes, etc.
+ * @param znode The Zookeeper name space.
+ * @param scheme Authentication scheme (e.g., "digest").
+ * @param credentials Authentication credentials (e.g., "user:pass").
+ */
+ public Log(int quorum,
+ String path,
+ String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode,
+ String scheme,
+ byte[] credentials) {
+ initialize(quorum, path, servers, timeout, unit, znode, scheme, credentials);
+ }
+
+ /**
+ * Returns a position based off of the bytes recovered from
+ * Position.identity().
+ *
+ * @param identity Identity, in bytes, of the position.
+ *
+ * @return The position.
+ */
+ public Position position(byte[] identity) {
+ long value =
+ ((long) (identity[0] & 0xff) << 56) |
+ ((long) (identity[1] & 0xff) << 48) |
+ ((long) (identity[2] & 0xff) << 40) |
+ ((long) (identity[3] & 0xff) << 32) |
+ ((long) (identity[4] & 0xff) << 24) |
+ ((long) (identity[5] & 0xff) << 16) |
+ ((long) (identity[6] & 0xff) << 8) |
+ ((long) (identity[7] & 0xff));
+ return new Position(value);
+ }
+
+ protected native void initialize(int quorum,
+ String path,
+ Set<String> pids);
+
+ protected native void initialize(int quorum,
+ String path,
+ String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode);
+
+ protected native void initialize(int quorum,
+ String path,
+ String servers,
+ long timeout,
+ TimeUnit unit,
+ String znode,
+ String scheme,
+ byte[] credentials);
+
+ protected native void finalize();
+
+ private long __log;
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/MesosExecutorDriver.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/MesosExecutorDriver.java b/myriad-commons/src/main/java/org/apache/mesos/MesosExecutorDriver.java
new file mode 100644
index 0000000..b52a81b
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/MesosExecutorDriver.java
@@ -0,0 +1,97 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos;
+
+import org.apache.mesos.Protos.*;
+
+/**
+ * Concrete implementation of an ExecutorDriver that connects an
+ * Executor with a Mesos slave. The MesosExecutorDriver is
+ * thread-safe.
+ * <p>
+ * The driver is responsible for invoking the Executor callbacks as it
+ * communicates with the Mesos slave.
+ * </p>
+ * <p>
+ * Note that blocking on the MesosExecutorDriver (e.g., via {@link
+ * #join}) doesn't affect the executor callbacks in anyway because
+ * they are handled by a different thread.
+ * </p>
+ * <p>
+ * Note that the driver uses GLOG to do its own logging. GLOG flags can
+ * be set via environment variables, prefixing the flag name with
+ * "GLOG_", e.g., "GLOG_v=1". For Mesos specific logging flags see
+ * src/logging/flags.hpp. Mesos flags can also be set via environment
+ * variables, prefixing the flag name with "MESOS_", e.g.,
+ * "MESOS_QUIET=1".
+ * </p>
+ * <p>
+ * See src/examples/java/TestExecutor.java for an example of using the
+ * MesosExecutorDriver.
+ * </p>
+ */
+public class MesosExecutorDriver implements ExecutorDriver {
+ static {
+ MesosNativeLibrary.load();
+ }
+
+ /**
+ * Creates a new driver that uses the specified Executor.
+ *
+ * @param executor The instance of the executor that will be used
+ * to connect to the slave.
+ *
+ * @see Executor
+ */
+ public MesosExecutorDriver(Executor executor) {
+ if (executor == null) {
+ throw new NullPointerException("Not expecting a null Executor");
+ }
+
+ this.executor = executor;
+
+ initialize();
+ }
+
+ /**
+ * See ExecutorDriver for descriptions of these.
+ *
+ * @see ExecutorDriver
+ */
+ public native Status start();
+ public native Status stop();
+ public native Status abort();
+ public native Status join();
+
+ public Status run() {
+ Status status = start();
+ return status != Status.DRIVER_RUNNING ? status : join();
+ }
+
+ public native Status sendStatusUpdate(TaskStatus status);
+ public native Status sendFrameworkMessage(byte[] data);
+
+ protected native void initialize();
+ protected native void finalize();
+
+ private final Executor executor;
+
+ private long __executor;
+ private long __driver;
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/MesosNativeLibrary.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/MesosNativeLibrary.java b/myriad-commons/src/main/java/org/apache/mesos/MesosNativeLibrary.java
new file mode 100644
index 0000000..4ce325c
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/MesosNativeLibrary.java
@@ -0,0 +1,245 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos;
+
+public class MesosNativeLibrary {
+ /**
+ * Represent a 'libmesos' version with Major, Minor, and Patch versions. We
+ * use a class here to make it easier to do version compatibility checking.
+ * For example:
+ * <pre>
+ * {@code
+ * static Version BugFixVersion = new Version(0, 22, 1);
+ * public static void myFunction() {
+ * if (version().compareTo(BugFixVersion) >= 0) {
+ * // New behavior with bug fix.
+ * } else {
+ * // Old behavior for backwards compatibility.
+ * }
+ * }
+ * }
+ * </pre>
+ */
+ public static class Version implements Comparable<Version> {
+ public Version(long major, long minor, long patch) {
+ if (major < 0) {
+ throw new IllegalArgumentException(
+ "Major version must not be negative");
+ }
+
+ if (minor < 0) {
+ throw new IllegalArgumentException(
+ "Minor version must not be negative");
+ }
+
+ if (patch < 0) {
+ throw new IllegalArgumentException(
+ "Patch version must not be negative");
+ }
+
+ this.major = major;
+ this.minor = minor;
+ this.patch = patch;
+ }
+
+ public Version(long major, long minor) {
+ this(major, minor, 0);
+ }
+
+ public Version(long major) {
+ this(major, 0, 0);
+ }
+
+ public boolean equals(Version other) {
+ return other != null &&
+ major == other.major &&
+ minor == other.minor &&
+ patch == other.patch;
+ }
+
+ /**
+ * Compare this version to an 'other' one. The comparison is done
+ * lexicographically. This returns -1 if this version is 'lesser' than the
+ * other, 0 if they are equivalent, and 1 if this version is 'greater'.
+ */
+ @Override
+ public int compareTo(Version other) {
+ if (other == null) {
+ throw new IllegalArgumentException("other Version must not be null");
+ }
+
+ if (major < other.major) {
+ return -1;
+ } else if (major > other.major) {
+ return 1;
+ }
+
+ if (minor < other.minor) {
+ return -1;
+ } else if (minor > other.minor) {
+ return 1;
+ }
+
+ if (patch < other.patch) {
+ return -1;
+ } else if (patch > other.patch) {
+ return 1;
+ }
+
+ return 0;
+ }
+
+ /**
+ * A helper that is easier to use than 'compareTo', this returns
+ * true if 'this' version is strictly 'less than', not 'less than
+ * or equal to' the 'other' version.
+ */
+ public boolean before(Version other) {
+ return this.compareTo(other) < 0;
+ }
+
+ /**
+ * A helper that is easier to use than 'compareTo', this returns
+ * true if 'this' version is strictly 'greater than', not 'greater
+ * than or equal to' the 'other' version.
+ */
+ public boolean after(Version other) {
+ return this.compareTo(other) > 0;
+ }
+
+ public final long major;
+ public final long minor;
+ public final long patch;
+ }
+
+ /**
+ * Attempts to load the native library (if it was not previously loaded)
+ * from the given path. If the path is null 'java.library.path' is used to
+ * load the library.
+ */
+ public static synchronized void load(String path) {
+ // Our JNI library will actually set 'loaded' to true once it is
+ // loaded, that way the library can get loaded by a user via
+ // 'System.load' in the event that they want to specify an
+ // absolute path and we won't try and reload the library ourselves
+ // (which would probably fail because 'java.library.path' might
+ // not be set).
+ if (loaded) {
+ return;
+ }
+
+ // In some circumstances, such as when sandboxed class loaders are used,
+ // the current thread's context class loader will not be able to see
+ // MesosNativeLibrary (even when executing this code!).
+ // We therefore, temporarily swap the thread's context class loader with
+ // the class loader that loaded this class, for the duration of the native
+ // library load.
+ ClassLoader contextClassLoader =
+ Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(
+ MesosNativeLibrary.class.getClassLoader());
+ try {
+ if (path != null) {
+ System.load(path);
+ } else {
+ // TODO(tillt): Change the default fallback to JNI specific library
+ // once libmesos has been split.
+ System.loadLibrary("mesos");
+ }
+ } catch (UnsatisfiedLinkError error) {
+ System.err.println("Failed to load native Mesos library from " +
+ (path != null ? path : System.getProperty("java.library.path")));
+ throw error;
+ } finally {
+ Thread.currentThread().setContextClassLoader(contextClassLoader);
+ }
+ }
+
+ public static void load() {
+ // Try to get the JNI specific library path from the environment.
+ String path = System.getenv("MESOS_NATIVE_JAVA_LIBRARY");
+
+ // As a fallback, use deprecated environment variable to extract that path.
+ if (path == null) {
+ path = System.getenv("MESOS_NATIVE_LIBRARY");
+ if (path != null) {
+ System.out.println("Warning: MESOS_NATIVE_LIBRARY is deprecated, " +
+ "use MESOS_NATIVE_JAVA_LIBRARY instead. Future releases will " +
+ "not support JNI bindings via MESOS_NATIVE_LIBRARY.");
+ }
+ }
+
+ load(path);
+ }
+
+ /**
+ * Returns the version of the native loaded library, or throws a
+ * runtime exception if the library is not loaded. This was
+ * introduced in MESOS 0.22.1. Any version prior to that will be
+ * 0.0.0. This means you should not make version specific decision
+ * before the 0.22.1 version boundary. For example, if you found a
+ * bug that was fixed in 0.19.0, you will *not* be able to perform
+ * the following check correctly:
+ *
+ * if (version().before(new Version(0, 19, 0))) {
+ * ...
+ * }
+ *
+ * This predicate will return true for all versions up until 0.22.1.
+ */
+ public static synchronized Version version() {
+ // Since we allow 'load' to be called with a parameter, we can not load on
+ // behalf of the user here. Instead, we throw an exception if the library
+ // has not been loaded.
+ if (!loaded) {
+ throw new RuntimeException("'libmesos' not loaded");
+ }
+
+ if (version == null) {
+ // Try to load the libmesos version identifier. If we get an
+ // 'UnsatisfiedLinkError' then this means we are loading a 'libmesos' with
+ // a version prior to 0.22.1, which is when the 'MAJOR', 'MINOR', and
+ // 'PATCH' version identifiers were introduced.
+ try {
+ version = _version();
+ } catch (UnsatisfiedLinkError error) {
+ System.err.println(
+ "WARNING: using an old version of 'libmesos'" +
+ " without proper version information: " + error.getMessage());
+
+ // If we're using a version of 'libmesos' less than 0.22.1, then we set
+ // the version to 0.0.0.
+ version = new Version(0, 0, 0);
+ }
+ }
+
+ return version;
+ }
+
+ public static final String VERSION = "1.5.0";
+
+ private static Version version = null;
+
+ private static boolean loaded = false;
+
+ /**
+ * Native implementation of 'libmesos' version identifier function.
+ */
+ private static native Version _version();
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/MesosSchedulerDriver.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/MesosSchedulerDriver.java b/myriad-commons/src/main/java/org/apache/mesos/MesosSchedulerDriver.java
new file mode 100644
index 0000000..4f61da2
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/MesosSchedulerDriver.java
@@ -0,0 +1,307 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos;
+
+import java.util.Collection;
+
+import org.apache.mesos.Protos.*;
+
+/**
+ * Concrete implementation of a SchedulerDriver that connects a
+ * Scheduler with a Mesos master. The MesosSchedulerDriver is
+ * thread-safe.
+ * <p>
+ * Note that scheduler failover is supported in Mesos. After a
+ * scheduler is registered with Mesos it may failover (to a new
+ * process on the same machine or across multiple machines) by
+ * creating a new driver with the ID given to it in {@link
+ * Scheduler#registered}.
+ * <p>
+ * The driver is responsible for invoking the Scheduler callbacks as
+ * it communicates with the Mesos master.
+ * <p>
+ * Note that blocking on the MesosSchedulerDriver (e.g., via {@link
+ * #join}) doesn't affect the scheduler callbacks in anyway because
+ * they are handled by a different thread.
+ * <p>
+ * <p>
+ * Note that the driver uses GLOG to do its own logging. GLOG flags can
+ * be set via environment variables, prefixing the flag name with
+ * "GLOG_", e.g., "GLOG_v=1". For Mesos specific logging flags see
+ * src/logging/flags.hpp. Mesos flags can also be set via environment
+ * variables, prefixing the flag name with "MESOS_", e.g.,
+ * "MESOS_QUIET=1".
+ * <p>
+ * See src/examples/java/TestFramework.java for an example of using
+ * the MesosSchedulerDriver.
+ */
+public class MesosSchedulerDriver implements SchedulerDriver {
+ static {
+ MesosNativeLibrary.load();
+ }
+
+ /**
+ * Creates a new driver for the specified scheduler. The master
+ * should be one of:
+ * <pre>
+ * {@code
+ * host:port
+ * zk://host1:port1,host2:port2,.../path
+ * zk://username:password@host1:port1,host2:port2,.../path
+ * file:///path/to/file (where file contains one of the above)
+ * }
+ * </pre>
+ * <p>
+ * The driver will attempt to "failover" if the specified
+ * FrameworkInfo includes a valid FrameworkID.
+ * <p>
+ * Any Mesos configuration options are read from environment
+ * variables, as well as any configuration files found through the
+ * environment variables.
+ * <p>
+ *
+ * @param scheduler The scheduler implementation which callbacks are invoked
+ * upon scheduler events.
+ * @param framework The frameworkInfo describing the current framework.
+ * @param master The address to the currently active Mesos master.
+ */
+ // TODO(vinod): Deprecate this in favor the constructor that takes
+ // 'credential' as parameter.
+ public MesosSchedulerDriver(Scheduler scheduler,
+ FrameworkInfo framework,
+ String master) {
+ if (scheduler == null) {
+ throw new NullPointerException("Not expecting a null Scheduler");
+ }
+
+ if (framework == null) {
+ throw new NullPointerException("Not expecting a null FrameworkInfo");
+ }
+
+ if (master == null) {
+ throw new NullPointerException("Not expecting a null master");
+ }
+
+ this.scheduler = scheduler;
+ this.framework = framework;
+ this.master = master;
+ this.implicitAcknowledgements = true;
+ this.credential = null;
+
+ initialize();
+ }
+
+ /**
+ * Same as the other constructors, except that it accepts the newly
+ * introduced 'credential' parameter.
+ *
+ * @param scheduler The scheduler implementation which callbacks are invoked
+ * upon scheduler events.
+ * @param framework The frameworkInfo describing the current framework.
+ * @param master The address to the currently active Mesos master.
+ * @param credential The credentials that will be used used to authenticate
+ * calls from this scheduler.
+ */
+ public MesosSchedulerDriver(Scheduler scheduler,
+ FrameworkInfo framework,
+ String master,
+ Credential credential) {
+
+ if (scheduler == null) {
+ throw new NullPointerException("Not expecting a null Scheduler");
+ }
+
+ if (framework == null) {
+ throw new NullPointerException("Not expecting a null FrameworkInfo");
+ }
+
+ if (master == null) {
+ throw new NullPointerException("Not expecting a null master");
+ }
+
+ if (credential == null) {
+ throw new NullPointerException("Not expecting a null credential");
+ }
+
+ this.scheduler = scheduler;
+ this.framework = framework;
+ this.master = master;
+ this.implicitAcknowledgements = true;
+ this.credential = credential;
+
+ initialize();
+ }
+
+ /**
+ * Same as the other constructors, except that it accepts the newly
+ * introduced 'implicitAcknowledgements' parameter.
+ *
+ * @param scheduler The scheduler implementation which callbacks are invoked
+ * upon scheduler events.
+ * @param framework The frameworkInfo describing the current framework.
+ * @param master The address to the currently active Mesos master.
+ * @param implicitAcknowledgements Whether the driver should send
+ * acknowledgements on behalf of the scheduler. Setting this to
+ * false allows schedulers to perform their own acknowledgements,
+ * which enables asynchronous / batch processing of status updates.
+ */
+ public MesosSchedulerDriver(Scheduler scheduler,
+ FrameworkInfo framework,
+ String master,
+ boolean implicitAcknowledgements) {
+
+ if (scheduler == null) {
+ throw new NullPointerException("Not expecting a null Scheduler");
+ }
+
+ if (framework == null) {
+ throw new NullPointerException("Not expecting a null FrameworkInfo");
+ }
+
+ if (master == null) {
+ throw new NullPointerException("Not expecting a null master");
+ }
+
+ this.scheduler = scheduler;
+ this.framework = framework;
+ this.master = master;
+ this.implicitAcknowledgements = implicitAcknowledgements;
+ this.credential = null;
+
+ initialize();
+ }
+
+ /**
+ * Same as the other constructors, except that it accepts the newly
+ * introduced 'implicitAcknowledgements' and 'credentials' parameters.
+ *
+ * @param scheduler The scheduler implementation which callbacks are invoked
+ * upon scheduler events.
+ * @param framework The frameworkInfo describing the current framework.
+ * @param master The address to the currently active Mesos master.
+ * @param implicitAcknowledgements Whether the driver should send
+ * acknowledgements on behalf of the scheduler. Setting this to
+ * false allows schedulers to perform their own acknowledgements,
+ * which enables asynchronous / batch processing of status updates.
+ * @param credential The credentials that will be used used to authenticate
+ * calls from this scheduler.
+ */
+ public MesosSchedulerDriver(Scheduler scheduler,
+ FrameworkInfo framework,
+ String master,
+ boolean implicitAcknowledgements,
+ Credential credential) {
+
+ if (scheduler == null) {
+ throw new NullPointerException("Not expecting a null Scheduler");
+ }
+
+ if (framework == null) {
+ throw new NullPointerException("Not expecting a null FrameworkInfo");
+ }
+
+ if (master == null) {
+ throw new NullPointerException("Not expecting a null master");
+ }
+
+ if (credential == null) {
+ throw new NullPointerException("Not expecting a null credential");
+ }
+
+ this.scheduler = scheduler;
+ this.framework = framework;
+ this.master = master;
+ this.implicitAcknowledgements = implicitAcknowledgements;
+ this.credential = credential;
+
+ initialize();
+ }
+
+ public native Status start();
+
+ public native Status stop(boolean failover);
+
+ public Status stop() {
+ return stop(false);
+ }
+
+ public native Status abort();
+
+ public native Status join();
+
+ public Status run() {
+ Status status = start();
+ return status != Status.DRIVER_RUNNING ? status : join();
+ }
+
+ public native Status requestResources(Collection<Request> requests);
+
+ public Status launchTasks(OfferID offerId,
+ Collection<TaskInfo> tasks) {
+ return launchTasks(offerId, tasks, Filters.newBuilder().build());
+ }
+
+ public native Status launchTasks(OfferID offerId,
+ Collection<TaskInfo> tasks,
+ Filters filters);
+ public Status launchTasks(Collection<OfferID> offerIds,
+ Collection<TaskInfo> tasks) {
+ return launchTasks(offerIds, tasks, Filters.newBuilder().build());
+ }
+
+ public native Status launchTasks(Collection<OfferID> offerIds,
+ Collection<TaskInfo> tasks,
+ Filters filters);
+
+ public native Status killTask(TaskID taskId);
+
+ public native Status acceptOffers(Collection<OfferID> offerIds,
+ Collection<Offer.Operation> operations,
+ Filters filters);
+
+ public Status declineOffer(OfferID offerId) {
+ return declineOffer(offerId, Filters.newBuilder().build());
+ }
+
+ public native Status declineOffer(OfferID offerId, Filters filters);
+
+ public native Status reviveOffers();
+
+ public native Status suppressOffers();
+
+ public native Status acknowledgeStatusUpdate(TaskStatus status);
+
+ public native Status sendFrameworkMessage(ExecutorID executorId,
+ SlaveID slaveId,
+ byte[] data);
+
+ public native Status reconcileTasks(Collection<TaskStatus> statuses);
+
+ protected native void initialize();
+ protected native void finalize();
+
+ private final Scheduler scheduler;
+ private final FrameworkInfo framework;
+ private final String master;
+ private final boolean implicitAcknowledgements;
+ private final Credential credential;
+
+ private long __scheduler;
+ private long __driver;
+}
[19/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/src/main/java/org/apache/mesos/v1/maintenance/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/maintenance/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/maintenance/Protos.java
new file mode 100644
index 0000000..6e3a750
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/maintenance/Protos.java
@@ -0,0 +1,3953 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/v1/maintenance/maintenance.proto
+
+package org.apache.mesos.v1.maintenance;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface WindowOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // repeated .mesos.v1.MachineID machine_ids = 1;
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ java.util.List<org.apache.mesos.v1.Protos.MachineID>
+ getMachineIdsList();
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.MachineID getMachineIds(int index);
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ int getMachineIdsCount();
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ java.util.List<? extends org.apache.mesos.v1.Protos.MachineIDOrBuilder>
+ getMachineIdsOrBuilderList();
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.MachineIDOrBuilder getMachineIdsOrBuilder(
+ int index);
+
+ // required .mesos.v1.Unavailability unavailability = 2;
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ boolean hasUnavailability();
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.Unavailability getUnavailability();
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.UnavailabilityOrBuilder getUnavailabilityOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.maintenance.Window}
+ *
+ * <pre>
+ **
+ * A set of machines scheduled to go into maintenance
+ * in the same `unavailability`.
+ * </pre>
+ */
+ public static final class Window extends
+ com.google.protobuf.GeneratedMessage
+ implements WindowOrBuilder {
+ // Use Window.newBuilder() to construct.
+ private Window(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Window(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Window defaultInstance;
+ public static Window getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Window getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Window(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ machineIds_ = new java.util.ArrayList<org.apache.mesos.v1.Protos.MachineID>();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ machineIds_.add(input.readMessage(org.apache.mesos.v1.Protos.MachineID.PARSER, extensionRegistry));
+ break;
+ }
+ case 18: {
+ org.apache.mesos.v1.Protos.Unavailability.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = unavailability_.toBuilder();
+ }
+ unavailability_ = input.readMessage(org.apache.mesos.v1.Protos.Unavailability.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(unavailability_);
+ unavailability_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ machineIds_ = java.util.Collections.unmodifiableList(machineIds_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_Window_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_Window_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.maintenance.Protos.Window.class, org.apache.mesos.v1.maintenance.Protos.Window.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Window> PARSER =
+ new com.google.protobuf.AbstractParser<Window>() {
+ public Window parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Window(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Window> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // repeated .mesos.v1.MachineID machine_ids = 1;
+ public static final int MACHINE_IDS_FIELD_NUMBER = 1;
+ private java.util.List<org.apache.mesos.v1.Protos.MachineID> machineIds_;
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.MachineID> getMachineIdsList() {
+ return machineIds_;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.Protos.MachineIDOrBuilder>
+ getMachineIdsOrBuilderList() {
+ return machineIds_;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public int getMachineIdsCount() {
+ return machineIds_.size();
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MachineID getMachineIds(int index) {
+ return machineIds_.get(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MachineIDOrBuilder getMachineIdsOrBuilder(
+ int index) {
+ return machineIds_.get(index);
+ }
+
+ // required .mesos.v1.Unavailability unavailability = 2;
+ public static final int UNAVAILABILITY_FIELD_NUMBER = 2;
+ private org.apache.mesos.v1.Protos.Unavailability unavailability_;
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public boolean hasUnavailability() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Unavailability getUnavailability() {
+ return unavailability_;
+ }
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.UnavailabilityOrBuilder getUnavailabilityOrBuilder() {
+ return unavailability_;
+ }
+
+ private void initFields() {
+ machineIds_ = java.util.Collections.emptyList();
+ unavailability_ = org.apache.mesos.v1.Protos.Unavailability.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasUnavailability()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getUnavailability().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ for (int i = 0; i < machineIds_.size(); i++) {
+ output.writeMessage(1, machineIds_.get(i));
+ }
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(2, unavailability_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < machineIds_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, machineIds_.get(i));
+ }
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, unavailability_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.maintenance.Protos.Window parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Window parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Window parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Window parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Window parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Window parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Window parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Window parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Window parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Window parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.maintenance.Protos.Window prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.maintenance.Window}
+ *
+ * <pre>
+ **
+ * A set of machines scheduled to go into maintenance
+ * in the same `unavailability`.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.maintenance.Protos.WindowOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_Window_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_Window_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.maintenance.Protos.Window.class, org.apache.mesos.v1.maintenance.Protos.Window.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.maintenance.Protos.Window.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getMachineIdsFieldBuilder();
+ getUnavailabilityFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (machineIdsBuilder_ == null) {
+ machineIds_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ machineIdsBuilder_.clear();
+ }
+ if (unavailabilityBuilder_ == null) {
+ unavailability_ = org.apache.mesos.v1.Protos.Unavailability.getDefaultInstance();
+ } else {
+ unavailabilityBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_Window_descriptor;
+ }
+
+ public org.apache.mesos.v1.maintenance.Protos.Window getDefaultInstanceForType() {
+ return org.apache.mesos.v1.maintenance.Protos.Window.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.maintenance.Protos.Window build() {
+ org.apache.mesos.v1.maintenance.Protos.Window result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.maintenance.Protos.Window buildPartial() {
+ org.apache.mesos.v1.maintenance.Protos.Window result = new org.apache.mesos.v1.maintenance.Protos.Window(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (machineIdsBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ machineIds_ = java.util.Collections.unmodifiableList(machineIds_);
+ bitField0_ = (bitField0_ & ~0x00000001);
+ }
+ result.machineIds_ = machineIds_;
+ } else {
+ result.machineIds_ = machineIdsBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (unavailabilityBuilder_ == null) {
+ result.unavailability_ = unavailability_;
+ } else {
+ result.unavailability_ = unavailabilityBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.maintenance.Protos.Window) {
+ return mergeFrom((org.apache.mesos.v1.maintenance.Protos.Window)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.maintenance.Protos.Window other) {
+ if (other == org.apache.mesos.v1.maintenance.Protos.Window.getDefaultInstance()) return this;
+ if (machineIdsBuilder_ == null) {
+ if (!other.machineIds_.isEmpty()) {
+ if (machineIds_.isEmpty()) {
+ machineIds_ = other.machineIds_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ ensureMachineIdsIsMutable();
+ machineIds_.addAll(other.machineIds_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.machineIds_.isEmpty()) {
+ if (machineIdsBuilder_.isEmpty()) {
+ machineIdsBuilder_.dispose();
+ machineIdsBuilder_ = null;
+ machineIds_ = other.machineIds_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ machineIdsBuilder_ =
+ com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+ getMachineIdsFieldBuilder() : null;
+ } else {
+ machineIdsBuilder_.addAllMessages(other.machineIds_);
+ }
+ }
+ }
+ if (other.hasUnavailability()) {
+ mergeUnavailability(other.getUnavailability());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasUnavailability()) {
+
+ return false;
+ }
+ if (!getUnavailability().isInitialized()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.maintenance.Protos.Window parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.maintenance.Protos.Window) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // repeated .mesos.v1.MachineID machine_ids = 1;
+ private java.util.List<org.apache.mesos.v1.Protos.MachineID> machineIds_ =
+ java.util.Collections.emptyList();
+ private void ensureMachineIdsIsMutable() {
+ if (!((bitField0_ & 0x00000001) == 0x00000001)) {
+ machineIds_ = new java.util.ArrayList<org.apache.mesos.v1.Protos.MachineID>(machineIds_);
+ bitField0_ |= 0x00000001;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.MachineID, org.apache.mesos.v1.Protos.MachineID.Builder, org.apache.mesos.v1.Protos.MachineIDOrBuilder> machineIdsBuilder_;
+
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.MachineID> getMachineIdsList() {
+ if (machineIdsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(machineIds_);
+ } else {
+ return machineIdsBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public int getMachineIdsCount() {
+ if (machineIdsBuilder_ == null) {
+ return machineIds_.size();
+ } else {
+ return machineIdsBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MachineID getMachineIds(int index) {
+ if (machineIdsBuilder_ == null) {
+ return machineIds_.get(index);
+ } else {
+ return machineIdsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public Builder setMachineIds(
+ int index, org.apache.mesos.v1.Protos.MachineID value) {
+ if (machineIdsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMachineIdsIsMutable();
+ machineIds_.set(index, value);
+ onChanged();
+ } else {
+ machineIdsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public Builder setMachineIds(
+ int index, org.apache.mesos.v1.Protos.MachineID.Builder builderForValue) {
+ if (machineIdsBuilder_ == null) {
+ ensureMachineIdsIsMutable();
+ machineIds_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ machineIdsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public Builder addMachineIds(org.apache.mesos.v1.Protos.MachineID value) {
+ if (machineIdsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMachineIdsIsMutable();
+ machineIds_.add(value);
+ onChanged();
+ } else {
+ machineIdsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public Builder addMachineIds(
+ int index, org.apache.mesos.v1.Protos.MachineID value) {
+ if (machineIdsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMachineIdsIsMutable();
+ machineIds_.add(index, value);
+ onChanged();
+ } else {
+ machineIdsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public Builder addMachineIds(
+ org.apache.mesos.v1.Protos.MachineID.Builder builderForValue) {
+ if (machineIdsBuilder_ == null) {
+ ensureMachineIdsIsMutable();
+ machineIds_.add(builderForValue.build());
+ onChanged();
+ } else {
+ machineIdsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public Builder addMachineIds(
+ int index, org.apache.mesos.v1.Protos.MachineID.Builder builderForValue) {
+ if (machineIdsBuilder_ == null) {
+ ensureMachineIdsIsMutable();
+ machineIds_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ machineIdsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public Builder addAllMachineIds(
+ java.lang.Iterable<? extends org.apache.mesos.v1.Protos.MachineID> values) {
+ if (machineIdsBuilder_ == null) {
+ ensureMachineIdsIsMutable();
+ super.addAll(values, machineIds_);
+ onChanged();
+ } else {
+ machineIdsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public Builder clearMachineIds() {
+ if (machineIdsBuilder_ == null) {
+ machineIds_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ machineIdsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public Builder removeMachineIds(int index) {
+ if (machineIdsBuilder_ == null) {
+ ensureMachineIdsIsMutable();
+ machineIds_.remove(index);
+ onChanged();
+ } else {
+ machineIdsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MachineID.Builder getMachineIdsBuilder(
+ int index) {
+ return getMachineIdsFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MachineIDOrBuilder getMachineIdsOrBuilder(
+ int index) {
+ if (machineIdsBuilder_ == null) {
+ return machineIds_.get(index); } else {
+ return machineIdsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.Protos.MachineIDOrBuilder>
+ getMachineIdsOrBuilderList() {
+ if (machineIdsBuilder_ != null) {
+ return machineIdsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(machineIds_);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MachineID.Builder addMachineIdsBuilder() {
+ return getMachineIdsFieldBuilder().addBuilder(
+ org.apache.mesos.v1.Protos.MachineID.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.MachineID.Builder addMachineIdsBuilder(
+ int index) {
+ return getMachineIdsFieldBuilder().addBuilder(
+ index, org.apache.mesos.v1.Protos.MachineID.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.v1.MachineID machine_ids = 1;</code>
+ *
+ * <pre>
+ * Machines affected by this maintenance window.
+ * </pre>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.MachineID.Builder>
+ getMachineIdsBuilderList() {
+ return getMachineIdsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.MachineID, org.apache.mesos.v1.Protos.MachineID.Builder, org.apache.mesos.v1.Protos.MachineIDOrBuilder>
+ getMachineIdsFieldBuilder() {
+ if (machineIdsBuilder_ == null) {
+ machineIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.MachineID, org.apache.mesos.v1.Protos.MachineID.Builder, org.apache.mesos.v1.Protos.MachineIDOrBuilder>(
+ machineIds_,
+ ((bitField0_ & 0x00000001) == 0x00000001),
+ getParentForChildren(),
+ isClean());
+ machineIds_ = null;
+ }
+ return machineIdsBuilder_;
+ }
+
+ // required .mesos.v1.Unavailability unavailability = 2;
+ private org.apache.mesos.v1.Protos.Unavailability unavailability_ = org.apache.mesos.v1.Protos.Unavailability.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.Unavailability, org.apache.mesos.v1.Protos.Unavailability.Builder, org.apache.mesos.v1.Protos.UnavailabilityOrBuilder> unavailabilityBuilder_;
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public boolean hasUnavailability() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Unavailability getUnavailability() {
+ if (unavailabilityBuilder_ == null) {
+ return unavailability_;
+ } else {
+ return unavailabilityBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public Builder setUnavailability(org.apache.mesos.v1.Protos.Unavailability value) {
+ if (unavailabilityBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ unavailability_ = value;
+ onChanged();
+ } else {
+ unavailabilityBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public Builder setUnavailability(
+ org.apache.mesos.v1.Protos.Unavailability.Builder builderForValue) {
+ if (unavailabilityBuilder_ == null) {
+ unavailability_ = builderForValue.build();
+ onChanged();
+ } else {
+ unavailabilityBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public Builder mergeUnavailability(org.apache.mesos.v1.Protos.Unavailability value) {
+ if (unavailabilityBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002) &&
+ unavailability_ != org.apache.mesos.v1.Protos.Unavailability.getDefaultInstance()) {
+ unavailability_ =
+ org.apache.mesos.v1.Protos.Unavailability.newBuilder(unavailability_).mergeFrom(value).buildPartial();
+ } else {
+ unavailability_ = value;
+ }
+ onChanged();
+ } else {
+ unavailabilityBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public Builder clearUnavailability() {
+ if (unavailabilityBuilder_ == null) {
+ unavailability_ = org.apache.mesos.v1.Protos.Unavailability.getDefaultInstance();
+ onChanged();
+ } else {
+ unavailabilityBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Unavailability.Builder getUnavailabilityBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getUnavailabilityFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.UnavailabilityOrBuilder getUnavailabilityOrBuilder() {
+ if (unavailabilityBuilder_ != null) {
+ return unavailabilityBuilder_.getMessageOrBuilder();
+ } else {
+ return unavailability_;
+ }
+ }
+ /**
+ * <code>required .mesos.v1.Unavailability unavailability = 2;</code>
+ *
+ * <pre>
+ * Interval during which this set of machines is expected to be down.
+ * </pre>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.Unavailability, org.apache.mesos.v1.Protos.Unavailability.Builder, org.apache.mesos.v1.Protos.UnavailabilityOrBuilder>
+ getUnavailabilityFieldBuilder() {
+ if (unavailabilityBuilder_ == null) {
+ unavailabilityBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.Unavailability, org.apache.mesos.v1.Protos.Unavailability.Builder, org.apache.mesos.v1.Protos.UnavailabilityOrBuilder>(
+ unavailability_,
+ getParentForChildren(),
+ isClean());
+ unavailability_ = null;
+ }
+ return unavailabilityBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.maintenance.Window)
+ }
+
+ static {
+ defaultInstance = new Window(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.maintenance.Window)
+ }
+
+ public interface ScheduleOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // repeated .mesos.v1.maintenance.Window windows = 1;
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ java.util.List<org.apache.mesos.v1.maintenance.Protos.Window>
+ getWindowsList();
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ org.apache.mesos.v1.maintenance.Protos.Window getWindows(int index);
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ int getWindowsCount();
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ java.util.List<? extends org.apache.mesos.v1.maintenance.Protos.WindowOrBuilder>
+ getWindowsOrBuilderList();
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ org.apache.mesos.v1.maintenance.Protos.WindowOrBuilder getWindowsOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code mesos.v1.maintenance.Schedule}
+ *
+ * <pre>
+ **
+ * A list of maintenance windows.
+ * For example, this may represent a rolling restart of agents.
+ * </pre>
+ */
+ public static final class Schedule extends
+ com.google.protobuf.GeneratedMessage
+ implements ScheduleOrBuilder {
+ // Use Schedule.newBuilder() to construct.
+ private Schedule(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Schedule(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Schedule defaultInstance;
+ public static Schedule getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Schedule getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Schedule(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ windows_ = new java.util.ArrayList<org.apache.mesos.v1.maintenance.Protos.Window>();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ windows_.add(input.readMessage(org.apache.mesos.v1.maintenance.Protos.Window.PARSER, extensionRegistry));
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ windows_ = java.util.Collections.unmodifiableList(windows_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_Schedule_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_Schedule_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.maintenance.Protos.Schedule.class, org.apache.mesos.v1.maintenance.Protos.Schedule.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Schedule> PARSER =
+ new com.google.protobuf.AbstractParser<Schedule>() {
+ public Schedule parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Schedule(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Schedule> getParserForType() {
+ return PARSER;
+ }
+
+ // repeated .mesos.v1.maintenance.Window windows = 1;
+ public static final int WINDOWS_FIELD_NUMBER = 1;
+ private java.util.List<org.apache.mesos.v1.maintenance.Protos.Window> windows_;
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public java.util.List<org.apache.mesos.v1.maintenance.Protos.Window> getWindowsList() {
+ return windows_;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.maintenance.Protos.WindowOrBuilder>
+ getWindowsOrBuilderList() {
+ return windows_;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public int getWindowsCount() {
+ return windows_.size();
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public org.apache.mesos.v1.maintenance.Protos.Window getWindows(int index) {
+ return windows_.get(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public org.apache.mesos.v1.maintenance.Protos.WindowOrBuilder getWindowsOrBuilder(
+ int index) {
+ return windows_.get(index);
+ }
+
+ private void initFields() {
+ windows_ = java.util.Collections.emptyList();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ for (int i = 0; i < getWindowsCount(); i++) {
+ if (!getWindows(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ for (int i = 0; i < windows_.size(); i++) {
+ output.writeMessage(1, windows_.get(i));
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < windows_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, windows_.get(i));
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.maintenance.Protos.Schedule parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Schedule parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Schedule parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Schedule parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Schedule parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Schedule parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Schedule parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Schedule parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Schedule parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.Schedule parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.maintenance.Protos.Schedule prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.maintenance.Schedule}
+ *
+ * <pre>
+ **
+ * A list of maintenance windows.
+ * For example, this may represent a rolling restart of agents.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.maintenance.Protos.ScheduleOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_Schedule_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_Schedule_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.maintenance.Protos.Schedule.class, org.apache.mesos.v1.maintenance.Protos.Schedule.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.maintenance.Protos.Schedule.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getWindowsFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (windowsBuilder_ == null) {
+ windows_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ windowsBuilder_.clear();
+ }
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_Schedule_descriptor;
+ }
+
+ public org.apache.mesos.v1.maintenance.Protos.Schedule getDefaultInstanceForType() {
+ return org.apache.mesos.v1.maintenance.Protos.Schedule.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.maintenance.Protos.Schedule build() {
+ org.apache.mesos.v1.maintenance.Protos.Schedule result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.maintenance.Protos.Schedule buildPartial() {
+ org.apache.mesos.v1.maintenance.Protos.Schedule result = new org.apache.mesos.v1.maintenance.Protos.Schedule(this);
+ int from_bitField0_ = bitField0_;
+ if (windowsBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ windows_ = java.util.Collections.unmodifiableList(windows_);
+ bitField0_ = (bitField0_ & ~0x00000001);
+ }
+ result.windows_ = windows_;
+ } else {
+ result.windows_ = windowsBuilder_.build();
+ }
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.maintenance.Protos.Schedule) {
+ return mergeFrom((org.apache.mesos.v1.maintenance.Protos.Schedule)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.maintenance.Protos.Schedule other) {
+ if (other == org.apache.mesos.v1.maintenance.Protos.Schedule.getDefaultInstance()) return this;
+ if (windowsBuilder_ == null) {
+ if (!other.windows_.isEmpty()) {
+ if (windows_.isEmpty()) {
+ windows_ = other.windows_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ ensureWindowsIsMutable();
+ windows_.addAll(other.windows_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.windows_.isEmpty()) {
+ if (windowsBuilder_.isEmpty()) {
+ windowsBuilder_.dispose();
+ windowsBuilder_ = null;
+ windows_ = other.windows_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ windowsBuilder_ =
+ com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+ getWindowsFieldBuilder() : null;
+ } else {
+ windowsBuilder_.addAllMessages(other.windows_);
+ }
+ }
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ for (int i = 0; i < getWindowsCount(); i++) {
+ if (!getWindows(i).isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.maintenance.Protos.Schedule parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.maintenance.Protos.Schedule) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // repeated .mesos.v1.maintenance.Window windows = 1;
+ private java.util.List<org.apache.mesos.v1.maintenance.Protos.Window> windows_ =
+ java.util.Collections.emptyList();
+ private void ensureWindowsIsMutable() {
+ if (!((bitField0_ & 0x00000001) == 0x00000001)) {
+ windows_ = new java.util.ArrayList<org.apache.mesos.v1.maintenance.Protos.Window>(windows_);
+ bitField0_ |= 0x00000001;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.maintenance.Protos.Window, org.apache.mesos.v1.maintenance.Protos.Window.Builder, org.apache.mesos.v1.maintenance.Protos.WindowOrBuilder> windowsBuilder_;
+
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public java.util.List<org.apache.mesos.v1.maintenance.Protos.Window> getWindowsList() {
+ if (windowsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(windows_);
+ } else {
+ return windowsBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public int getWindowsCount() {
+ if (windowsBuilder_ == null) {
+ return windows_.size();
+ } else {
+ return windowsBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public org.apache.mesos.v1.maintenance.Protos.Window getWindows(int index) {
+ if (windowsBuilder_ == null) {
+ return windows_.get(index);
+ } else {
+ return windowsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public Builder setWindows(
+ int index, org.apache.mesos.v1.maintenance.Protos.Window value) {
+ if (windowsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureWindowsIsMutable();
+ windows_.set(index, value);
+ onChanged();
+ } else {
+ windowsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public Builder setWindows(
+ int index, org.apache.mesos.v1.maintenance.Protos.Window.Builder builderForValue) {
+ if (windowsBuilder_ == null) {
+ ensureWindowsIsMutable();
+ windows_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ windowsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public Builder addWindows(org.apache.mesos.v1.maintenance.Protos.Window value) {
+ if (windowsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureWindowsIsMutable();
+ windows_.add(value);
+ onChanged();
+ } else {
+ windowsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public Builder addWindows(
+ int index, org.apache.mesos.v1.maintenance.Protos.Window value) {
+ if (windowsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureWindowsIsMutable();
+ windows_.add(index, value);
+ onChanged();
+ } else {
+ windowsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public Builder addWindows(
+ org.apache.mesos.v1.maintenance.Protos.Window.Builder builderForValue) {
+ if (windowsBuilder_ == null) {
+ ensureWindowsIsMutable();
+ windows_.add(builderForValue.build());
+ onChanged();
+ } else {
+ windowsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public Builder addWindows(
+ int index, org.apache.mesos.v1.maintenance.Protos.Window.Builder builderForValue) {
+ if (windowsBuilder_ == null) {
+ ensureWindowsIsMutable();
+ windows_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ windowsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public Builder addAllWindows(
+ java.lang.Iterable<? extends org.apache.mesos.v1.maintenance.Protos.Window> values) {
+ if (windowsBuilder_ == null) {
+ ensureWindowsIsMutable();
+ super.addAll(values, windows_);
+ onChanged();
+ } else {
+ windowsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public Builder clearWindows() {
+ if (windowsBuilder_ == null) {
+ windows_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ windowsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public Builder removeWindows(int index) {
+ if (windowsBuilder_ == null) {
+ ensureWindowsIsMutable();
+ windows_.remove(index);
+ onChanged();
+ } else {
+ windowsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public org.apache.mesos.v1.maintenance.Protos.Window.Builder getWindowsBuilder(
+ int index) {
+ return getWindowsFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public org.apache.mesos.v1.maintenance.Protos.WindowOrBuilder getWindowsOrBuilder(
+ int index) {
+ if (windowsBuilder_ == null) {
+ return windows_.get(index); } else {
+ return windowsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.maintenance.Protos.WindowOrBuilder>
+ getWindowsOrBuilderList() {
+ if (windowsBuilder_ != null) {
+ return windowsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(windows_);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public org.apache.mesos.v1.maintenance.Protos.Window.Builder addWindowsBuilder() {
+ return getWindowsFieldBuilder().addBuilder(
+ org.apache.mesos.v1.maintenance.Protos.Window.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public org.apache.mesos.v1.maintenance.Protos.Window.Builder addWindowsBuilder(
+ int index) {
+ return getWindowsFieldBuilder().addBuilder(
+ index, org.apache.mesos.v1.maintenance.Protos.Window.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.v1.maintenance.Window windows = 1;</code>
+ */
+ public java.util.List<org.apache.mesos.v1.maintenance.Protos.Window.Builder>
+ getWindowsBuilderList() {
+ return getWindowsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.maintenance.Protos.Window, org.apache.mesos.v1.maintenance.Protos.Window.Builder, org.apache.mesos.v1.maintenance.Protos.WindowOrBuilder>
+ getWindowsFieldBuilder() {
+ if (windowsBuilder_ == null) {
+ windowsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.maintenance.Protos.Window, org.apache.mesos.v1.maintenance.Protos.Window.Builder, org.apache.mesos.v1.maintenance.Protos.WindowOrBuilder>(
+ windows_,
+ ((bitField0_ & 0x00000001) == 0x00000001),
+ getParentForChildren(),
+ isClean());
+ windows_ = null;
+ }
+ return windowsBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.maintenance.Schedule)
+ }
+
+ static {
+ defaultInstance = new Schedule(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.maintenance.Schedule)
+ }
+
+ public interface ClusterStatusOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // repeated .mesos.v1.maintenance.ClusterStatus.DrainingMachine draining_machines = 1;
+ /**
+ * <code>repeated .mesos.v1.maintenance.ClusterStatus.DrainingMachine draining_machines = 1;</code>
+ */
+ java.util.List<org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine>
+ getDrainingMachinesList();
+ /**
+ * <code>repeated .mesos.v1.maintenance.ClusterStatus.DrainingMachine draining_machines = 1;</code>
+ */
+ org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine getDrainingMachines(int index);
+ /**
+ * <code>repeated .mesos.v1.maintenance.ClusterStatus.DrainingMachine draining_machines = 1;</code>
+ */
+ int getDrainingMachinesCount();
+ /**
+ * <code>repeated .mesos.v1.maintenance.ClusterStatus.DrainingMachine draining_machines = 1;</code>
+ */
+ java.util.List<? extends org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachineOrBuilder>
+ getDrainingMachinesOrBuilderList();
+ /**
+ * <code>repeated .mesos.v1.maintenance.ClusterStatus.DrainingMachine draining_machines = 1;</code>
+ */
+ org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachineOrBuilder getDrainingMachinesOrBuilder(
+ int index);
+
+ // repeated .mesos.v1.MachineID down_machines = 2;
+ /**
+ * <code>repeated .mesos.v1.MachineID down_machines = 2;</code>
+ */
+ java.util.List<org.apache.mesos.v1.Protos.MachineID>
+ getDownMachinesList();
+ /**
+ * <code>repeated .mesos.v1.MachineID down_machines = 2;</code>
+ */
+ org.apache.mesos.v1.Protos.MachineID getDownMachines(int index);
+ /**
+ * <code>repeated .mesos.v1.MachineID down_machines = 2;</code>
+ */
+ int getDownMachinesCount();
+ /**
+ * <code>repeated .mesos.v1.MachineID down_machines = 2;</code>
+ */
+ java.util.List<? extends org.apache.mesos.v1.Protos.MachineIDOrBuilder>
+ getDownMachinesOrBuilderList();
+ /**
+ * <code>repeated .mesos.v1.MachineID down_machines = 2;</code>
+ */
+ org.apache.mesos.v1.Protos.MachineIDOrBuilder getDownMachinesOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code mesos.v1.maintenance.ClusterStatus}
+ *
+ * <pre>
+ **
+ * Represents the maintenance status of each machine in the cluster.
+ * The lists correspond to the `MachineInfo.Mode` enumeration.
+ * </pre>
+ */
+ public static final class ClusterStatus extends
+ com.google.protobuf.GeneratedMessage
+ implements ClusterStatusOrBuilder {
+ // Use ClusterStatus.newBuilder() to construct.
+ private ClusterStatus(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private ClusterStatus(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final ClusterStatus defaultInstance;
+ public static ClusterStatus getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public ClusterStatus getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private ClusterStatus(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ drainingMachines_ = new java.util.ArrayList<org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine>();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ drainingMachines_.add(input.readMessage(org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine.PARSER, extensionRegistry));
+ break;
+ }
+ case 18: {
+ if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+ downMachines_ = new java.util.ArrayList<org.apache.mesos.v1.Protos.MachineID>();
+ mutable_bitField0_ |= 0x00000002;
+ }
+ downMachines_.add(input.readMessage(org.apache.mesos.v1.Protos.MachineID.PARSER, extensionRegistry));
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ drainingMachines_ = java.util.Collections.unmodifiableList(drainingMachines_);
+ }
+ if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+ downMachines_ = java.util.Collections.unmodifiableList(downMachines_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_ClusterStatus_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_ClusterStatus_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.maintenance.Protos.ClusterStatus.class, org.apache.mesos.v1.maintenance.Protos.ClusterStatus.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<ClusterStatus> PARSER =
+ new com.google.protobuf.AbstractParser<ClusterStatus>() {
+ public ClusterStatus parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new ClusterStatus(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<ClusterStatus> getParserForType() {
+ return PARSER;
+ }
+
+ public interface DrainingMachineOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .mesos.v1.MachineID id = 1;
+ /**
+ * <code>required .mesos.v1.MachineID id = 1;</code>
+ */
+ boolean hasId();
+ /**
+ * <code>required .mesos.v1.MachineID id = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.MachineID getId();
+ /**
+ * <code>required .mesos.v1.MachineID id = 1;</code>
+ */
+ org.apache.mesos.v1.Protos.MachineIDOrBuilder getIdOrBuilder();
+
+ // repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;
+ /**
+ * <code>repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;</code>
+ *
+ * <pre>
+ * A list of the most recent responses to inverse offers from frameworks
+ * running on this draining machine.
+ * </pre>
+ */
+ java.util.List<org.apache.mesos.v1.allocator.Protos.InverseOfferStatus>
+ getStatusesList();
+ /**
+ * <code>repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;</code>
+ *
+ * <pre>
+ * A list of the most recent responses to inverse offers from frameworks
+ * running on this draining machine.
+ * </pre>
+ */
+ org.apache.mesos.v1.allocator.Protos.InverseOfferStatus getStatuses(int index);
+ /**
+ * <code>repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;</code>
+ *
+ * <pre>
+ * A list of the most recent responses to inverse offers from frameworks
+ * running on this draining machine.
+ * </pre>
+ */
+ int getStatusesCount();
+ /**
+ * <code>repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;</code>
+ *
+ * <pre>
+ * A list of the most recent responses to inverse offers from frameworks
+ * running on this draining machine.
+ * </pre>
+ */
+ java.util.List<? extends org.apache.mesos.v1.allocator.Protos.InverseOfferStatusOrBuilder>
+ getStatusesOrBuilderList();
+ /**
+ * <code>repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;</code>
+ *
+ * <pre>
+ * A list of the most recent responses to inverse offers from frameworks
+ * running on this draining machine.
+ * </pre>
+ */
+ org.apache.mesos.v1.allocator.Protos.InverseOfferStatusOrBuilder getStatusesOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code mesos.v1.maintenance.ClusterStatus.DrainingMachine}
+ */
+ public static final class DrainingMachine extends
+ com.google.protobuf.GeneratedMessage
+ implements DrainingMachineOrBuilder {
+ // Use DrainingMachine.newBuilder() to construct.
+ private DrainingMachine(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private DrainingMachine(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final DrainingMachine defaultInstance;
+ public static DrainingMachine getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public DrainingMachine getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private DrainingMachine(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.v1.Protos.MachineID.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = id_.toBuilder();
+ }
+ id_ = input.readMessage(org.apache.mesos.v1.Protos.MachineID.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(id_);
+ id_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 18: {
+ if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+ statuses_ = new java.util.ArrayList<org.apache.mesos.v1.allocator.Protos.InverseOfferStatus>();
+ mutable_bitField0_ |= 0x00000002;
+ }
+ statuses_.add(input.readMessage(org.apache.mesos.v1.allocator.Protos.InverseOfferStatus.PARSER, extensionRegistry));
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
+ statuses_ = java.util.Collections.unmodifiableList(statuses_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_ClusterStatus_DrainingMachine_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.maintenance.Protos.internal_static_mesos_v1_maintenance_ClusterStatus_DrainingMachine_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine.class, org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<DrainingMachine> PARSER =
+ new com.google.protobuf.AbstractParser<DrainingMachine>() {
+ public DrainingMachine parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new DrainingMachine(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<DrainingMachine> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required .mesos.v1.MachineID id = 1;
+ public static final int ID_FIELD_NUMBER = 1;
+ private org.apache.mesos.v1.Protos.MachineID id_;
+ /**
+ * <code>required .mesos.v1.MachineID id = 1;</code>
+ */
+ public boolean hasId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.v1.MachineID id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.MachineID getId() {
+ return id_;
+ }
+ /**
+ * <code>required .mesos.v1.MachineID id = 1;</code>
+ */
+ public org.apache.mesos.v1.Protos.MachineIDOrBuilder getIdOrBuilder() {
+ return id_;
+ }
+
+ // repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;
+ public static final int STATUSES_FIELD_NUMBER = 2;
+ private java.util.List<org.apache.mesos.v1.allocator.Protos.InverseOfferStatus> statuses_;
+ /**
+ * <code>repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;</code>
+ *
+ * <pre>
+ * A list of the most recent responses to inverse offers from frameworks
+ * running on this draining machine.
+ * </pre>
+ */
+ public java.util.List<org.apache.mesos.v1.allocator.Protos.InverseOfferStatus> getStatusesList() {
+ return statuses_;
+ }
+ /**
+ * <code>repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;</code>
+ *
+ * <pre>
+ * A list of the most recent responses to inverse offers from frameworks
+ * running on this draining machine.
+ * </pre>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.allocator.Protos.InverseOfferStatusOrBuilder>
+ getStatusesOrBuilderList() {
+ return statuses_;
+ }
+ /**
+ * <code>repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;</code>
+ *
+ * <pre>
+ * A list of the most recent responses to inverse offers from frameworks
+ * running on this draining machine.
+ * </pre>
+ */
+ public int getStatusesCount() {
+ return statuses_.size();
+ }
+ /**
+ * <code>repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;</code>
+ *
+ * <pre>
+ * A list of the most recent responses to inverse offers from frameworks
+ * running on this draining machine.
+ * </pre>
+ */
+ public org.apache.mesos.v1.allocator.Protos.InverseOfferStatus getStatuses(int index) {
+ return statuses_.get(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.allocator.InverseOfferStatus statuses = 2;</code>
+ *
+ * <pre>
+ * A list of the most recent responses to inverse offers from frameworks
+ * running on this draining machine.
+ * </pre>
+ */
+ public org.apache.mesos.v1.allocator.Protos.InverseOfferStatusOrBuilder getStatusesOrBuilder(
+ int index) {
+ return statuses_.get(index);
+ }
+
+ private void initFields() {
+ id_ = org.apache.mesos.v1.Protos.MachineID.getDefaultInstance();
+ statuses_ = java.util.Collections.emptyList();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasId()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ for (int i = 0; i < getStatusesCount(); i++) {
+ if (!getStatuses(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, id_);
+ }
+ for (int i = 0; i < statuses_.size(); i++) {
+ output.writeMessage(2, statuses_.get(i));
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, id_);
+ }
+ for (int i = 0; i < statuses_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, statuses_.get(i));
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.maintenance.Protos.ClusterStatus.DrainingMachine prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
<TRUNCATED>
[26/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
Add compatibility with mesos v1
Project: http://git-wip-us.apache.org/repos/asf/incubator-myriad/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-myriad/commit/16467f39
Tree: http://git-wip-us.apache.org/repos/asf/incubator-myriad/tree/16467f39
Diff: http://git-wip-us.apache.org/repos/asf/incubator-myriad/diff/16467f39
Branch: refs/heads/upgrademesos1.5
Commit: 16467f39db26fd7a41e36be3dedf0896b42e6a26
Parents: b5b468b
Author: jpgilaberte <jp...@stratio.com>
Authored: Thu Sep 6 16:49:27 2018 +0200
Committer: jpgilaberte <jp...@stratio.com>
Committed: Thu Sep 6 16:49:27 2018 +0200
----------------------------------------------------------------------
myriad-commons/proto/mesos/executor.proto | 212 -
myriad-commons/proto/mesos/mesos.proto | 3190 --
myriad-commons/proto/mesos/scheduler.proto | 433 -
myriad-commons/proto/mesos/v1/executor.proto | 214 -
myriad-commons/proto/mesos/v1/mesos.proto | 3173 --
myriad-commons/proto/mesos/v1/scheduler.proto | 420 -
.../java/org/apache/mesos/v1/agent/Protos.java | 31858 +++++++++++
.../org/apache/mesos/v1/allocator/Protos.java | 1089 +
.../org/apache/mesos/v1/maintenance/Protos.java | 3953 ++
.../java/org/apache/mesos/v1/master/Protos.java | 48707 +++++++++++++++++
.../java/org/apache/mesos/v1/quota/Protos.java | 3332 ++
.../mesos/v1/resource_provider/Protos.java | 5069 ++
12 files changed, 94008 insertions(+), 7642 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/proto/mesos/executor.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/executor.proto b/myriad-commons/proto/mesos/executor.proto
deleted file mode 100644
index 1b5fa5d..0000000
--- a/myriad-commons/proto/mesos/executor.proto
+++ /dev/null
@@ -1,212 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto2";
-
-import "mesos/mesos.proto";
-
-package mesos.executor;
-
-option java_package = "org.apache.mesos.executor";
-option java_outer_classname = "Protos";
-
-
-/**
- * Executor event API.
- *
- * An event is described using the standard protocol buffer "union"
- * trick, see https://developers.google.com/protocol-buffers/docs/techniques#union.
- */
-message Event {
- // Possible event types, followed by message definitions if
- // applicable.
- enum Type {
- // This must be the first enum value in this list, to
- // ensure that if 'type' is not set, the default value
- // is UNKNOWN. This enables enum values to be added
- // in a backwards-compatible way. See: MESOS-4997.
- UNKNOWN = 0;
-
- SUBSCRIBED = 1; // See 'Subscribed' below.
- LAUNCH = 2; // See 'Launch' below.
- LAUNCH_GROUP = 8; // See 'LaunchGroup' below.
- KILL = 3; // See 'Kill' below.
- ACKNOWLEDGED = 4; // See 'Acknowledged' below.
- MESSAGE = 5; // See 'Message' below.
- ERROR = 6; // See 'Error' below.
-
- // Received when the agent asks the executor to shutdown/kill itself.
- // The executor is then required to kill all its active tasks, send
- // `TASK_KILLED` status updates and gracefully exit. The executor
- // should terminate within a `MESOS_EXECUTOR_SHUTDOWN_GRACE_PERIOD`
- // (an environment variable set by the agent upon executor startup);
- // it can be configured via `ExecutorInfo.shutdown_grace_period`. If
- // the executor fails to do so, the agent will forcefully destroy the
- // container where the executor is running. The agent would then send
- // `TASK_LOST` updates for any remaining active tasks of this executor.
- //
- // NOTE: The executor must not assume that it will always be allotted
- // the full grace period, as the agent may decide to allot a shorter
- // period and failures / forcible terminations may occur.
- //
- // TODO(alexr): Consider adding a duration field into the `Shutdown`
- // message so that the agent can communicate when a shorter period
- // has been allotted.
- SHUTDOWN = 7;
- }
-
- // First event received when the executor subscribes.
- // The 'id' field in the 'framework_info' will be set.
- message Subscribed {
- required ExecutorInfo executor_info = 1;
- required FrameworkInfo framework_info = 2;
- required SlaveInfo slave_info = 3;
-
- // Uniquely identifies the container of an executor run.
- optional ContainerID container_id = 4;
- }
-
- // Received when the framework attempts to launch a task. Once
- // the task is successfuly launched, the executor must respond with
- // a TASK_RUNNING update (See TaskState in mesos.proto).
- message Launch {
- required TaskInfo task = 1;
- }
-
- // Received when the framework attempts to launch a group of tasks atomically.
- // Similar to `Launch` above the executor must send TASK_RUNNING updates for
- // tasks that are successfully launched.
- message LaunchGroup {
- required TaskGroupInfo task_group = 1;
- }
-
- // Received when the scheduler wants to kill a specific task. Once
- // the task is terminated, the executor should send a TASK_KILLED
- // (or TASK_FAILED) update. The terminal update is necessary so
- // Mesos can release the resources associated with the task.
- message Kill {
- required TaskID task_id = 1;
-
- // If set, overrides any previously specified kill policy for this task.
- // This includes 'TaskInfo.kill_policy' and 'Executor.kill.kill_policy'.
- optional KillPolicy kill_policy = 2;
- }
-
- // Received when the slave acknowledges the receipt of status
- // update. Schedulers are responsible for explicitly acknowledging
- // the receipt of status updates that have 'update.status().uuid()'
- // field set. Unacknowledged updates can be retried by the executor.
- // They should also be sent by the executor whenever it
- // re-subscribes.
- message Acknowledged {
- required TaskID task_id = 1;
- required bytes uuid = 2;
- }
-
- // Received when a custom message generated by the scheduler is
- // forwarded by the slave. Note that this message is not
- // interpreted by Mesos and is only forwarded (without reliability
- // guarantees) to the executor. It is up to the scheduler to retry
- // if the message is dropped for any reason.
- message Message {
- required bytes data = 1;
- }
-
- // Received in case the executor sends invalid calls (e.g.,
- // required values not set).
- // TODO(arojas): Remove this once the old executor driver is no
- // longer supported. With HTTP API all errors will be signaled via
- // HTTP response codes.
- message Error {
- required string message = 1;
- }
-
- // Type of the event, indicates which optional field below should be
- // present if that type has a nested message definition.
- // Enum fields should be optional, see: MESOS-4997.
- optional Type type = 1;
-
- optional Subscribed subscribed = 2;
- optional Acknowledged acknowledged = 3;
- optional Launch launch = 4;
- optional LaunchGroup launch_group = 8;
- optional Kill kill = 5;
- optional Message message = 6;
- optional Error error = 7;
-}
-
-
-/**
- * Executor call API.
- *
- * Like Event, a Call is described using the standard protocol buffer
- * "union" trick (see above).
- */
-message Call {
- // Possible call types, followed by message definitions if
- // applicable.
- enum Type {
- // See comments above on `Event::Type` for more details on this enum value.
- UNKNOWN = 0;
-
- SUBSCRIBE = 1; // See 'Subscribe' below.
- UPDATE = 2; // See 'Update' below.
- MESSAGE = 3; // See 'Message' below.
- }
-
- // Request to subscribe with the slave. If subscribing after a disconnection,
- // it must include a list of all the tasks and updates which haven't been
- // acknowledged by the scheduler.
- message Subscribe {
- repeated TaskInfo unacknowledged_tasks = 1;
- repeated Update unacknowledged_updates = 2;
- }
-
- // Notifies the scheduler that a task has transitioned from one
- // state to another. Status updates should be used by executors
- // to reliably communicate the status of the tasks that they
- // manage. It is crucial that a terminal update (see TaskState
- // in mesos.proto) is sent to the scheduler as soon as the task
- // terminates, in order for Mesos to release the resources allocated
- // to the task. It is the responsibility of the scheduler to
- // explicitly acknowledge the receipt of a status update. See
- // 'Acknowledged' in the 'Events' section above for the semantics.
- message Update {
- required TaskStatus status = 1;
- }
-
- // Sends arbitrary binary data to the scheduler. Note that Mesos
- // neither interprets this data nor makes any guarantees about the
- // delivery of this message to the scheduler.
- // See 'Message' in the 'Events' section.
- message Message {
- required bytes data = 2;
- }
-
- // Identifies the executor which generated this call.
- required ExecutorID executor_id = 1;
- required FrameworkID framework_id = 2;
-
- // Type of the call, indicates which optional field below should be
- // present if that type has a nested message definition.
- // In case type is SUBSCRIBED, no message needs to be set.
- // See comments on `Event::Type` above on the reasoning behind this field being optional.
- optional Type type = 3;
-
- optional Subscribe subscribe = 4;
- optional Update update = 5;
- optional Message message = 6;
-}
[13/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/proto/mesos/scheduler.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/scheduler.proto b/myriad-commons/proto/mesos/scheduler.proto
new file mode 100644
index 0000000..0528a7e
--- /dev/null
+++ b/myriad-commons/proto/mesos/scheduler.proto
@@ -0,0 +1,433 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto2";
+
+import "mesos/mesos.proto";
+
+package mesos.scheduler;
+
+option java_package = "org.apache.mesos.scheduler";
+option java_outer_classname = "Protos";
+
+
+/**
+ * Scheduler event API.
+ *
+ * An event is described using the standard protocol buffer "union"
+ * trick, see:
+ * https://developers.google.com/protocol-buffers/docs/techniques#union.
+ */
+message Event {
+ // Possible event types, followed by message definitions if
+ // applicable.
+ enum Type {
+ // This must be the first enum value in this list, to
+ // ensure that if 'type' is not set, the default value
+ // is UNKNOWN. This enables enum values to be added
+ // in a backwards-compatible way. See: MESOS-4997.
+ UNKNOWN = 0;
+
+ SUBSCRIBED = 1; // See 'Subscribed' below.
+ OFFERS = 2; // See 'Offers' below.
+ INVERSE_OFFERS = 9; // See 'InverseOffers' below.
+ RESCIND = 3; // See 'Rescind' below.
+ RESCIND_INVERSE_OFFER = 10; // See 'RescindInverseOffer' below.
+ UPDATE = 4; // See 'Update' below.
+ MESSAGE = 5; // See 'Message' below.
+ FAILURE = 6; // See 'Failure' below.
+ ERROR = 7; // See 'Error' below.
+
+ // Periodic message sent by the Mesos master according to
+ // 'Subscribed.heartbeat_interval_seconds'. If the scheduler does
+ // not receive any events (including heartbeats) for an extended
+ // period of time (e.g., 5 x heartbeat_interval_seconds), there is
+ // likely a network partition. In such a case the scheduler should
+ // close the existing subscription connection and resubscribe
+ // using a backoff strategy.
+ HEARTBEAT = 8;
+ }
+
+ // First event received when the scheduler subscribes.
+ message Subscribed {
+ required FrameworkID framework_id = 1;
+
+ // This value will be set if the master is sending heartbeats. See
+ // the comment above on 'HEARTBEAT' for more details.
+ optional double heartbeat_interval_seconds = 2;
+
+ // Since Mesos 1.1.
+ optional MasterInfo master_info = 3;
+ }
+
+ // Received whenever there are new resources that are offered to the
+ // scheduler. Each offer corresponds to a set of resources on an
+ // agent. Until the scheduler accepts or declines an offer the
+ // resources are considered allocated to the scheduler.
+ message Offers {
+ repeated Offer offers = 1;
+ }
+
+ // Received whenever there are resources requested back from the
+ // scheduler. Each inverse offer specifies the agent, and
+ // optionally specific resources. Accepting or Declining an inverse
+ // offer informs the allocator of the scheduler's ability to release
+ // the specified resources without violating an SLA. If no resources
+ // are specified then all resources on the agent are requested to be
+ // released.
+ message InverseOffers {
+ repeated InverseOffer inverse_offers = 1;
+ }
+
+ // Received when a particular offer is no longer valid (e.g., the
+ // slave corresponding to the offer has been removed) and hence
+ // needs to be rescinded. Any future calls ('Accept' / 'Decline') made
+ // by the scheduler regarding this offer will be invalid.
+ message Rescind {
+ required OfferID offer_id = 1;
+ }
+
+ // Received when a particular inverse offer is no longer valid
+ // (e.g., the agent corresponding to the offer has been removed)
+ // and hence needs to be rescinded. Any future calls ('Accept' /
+ // 'Decline') made by the scheduler regarding this inverse offer
+ // will be invalid.
+ message RescindInverseOffer {
+ required OfferID inverse_offer_id = 1;
+ }
+
+ // Received whenever there is a status update that is generated by
+ // the executor or slave or master. Status updates should be used by
+ // executors to reliably communicate the status of the tasks that
+ // they manage. It is crucial that a terminal update (see TaskState
+ // in mesos.proto) is sent by the executor as soon as the task
+ // terminates, in order for Mesos to release the resources allocated
+ // to the task. It is also the responsibility of the scheduler to
+ // explicitly acknowledge the receipt of a status update. See
+ // 'Acknowledge' in the 'Call' section below for the semantics.
+ //
+ // A task status update may be used for guaranteed delivery of some
+ // task-related information, e.g., task's health update. Such
+ // information may be shadowed by subsequent task status updates, that
+ // do not preserve fields of the previously sent message.
+ message Update {
+ required TaskStatus status = 1;
+ }
+
+ // Received when a custom message generated by the executor is
+ // forwarded by the master. Note that this message is not
+ // interpreted by Mesos and is only forwarded (without reliability
+ // guarantees) to the scheduler. It is up to the executor to retry
+ // if the message is dropped for any reason.
+ message Message {
+ required SlaveID slave_id = 1;
+ required ExecutorID executor_id = 2;
+ required bytes data = 3;
+ }
+
+ // Received when a slave is removed from the cluster (e.g., failed
+ // health checks) or when an executor is terminated. Note that, this
+ // event coincides with receipt of terminal UPDATE events for any
+ // active tasks belonging to the slave or executor and receipt of
+ // 'Rescind' events for any outstanding offers belonging to the
+ // slave. Note that there is no guaranteed order between the
+ // 'Failure', 'Update' and 'Rescind' events when a slave or executor
+ // is removed.
+ // TODO(vinod): Consider splitting the lost slave and terminated
+ // executor into separate events and ensure it's reliably generated.
+ message Failure {
+ optional SlaveID slave_id = 1;
+
+ // If this was just a failure of an executor on a slave then
+ // 'executor_id' will be set and possibly 'status' (if we were
+ // able to determine the exit status).
+ optional ExecutorID executor_id = 2;
+
+ // On Posix, `status` corresponds to termination information in the
+ // `stat_loc` area returned from a `waitpid` call. On Windows, `status`
+ // is obtained via calling the `GetExitCodeProcess()` function. For
+ // messages coming from Posix agents, schedulers need to apply
+ // `WEXITSTATUS` family macros or equivalent transformations to obtain
+ // exit codes.
+ //
+ // TODO(alexr): Consider unifying Windows and Posix behavior by returning
+ // exit code here, see MESOS-7241.
+ optional int32 status = 3;
+ }
+
+ // Received when there is an unrecoverable error in the scheduler (e.g.,
+ // scheduler failed over, rate limiting, authorization errors etc.). The
+ // scheduler should abort on receiving this event.
+ message Error {
+ required string message = 1;
+ }
+
+ // Type of the event, indicates which optional field below should be
+ // present if that type has a nested message definition.
+ // Enum fields should be optional, see: MESOS-4997.
+ optional Type type = 1;
+
+ optional Subscribed subscribed = 2;
+ optional Offers offers = 3;
+ optional InverseOffers inverse_offers = 9;
+ optional Rescind rescind = 4;
+ optional RescindInverseOffer rescind_inverse_offer = 10;
+ optional Update update = 5;
+ optional Message message = 6;
+ optional Failure failure = 7;
+ optional Error error = 8;
+}
+
+
+/**
+ * Scheduler call API.
+ *
+ * Like Event, a Call is described using the standard protocol buffer
+ * "union" trick (see above).
+ */
+message Call {
+ // Possible call types, followed by message definitions if
+ // applicable.
+ enum Type {
+ // See comments above on `Event::Type` for more details on this enum value.
+ UNKNOWN = 0;
+
+ SUBSCRIBE = 1; // See 'Subscribe' below.
+ TEARDOWN = 2; // Shuts down all tasks/executors and removes framework.
+ ACCEPT = 3; // See 'Accept' below.
+ DECLINE = 4; // See 'Decline' below.
+ ACCEPT_INVERSE_OFFERS = 13; // See 'AcceptInverseOffers' below.
+ DECLINE_INVERSE_OFFERS = 14; // See 'DeclineInverseOffers' below.
+ REVIVE = 5; // Removes any previous filters set via ACCEPT or DECLINE.
+ KILL = 6; // See 'Kill' below.
+ SHUTDOWN = 7; // See 'Shutdown' below.
+ ACKNOWLEDGE = 8; // See 'Acknowledge' below.
+ RECONCILE = 9; // See 'Reconcile' below.
+ MESSAGE = 10; // See 'Message' below.
+ REQUEST = 11; // See 'Request' below.
+ SUPPRESS = 12; // Inform master to stop sending offers to the framework.
+
+ // TODO(benh): Consider adding an 'ACTIVATE' and 'DEACTIVATE' for
+ // already subscribed frameworks as a way of stopping offers from
+ // being generated and other events from being sent by the master.
+ // Note that this functionality existed originally to support
+ // SchedulerDriver::abort which was only necessary to handle
+ // exceptions getting thrown from within Scheduler callbacks,
+ // something that is not an issue with the Event/Call API.
+ }
+
+ // Subscribes the scheduler with the master to receive events. A
+ // scheduler must send other calls only after it has received the
+ // SUBCRIBED event.
+ message Subscribe {
+ // See the comments below on 'framework_id' on the semantics for
+ // 'framework_info.id'.
+ required FrameworkInfo framework_info = 1;
+
+ // NOTE: 'force' field is not present in v1/scheduler.proto because it is
+ // only used by the scheduler driver. The driver sets it to true when the
+ // scheduler re-registers for the first time after a failover. Once
+ // re-registered all subsequent re-registration attempts (e.g., due to ZK
+ // blip) will have 'force' set to false. This is important because master
+ // uses this field to know when it needs to send FrameworkRegisteredMessage
+ // vs FrameworkReregisteredMessage.
+ optional bool force = 2;
+
+ // List of suppressed roles for which the framework does not wish to be
+ // offered resources. The framework can decide to suppress all or a subset
+ // of roles the framework (re)registers as.
+ //
+ // Note: This field is not set by scheduler driver, so will always be
+ // empty. It is added here for transformation from `v1::Call::Subscribe`.
+ repeated string suppressed_roles = 3;
+ }
+
+ // Accepts an offer, performing the specified operations
+ // in a sequential manner.
+ //
+ // E.g. Launch a task with a newly reserved persistent volume:
+ //
+ // Accept {
+ // offer_ids: [ ... ]
+ // operations: [
+ // { type: RESERVE,
+ // reserve: { resources: [ disk(role):2 ] } }
+ // { type: CREATE,
+ // create: { volumes: [ disk(role):1+persistence ] } }
+ // { type: LAUNCH,
+ // launch: { task_infos ... disk(role):1;disk(role):1+persistence } }
+ // ]
+ // }
+ //
+ // NOTE: Any of the offer’s resources not used in the `Accept` call
+ // (e.g., to launch a task) are considered unused and might be
+ // reoffered to other frameworks. In other words, the same `OfferID`
+ // cannot be used in more than one `Accept` call.
+ // NOTE: All offers must belong to the same agent.
+ message Accept {
+ repeated OfferID offer_ids = 1;
+ repeated Offer.Operation operations = 2;
+ optional Filters filters = 3;
+ }
+
+ // Declines an offer, signaling the master to potentially reoffer
+ // the resources to a different framework. Note that this is same
+ // as sending an Accept call with no operations. See comments on
+ // top of 'Accept' for semantics.
+ message Decline {
+ repeated OfferID offer_ids = 1;
+ optional Filters filters = 2;
+ }
+
+ // Accepts an inverse offer. Inverse offers should only be accepted
+ // if the resources in the offer can be safely evacuated before the
+ // provided unavailability.
+ message AcceptInverseOffers {
+ repeated OfferID inverse_offer_ids = 1;
+ optional Filters filters = 2;
+ }
+
+ // Declines an inverse offer. Inverse offers should be declined if
+ // the resources in the offer might not be safely evacuated before
+ // the provided unavailability.
+ message DeclineInverseOffers {
+ repeated OfferID inverse_offer_ids = 1;
+ optional Filters filters = 2;
+ }
+
+ // Revive offers for the specified roles. If `roles` is empty,
+ // the `REVIVE` call will revive offers for all of the roles
+ // the framework is currently subscribed to.
+ message Revive {
+ repeated string roles = 1;
+ }
+
+ // Kills a specific task. If the scheduler has a custom executor,
+ // the kill is forwarded to the executor and it is up to the
+ // executor to kill the task and send a TASK_KILLED (or TASK_FAILED)
+ // update. Note that Mesos releases the resources for a task once it
+ // receives a terminal update (See TaskState in mesos.proto) for it.
+ // If the task is unknown to the master, a TASK_LOST update is
+ // generated.
+ //
+ // If a task within a task group is killed before the group is
+ // delivered to the executor, all tasks in the task group are
+ // killed. When a task group has been delivered to the executor,
+ // it is up to the executor to decide how to deal with the kill.
+ // Note The default Mesos executor will currently kill all the
+ // tasks in the task group if it gets a kill for any task.
+ message Kill {
+ required TaskID task_id = 1;
+ optional SlaveID slave_id = 2;
+
+ // If set, overrides any previously specified kill policy for this task.
+ // This includes 'TaskInfo.kill_policy' and 'Executor.kill.kill_policy'.
+ // Can be used to forcefully kill a task which is already being killed.
+ optional KillPolicy kill_policy = 3;
+ }
+
+ // Shuts down a custom executor. When the executor gets a shutdown
+ // event, it is expected to kill all its tasks (and send TASK_KILLED
+ // updates) and terminate. If the executor doesn’t terminate within
+ // a certain timeout (configurable via
+ // '--executor_shutdown_grace_period' slave flag), the slave will
+ // forcefully destroy the container (executor and its tasks) and
+ // transition its active tasks to TASK_LOST.
+ message Shutdown {
+ required ExecutorID executor_id = 1;
+ required SlaveID slave_id = 2;
+ }
+
+ // Acknowledges the receipt of status update. Schedulers are
+ // responsible for explicitly acknowledging the receipt of status
+ // updates that have 'Update.status().uuid()' field set. Such status
+ // updates are retried by the slave until they are acknowledged by
+ // the scheduler.
+ message Acknowledge {
+ required SlaveID slave_id = 1;
+ required TaskID task_id = 2;
+ required bytes uuid = 3;
+ }
+
+ // Allows the scheduler to query the status for non-terminal tasks.
+ // This causes the master to send back the latest task status for
+ // each task in 'tasks', if possible. Tasks that are no longer known
+ // will result in a TASK_LOST, TASK_UNKNOWN, or TASK_UNREACHABLE update.
+ // If 'tasks' is empty, then the master will send the latest status
+ // for each task currently known.
+ message Reconcile {
+ // TODO(vinod): Support arbitrary queries than just state of tasks.
+ message Task {
+ required TaskID task_id = 1;
+ optional SlaveID slave_id = 2;
+ }
+
+ repeated Task tasks = 1;
+ }
+
+ // Sends arbitrary binary data to the executor. Note that Mesos
+ // neither interprets this data nor makes any guarantees about the
+ // delivery of this message to the executor.
+ message Message {
+ required SlaveID slave_id = 1;
+ required ExecutorID executor_id = 2;
+ required bytes data = 3;
+ }
+
+ // Requests a specific set of resources from Mesos's allocator. If
+ // the allocator has support for this, corresponding offers will be
+ // sent asynchronously via the OFFERS event(s).
+ //
+ // NOTE: The built-in hierarchical allocator doesn't have support
+ // for this call and hence simply ignores it.
+ message Request {
+ repeated mesos.Request requests = 1;
+ }
+
+ // Suppress offers for the specified roles. If `roles` is empty,
+ // the `SUPPRESS` call will suppress offers for all of the roles
+ // the framework is currently subscribed to.
+ message Suppress {
+ repeated string roles = 1;
+ }
+
+ // Identifies who generated this call. Master assigns a framework id
+ // when a new scheduler subscribes for the first time. Once assigned,
+ // the scheduler must set the 'framework_id' here and within its
+ // FrameworkInfo (in any further 'Subscribe' calls). This allows the
+ // master to identify a scheduler correctly across disconnections,
+ // failovers, etc.
+ optional FrameworkID framework_id = 1;
+
+ // Type of the call, indicates which optional field below should be
+ // present if that type has a nested message definition.
+ // See comments on `Event::Type` above on the reasoning behind this field being optional.
+ optional Type type = 2;
+
+ optional Subscribe subscribe = 3;
+ optional Accept accept = 4;
+ optional Decline decline = 5;
+ optional AcceptInverseOffers accept_inverse_offers = 13;
+ optional DeclineInverseOffers decline_inverse_offers = 14;
+ optional Revive revive = 15;
+ optional Kill kill = 6;
+ optional Shutdown shutdown = 7;
+ optional Acknowledge acknowledge = 8;
+ optional Reconcile reconcile = 9;
+ optional Message message = 10;
+ optional Request request = 11;
+ optional Suppress suppress = 16;
+}
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/proto/mesos/v1/executor.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/v1/executor.proto b/myriad-commons/proto/mesos/v1/executor.proto
new file mode 100644
index 0000000..b2ef325
--- /dev/null
+++ b/myriad-commons/proto/mesos/v1/executor.proto
@@ -0,0 +1,214 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto2";
+
+import "mesos/v1/mesos.proto";
+
+package mesos.v1.executor;
+
+option java_package = "org.apache.mesos.v1.executor";
+option java_outer_classname = "Protos";
+
+
+/**
+ * Executor event API.
+ *
+ * An event is described using the standard protocol buffer "union"
+ * trick, see https://developers.google.com/protocol-buffers/docs/techniques#union.
+ */
+message Event {
+ // Possible event types, followed by message definitions if
+ // applicable.
+ enum Type {
+ // This must be the first enum value in this list, to
+ // ensure that if 'type' is not set, the default value
+ // is UNKNOWN. This enables enum values to be added
+ // in a backwards-compatible way. See: MESOS-4997.
+ UNKNOWN = 0;
+
+ SUBSCRIBED = 1; // See 'Subscribed' below.
+ LAUNCH = 2; // See 'Launch' below.
+ LAUNCH_GROUP = 8; // See 'LaunchGroup' below.
+ KILL = 3; // See 'Kill' below.
+ ACKNOWLEDGED = 4; // See 'Acknowledged' below.
+ MESSAGE = 5; // See 'Message' below.
+ ERROR = 6; // See 'Error' below.
+
+ // Received when the agent asks the executor to shutdown/kill itself.
+ // The executor is then required to kill all its active tasks, send
+ // `TASK_KILLED` status updates and gracefully exit. The executor
+ // should terminate within a `MESOS_EXECUTOR_SHUTDOWN_GRACE_PERIOD`
+ // (an environment variable set by the agent upon executor startup);
+ // it can be configured via `ExecutorInfo.shutdown_grace_period`. If
+ // the executor fails to do so, the agent will forcefully destroy the
+ // container where the executor is running. The agent would then send
+ // `TASK_LOST` updates for any remaining active tasks of this executor.
+ //
+ // NOTE: The executor must not assume that it will always be allotted
+ // the full grace period, as the agent may decide to allot a shorter
+ // period and failures / forcible terminations may occur.
+ //
+ // TODO(alexr): Consider adding a duration field into the `Shutdown`
+ // message so that the agent can communicate when a shorter period
+ // has been allotted.
+ SHUTDOWN = 7;
+ }
+
+ // First event received when the executor subscribes.
+ // The 'id' field in the 'framework_info' will be set.
+ message Subscribed {
+ required ExecutorInfo executor_info = 1;
+ required FrameworkInfo framework_info = 2;
+ required AgentInfo agent_info = 3;
+
+ // Uniquely identifies the container of an executor run.
+ optional ContainerID container_id = 4;
+ }
+
+ // Received when the framework attempts to launch a task. Once
+ // the task is successfully launched, the executor must respond with
+ // a TASK_RUNNING update (See TaskState in v1/mesos.proto).
+ message Launch {
+ required TaskInfo task = 1;
+ }
+
+ // Received when the framework attempts to launch a group of tasks atomically.
+ // Similar to `Launch` above the executor must send TASK_RUNNING updates for
+ // tasks that are successfully launched.
+ message LaunchGroup {
+ required TaskGroupInfo task_group = 1;
+ }
+
+ // Received when the scheduler wants to kill a specific task. Once
+ // the task is terminated, the executor should send a TASK_KILLED
+ // (or TASK_FAILED) update. The terminal update is necessary so
+ // Mesos can release the resources associated with the task.
+ message Kill {
+ required TaskID task_id = 1;
+
+ // If set, overrides any previously specified kill policy for this task.
+ // This includes 'TaskInfo.kill_policy' and 'Executor.kill.kill_policy'.
+ // Can be used to forcefully kill a task which is already being killed.
+ optional KillPolicy kill_policy = 2;
+ }
+
+ // Received when the agent acknowledges the receipt of status
+ // update. Schedulers are responsible for explicitly acknowledging
+ // the receipt of status updates that have 'update.status().uuid()'
+ // field set. Unacknowledged updates can be retried by the executor.
+ // They should also be sent by the executor whenever it
+ // re-subscribes.
+ message Acknowledged {
+ required TaskID task_id = 1;
+ required bytes uuid = 2;
+ }
+
+ // Received when a custom message generated by the scheduler is
+ // forwarded by the agent. Note that this message is not
+ // interpreted by Mesos and is only forwarded (without reliability
+ // guarantees) to the executor. It is up to the scheduler to retry
+ // if the message is dropped for any reason.
+ message Message {
+ required bytes data = 1;
+ }
+
+ // Received in case the executor sends invalid calls (e.g.,
+ // required values not set).
+ // TODO(arojas): Remove this once the old executor driver is no
+ // longer supported. With HTTP API all errors will be signaled via
+ // HTTP response codes.
+ message Error {
+ required string message = 1;
+ }
+
+ // Type of the event, indicates which optional field below should be
+ // present if that type has a nested message definition.
+ // Enum fields should be optional, see: MESOS-4997.
+ optional Type type = 1;
+
+ optional Subscribed subscribed = 2;
+ optional Acknowledged acknowledged = 3;
+ optional Launch launch = 4;
+ optional LaunchGroup launch_group = 8;
+ optional Kill kill = 5;
+ optional Message message = 6;
+ optional Error error = 7;
+}
+
+
+/**
+ * Executor call API.
+ *
+ * Like Event, a Call is described using the standard protocol buffer
+ * "union" trick (see above).
+ */
+ message Call {
+ // Possible call types, followed by message definitions if
+ // applicable.
+ enum Type {
+ // See comments above on `Event::Type` for more details on this enum value.
+ UNKNOWN = 0;
+
+ SUBSCRIBE = 1; // See 'Subscribe' below.
+ UPDATE = 2; // See 'Update' below.
+ MESSAGE = 3; // See 'Message' below.
+ }
+
+ // Request to subscribe with the agent. If subscribing after a disconnection,
+ // it must include a list of all the tasks and updates which haven't been
+ // acknowledged by the scheduler.
+ message Subscribe {
+ repeated TaskInfo unacknowledged_tasks = 1;
+ repeated Update unacknowledged_updates = 2;
+ }
+
+ // Notifies the scheduler that a task has transitioned from one
+ // state to another. Status updates should be used by executors
+ // to reliably communicate the status of the tasks that they
+ // manage. It is crucial that a terminal update (see TaskState
+ // in v1/mesos.proto) is sent to the scheduler as soon as the task
+ // terminates, in order for Mesos to release the resources allocated
+ // to the task. It is the responsibility of the scheduler to
+ // explicitly acknowledge the receipt of a status update. See
+ // 'Acknowledged' in the 'Events' section above for the semantics.
+ message Update {
+ required TaskStatus status = 1;
+ }
+
+ // Sends arbitrary binary data to the scheduler. Note that Mesos
+ // neither interprets this data nor makes any guarantees about the
+ // delivery of this message to the scheduler.
+ // See 'Message' in the 'Events' section.
+ message Message {
+ required bytes data = 2;
+ }
+
+ // Identifies the executor which generated this call.
+ required ExecutorID executor_id = 1;
+ required FrameworkID framework_id = 2;
+
+ // Type of the call, indicates which optional field below should be
+ // present if that type has a nested message definition.
+ // In case type is SUBSCRIBED, no message needs to be set.
+ // See comments on `Event::Type` above on the reasoning behind this
+ // field being optional.
+ optional Type type = 3;
+
+ optional Subscribe subscribe = 4;
+ optional Update update = 5;
+ optional Message message = 6;
+}
[03/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Mesos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Mesos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Mesos.java
new file mode 100644
index 0000000..f8842ce
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/scheduler/Mesos.java
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mesos.v1.scheduler;
+
+import org.apache.mesos.v1.scheduler.Protos.Call;
+
+/**
+ * Abstract interface for connecting a scheduler to Mesos. This interface
+ * is used to send Call's to Mesos (e.g., launch tasks, kill tasks, etc.).
+ */
+public interface Mesos {
+ /**
+ * Sends a Call to the Mesos master. The scheduler should only invoke this
+ * method once it has received the 'connected' callback. Otherwise, all calls
+ * would be dropped while disconnected.
+ *
+ * Some local validation of calls is performed which may generate
+ * events without ever being sent to the master.
+ *
+ * These comments are copied from include/mesos/v1/scheduler.hpp and should
+ * be kept in sync.
+ */
+ void send(Call call);
+
+ /**
+ * Force a reconnection with the Mesos master.
+ *
+ * In the case of a one-way network partition, the connection between the
+ * scheduler and master might not necessarily break. If the scheduler detects
+ * a partition, due to lack of `HEARTBEAT` events (e.g., 5) within a time
+ * window, it can explicitly ask the library to force a reconnection with
+ * the master.
+ *
+ * This call would be ignored if the scheduler is already disconnected with
+ * the master (e.g., no new master has been elected). Otherwise, the scheduler
+ * would get a 'disconnected' callback followed by a 'connected' callback.
+ *
+ * These comments are copied from include/mesos/v1/scheduler.hpp and should
+ * be kept in sync.
+ */
+ void reconnect();
+}
[05/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/v1/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/Protos.java
new file mode 100644
index 0000000..42cc10b
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/Protos.java
@@ -0,0 +1,162577 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/v1/mesos.proto
+
+package org.apache.mesos.v1;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ /**
+ * Protobuf enum {@code mesos.v1.Status}
+ *
+ * <pre>
+ **
+ * Status is used to indicate the state of the scheduler and executor
+ * driver after function calls.
+ * </pre>
+ */
+ public enum Status
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>DRIVER_NOT_STARTED = 1;</code>
+ */
+ DRIVER_NOT_STARTED(0, 1),
+ /**
+ * <code>DRIVER_RUNNING = 2;</code>
+ */
+ DRIVER_RUNNING(1, 2),
+ /**
+ * <code>DRIVER_ABORTED = 3;</code>
+ */
+ DRIVER_ABORTED(2, 3),
+ /**
+ * <code>DRIVER_STOPPED = 4;</code>
+ */
+ DRIVER_STOPPED(3, 4),
+ ;
+
+ /**
+ * <code>DRIVER_NOT_STARTED = 1;</code>
+ */
+ public static final int DRIVER_NOT_STARTED_VALUE = 1;
+ /**
+ * <code>DRIVER_RUNNING = 2;</code>
+ */
+ public static final int DRIVER_RUNNING_VALUE = 2;
+ /**
+ * <code>DRIVER_ABORTED = 3;</code>
+ */
+ public static final int DRIVER_ABORTED_VALUE = 3;
+ /**
+ * <code>DRIVER_STOPPED = 4;</code>
+ */
+ public static final int DRIVER_STOPPED_VALUE = 4;
+
+
+ public final int getNumber() { return value; }
+
+ public static Status valueOf(int value) {
+ switch (value) {
+ case 1: return DRIVER_NOT_STARTED;
+ case 2: return DRIVER_RUNNING;
+ case 3: return DRIVER_ABORTED;
+ case 4: return DRIVER_STOPPED;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Status>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<Status>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Status>() {
+ public Status findValueByNumber(int number) {
+ return Status.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Status[] VALUES = values();
+
+ public static Status valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private Status(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.v1.Status)
+ }
+
+ /**
+ * Protobuf enum {@code mesos.v1.TaskState}
+ *
+ * <pre>
+ **
+ * Describes possible task states. IMPORTANT: Mesos assumes tasks that
+ * enter terminal states (see below) imply the task is no longer
+ * running and thus clean up any thing associated with the task
+ * (ultimately offering any resources being consumed by that task to
+ * another task).
+ * </pre>
+ */
+ public enum TaskState
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>TASK_STAGING = 6;</code>
+ *
+ * <pre>
+ * Initial state. Framework status updates should not use.
+ * </pre>
+ */
+ TASK_STAGING(0, 6),
+ /**
+ * <code>TASK_STARTING = 0;</code>
+ *
+ * <pre>
+ * The task is being launched by the executor.
+ * </pre>
+ */
+ TASK_STARTING(1, 0),
+ /**
+ * <code>TASK_RUNNING = 1;</code>
+ */
+ TASK_RUNNING(2, 1),
+ /**
+ * <code>TASK_KILLING = 8;</code>
+ *
+ * <pre>
+ * NOTE: This should only be sent when the framework has
+ * the TASK_KILLING_STATE capability.
+ * </pre>
+ */
+ TASK_KILLING(3, 8),
+ /**
+ * <code>TASK_FINISHED = 2;</code>
+ *
+ * <pre>
+ * TERMINAL: The task finished successfully.
+ * </pre>
+ */
+ TASK_FINISHED(4, 2),
+ /**
+ * <code>TASK_FAILED = 3;</code>
+ *
+ * <pre>
+ * TERMINAL: The task failed to finish successfully.
+ * </pre>
+ */
+ TASK_FAILED(5, 3),
+ /**
+ * <code>TASK_KILLED = 4;</code>
+ *
+ * <pre>
+ * TERMINAL: The task was killed by the executor.
+ * </pre>
+ */
+ TASK_KILLED(6, 4),
+ /**
+ * <code>TASK_ERROR = 7;</code>
+ *
+ * <pre>
+ * TERMINAL: The task description contains an error.
+ * </pre>
+ */
+ TASK_ERROR(7, 7),
+ /**
+ * <code>TASK_LOST = 5;</code>
+ *
+ * <pre>
+ * In Mesos 1.3, this will only be sent when the framework does NOT
+ * opt-in to the PARTITION_AWARE capability.
+ *
+ * NOTE: This state is not always terminal. For example, tasks might
+ * transition from TASK_LOST to TASK_RUNNING or other states when a
+ * partitioned agent re-registers.
+ * </pre>
+ */
+ TASK_LOST(8, 5),
+ /**
+ * <code>TASK_DROPPED = 9;</code>
+ *
+ * <pre>
+ * The task failed to launch because of a transient error. The
+ * task's executor never started running. Unlike TASK_ERROR, the
+ * task description is valid -- attempting to launch the task again
+ * may be successful.
+ * </pre>
+ */
+ TASK_DROPPED(9, 9),
+ /**
+ * <code>TASK_UNREACHABLE = 10;</code>
+ *
+ * <pre>
+ * The task was running on an agent that has lost contact with the
+ * master, typically due to a network failure or partition. The task
+ * may or may not still be running.
+ * </pre>
+ */
+ TASK_UNREACHABLE(10, 10),
+ /**
+ * <code>TASK_GONE = 11;</code>
+ *
+ * <pre>
+ * The task is no longer running. This can occur if the agent has
+ * been terminated along with all of its tasks (e.g., the host that
+ * was running the agent was rebooted). It might also occur if the
+ * task was terminated due to an agent or containerizer error, or if
+ * the task was preempted by the QoS controller in an
+ * oversubscription scenario.
+ * </pre>
+ */
+ TASK_GONE(11, 11),
+ /**
+ * <code>TASK_GONE_BY_OPERATOR = 12;</code>
+ *
+ * <pre>
+ * The task was running on an agent that the master cannot contact;
+ * the operator has asserted that the agent has been shutdown, but
+ * this has not been directly confirmed by the master. If the
+ * operator is correct, the task is not running and this is a
+ * terminal state; if the operator is mistaken, the task may still
+ * be running and might return to RUNNING in the future.
+ * </pre>
+ */
+ TASK_GONE_BY_OPERATOR(12, 12),
+ /**
+ * <code>TASK_UNKNOWN = 13;</code>
+ *
+ * <pre>
+ * The master has no knowledge of the task. This is typically
+ * because either (a) the master never had knowledge of the task, or
+ * (b) the master forgot about the task because it garbage collected
+ * its metadata about the task. The task may or may not still be
+ * running.
+ * </pre>
+ */
+ TASK_UNKNOWN(13, 13),
+ ;
+
+ /**
+ * <code>TASK_STAGING = 6;</code>
+ *
+ * <pre>
+ * Initial state. Framework status updates should not use.
+ * </pre>
+ */
+ public static final int TASK_STAGING_VALUE = 6;
+ /**
+ * <code>TASK_STARTING = 0;</code>
+ *
+ * <pre>
+ * The task is being launched by the executor.
+ * </pre>
+ */
+ public static final int TASK_STARTING_VALUE = 0;
+ /**
+ * <code>TASK_RUNNING = 1;</code>
+ */
+ public static final int TASK_RUNNING_VALUE = 1;
+ /**
+ * <code>TASK_KILLING = 8;</code>
+ *
+ * <pre>
+ * NOTE: This should only be sent when the framework has
+ * the TASK_KILLING_STATE capability.
+ * </pre>
+ */
+ public static final int TASK_KILLING_VALUE = 8;
+ /**
+ * <code>TASK_FINISHED = 2;</code>
+ *
+ * <pre>
+ * TERMINAL: The task finished successfully.
+ * </pre>
+ */
+ public static final int TASK_FINISHED_VALUE = 2;
+ /**
+ * <code>TASK_FAILED = 3;</code>
+ *
+ * <pre>
+ * TERMINAL: The task failed to finish successfully.
+ * </pre>
+ */
+ public static final int TASK_FAILED_VALUE = 3;
+ /**
+ * <code>TASK_KILLED = 4;</code>
+ *
+ * <pre>
+ * TERMINAL: The task was killed by the executor.
+ * </pre>
+ */
+ public static final int TASK_KILLED_VALUE = 4;
+ /**
+ * <code>TASK_ERROR = 7;</code>
+ *
+ * <pre>
+ * TERMINAL: The task description contains an error.
+ * </pre>
+ */
+ public static final int TASK_ERROR_VALUE = 7;
+ /**
+ * <code>TASK_LOST = 5;</code>
+ *
+ * <pre>
+ * In Mesos 1.3, this will only be sent when the framework does NOT
+ * opt-in to the PARTITION_AWARE capability.
+ *
+ * NOTE: This state is not always terminal. For example, tasks might
+ * transition from TASK_LOST to TASK_RUNNING or other states when a
+ * partitioned agent re-registers.
+ * </pre>
+ */
+ public static final int TASK_LOST_VALUE = 5;
+ /**
+ * <code>TASK_DROPPED = 9;</code>
+ *
+ * <pre>
+ * The task failed to launch because of a transient error. The
+ * task's executor never started running. Unlike TASK_ERROR, the
+ * task description is valid -- attempting to launch the task again
+ * may be successful.
+ * </pre>
+ */
+ public static final int TASK_DROPPED_VALUE = 9;
+ /**
+ * <code>TASK_UNREACHABLE = 10;</code>
+ *
+ * <pre>
+ * The task was running on an agent that has lost contact with the
+ * master, typically due to a network failure or partition. The task
+ * may or may not still be running.
+ * </pre>
+ */
+ public static final int TASK_UNREACHABLE_VALUE = 10;
+ /**
+ * <code>TASK_GONE = 11;</code>
+ *
+ * <pre>
+ * The task is no longer running. This can occur if the agent has
+ * been terminated along with all of its tasks (e.g., the host that
+ * was running the agent was rebooted). It might also occur if the
+ * task was terminated due to an agent or containerizer error, or if
+ * the task was preempted by the QoS controller in an
+ * oversubscription scenario.
+ * </pre>
+ */
+ public static final int TASK_GONE_VALUE = 11;
+ /**
+ * <code>TASK_GONE_BY_OPERATOR = 12;</code>
+ *
+ * <pre>
+ * The task was running on an agent that the master cannot contact;
+ * the operator has asserted that the agent has been shutdown, but
+ * this has not been directly confirmed by the master. If the
+ * operator is correct, the task is not running and this is a
+ * terminal state; if the operator is mistaken, the task may still
+ * be running and might return to RUNNING in the future.
+ * </pre>
+ */
+ public static final int TASK_GONE_BY_OPERATOR_VALUE = 12;
+ /**
+ * <code>TASK_UNKNOWN = 13;</code>
+ *
+ * <pre>
+ * The master has no knowledge of the task. This is typically
+ * because either (a) the master never had knowledge of the task, or
+ * (b) the master forgot about the task because it garbage collected
+ * its metadata about the task. The task may or may not still be
+ * running.
+ * </pre>
+ */
+ public static final int TASK_UNKNOWN_VALUE = 13;
+
+
+ public final int getNumber() { return value; }
+
+ public static TaskState valueOf(int value) {
+ switch (value) {
+ case 6: return TASK_STAGING;
+ case 0: return TASK_STARTING;
+ case 1: return TASK_RUNNING;
+ case 8: return TASK_KILLING;
+ case 2: return TASK_FINISHED;
+ case 3: return TASK_FAILED;
+ case 4: return TASK_KILLED;
+ case 7: return TASK_ERROR;
+ case 5: return TASK_LOST;
+ case 9: return TASK_DROPPED;
+ case 10: return TASK_UNREACHABLE;
+ case 11: return TASK_GONE;
+ case 12: return TASK_GONE_BY_OPERATOR;
+ case 13: return TASK_UNKNOWN;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<TaskState>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<TaskState>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<TaskState>() {
+ public TaskState findValueByNumber(int number) {
+ return TaskState.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.getDescriptor().getEnumTypes().get(1);
+ }
+
+ private static final TaskState[] VALUES = values();
+
+ public static TaskState valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private TaskState(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.v1.TaskState)
+ }
+
+ public interface FrameworkIDOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.FrameworkID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to a framework. A framework can reuse this ID
+ * in order to do failover (see MesosSchedulerDriver).
+ * </pre>
+ */
+ public static final class FrameworkID extends
+ com.google.protobuf.GeneratedMessage
+ implements FrameworkIDOrBuilder {
+ // Use FrameworkID.newBuilder() to construct.
+ private FrameworkID(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private FrameworkID(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final FrameworkID defaultInstance;
+ public static FrameworkID getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public FrameworkID getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private FrameworkID(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ value_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_FrameworkID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_FrameworkID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.Protos.FrameworkID.class, org.apache.mesos.v1.Protos.FrameworkID.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<FrameworkID> PARSER =
+ new com.google.protobuf.AbstractParser<FrameworkID>() {
+ public FrameworkID parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new FrameworkID(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<FrameworkID> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ value_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ value_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getValueBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getValueBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.Protos.FrameworkID parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.Protos.FrameworkID parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.FrameworkID parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.Protos.FrameworkID parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.FrameworkID parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.FrameworkID parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.FrameworkID parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.FrameworkID parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.FrameworkID parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.FrameworkID parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.Protos.FrameworkID prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.FrameworkID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to a framework. A framework can reuse this ID
+ * in order to do failover (see MesosSchedulerDriver).
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.Protos.FrameworkIDOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_FrameworkID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_FrameworkID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.Protos.FrameworkID.class, org.apache.mesos.v1.Protos.FrameworkID.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.Protos.FrameworkID.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ value_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_FrameworkID_descriptor;
+ }
+
+ public org.apache.mesos.v1.Protos.FrameworkID getDefaultInstanceForType() {
+ return org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.Protos.FrameworkID build() {
+ org.apache.mesos.v1.Protos.FrameworkID result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.Protos.FrameworkID buildPartial() {
+ org.apache.mesos.v1.Protos.FrameworkID result = new org.apache.mesos.v1.Protos.FrameworkID(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.value_ = value_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.Protos.FrameworkID) {
+ return mergeFrom((org.apache.mesos.v1.Protos.FrameworkID)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.Protos.FrameworkID other) {
+ if (other == org.apache.mesos.v1.Protos.FrameworkID.getDefaultInstance()) return this;
+ if (other.hasValue()) {
+ bitField0_ |= 0x00000001;
+ value_ = other.value_;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasValue()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.Protos.FrameworkID parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.Protos.FrameworkID) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required string value = 1;
+ private java.lang.Object value_ = "";
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ value_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder clearValue() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.FrameworkID)
+ }
+
+ static {
+ defaultInstance = new FrameworkID(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.FrameworkID)
+ }
+
+ public interface OfferIDOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.OfferID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to an offer.
+ * </pre>
+ */
+ public static final class OfferID extends
+ com.google.protobuf.GeneratedMessage
+ implements OfferIDOrBuilder {
+ // Use OfferID.newBuilder() to construct.
+ private OfferID(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private OfferID(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final OfferID defaultInstance;
+ public static OfferID getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public OfferID getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private OfferID(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ value_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_OfferID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_OfferID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.Protos.OfferID.class, org.apache.mesos.v1.Protos.OfferID.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<OfferID> PARSER =
+ new com.google.protobuf.AbstractParser<OfferID>() {
+ public OfferID parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new OfferID(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<OfferID> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ value_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ value_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getValueBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getValueBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.Protos.OfferID parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.Protos.OfferID parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.OfferID parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.Protos.OfferID parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.OfferID parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.OfferID parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.OfferID parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.OfferID parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.OfferID parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.OfferID parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.Protos.OfferID prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.OfferID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to an offer.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.Protos.OfferIDOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_OfferID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_OfferID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.Protos.OfferID.class, org.apache.mesos.v1.Protos.OfferID.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.Protos.OfferID.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ value_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_OfferID_descriptor;
+ }
+
+ public org.apache.mesos.v1.Protos.OfferID getDefaultInstanceForType() {
+ return org.apache.mesos.v1.Protos.OfferID.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.Protos.OfferID build() {
+ org.apache.mesos.v1.Protos.OfferID result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.Protos.OfferID buildPartial() {
+ org.apache.mesos.v1.Protos.OfferID result = new org.apache.mesos.v1.Protos.OfferID(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.value_ = value_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.Protos.OfferID) {
+ return mergeFrom((org.apache.mesos.v1.Protos.OfferID)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.Protos.OfferID other) {
+ if (other == org.apache.mesos.v1.Protos.OfferID.getDefaultInstance()) return this;
+ if (other.hasValue()) {
+ bitField0_ |= 0x00000001;
+ value_ = other.value_;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasValue()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.Protos.OfferID parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.Protos.OfferID) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required string value = 1;
+ private java.lang.Object value_ = "";
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ value_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder clearValue() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.OfferID)
+ }
+
+ static {
+ defaultInstance = new OfferID(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.OfferID)
+ }
+
+ public interface AgentIDOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.AgentID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to an agent. Currently, an agent gets a new ID
+ * whenever it (re)registers with Mesos. Framework writers shouldn't
+ * assume any binding between an agent ID and and a hostname.
+ * </pre>
+ */
+ public static final class AgentID extends
+ com.google.protobuf.GeneratedMessage
+ implements AgentIDOrBuilder {
+ // Use AgentID.newBuilder() to construct.
+ private AgentID(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private AgentID(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final AgentID defaultInstance;
+ public static AgentID getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public AgentID getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private AgentID(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ value_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_AgentID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_AgentID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.Protos.AgentID.class, org.apache.mesos.v1.Protos.AgentID.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<AgentID> PARSER =
+ new com.google.protobuf.AbstractParser<AgentID>() {
+ public AgentID parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new AgentID(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<AgentID> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ value_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ value_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getValueBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getValueBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.Protos.AgentID parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.Protos.AgentID parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.AgentID parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.Protos.AgentID parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.AgentID parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.AgentID parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.AgentID parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.AgentID parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.AgentID parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.AgentID parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.Protos.AgentID prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.AgentID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to an agent. Currently, an agent gets a new ID
+ * whenever it (re)registers with Mesos. Framework writers shouldn't
+ * assume any binding between an agent ID and and a hostname.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.Protos.AgentIDOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_AgentID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_AgentID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.Protos.AgentID.class, org.apache.mesos.v1.Protos.AgentID.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.Protos.AgentID.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ value_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_AgentID_descriptor;
+ }
+
+ public org.apache.mesos.v1.Protos.AgentID getDefaultInstanceForType() {
+ return org.apache.mesos.v1.Protos.AgentID.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.Protos.AgentID build() {
+ org.apache.mesos.v1.Protos.AgentID result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.Protos.AgentID buildPartial() {
+ org.apache.mesos.v1.Protos.AgentID result = new org.apache.mesos.v1.Protos.AgentID(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.value_ = value_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.Protos.AgentID) {
+ return mergeFrom((org.apache.mesos.v1.Protos.AgentID)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.Protos.AgentID other) {
+ if (other == org.apache.mesos.v1.Protos.AgentID.getDefaultInstance()) return this;
+ if (other.hasValue()) {
+ bitField0_ |= 0x00000001;
+ value_ = other.value_;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasValue()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.Protos.AgentID parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.Protos.AgentID) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required string value = 1;
+ private java.lang.Object value_ = "";
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ value_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder clearValue() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.AgentID)
+ }
+
+ static {
+ defaultInstance = new AgentID(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.AgentID)
+ }
+
+ public interface TaskIDOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.TaskID}
+ *
+ * <pre>
+ **
+ * A framework-generated ID to distinguish a task. The ID must remain
+ * unique while the task is active. A framework can reuse an ID _only_
+ * if the previous task with the same ID has reached a terminal state
+ * (e.g., TASK_FINISHED, TASK_KILLED, etc.). However, reusing task IDs
+ * is strongly discouraged (MESOS-2198).
+ * </pre>
+ */
+ public static final class TaskID extends
+ com.google.protobuf.GeneratedMessage
+ implements TaskIDOrBuilder {
+ // Use TaskID.newBuilder() to construct.
+ private TaskID(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private TaskID(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final TaskID defaultInstance;
+ public static TaskID getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public TaskID getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private TaskID(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ value_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_TaskID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_TaskID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.Protos.TaskID.class, org.apache.mesos.v1.Protos.TaskID.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<TaskID> PARSER =
+ new com.google.protobuf.AbstractParser<TaskID>() {
+ public TaskID parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new TaskID(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<TaskID> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ value_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ value_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getValueBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getValueBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.Protos.TaskID parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.Protos.TaskID parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.TaskID parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.Protos.TaskID parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.TaskID parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.TaskID parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.TaskID parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.TaskID parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.Protos.TaskID parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.Protos.TaskID parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.Protos.TaskID prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.TaskID}
+ *
+ * <pre>
+ **
+ * A framework-generated ID to distinguish a task. The ID must remain
+ * unique while the task is active. A framework can reuse an ID _only_
+ * if the previous task with the same ID has reached a terminal state
+ * (e.g., TASK_FINISHED, TASK_KILLED, etc.). However, reusing task IDs
+ * is strongly discouraged (MESOS-2198).
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.Protos.TaskIDOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_TaskID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_TaskID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.Protos.TaskID.class, org.apache.mesos.v1.Protos.TaskID.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.Protos.TaskID.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ value_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_TaskID_descriptor;
+ }
+
+ public org.apache.mesos.v1.Protos.TaskID getDefaultInstanceForType() {
+ return org.apache.mesos.v1.Protos.TaskID.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.Protos.TaskID build() {
+ org.apache.mesos.v1.Protos.TaskID result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.Protos.TaskID buildPartial() {
+ org.apache.mesos.v1.Protos.TaskID result = new org.apache.mesos.v1.Protos.TaskID(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.value_ = value_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.Protos.TaskID) {
+ return mergeFrom((org.apache.mesos.v1.Protos.TaskID)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.Protos.TaskID other) {
+ if (other == org.apache.mesos.v1.Protos.TaskID.getDefaultInstance()) return this;
+ if (other.hasValue()) {
+ bitField0_ |= 0x00000001;
+ value_ = other.value_;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasValue()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.Protos.TaskID parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.Protos.TaskID) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required string value = 1;
+ private java.lang.Object value_ = "";
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ value_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder clearValue() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.TaskID)
+ }
+
+ static {
+ defaultInstance = new TaskID(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.TaskID)
+ }
+
+ public interface ExecutorIDOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.ExecutorID}
+ *
+ * <pre>
+ **
+ * A framework-generated ID to distinguish an executor. Only one
+ * executor with the same ID can be active on the same agent at a
+ * time. However, reusing executor IDs is discouraged.
+ * </pre>
+ */
+ public static final class ExecutorID extends
+ com.google.protobuf.GeneratedMessage
+ implements ExecutorIDOrBuilder {
+ // Use ExecutorID.newBuilder() to construct.
+ private ExecutorID(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private ExecutorID(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final ExecutorID defaultInstance;
+ public static ExecutorID getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public ExecutorID getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private ExecutorID(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ value_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_ExecutorID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.Protos.internal_static_mesos_v1_ExecutorID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.Protos.ExecutorID.class, org.apache.mesos.v1.Protos.ExecutorID.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<ExecutorID> PARSER =
+ new com.google.protobuf.AbstractParser<ExecutorID>() {
+ public ExecutorID parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new ExecutorID(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<ExecutorID> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ value_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ value_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getValueBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getValueBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache
<TRUNCATED>
[10/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/Protos.java
new file mode 100644
index 0000000..6a97384
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/Protos.java
@@ -0,0 +1,162923 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/mesos.proto
+
+package org.apache.mesos;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ /**
+ * Protobuf enum {@code mesos.Status}
+ *
+ * <pre>
+ **
+ * Status is used to indicate the state of the scheduler and executor
+ * driver after function calls.
+ * </pre>
+ */
+ public enum Status
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>DRIVER_NOT_STARTED = 1;</code>
+ */
+ DRIVER_NOT_STARTED(0, 1),
+ /**
+ * <code>DRIVER_RUNNING = 2;</code>
+ */
+ DRIVER_RUNNING(1, 2),
+ /**
+ * <code>DRIVER_ABORTED = 3;</code>
+ */
+ DRIVER_ABORTED(2, 3),
+ /**
+ * <code>DRIVER_STOPPED = 4;</code>
+ */
+ DRIVER_STOPPED(3, 4),
+ ;
+
+ /**
+ * <code>DRIVER_NOT_STARTED = 1;</code>
+ */
+ public static final int DRIVER_NOT_STARTED_VALUE = 1;
+ /**
+ * <code>DRIVER_RUNNING = 2;</code>
+ */
+ public static final int DRIVER_RUNNING_VALUE = 2;
+ /**
+ * <code>DRIVER_ABORTED = 3;</code>
+ */
+ public static final int DRIVER_ABORTED_VALUE = 3;
+ /**
+ * <code>DRIVER_STOPPED = 4;</code>
+ */
+ public static final int DRIVER_STOPPED_VALUE = 4;
+
+
+ public final int getNumber() { return value; }
+
+ public static Status valueOf(int value) {
+ switch (value) {
+ case 1: return DRIVER_NOT_STARTED;
+ case 2: return DRIVER_RUNNING;
+ case 3: return DRIVER_ABORTED;
+ case 4: return DRIVER_STOPPED;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Status>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<Status>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Status>() {
+ public Status findValueByNumber(int number) {
+ return Status.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Status[] VALUES = values();
+
+ public static Status valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private Status(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.Status)
+ }
+
+ /**
+ * Protobuf enum {@code mesos.TaskState}
+ *
+ * <pre>
+ **
+ * Describes possible task states. IMPORTANT: Mesos assumes tasks that
+ * enter terminal states (see below) imply the task is no longer
+ * running and thus clean up any thing associated with the task
+ * (ultimately offering any resources being consumed by that task to
+ * another task).
+ * </pre>
+ */
+ public enum TaskState
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>TASK_STAGING = 6;</code>
+ *
+ * <pre>
+ * Initial state. Framework status updates should not use.
+ * </pre>
+ */
+ TASK_STAGING(0, 6),
+ /**
+ * <code>TASK_STARTING = 0;</code>
+ *
+ * <pre>
+ * The task is being launched by the executor.
+ * </pre>
+ */
+ TASK_STARTING(1, 0),
+ /**
+ * <code>TASK_RUNNING = 1;</code>
+ */
+ TASK_RUNNING(2, 1),
+ /**
+ * <code>TASK_KILLING = 8;</code>
+ *
+ * <pre>
+ * NOTE: This should only be sent when the framework has
+ * the TASK_KILLING_STATE capability.
+ * </pre>
+ */
+ TASK_KILLING(3, 8),
+ /**
+ * <code>TASK_FINISHED = 2;</code>
+ *
+ * <pre>
+ * TERMINAL: The task finished successfully.
+ * </pre>
+ */
+ TASK_FINISHED(4, 2),
+ /**
+ * <code>TASK_FAILED = 3;</code>
+ *
+ * <pre>
+ * TERMINAL: The task failed to finish successfully.
+ * </pre>
+ */
+ TASK_FAILED(5, 3),
+ /**
+ * <code>TASK_KILLED = 4;</code>
+ *
+ * <pre>
+ * TERMINAL: The task was killed by the executor.
+ * </pre>
+ */
+ TASK_KILLED(6, 4),
+ /**
+ * <code>TASK_ERROR = 7;</code>
+ *
+ * <pre>
+ * TERMINAL: The task description contains an error.
+ * </pre>
+ */
+ TASK_ERROR(7, 7),
+ /**
+ * <code>TASK_LOST = 5;</code>
+ *
+ * <pre>
+ * In Mesos 1.3, this will only be sent when the framework does NOT
+ * opt-in to the PARTITION_AWARE capability.
+ *
+ * NOTE: This state is not always terminal. For example, tasks might
+ * transition from TASK_LOST to TASK_RUNNING or other states when a
+ * partitioned agent re-registers.
+ * </pre>
+ */
+ TASK_LOST(8, 5),
+ /**
+ * <code>TASK_DROPPED = 9;</code>
+ *
+ * <pre>
+ * The task failed to launch because of a transient error. The
+ * task's executor never started running. Unlike TASK_ERROR, the
+ * task description is valid -- attempting to launch the task again
+ * may be successful.
+ * </pre>
+ */
+ TASK_DROPPED(9, 9),
+ /**
+ * <code>TASK_UNREACHABLE = 10;</code>
+ *
+ * <pre>
+ * The task was running on an agent that has lost contact with the
+ * master, typically due to a network failure or partition. The task
+ * may or may not still be running.
+ * </pre>
+ */
+ TASK_UNREACHABLE(10, 10),
+ /**
+ * <code>TASK_GONE = 11;</code>
+ *
+ * <pre>
+ * The task is no longer running. This can occur if the agent has
+ * been terminated along with all of its tasks (e.g., the host that
+ * was running the agent was rebooted). It might also occur if the
+ * task was terminated due to an agent or containerizer error, or if
+ * the task was preempted by the QoS controller in an
+ * oversubscription scenario.
+ * </pre>
+ */
+ TASK_GONE(11, 11),
+ /**
+ * <code>TASK_GONE_BY_OPERATOR = 12;</code>
+ *
+ * <pre>
+ * The task was running on an agent that the master cannot contact;
+ * the operator has asserted that the agent has been shutdown, but
+ * this has not been directly confirmed by the master. If the
+ * operator is correct, the task is not running and this is a
+ * terminal state; if the operator is mistaken, the task may still
+ * be running and might return to RUNNING in the future.
+ * </pre>
+ */
+ TASK_GONE_BY_OPERATOR(12, 12),
+ /**
+ * <code>TASK_UNKNOWN = 13;</code>
+ *
+ * <pre>
+ * The master has no knowledge of the task. This is typically
+ * because either (a) the master never had knowledge of the task, or
+ * (b) the master forgot about the task because it garbage collected
+ * its metadata about the task. The task may or may not still be
+ * running.
+ * </pre>
+ */
+ TASK_UNKNOWN(13, 13),
+ ;
+
+ /**
+ * <code>TASK_STAGING = 6;</code>
+ *
+ * <pre>
+ * Initial state. Framework status updates should not use.
+ * </pre>
+ */
+ public static final int TASK_STAGING_VALUE = 6;
+ /**
+ * <code>TASK_STARTING = 0;</code>
+ *
+ * <pre>
+ * The task is being launched by the executor.
+ * </pre>
+ */
+ public static final int TASK_STARTING_VALUE = 0;
+ /**
+ * <code>TASK_RUNNING = 1;</code>
+ */
+ public static final int TASK_RUNNING_VALUE = 1;
+ /**
+ * <code>TASK_KILLING = 8;</code>
+ *
+ * <pre>
+ * NOTE: This should only be sent when the framework has
+ * the TASK_KILLING_STATE capability.
+ * </pre>
+ */
+ public static final int TASK_KILLING_VALUE = 8;
+ /**
+ * <code>TASK_FINISHED = 2;</code>
+ *
+ * <pre>
+ * TERMINAL: The task finished successfully.
+ * </pre>
+ */
+ public static final int TASK_FINISHED_VALUE = 2;
+ /**
+ * <code>TASK_FAILED = 3;</code>
+ *
+ * <pre>
+ * TERMINAL: The task failed to finish successfully.
+ * </pre>
+ */
+ public static final int TASK_FAILED_VALUE = 3;
+ /**
+ * <code>TASK_KILLED = 4;</code>
+ *
+ * <pre>
+ * TERMINAL: The task was killed by the executor.
+ * </pre>
+ */
+ public static final int TASK_KILLED_VALUE = 4;
+ /**
+ * <code>TASK_ERROR = 7;</code>
+ *
+ * <pre>
+ * TERMINAL: The task description contains an error.
+ * </pre>
+ */
+ public static final int TASK_ERROR_VALUE = 7;
+ /**
+ * <code>TASK_LOST = 5;</code>
+ *
+ * <pre>
+ * In Mesos 1.3, this will only be sent when the framework does NOT
+ * opt-in to the PARTITION_AWARE capability.
+ *
+ * NOTE: This state is not always terminal. For example, tasks might
+ * transition from TASK_LOST to TASK_RUNNING or other states when a
+ * partitioned agent re-registers.
+ * </pre>
+ */
+ public static final int TASK_LOST_VALUE = 5;
+ /**
+ * <code>TASK_DROPPED = 9;</code>
+ *
+ * <pre>
+ * The task failed to launch because of a transient error. The
+ * task's executor never started running. Unlike TASK_ERROR, the
+ * task description is valid -- attempting to launch the task again
+ * may be successful.
+ * </pre>
+ */
+ public static final int TASK_DROPPED_VALUE = 9;
+ /**
+ * <code>TASK_UNREACHABLE = 10;</code>
+ *
+ * <pre>
+ * The task was running on an agent that has lost contact with the
+ * master, typically due to a network failure or partition. The task
+ * may or may not still be running.
+ * </pre>
+ */
+ public static final int TASK_UNREACHABLE_VALUE = 10;
+ /**
+ * <code>TASK_GONE = 11;</code>
+ *
+ * <pre>
+ * The task is no longer running. This can occur if the agent has
+ * been terminated along with all of its tasks (e.g., the host that
+ * was running the agent was rebooted). It might also occur if the
+ * task was terminated due to an agent or containerizer error, or if
+ * the task was preempted by the QoS controller in an
+ * oversubscription scenario.
+ * </pre>
+ */
+ public static final int TASK_GONE_VALUE = 11;
+ /**
+ * <code>TASK_GONE_BY_OPERATOR = 12;</code>
+ *
+ * <pre>
+ * The task was running on an agent that the master cannot contact;
+ * the operator has asserted that the agent has been shutdown, but
+ * this has not been directly confirmed by the master. If the
+ * operator is correct, the task is not running and this is a
+ * terminal state; if the operator is mistaken, the task may still
+ * be running and might return to RUNNING in the future.
+ * </pre>
+ */
+ public static final int TASK_GONE_BY_OPERATOR_VALUE = 12;
+ /**
+ * <code>TASK_UNKNOWN = 13;</code>
+ *
+ * <pre>
+ * The master has no knowledge of the task. This is typically
+ * because either (a) the master never had knowledge of the task, or
+ * (b) the master forgot about the task because it garbage collected
+ * its metadata about the task. The task may or may not still be
+ * running.
+ * </pre>
+ */
+ public static final int TASK_UNKNOWN_VALUE = 13;
+
+
+ public final int getNumber() { return value; }
+
+ public static TaskState valueOf(int value) {
+ switch (value) {
+ case 6: return TASK_STAGING;
+ case 0: return TASK_STARTING;
+ case 1: return TASK_RUNNING;
+ case 8: return TASK_KILLING;
+ case 2: return TASK_FINISHED;
+ case 3: return TASK_FAILED;
+ case 4: return TASK_KILLED;
+ case 7: return TASK_ERROR;
+ case 5: return TASK_LOST;
+ case 9: return TASK_DROPPED;
+ case 10: return TASK_UNREACHABLE;
+ case 11: return TASK_GONE;
+ case 12: return TASK_GONE_BY_OPERATOR;
+ case 13: return TASK_UNKNOWN;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<TaskState>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<TaskState>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<TaskState>() {
+ public TaskState findValueByNumber(int number) {
+ return TaskState.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.getDescriptor().getEnumTypes().get(1);
+ }
+
+ private static final TaskState[] VALUES = values();
+
+ public static TaskState valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private TaskState(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.TaskState)
+ }
+
+ public interface FrameworkIDOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.FrameworkID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to a framework. A framework can reuse this ID
+ * in order to do failover (see MesosSchedulerDriver).
+ * </pre>
+ */
+ public static final class FrameworkID extends
+ com.google.protobuf.GeneratedMessage
+ implements FrameworkIDOrBuilder {
+ // Use FrameworkID.newBuilder() to construct.
+ private FrameworkID(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private FrameworkID(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final FrameworkID defaultInstance;
+ public static FrameworkID getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public FrameworkID getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private FrameworkID(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ value_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.internal_static_mesos_FrameworkID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.Protos.internal_static_mesos_FrameworkID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.Protos.FrameworkID.class, org.apache.mesos.Protos.FrameworkID.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<FrameworkID> PARSER =
+ new com.google.protobuf.AbstractParser<FrameworkID>() {
+ public FrameworkID parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new FrameworkID(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<FrameworkID> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ value_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ value_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getValueBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getValueBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.Protos.FrameworkID parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.Protos.FrameworkID parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.FrameworkID parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.Protos.FrameworkID parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.FrameworkID parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.Protos.FrameworkID parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.FrameworkID parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.Protos.FrameworkID parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.FrameworkID parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.Protos.FrameworkID parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.Protos.FrameworkID prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.FrameworkID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to a framework. A framework can reuse this ID
+ * in order to do failover (see MesosSchedulerDriver).
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.Protos.FrameworkIDOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.internal_static_mesos_FrameworkID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.Protos.internal_static_mesos_FrameworkID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.Protos.FrameworkID.class, org.apache.mesos.Protos.FrameworkID.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.Protos.FrameworkID.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ value_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.Protos.internal_static_mesos_FrameworkID_descriptor;
+ }
+
+ public org.apache.mesos.Protos.FrameworkID getDefaultInstanceForType() {
+ return org.apache.mesos.Protos.FrameworkID.getDefaultInstance();
+ }
+
+ public org.apache.mesos.Protos.FrameworkID build() {
+ org.apache.mesos.Protos.FrameworkID result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.Protos.FrameworkID buildPartial() {
+ org.apache.mesos.Protos.FrameworkID result = new org.apache.mesos.Protos.FrameworkID(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.value_ = value_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.Protos.FrameworkID) {
+ return mergeFrom((org.apache.mesos.Protos.FrameworkID)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.Protos.FrameworkID other) {
+ if (other == org.apache.mesos.Protos.FrameworkID.getDefaultInstance()) return this;
+ if (other.hasValue()) {
+ bitField0_ |= 0x00000001;
+ value_ = other.value_;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasValue()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.Protos.FrameworkID parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.Protos.FrameworkID) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required string value = 1;
+ private java.lang.Object value_ = "";
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ value_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder clearValue() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.FrameworkID)
+ }
+
+ static {
+ defaultInstance = new FrameworkID(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.FrameworkID)
+ }
+
+ public interface OfferIDOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.OfferID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to an offer.
+ * </pre>
+ */
+ public static final class OfferID extends
+ com.google.protobuf.GeneratedMessage
+ implements OfferIDOrBuilder {
+ // Use OfferID.newBuilder() to construct.
+ private OfferID(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private OfferID(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final OfferID defaultInstance;
+ public static OfferID getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public OfferID getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private OfferID(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ value_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.internal_static_mesos_OfferID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.Protos.internal_static_mesos_OfferID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.Protos.OfferID.class, org.apache.mesos.Protos.OfferID.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<OfferID> PARSER =
+ new com.google.protobuf.AbstractParser<OfferID>() {
+ public OfferID parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new OfferID(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<OfferID> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ value_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ value_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getValueBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getValueBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.Protos.OfferID parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.Protos.OfferID parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.OfferID parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.Protos.OfferID parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.OfferID parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.Protos.OfferID parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.OfferID parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.Protos.OfferID parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.OfferID parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.Protos.OfferID parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.Protos.OfferID prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.OfferID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to an offer.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.Protos.OfferIDOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.internal_static_mesos_OfferID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.Protos.internal_static_mesos_OfferID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.Protos.OfferID.class, org.apache.mesos.Protos.OfferID.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.Protos.OfferID.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ value_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.Protos.internal_static_mesos_OfferID_descriptor;
+ }
+
+ public org.apache.mesos.Protos.OfferID getDefaultInstanceForType() {
+ return org.apache.mesos.Protos.OfferID.getDefaultInstance();
+ }
+
+ public org.apache.mesos.Protos.OfferID build() {
+ org.apache.mesos.Protos.OfferID result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.Protos.OfferID buildPartial() {
+ org.apache.mesos.Protos.OfferID result = new org.apache.mesos.Protos.OfferID(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.value_ = value_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.Protos.OfferID) {
+ return mergeFrom((org.apache.mesos.Protos.OfferID)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.Protos.OfferID other) {
+ if (other == org.apache.mesos.Protos.OfferID.getDefaultInstance()) return this;
+ if (other.hasValue()) {
+ bitField0_ |= 0x00000001;
+ value_ = other.value_;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasValue()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.Protos.OfferID parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.Protos.OfferID) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required string value = 1;
+ private java.lang.Object value_ = "";
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ value_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder clearValue() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.OfferID)
+ }
+
+ static {
+ defaultInstance = new OfferID(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.OfferID)
+ }
+
+ public interface SlaveIDOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.SlaveID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to a slave. Currently, a slave gets a new ID
+ * whenever it (re)registers with Mesos. Framework writers shouldn't
+ * assume any binding between a slave ID and and a hostname.
+ * </pre>
+ */
+ public static final class SlaveID extends
+ com.google.protobuf.GeneratedMessage
+ implements SlaveIDOrBuilder {
+ // Use SlaveID.newBuilder() to construct.
+ private SlaveID(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private SlaveID(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final SlaveID defaultInstance;
+ public static SlaveID getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public SlaveID getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private SlaveID(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ value_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.internal_static_mesos_SlaveID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.Protos.internal_static_mesos_SlaveID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.Protos.SlaveID.class, org.apache.mesos.Protos.SlaveID.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<SlaveID> PARSER =
+ new com.google.protobuf.AbstractParser<SlaveID>() {
+ public SlaveID parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new SlaveID(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<SlaveID> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ value_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ value_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getValueBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getValueBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.Protos.SlaveID parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.Protos.SlaveID parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.SlaveID parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.Protos.SlaveID parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.SlaveID parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.Protos.SlaveID parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.SlaveID parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.Protos.SlaveID parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.SlaveID parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.Protos.SlaveID parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.Protos.SlaveID prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.SlaveID}
+ *
+ * <pre>
+ **
+ * A unique ID assigned to a slave. Currently, a slave gets a new ID
+ * whenever it (re)registers with Mesos. Framework writers shouldn't
+ * assume any binding between a slave ID and and a hostname.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.Protos.SlaveIDOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.internal_static_mesos_SlaveID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.Protos.internal_static_mesos_SlaveID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.Protos.SlaveID.class, org.apache.mesos.Protos.SlaveID.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.Protos.SlaveID.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ value_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.Protos.internal_static_mesos_SlaveID_descriptor;
+ }
+
+ public org.apache.mesos.Protos.SlaveID getDefaultInstanceForType() {
+ return org.apache.mesos.Protos.SlaveID.getDefaultInstance();
+ }
+
+ public org.apache.mesos.Protos.SlaveID build() {
+ org.apache.mesos.Protos.SlaveID result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.Protos.SlaveID buildPartial() {
+ org.apache.mesos.Protos.SlaveID result = new org.apache.mesos.Protos.SlaveID(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.value_ = value_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.Protos.SlaveID) {
+ return mergeFrom((org.apache.mesos.Protos.SlaveID)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.Protos.SlaveID other) {
+ if (other == org.apache.mesos.Protos.SlaveID.getDefaultInstance()) return this;
+ if (other.hasValue()) {
+ bitField0_ |= 0x00000001;
+ value_ = other.value_;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasValue()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.Protos.SlaveID parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.Protos.SlaveID) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required string value = 1;
+ private java.lang.Object value_ = "";
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ value_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder clearValue() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.SlaveID)
+ }
+
+ static {
+ defaultInstance = new SlaveID(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.SlaveID)
+ }
+
+ public interface TaskIDOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.TaskID}
+ *
+ * <pre>
+ **
+ * A framework-generated ID to distinguish a task. The ID must remain
+ * unique while the task is active. A framework can reuse an ID _only_
+ * if the previous task with the same ID has reached a terminal state
+ * (e.g., TASK_FINISHED, TASK_KILLED, etc.). However, reusing task IDs
+ * is strongly discouraged (MESOS-2198).
+ * </pre>
+ */
+ public static final class TaskID extends
+ com.google.protobuf.GeneratedMessage
+ implements TaskIDOrBuilder {
+ // Use TaskID.newBuilder() to construct.
+ private TaskID(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private TaskID(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final TaskID defaultInstance;
+ public static TaskID getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public TaskID getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private TaskID(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ value_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.internal_static_mesos_TaskID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.Protos.internal_static_mesos_TaskID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.Protos.TaskID.class, org.apache.mesos.Protos.TaskID.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<TaskID> PARSER =
+ new com.google.protobuf.AbstractParser<TaskID>() {
+ public TaskID parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new TaskID(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<TaskID> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ value_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ value_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getValueBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getValueBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.Protos.TaskID parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.Protos.TaskID parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.TaskID parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.Protos.TaskID parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.TaskID parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.Protos.TaskID parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.TaskID parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.Protos.TaskID parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.TaskID parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.Protos.TaskID parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.Protos.TaskID prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.TaskID}
+ *
+ * <pre>
+ **
+ * A framework-generated ID to distinguish a task. The ID must remain
+ * unique while the task is active. A framework can reuse an ID _only_
+ * if the previous task with the same ID has reached a terminal state
+ * (e.g., TASK_FINISHED, TASK_KILLED, etc.). However, reusing task IDs
+ * is strongly discouraged (MESOS-2198).
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.Protos.TaskIDOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.internal_static_mesos_TaskID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.Protos.internal_static_mesos_TaskID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.Protos.TaskID.class, org.apache.mesos.Protos.TaskID.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.Protos.TaskID.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ value_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.Protos.internal_static_mesos_TaskID_descriptor;
+ }
+
+ public org.apache.mesos.Protos.TaskID getDefaultInstanceForType() {
+ return org.apache.mesos.Protos.TaskID.getDefaultInstance();
+ }
+
+ public org.apache.mesos.Protos.TaskID build() {
+ org.apache.mesos.Protos.TaskID result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.Protos.TaskID buildPartial() {
+ org.apache.mesos.Protos.TaskID result = new org.apache.mesos.Protos.TaskID(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.value_ = value_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.Protos.TaskID) {
+ return mergeFrom((org.apache.mesos.Protos.TaskID)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.Protos.TaskID other) {
+ if (other == org.apache.mesos.Protos.TaskID.getDefaultInstance()) return this;
+ if (other.hasValue()) {
+ bitField0_ |= 0x00000001;
+ value_ = other.value_;
+ onChanged();
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasValue()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.Protos.TaskID parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.Protos.TaskID) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required string value = 1;
+ private java.lang.Object value_ = "";
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ value_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder clearValue() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.TaskID)
+ }
+
+ static {
+ defaultInstance = new TaskID(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.TaskID)
+ }
+
+ public interface ExecutorIDOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+ }
+ /**
+ * Protobuf type {@code mesos.ExecutorID}
+ *
+ * <pre>
+ **
+ * A framework-generated ID to distinguish an executor. Only one
+ * executor with the same ID can be active on the same slave at a
+ * time. However, reusing executor IDs is discouraged.
+ * </pre>
+ */
+ public static final class ExecutorID extends
+ com.google.protobuf.GeneratedMessage
+ implements ExecutorIDOrBuilder {
+ // Use ExecutorID.newBuilder() to construct.
+ private ExecutorID(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private ExecutorID(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final ExecutorID defaultInstance;
+ public static ExecutorID getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public ExecutorID getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private ExecutorID(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ value_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.Protos.internal_static_mesos_ExecutorID_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.Protos.internal_static_mesos_ExecutorID_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.Protos.ExecutorID.class, org.apache.mesos.Protos.ExecutorID.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<ExecutorID> PARSER =
+ new com.google.protobuf.AbstractParser<ExecutorID>() {
+ public ExecutorID parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new ExecutorID(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<ExecutorID> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public java.lang.String getValue() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ value_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueBytes() {
+ java.lang.Object ref = value_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ value_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ value_ = "";
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getValueBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getValueBytes());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.Protos.ExecutorID parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.Protos.ExecutorID parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.Protos.ExecutorID parseFrom(byte[] data)
+
<TRUNCATED>
[18/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/src/main/java/org/apache/mesos/v1/master/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/master/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/master/Protos.java
new file mode 100644
index 0000000..d5d62a8
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/master/Protos.java
@@ -0,0 +1,48707 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/v1/master/master.proto
+
+package org.apache.mesos.v1.master;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface CallOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.v1.master.Call.Type type = 1;
+ /**
+ * <code>optional .mesos.v1.master.Call.Type type = 1;</code>
+ */
+ boolean hasType();
+ /**
+ * <code>optional .mesos.v1.master.Call.Type type = 1;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.Type getType();
+
+ // optional .mesos.v1.master.Call.GetMetrics get_metrics = 2;
+ /**
+ * <code>optional .mesos.v1.master.Call.GetMetrics get_metrics = 2;</code>
+ */
+ boolean hasGetMetrics();
+ /**
+ * <code>optional .mesos.v1.master.Call.GetMetrics get_metrics = 2;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.GetMetrics getGetMetrics();
+ /**
+ * <code>optional .mesos.v1.master.Call.GetMetrics get_metrics = 2;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.GetMetricsOrBuilder getGetMetricsOrBuilder();
+
+ // optional .mesos.v1.master.Call.SetLoggingLevel set_logging_level = 3;
+ /**
+ * <code>optional .mesos.v1.master.Call.SetLoggingLevel set_logging_level = 3;</code>
+ */
+ boolean hasSetLoggingLevel();
+ /**
+ * <code>optional .mesos.v1.master.Call.SetLoggingLevel set_logging_level = 3;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel getSetLoggingLevel();
+ /**
+ * <code>optional .mesos.v1.master.Call.SetLoggingLevel set_logging_level = 3;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.SetLoggingLevelOrBuilder getSetLoggingLevelOrBuilder();
+
+ // optional .mesos.v1.master.Call.ListFiles list_files = 4;
+ /**
+ * <code>optional .mesos.v1.master.Call.ListFiles list_files = 4;</code>
+ */
+ boolean hasListFiles();
+ /**
+ * <code>optional .mesos.v1.master.Call.ListFiles list_files = 4;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.ListFiles getListFiles();
+ /**
+ * <code>optional .mesos.v1.master.Call.ListFiles list_files = 4;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.ListFilesOrBuilder getListFilesOrBuilder();
+
+ // optional .mesos.v1.master.Call.ReadFile read_file = 5;
+ /**
+ * <code>optional .mesos.v1.master.Call.ReadFile read_file = 5;</code>
+ */
+ boolean hasReadFile();
+ /**
+ * <code>optional .mesos.v1.master.Call.ReadFile read_file = 5;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.ReadFile getReadFile();
+ /**
+ * <code>optional .mesos.v1.master.Call.ReadFile read_file = 5;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.ReadFileOrBuilder getReadFileOrBuilder();
+
+ // optional .mesos.v1.master.Call.UpdateWeights update_weights = 6;
+ /**
+ * <code>optional .mesos.v1.master.Call.UpdateWeights update_weights = 6;</code>
+ */
+ boolean hasUpdateWeights();
+ /**
+ * <code>optional .mesos.v1.master.Call.UpdateWeights update_weights = 6;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.UpdateWeights getUpdateWeights();
+ /**
+ * <code>optional .mesos.v1.master.Call.UpdateWeights update_weights = 6;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.UpdateWeightsOrBuilder getUpdateWeightsOrBuilder();
+
+ // optional .mesos.v1.master.Call.ReserveResources reserve_resources = 7;
+ /**
+ * <code>optional .mesos.v1.master.Call.ReserveResources reserve_resources = 7;</code>
+ */
+ boolean hasReserveResources();
+ /**
+ * <code>optional .mesos.v1.master.Call.ReserveResources reserve_resources = 7;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.ReserveResources getReserveResources();
+ /**
+ * <code>optional .mesos.v1.master.Call.ReserveResources reserve_resources = 7;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.ReserveResourcesOrBuilder getReserveResourcesOrBuilder();
+
+ // optional .mesos.v1.master.Call.UnreserveResources unreserve_resources = 8;
+ /**
+ * <code>optional .mesos.v1.master.Call.UnreserveResources unreserve_resources = 8;</code>
+ */
+ boolean hasUnreserveResources();
+ /**
+ * <code>optional .mesos.v1.master.Call.UnreserveResources unreserve_resources = 8;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.UnreserveResources getUnreserveResources();
+ /**
+ * <code>optional .mesos.v1.master.Call.UnreserveResources unreserve_resources = 8;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.UnreserveResourcesOrBuilder getUnreserveResourcesOrBuilder();
+
+ // optional .mesos.v1.master.Call.CreateVolumes create_volumes = 9;
+ /**
+ * <code>optional .mesos.v1.master.Call.CreateVolumes create_volumes = 9;</code>
+ */
+ boolean hasCreateVolumes();
+ /**
+ * <code>optional .mesos.v1.master.Call.CreateVolumes create_volumes = 9;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.CreateVolumes getCreateVolumes();
+ /**
+ * <code>optional .mesos.v1.master.Call.CreateVolumes create_volumes = 9;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.CreateVolumesOrBuilder getCreateVolumesOrBuilder();
+
+ // optional .mesos.v1.master.Call.DestroyVolumes destroy_volumes = 10;
+ /**
+ * <code>optional .mesos.v1.master.Call.DestroyVolumes destroy_volumes = 10;</code>
+ */
+ boolean hasDestroyVolumes();
+ /**
+ * <code>optional .mesos.v1.master.Call.DestroyVolumes destroy_volumes = 10;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.DestroyVolumes getDestroyVolumes();
+ /**
+ * <code>optional .mesos.v1.master.Call.DestroyVolumes destroy_volumes = 10;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.DestroyVolumesOrBuilder getDestroyVolumesOrBuilder();
+
+ // optional .mesos.v1.master.Call.UpdateMaintenanceSchedule update_maintenance_schedule = 11;
+ /**
+ * <code>optional .mesos.v1.master.Call.UpdateMaintenanceSchedule update_maintenance_schedule = 11;</code>
+ */
+ boolean hasUpdateMaintenanceSchedule();
+ /**
+ * <code>optional .mesos.v1.master.Call.UpdateMaintenanceSchedule update_maintenance_schedule = 11;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.UpdateMaintenanceSchedule getUpdateMaintenanceSchedule();
+ /**
+ * <code>optional .mesos.v1.master.Call.UpdateMaintenanceSchedule update_maintenance_schedule = 11;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.UpdateMaintenanceScheduleOrBuilder getUpdateMaintenanceScheduleOrBuilder();
+
+ // optional .mesos.v1.master.Call.StartMaintenance start_maintenance = 12;
+ /**
+ * <code>optional .mesos.v1.master.Call.StartMaintenance start_maintenance = 12;</code>
+ */
+ boolean hasStartMaintenance();
+ /**
+ * <code>optional .mesos.v1.master.Call.StartMaintenance start_maintenance = 12;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.StartMaintenance getStartMaintenance();
+ /**
+ * <code>optional .mesos.v1.master.Call.StartMaintenance start_maintenance = 12;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.StartMaintenanceOrBuilder getStartMaintenanceOrBuilder();
+
+ // optional .mesos.v1.master.Call.StopMaintenance stop_maintenance = 13;
+ /**
+ * <code>optional .mesos.v1.master.Call.StopMaintenance stop_maintenance = 13;</code>
+ */
+ boolean hasStopMaintenance();
+ /**
+ * <code>optional .mesos.v1.master.Call.StopMaintenance stop_maintenance = 13;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.StopMaintenance getStopMaintenance();
+ /**
+ * <code>optional .mesos.v1.master.Call.StopMaintenance stop_maintenance = 13;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.StopMaintenanceOrBuilder getStopMaintenanceOrBuilder();
+
+ // optional .mesos.v1.master.Call.SetQuota set_quota = 14;
+ /**
+ * <code>optional .mesos.v1.master.Call.SetQuota set_quota = 14;</code>
+ */
+ boolean hasSetQuota();
+ /**
+ * <code>optional .mesos.v1.master.Call.SetQuota set_quota = 14;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.SetQuota getSetQuota();
+ /**
+ * <code>optional .mesos.v1.master.Call.SetQuota set_quota = 14;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.SetQuotaOrBuilder getSetQuotaOrBuilder();
+
+ // optional .mesos.v1.master.Call.RemoveQuota remove_quota = 15;
+ /**
+ * <code>optional .mesos.v1.master.Call.RemoveQuota remove_quota = 15;</code>
+ */
+ boolean hasRemoveQuota();
+ /**
+ * <code>optional .mesos.v1.master.Call.RemoveQuota remove_quota = 15;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.RemoveQuota getRemoveQuota();
+ /**
+ * <code>optional .mesos.v1.master.Call.RemoveQuota remove_quota = 15;</code>
+ */
+ org.apache.mesos.v1.master.Protos.Call.RemoveQuotaOrBuilder getRemoveQuotaOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.master.Call}
+ *
+ * <pre>
+ **
+ * Calls that can be sent to the v1 master API.
+ *
+ * A call is described using the standard protocol buffer "union"
+ * trick, see
+ * https://developers.google.com/protocol-buffers/docs/techniques#union.
+ * </pre>
+ */
+ public static final class Call extends
+ com.google.protobuf.GeneratedMessage
+ implements CallOrBuilder {
+ // Use Call.newBuilder() to construct.
+ private Call(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Call(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Call defaultInstance;
+ public static Call getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Call getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Call(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ int rawValue = input.readEnum();
+ org.apache.mesos.v1.master.Protos.Call.Type value = org.apache.mesos.v1.master.Protos.Call.Type.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(1, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ type_ = value;
+ }
+ break;
+ }
+ case 18: {
+ org.apache.mesos.v1.master.Protos.Call.GetMetrics.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = getMetrics_.toBuilder();
+ }
+ getMetrics_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.GetMetrics.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(getMetrics_);
+ getMetrics_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = setLoggingLevel_.toBuilder();
+ }
+ setLoggingLevel_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(setLoggingLevel_);
+ setLoggingLevel_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ org.apache.mesos.v1.master.Protos.Call.ListFiles.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ subBuilder = listFiles_.toBuilder();
+ }
+ listFiles_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.ListFiles.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(listFiles_);
+ listFiles_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 42: {
+ org.apache.mesos.v1.master.Protos.Call.ReadFile.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ subBuilder = readFile_.toBuilder();
+ }
+ readFile_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.ReadFile.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(readFile_);
+ readFile_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
+ case 50: {
+ org.apache.mesos.v1.master.Protos.Call.UpdateWeights.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ subBuilder = updateWeights_.toBuilder();
+ }
+ updateWeights_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.UpdateWeights.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(updateWeights_);
+ updateWeights_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000020;
+ break;
+ }
+ case 58: {
+ org.apache.mesos.v1.master.Protos.Call.ReserveResources.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
+ subBuilder = reserveResources_.toBuilder();
+ }
+ reserveResources_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.ReserveResources.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(reserveResources_);
+ reserveResources_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000040;
+ break;
+ }
+ case 66: {
+ org.apache.mesos.v1.master.Protos.Call.UnreserveResources.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ subBuilder = unreserveResources_.toBuilder();
+ }
+ unreserveResources_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.UnreserveResources.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(unreserveResources_);
+ unreserveResources_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000080;
+ break;
+ }
+ case 74: {
+ org.apache.mesos.v1.master.Protos.Call.CreateVolumes.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000100) == 0x00000100)) {
+ subBuilder = createVolumes_.toBuilder();
+ }
+ createVolumes_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.CreateVolumes.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(createVolumes_);
+ createVolumes_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000100;
+ break;
+ }
+ case 82: {
+ org.apache.mesos.v1.master.Protos.Call.DestroyVolumes.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000200) == 0x00000200)) {
+ subBuilder = destroyVolumes_.toBuilder();
+ }
+ destroyVolumes_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.DestroyVolumes.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(destroyVolumes_);
+ destroyVolumes_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000200;
+ break;
+ }
+ case 90: {
+ org.apache.mesos.v1.master.Protos.Call.UpdateMaintenanceSchedule.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000400) == 0x00000400)) {
+ subBuilder = updateMaintenanceSchedule_.toBuilder();
+ }
+ updateMaintenanceSchedule_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.UpdateMaintenanceSchedule.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(updateMaintenanceSchedule_);
+ updateMaintenanceSchedule_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000400;
+ break;
+ }
+ case 98: {
+ org.apache.mesos.v1.master.Protos.Call.StartMaintenance.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000800) == 0x00000800)) {
+ subBuilder = startMaintenance_.toBuilder();
+ }
+ startMaintenance_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.StartMaintenance.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(startMaintenance_);
+ startMaintenance_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000800;
+ break;
+ }
+ case 106: {
+ org.apache.mesos.v1.master.Protos.Call.StopMaintenance.Builder subBuilder = null;
+ if (((bitField0_ & 0x00001000) == 0x00001000)) {
+ subBuilder = stopMaintenance_.toBuilder();
+ }
+ stopMaintenance_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.StopMaintenance.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(stopMaintenance_);
+ stopMaintenance_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00001000;
+ break;
+ }
+ case 114: {
+ org.apache.mesos.v1.master.Protos.Call.SetQuota.Builder subBuilder = null;
+ if (((bitField0_ & 0x00002000) == 0x00002000)) {
+ subBuilder = setQuota_.toBuilder();
+ }
+ setQuota_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.SetQuota.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(setQuota_);
+ setQuota_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00002000;
+ break;
+ }
+ case 122: {
+ org.apache.mesos.v1.master.Protos.Call.RemoveQuota.Builder subBuilder = null;
+ if (((bitField0_ & 0x00004000) == 0x00004000)) {
+ subBuilder = removeQuota_.toBuilder();
+ }
+ removeQuota_ = input.readMessage(org.apache.mesos.v1.master.Protos.Call.RemoveQuota.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(removeQuota_);
+ removeQuota_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00004000;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.master.Protos.Call.class, org.apache.mesos.v1.master.Protos.Call.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Call> PARSER =
+ new com.google.protobuf.AbstractParser<Call>() {
+ public Call parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Call(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Call> getParserForType() {
+ return PARSER;
+ }
+
+ /**
+ * Protobuf enum {@code mesos.v1.master.Call.Type}
+ */
+ public enum Type
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * If a call of type `Call::FOO` requires additional parameters they can be
+ * included in the corresponding `Call::Foo` message. Similarly, if a call
+ * receives a synchronous response it will be returned as a `Response`
+ * message of type `Response::FOO`. Currently all calls except
+ * `Call::SUBSCRIBE` receive synchronous responses; `Call::SUBSCRIBE` returns
+ * a streaming response of `Event`.
+ * </pre>
+ */
+ UNKNOWN(0, 0),
+ /**
+ * <code>GET_HEALTH = 1;</code>
+ *
+ * <pre>
+ * Retrieves the master's health status.
+ * </pre>
+ */
+ GET_HEALTH(1, 1),
+ /**
+ * <code>GET_FLAGS = 2;</code>
+ *
+ * <pre>
+ * Retrieves the master's flag configuration.
+ * </pre>
+ */
+ GET_FLAGS(2, 2),
+ /**
+ * <code>GET_VERSION = 3;</code>
+ *
+ * <pre>
+ * Retrieves the master's version information.
+ * </pre>
+ */
+ GET_VERSION(3, 3),
+ /**
+ * <code>GET_METRICS = 4;</code>
+ *
+ * <pre>
+ * See 'GetMetrics' below.
+ * </pre>
+ */
+ GET_METRICS(4, 4),
+ /**
+ * <code>GET_LOGGING_LEVEL = 5;</code>
+ *
+ * <pre>
+ * Retrieves the master's logging level.
+ * </pre>
+ */
+ GET_LOGGING_LEVEL(5, 5),
+ /**
+ * <code>SET_LOGGING_LEVEL = 6;</code>
+ *
+ * <pre>
+ * See 'SetLoggingLevel' below.
+ * </pre>
+ */
+ SET_LOGGING_LEVEL(6, 6),
+ /**
+ * <code>LIST_FILES = 7;</code>
+ */
+ LIST_FILES(7, 7),
+ /**
+ * <code>READ_FILE = 8;</code>
+ *
+ * <pre>
+ * See 'ReadFile' below.
+ * </pre>
+ */
+ READ_FILE(8, 8),
+ /**
+ * <code>GET_STATE = 9;</code>
+ */
+ GET_STATE(9, 9),
+ /**
+ * <code>GET_AGENTS = 10;</code>
+ */
+ GET_AGENTS(10, 10),
+ /**
+ * <code>GET_FRAMEWORKS = 11;</code>
+ */
+ GET_FRAMEWORKS(11, 11),
+ /**
+ * <code>GET_EXECUTORS = 12;</code>
+ *
+ * <pre>
+ * Retrieves the information about all executors.
+ * </pre>
+ */
+ GET_EXECUTORS(12, 12),
+ /**
+ * <code>GET_TASKS = 13;</code>
+ *
+ * <pre>
+ * Retrieves the information about all known tasks.
+ * </pre>
+ */
+ GET_TASKS(13, 13),
+ /**
+ * <code>GET_ROLES = 14;</code>
+ *
+ * <pre>
+ * Retrieves the information about roles.
+ * </pre>
+ */
+ GET_ROLES(14, 14),
+ /**
+ * <code>GET_WEIGHTS = 15;</code>
+ *
+ * <pre>
+ * Retrieves the information about role weights.
+ * </pre>
+ */
+ GET_WEIGHTS(15, 15),
+ /**
+ * <code>UPDATE_WEIGHTS = 16;</code>
+ */
+ UPDATE_WEIGHTS(16, 16),
+ /**
+ * <code>GET_MASTER = 17;</code>
+ *
+ * <pre>
+ * Retrieves the master's information.
+ * </pre>
+ */
+ GET_MASTER(17, 17),
+ /**
+ * <code>SUBSCRIBE = 18;</code>
+ *
+ * <pre>
+ * Subscribes the master to receive events.
+ * </pre>
+ */
+ SUBSCRIBE(18, 18),
+ /**
+ * <code>RESERVE_RESOURCES = 19;</code>
+ */
+ RESERVE_RESOURCES(19, 19),
+ /**
+ * <code>UNRESERVE_RESOURCES = 20;</code>
+ */
+ UNRESERVE_RESOURCES(20, 20),
+ /**
+ * <code>CREATE_VOLUMES = 21;</code>
+ *
+ * <pre>
+ * See 'CreateVolumes' below.
+ * </pre>
+ */
+ CREATE_VOLUMES(21, 21),
+ /**
+ * <code>DESTROY_VOLUMES = 22;</code>
+ *
+ * <pre>
+ * See 'DestroyVolumes' below.
+ * </pre>
+ */
+ DESTROY_VOLUMES(22, 22),
+ /**
+ * <code>GET_MAINTENANCE_STATUS = 23;</code>
+ *
+ * <pre>
+ * Retrieves the cluster's maintenance status.
+ * </pre>
+ */
+ GET_MAINTENANCE_STATUS(23, 23),
+ /**
+ * <code>GET_MAINTENANCE_SCHEDULE = 24;</code>
+ *
+ * <pre>
+ * Retrieves the cluster's maintenance schedule.
+ * </pre>
+ */
+ GET_MAINTENANCE_SCHEDULE(24, 24),
+ /**
+ * <code>UPDATE_MAINTENANCE_SCHEDULE = 25;</code>
+ *
+ * <pre>
+ * See 'UpdateMaintenanceSchedule' below.
+ * </pre>
+ */
+ UPDATE_MAINTENANCE_SCHEDULE(25, 25),
+ /**
+ * <code>START_MAINTENANCE = 26;</code>
+ *
+ * <pre>
+ * See 'StartMaintenance' below.
+ * </pre>
+ */
+ START_MAINTENANCE(26, 26),
+ /**
+ * <code>STOP_MAINTENANCE = 27;</code>
+ *
+ * <pre>
+ * See 'StopMaintenance' below.
+ * </pre>
+ */
+ STOP_MAINTENANCE(27, 27),
+ /**
+ * <code>GET_QUOTA = 28;</code>
+ */
+ GET_QUOTA(28, 28),
+ /**
+ * <code>SET_QUOTA = 29;</code>
+ *
+ * <pre>
+ * See 'SetQuota' below.
+ * </pre>
+ */
+ SET_QUOTA(29, 29),
+ /**
+ * <code>REMOVE_QUOTA = 30;</code>
+ *
+ * <pre>
+ * See 'RemoveQuota' below.
+ * </pre>
+ */
+ REMOVE_QUOTA(30, 30),
+ ;
+
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * If a call of type `Call::FOO` requires additional parameters they can be
+ * included in the corresponding `Call::Foo` message. Similarly, if a call
+ * receives a synchronous response it will be returned as a `Response`
+ * message of type `Response::FOO`. Currently all calls except
+ * `Call::SUBSCRIBE` receive synchronous responses; `Call::SUBSCRIBE` returns
+ * a streaming response of `Event`.
+ * </pre>
+ */
+ public static final int UNKNOWN_VALUE = 0;
+ /**
+ * <code>GET_HEALTH = 1;</code>
+ *
+ * <pre>
+ * Retrieves the master's health status.
+ * </pre>
+ */
+ public static final int GET_HEALTH_VALUE = 1;
+ /**
+ * <code>GET_FLAGS = 2;</code>
+ *
+ * <pre>
+ * Retrieves the master's flag configuration.
+ * </pre>
+ */
+ public static final int GET_FLAGS_VALUE = 2;
+ /**
+ * <code>GET_VERSION = 3;</code>
+ *
+ * <pre>
+ * Retrieves the master's version information.
+ * </pre>
+ */
+ public static final int GET_VERSION_VALUE = 3;
+ /**
+ * <code>GET_METRICS = 4;</code>
+ *
+ * <pre>
+ * See 'GetMetrics' below.
+ * </pre>
+ */
+ public static final int GET_METRICS_VALUE = 4;
+ /**
+ * <code>GET_LOGGING_LEVEL = 5;</code>
+ *
+ * <pre>
+ * Retrieves the master's logging level.
+ * </pre>
+ */
+ public static final int GET_LOGGING_LEVEL_VALUE = 5;
+ /**
+ * <code>SET_LOGGING_LEVEL = 6;</code>
+ *
+ * <pre>
+ * See 'SetLoggingLevel' below.
+ * </pre>
+ */
+ public static final int SET_LOGGING_LEVEL_VALUE = 6;
+ /**
+ * <code>LIST_FILES = 7;</code>
+ */
+ public static final int LIST_FILES_VALUE = 7;
+ /**
+ * <code>READ_FILE = 8;</code>
+ *
+ * <pre>
+ * See 'ReadFile' below.
+ * </pre>
+ */
+ public static final int READ_FILE_VALUE = 8;
+ /**
+ * <code>GET_STATE = 9;</code>
+ */
+ public static final int GET_STATE_VALUE = 9;
+ /**
+ * <code>GET_AGENTS = 10;</code>
+ */
+ public static final int GET_AGENTS_VALUE = 10;
+ /**
+ * <code>GET_FRAMEWORKS = 11;</code>
+ */
+ public static final int GET_FRAMEWORKS_VALUE = 11;
+ /**
+ * <code>GET_EXECUTORS = 12;</code>
+ *
+ * <pre>
+ * Retrieves the information about all executors.
+ * </pre>
+ */
+ public static final int GET_EXECUTORS_VALUE = 12;
+ /**
+ * <code>GET_TASKS = 13;</code>
+ *
+ * <pre>
+ * Retrieves the information about all known tasks.
+ * </pre>
+ */
+ public static final int GET_TASKS_VALUE = 13;
+ /**
+ * <code>GET_ROLES = 14;</code>
+ *
+ * <pre>
+ * Retrieves the information about roles.
+ * </pre>
+ */
+ public static final int GET_ROLES_VALUE = 14;
+ /**
+ * <code>GET_WEIGHTS = 15;</code>
+ *
+ * <pre>
+ * Retrieves the information about role weights.
+ * </pre>
+ */
+ public static final int GET_WEIGHTS_VALUE = 15;
+ /**
+ * <code>UPDATE_WEIGHTS = 16;</code>
+ */
+ public static final int UPDATE_WEIGHTS_VALUE = 16;
+ /**
+ * <code>GET_MASTER = 17;</code>
+ *
+ * <pre>
+ * Retrieves the master's information.
+ * </pre>
+ */
+ public static final int GET_MASTER_VALUE = 17;
+ /**
+ * <code>SUBSCRIBE = 18;</code>
+ *
+ * <pre>
+ * Subscribes the master to receive events.
+ * </pre>
+ */
+ public static final int SUBSCRIBE_VALUE = 18;
+ /**
+ * <code>RESERVE_RESOURCES = 19;</code>
+ */
+ public static final int RESERVE_RESOURCES_VALUE = 19;
+ /**
+ * <code>UNRESERVE_RESOURCES = 20;</code>
+ */
+ public static final int UNRESERVE_RESOURCES_VALUE = 20;
+ /**
+ * <code>CREATE_VOLUMES = 21;</code>
+ *
+ * <pre>
+ * See 'CreateVolumes' below.
+ * </pre>
+ */
+ public static final int CREATE_VOLUMES_VALUE = 21;
+ /**
+ * <code>DESTROY_VOLUMES = 22;</code>
+ *
+ * <pre>
+ * See 'DestroyVolumes' below.
+ * </pre>
+ */
+ public static final int DESTROY_VOLUMES_VALUE = 22;
+ /**
+ * <code>GET_MAINTENANCE_STATUS = 23;</code>
+ *
+ * <pre>
+ * Retrieves the cluster's maintenance status.
+ * </pre>
+ */
+ public static final int GET_MAINTENANCE_STATUS_VALUE = 23;
+ /**
+ * <code>GET_MAINTENANCE_SCHEDULE = 24;</code>
+ *
+ * <pre>
+ * Retrieves the cluster's maintenance schedule.
+ * </pre>
+ */
+ public static final int GET_MAINTENANCE_SCHEDULE_VALUE = 24;
+ /**
+ * <code>UPDATE_MAINTENANCE_SCHEDULE = 25;</code>
+ *
+ * <pre>
+ * See 'UpdateMaintenanceSchedule' below.
+ * </pre>
+ */
+ public static final int UPDATE_MAINTENANCE_SCHEDULE_VALUE = 25;
+ /**
+ * <code>START_MAINTENANCE = 26;</code>
+ *
+ * <pre>
+ * See 'StartMaintenance' below.
+ * </pre>
+ */
+ public static final int START_MAINTENANCE_VALUE = 26;
+ /**
+ * <code>STOP_MAINTENANCE = 27;</code>
+ *
+ * <pre>
+ * See 'StopMaintenance' below.
+ * </pre>
+ */
+ public static final int STOP_MAINTENANCE_VALUE = 27;
+ /**
+ * <code>GET_QUOTA = 28;</code>
+ */
+ public static final int GET_QUOTA_VALUE = 28;
+ /**
+ * <code>SET_QUOTA = 29;</code>
+ *
+ * <pre>
+ * See 'SetQuota' below.
+ * </pre>
+ */
+ public static final int SET_QUOTA_VALUE = 29;
+ /**
+ * <code>REMOVE_QUOTA = 30;</code>
+ *
+ * <pre>
+ * See 'RemoveQuota' below.
+ * </pre>
+ */
+ public static final int REMOVE_QUOTA_VALUE = 30;
+
+
+ public final int getNumber() { return value; }
+
+ public static Type valueOf(int value) {
+ switch (value) {
+ case 0: return UNKNOWN;
+ case 1: return GET_HEALTH;
+ case 2: return GET_FLAGS;
+ case 3: return GET_VERSION;
+ case 4: return GET_METRICS;
+ case 5: return GET_LOGGING_LEVEL;
+ case 6: return SET_LOGGING_LEVEL;
+ case 7: return LIST_FILES;
+ case 8: return READ_FILE;
+ case 9: return GET_STATE;
+ case 10: return GET_AGENTS;
+ case 11: return GET_FRAMEWORKS;
+ case 12: return GET_EXECUTORS;
+ case 13: return GET_TASKS;
+ case 14: return GET_ROLES;
+ case 15: return GET_WEIGHTS;
+ case 16: return UPDATE_WEIGHTS;
+ case 17: return GET_MASTER;
+ case 18: return SUBSCRIBE;
+ case 19: return RESERVE_RESOURCES;
+ case 20: return UNRESERVE_RESOURCES;
+ case 21: return CREATE_VOLUMES;
+ case 22: return DESTROY_VOLUMES;
+ case 23: return GET_MAINTENANCE_STATUS;
+ case 24: return GET_MAINTENANCE_SCHEDULE;
+ case 25: return UPDATE_MAINTENANCE_SCHEDULE;
+ case 26: return START_MAINTENANCE;
+ case 27: return STOP_MAINTENANCE;
+ case 28: return GET_QUOTA;
+ case 29: return SET_QUOTA;
+ case 30: return REMOVE_QUOTA;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Type>() {
+ public Type findValueByNumber(int number) {
+ return Type.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.master.Protos.Call.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Type[] VALUES = values();
+
+ public static Type valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private Type(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.v1.master.Call.Type)
+ }
+
+ public interface GetMetricsOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.v1.DurationInfo timeout = 1;
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ boolean hasTimeout();
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.DurationInfo getTimeout();
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.DurationInfoOrBuilder getTimeoutOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.master.Call.GetMetrics}
+ *
+ * <pre>
+ * Provides a snapshot of the current metrics tracked by the master.
+ * </pre>
+ */
+ public static final class GetMetrics extends
+ com.google.protobuf.GeneratedMessage
+ implements GetMetricsOrBuilder {
+ // Use GetMetrics.newBuilder() to construct.
+ private GetMetrics(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private GetMetrics(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final GetMetrics defaultInstance;
+ public static GetMetrics getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public GetMetrics getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private GetMetrics(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.v1.Protos.DurationInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = timeout_.toBuilder();
+ }
+ timeout_ = input.readMessage(org.apache.mesos.v1.Protos.DurationInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(timeout_);
+ timeout_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_GetMetrics_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_GetMetrics_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.master.Protos.Call.GetMetrics.class, org.apache.mesos.v1.master.Protos.Call.GetMetrics.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<GetMetrics> PARSER =
+ new com.google.protobuf.AbstractParser<GetMetrics>() {
+ public GetMetrics parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new GetMetrics(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<GetMetrics> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // optional .mesos.v1.DurationInfo timeout = 1;
+ public static final int TIMEOUT_FIELD_NUMBER = 1;
+ private org.apache.mesos.v1.Protos.DurationInfo timeout_;
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public boolean hasTimeout() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo getTimeout() {
+ return timeout_;
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfoOrBuilder getTimeoutOrBuilder() {
+ return timeout_;
+ }
+
+ private void initFields() {
+ timeout_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (hasTimeout()) {
+ if (!getTimeout().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, timeout_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, timeout_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.master.Protos.Call.GetMetrics parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.GetMetrics parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.GetMetrics parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.GetMetrics parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.GetMetrics parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.GetMetrics parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.GetMetrics parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.GetMetrics parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.GetMetrics parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.GetMetrics parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.master.Protos.Call.GetMetrics prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.master.Call.GetMetrics}
+ *
+ * <pre>
+ * Provides a snapshot of the current metrics tracked by the master.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.master.Protos.Call.GetMetricsOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_GetMetrics_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_GetMetrics_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.master.Protos.Call.GetMetrics.class, org.apache.mesos.v1.master.Protos.Call.GetMetrics.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.master.Protos.Call.GetMetrics.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getTimeoutFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (timeoutBuilder_ == null) {
+ timeout_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ } else {
+ timeoutBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_GetMetrics_descriptor;
+ }
+
+ public org.apache.mesos.v1.master.Protos.Call.GetMetrics getDefaultInstanceForType() {
+ return org.apache.mesos.v1.master.Protos.Call.GetMetrics.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.master.Protos.Call.GetMetrics build() {
+ org.apache.mesos.v1.master.Protos.Call.GetMetrics result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.master.Protos.Call.GetMetrics buildPartial() {
+ org.apache.mesos.v1.master.Protos.Call.GetMetrics result = new org.apache.mesos.v1.master.Protos.Call.GetMetrics(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (timeoutBuilder_ == null) {
+ result.timeout_ = timeout_;
+ } else {
+ result.timeout_ = timeoutBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.master.Protos.Call.GetMetrics) {
+ return mergeFrom((org.apache.mesos.v1.master.Protos.Call.GetMetrics)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.master.Protos.Call.GetMetrics other) {
+ if (other == org.apache.mesos.v1.master.Protos.Call.GetMetrics.getDefaultInstance()) return this;
+ if (other.hasTimeout()) {
+ mergeTimeout(other.getTimeout());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (hasTimeout()) {
+ if (!getTimeout().isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.master.Protos.Call.GetMetrics parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.master.Protos.Call.GetMetrics) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // optional .mesos.v1.DurationInfo timeout = 1;
+ private org.apache.mesos.v1.Protos.DurationInfo timeout_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.DurationInfo, org.apache.mesos.v1.Protos.DurationInfo.Builder, org.apache.mesos.v1.Protos.DurationInfoOrBuilder> timeoutBuilder_;
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public boolean hasTimeout() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo getTimeout() {
+ if (timeoutBuilder_ == null) {
+ return timeout_;
+ } else {
+ return timeoutBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public Builder setTimeout(org.apache.mesos.v1.Protos.DurationInfo value) {
+ if (timeoutBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ timeout_ = value;
+ onChanged();
+ } else {
+ timeoutBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public Builder setTimeout(
+ org.apache.mesos.v1.Protos.DurationInfo.Builder builderForValue) {
+ if (timeoutBuilder_ == null) {
+ timeout_ = builderForValue.build();
+ onChanged();
+ } else {
+ timeoutBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public Builder mergeTimeout(org.apache.mesos.v1.Protos.DurationInfo value) {
+ if (timeoutBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ timeout_ != org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance()) {
+ timeout_ =
+ org.apache.mesos.v1.Protos.DurationInfo.newBuilder(timeout_).mergeFrom(value).buildPartial();
+ } else {
+ timeout_ = value;
+ }
+ onChanged();
+ } else {
+ timeoutBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public Builder clearTimeout() {
+ if (timeoutBuilder_ == null) {
+ timeout_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ timeoutBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo.Builder getTimeoutBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getTimeoutFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfoOrBuilder getTimeoutOrBuilder() {
+ if (timeoutBuilder_ != null) {
+ return timeoutBuilder_.getMessageOrBuilder();
+ } else {
+ return timeout_;
+ }
+ }
+ /**
+ * <code>optional .mesos.v1.DurationInfo timeout = 1;</code>
+ *
+ * <pre>
+ * If set, `timeout` would be used to determines the maximum amount of time
+ * the API will take to respond. If the timeout is exceeded, some metrics
+ * may not be included in the response.
+ * </pre>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.DurationInfo, org.apache.mesos.v1.Protos.DurationInfo.Builder, org.apache.mesos.v1.Protos.DurationInfoOrBuilder>
+ getTimeoutFieldBuilder() {
+ if (timeoutBuilder_ == null) {
+ timeoutBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.DurationInfo, org.apache.mesos.v1.Protos.DurationInfo.Builder, org.apache.mesos.v1.Protos.DurationInfoOrBuilder>(
+ timeout_,
+ getParentForChildren(),
+ isClean());
+ timeout_ = null;
+ }
+ return timeoutBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.master.Call.GetMetrics)
+ }
+
+ static {
+ defaultInstance = new GetMetrics(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.master.Call.GetMetrics)
+ }
+
+ public interface SetLoggingLevelOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required uint32 level = 1;
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ boolean hasLevel();
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ int getLevel();
+
+ // required .mesos.v1.DurationInfo duration = 2;
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ boolean hasDuration();
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.DurationInfo getDuration();
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.DurationInfoOrBuilder getDurationOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.v1.master.Call.SetLoggingLevel}
+ *
+ * <pre>
+ * Sets the logging verbosity level for a specified duration. Mesos uses
+ * [glog](https://github.com/google/glog) for logging. The library only uses
+ * verbose logging which means nothing will be output unless the verbosity
+ * level is set (by default it's 0, libprocess uses levels 1, 2, and 3).
+ * </pre>
+ */
+ public static final class SetLoggingLevel extends
+ com.google.protobuf.GeneratedMessage
+ implements SetLoggingLevelOrBuilder {
+ // Use SetLoggingLevel.newBuilder() to construct.
+ private SetLoggingLevel(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private SetLoggingLevel(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final SetLoggingLevel defaultInstance;
+ public static SetLoggingLevel getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public SetLoggingLevel getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private SetLoggingLevel(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ bitField0_ |= 0x00000001;
+ level_ = input.readUInt32();
+ break;
+ }
+ case 18: {
+ org.apache.mesos.v1.Protos.DurationInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = duration_.toBuilder();
+ }
+ duration_ = input.readMessage(org.apache.mesos.v1.Protos.DurationInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(duration_);
+ duration_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_SetLoggingLevel_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_SetLoggingLevel_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel.class, org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<SetLoggingLevel> PARSER =
+ new com.google.protobuf.AbstractParser<SetLoggingLevel>() {
+ public SetLoggingLevel parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new SetLoggingLevel(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<SetLoggingLevel> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required uint32 level = 1;
+ public static final int LEVEL_FIELD_NUMBER = 1;
+ private int level_;
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public boolean hasLevel() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public int getLevel() {
+ return level_;
+ }
+
+ // required .mesos.v1.DurationInfo duration = 2;
+ public static final int DURATION_FIELD_NUMBER = 2;
+ private org.apache.mesos.v1.Protos.DurationInfo duration_;
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public boolean hasDuration() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo getDuration() {
+ return duration_;
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfoOrBuilder getDurationOrBuilder() {
+ return duration_;
+ }
+
+ private void initFields() {
+ level_ = 0;
+ duration_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasLevel()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasDuration()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getDuration().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeUInt32(1, level_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeMessage(2, duration_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(1, level_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, duration_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.master.Call.SetLoggingLevel}
+ *
+ * <pre>
+ * Sets the logging verbosity level for a specified duration. Mesos uses
+ * [glog](https://github.com/google/glog) for logging. The library only uses
+ * verbose logging which means nothing will be output unless the verbosity
+ * level is set (by default it's 0, libprocess uses levels 1, 2, and 3).
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.master.Protos.Call.SetLoggingLevelOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_SetLoggingLevel_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_SetLoggingLevel_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel.class, org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getDurationFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ level_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (durationBuilder_ == null) {
+ duration_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ } else {
+ durationBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.master.Protos.internal_static_mesos_v1_master_Call_SetLoggingLevel_descriptor;
+ }
+
+ public org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel getDefaultInstanceForType() {
+ return org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel build() {
+ org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel buildPartial() {
+ org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel result = new org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.level_ = level_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ if (durationBuilder_ == null) {
+ result.duration_ = duration_;
+ } else {
+ result.duration_ = durationBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel) {
+ return mergeFrom((org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel other) {
+ if (other == org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel.getDefaultInstance()) return this;
+ if (other.hasLevel()) {
+ setLevel(other.getLevel());
+ }
+ if (other.hasDuration()) {
+ mergeDuration(other.getDuration());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasLevel()) {
+
+ return false;
+ }
+ if (!hasDuration()) {
+
+ return false;
+ }
+ if (!getDuration().isInitialized()) {
+
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.master.Protos.Call.SetLoggingLevel) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required uint32 level = 1;
+ private int level_ ;
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public boolean hasLevel() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public int getLevel() {
+ return level_;
+ }
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public Builder setLevel(int value) {
+ bitField0_ |= 0x00000001;
+ level_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required uint32 level = 1;</code>
+ *
+ * <pre>
+ * The verbosity level.
+ * </pre>
+ */
+ public Builder clearLevel() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ level_ = 0;
+ onChanged();
+ return this;
+ }
+
+ // required .mesos.v1.DurationInfo duration = 2;
+ private org.apache.mesos.v1.Protos.DurationInfo duration_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.v1.Protos.DurationInfo, org.apache.mesos.v1.Protos.DurationInfo.Builder, org.apache.mesos.v1.Protos.DurationInfoOrBuilder> durationBuilder_;
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public boolean hasDuration() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo getDuration() {
+ if (durationBuilder_ == null) {
+ return duration_;
+ } else {
+ return durationBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public Builder setDuration(org.apache.mesos.v1.Protos.DurationInfo value) {
+ if (durationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ duration_ = value;
+ onChanged();
+ } else {
+ durationBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public Builder setDuration(
+ org.apache.mesos.v1.Protos.DurationInfo.Builder builderForValue) {
+ if (durationBuilder_ == null) {
+ duration_ = builderForValue.build();
+ onChanged();
+ } else {
+ durationBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public Builder mergeDuration(org.apache.mesos.v1.Protos.DurationInfo value) {
+ if (durationBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002) &&
+ duration_ != org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance()) {
+ duration_ =
+ org.apache.mesos.v1.Protos.DurationInfo.newBuilder(duration_).mergeFrom(value).buildPartial();
+ } else {
+ duration_ = value;
+ }
+ onChanged();
+ } else {
+ durationBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public Builder clearDuration() {
+ if (durationBuilder_ == null) {
+ duration_ = org.apache.mesos.v1.Protos.DurationInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ durationBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfo.Builder getDurationBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getDurationFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.v1.DurationInfo duration = 2;</code>
+ *
+ * <pre>
+ * The duration to keep verbosity level toggled. After this duration, the
+ * verbosity level of log would revert to the original level.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.DurationInfoOrBuilder getDurationOrBuilder() {
+ if (durationBuilder_ != null) {
+ return durationBuilder_.getMessageOrBuilder();
+ } else {
+ return duration_;
+ }
+
<TRUNCATED>
[14/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/proto/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/mesos.proto b/myriad-commons/proto/mesos/mesos.proto
new file mode 100644
index 0000000..3449c2d
--- /dev/null
+++ b/myriad-commons/proto/mesos/mesos.proto
@@ -0,0 +1,3190 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto2";
+
+package mesos;
+
+option java_package = "org.apache.mesos";
+option java_outer_classname = "Protos";
+
+
+/**
+ * Status is used to indicate the state of the scheduler and executor
+ * driver after function calls.
+ */
+enum Status {
+ DRIVER_NOT_STARTED = 1;
+ DRIVER_RUNNING = 2;
+ DRIVER_ABORTED = 3;
+ DRIVER_STOPPED = 4;
+}
+
+
+/**
+ * A unique ID assigned to a framework. A framework can reuse this ID
+ * in order to do failover (see MesosSchedulerDriver).
+ */
+message FrameworkID {
+ required string value = 1;
+}
+
+
+/**
+ * A unique ID assigned to an offer.
+ */
+message OfferID {
+ required string value = 1;
+}
+
+
+/**
+ * A unique ID assigned to a slave. Currently, a slave gets a new ID
+ * whenever it (re)registers with Mesos. Framework writers shouldn't
+ * assume any binding between a slave ID and and a hostname.
+ */
+message SlaveID {
+ required string value = 1;
+}
+
+
+/**
+ * A framework-generated ID to distinguish a task. The ID must remain
+ * unique while the task is active. A framework can reuse an ID _only_
+ * if the previous task with the same ID has reached a terminal state
+ * (e.g., TASK_FINISHED, TASK_KILLED, etc.). However, reusing task IDs
+ * is strongly discouraged (MESOS-2198).
+ */
+message TaskID {
+ required string value = 1;
+}
+
+
+/**
+ * A framework-generated ID to distinguish an executor. Only one
+ * executor with the same ID can be active on the same slave at a
+ * time. However, reusing executor IDs is discouraged.
+ */
+message ExecutorID {
+ required string value = 1;
+}
+
+
+/**
+ * ID used to uniquely identify a container. If the `parent` is not
+ * specified, the ID is a UUID generated by the agent to uniquely
+ * identify the container of an executor run. If the `parent` field is
+ * specified, it represents a nested container.
+ */
+message ContainerID {
+ required string value = 1;
+ optional ContainerID parent = 2;
+}
+
+
+/**
+ * A unique ID assigned to a resource provider. Currently, a resource
+ * provider gets a new ID whenever it (re)registers with Mesos.
+ */
+message ResourceProviderID {
+ required string value = 1;
+}
+
+
+/**
+ * Represents time since the epoch, in nanoseconds.
+ */
+message TimeInfo {
+ required int64 nanoseconds = 1;
+}
+
+
+/**
+ * Represents duration in nanoseconds.
+ */
+message DurationInfo {
+ required int64 nanoseconds = 1;
+}
+
+
+/**
+ * A network address.
+ *
+ * TODO(bmahler): Use this more widely.
+ */
+message Address {
+ // May contain a hostname, IP address, or both.
+ optional string hostname = 1;
+ optional string ip = 2;
+
+ required int32 port = 3;
+}
+
+
+/**
+ * Represents a URL.
+ */
+message URL {
+ required string scheme = 1;
+ required Address address = 2;
+ optional string path = 3;
+ repeated Parameter query = 4;
+ optional string fragment = 5;
+}
+
+
+/**
+ * Represents an interval, from a given start time over a given duration.
+ * This interval pertains to an unavailability event, such as maintenance,
+ * and is not a generic interval.
+ */
+message Unavailability {
+ required TimeInfo start = 1;
+
+ // When added to `start`, this represents the end of the interval.
+ // If unspecified, the duration is assumed to be infinite.
+ optional DurationInfo duration = 2;
+
+ // TODO(josephw): Add additional fields for expressing the purpose and
+ // urgency of the unavailability event.
+}
+
+
+/**
+ * Represents a single machine, which may hold one or more slaves.
+ *
+ * NOTE: In order to match a slave to a machine, both the `hostname` and
+ * `ip` must match the values advertised by the slave to the master.
+ * Hostname is not case-sensitive.
+ */
+message MachineID {
+ optional string hostname = 1;
+ optional string ip = 2;
+}
+
+
+/**
+ * Holds information about a single machine, its `mode`, and any other
+ * relevant information which may affect the behavior of the machine.
+ */
+message MachineInfo {
+ // Describes the several states that a machine can be in. A `Mode`
+ // applies to a machine and to all associated slaves on the machine.
+ enum Mode {
+ // In this mode, a machine is behaving normally;
+ // offering resources, executing tasks, etc.
+ UP = 1;
+
+ // In this mode, all slaves on the machine are expected to cooperate with
+ // frameworks to drain resources. In general, draining is done ahead of
+ // a pending `unavailability`. The resources should be drained so as to
+ // maximize utilization prior to the maintenance but without knowingly
+ // violating the frameworks' requirements.
+ DRAINING = 2;
+
+ // In this mode, a machine is not running any tasks and will not offer
+ // any of its resources. Slaves on the machine will not be allowed to
+ // register with the master.
+ DOWN = 3;
+ }
+
+ required MachineID id = 1;
+ optional Mode mode = 2;
+
+ // Signifies that the machine may be unavailable during the given interval.
+ // See comments in `Unavailability` and for the `unavailability` fields
+ // in `Offer` and `InverseOffer` for more information.
+ optional Unavailability unavailability = 3;
+}
+
+
+/**
+ * Describes a framework.
+ */
+message FrameworkInfo {
+ // Used to determine the Unix user that an executor or task should be
+ // launched as.
+ //
+ // When using the MesosSchedulerDriver, if the field is set to an
+ // empty string, it will automagically set it to the current user.
+ //
+ // When using the HTTP Scheduler API, the user has to be set
+ // explicitly.
+ required string user = 1;
+
+ // Name of the framework that shows up in the Mesos Web UI.
+ required string name = 2;
+
+ // Note that 'id' is only available after a framework has
+ // registered, however, it is included here in order to facilitate
+ // scheduler failover (i.e., if it is set then the
+ // MesosSchedulerDriver expects the scheduler is performing
+ // failover).
+ optional FrameworkID id = 3;
+
+ // The amount of time (in seconds) that the master will wait for the
+ // scheduler to failover before it tears down the framework by
+ // killing all its tasks/executors. This should be non-zero if a
+ // framework expects to reconnect after a failure and not lose its
+ // tasks/executors.
+ //
+ // NOTE: To avoid accidental destruction of tasks, production
+ // frameworks typically set this to a large value (e.g., 1 week).
+ optional double failover_timeout = 4 [default = 0.0];
+
+ // If set, agents running tasks started by this framework will write
+ // the framework pid, executor pids and status updates to disk. If
+ // the agent exits (e.g., due to a crash or as part of upgrading
+ // Mesos), this checkpointed data allows the restarted agent to
+ // reconnect to executors that were started by the old instance of
+ // the agent. Enabling checkpointing improves fault tolerance, at
+ // the cost of a (usually small) increase in disk I/O.
+ optional bool checkpoint = 5 [default = false];
+
+ // Roles are the entities to which allocations are made.
+ // The framework must have at least one role in order to
+ // be offered resources. Note that `role` is deprecated
+ // in favor of `roles` and only one of these fields must
+ // be used. Since we cannot distinguish between empty
+ // `roles` and the default unset `role`, we require that
+ // frameworks set the `MULTI_ROLE` capability if
+ // setting the `roles` field.
+ optional string role = 6 [default = "*", deprecated=true];
+ repeated string roles = 12;
+
+ // Used to indicate the current host from which the scheduler is
+ // registered in the Mesos Web UI. If set to an empty string Mesos
+ // will automagically set it to the current hostname if one is
+ // available.
+ optional string hostname = 7;
+
+ // This field should match the credential's principal the framework
+ // uses for authentication. This field is used for framework API
+ // rate limiting and dynamic reservations. It should be set even
+ // if authentication is not enabled if these features are desired.
+ optional string principal = 8;
+
+ // This field allows a framework to advertise its web UI, so that
+ // the Mesos web UI can link to it. It is expected to be a full URL,
+ // for example http://my-scheduler.example.com:8080/.
+ optional string webui_url = 9;
+
+ message Capability {
+ enum Type {
+ // This must be the first enum value in this list, to
+ // ensure that if 'type' is not set, the default value
+ // is UNKNOWN. This enables enum values to be added
+ // in a backwards-compatible way. See: MESOS-4997.
+ UNKNOWN = 0;
+
+ // Receive offers with revocable resources. See 'Resource'
+ // message for details.
+ REVOCABLE_RESOURCES = 1;
+
+ // Receive the TASK_KILLING TaskState when a task is being
+ // killed by an executor. The executor will examine this
+ // capability to determine whether it can send TASK_KILLING.
+ TASK_KILLING_STATE = 2;
+
+ // Indicates whether the framework is aware of GPU resources.
+ // Frameworks that are aware of GPU resources are expected to
+ // avoid placing non-GPU workloads on GPU agents, in order
+ // to avoid occupying a GPU agent and preventing GPU workloads
+ // from running! Currently, if a framework is unaware of GPU
+ // resources, it will not be offered *any* of the resources on
+ // an agent with GPUs. This restriction is in place because we
+ // do not have a revocation mechanism that ensures GPU workloads
+ // can evict GPU agent occupants if necessary.
+ //
+ // TODO(bmahler): As we add revocation we can relax the
+ // restriction here. See MESOS-5634 for more information.
+ GPU_RESOURCES = 3;
+
+ // Receive offers with resources that are shared.
+ SHARED_RESOURCES = 4;
+
+ // Indicates that (1) the framework is prepared to handle the
+ // following TaskStates: TASK_UNREACHABLE, TASK_DROPPED,
+ // TASK_GONE, TASK_GONE_BY_OPERATOR, and TASK_UNKNOWN, and (2)
+ // the framework will assume responsibility for managing
+ // partitioned tasks that reregister with the master.
+ //
+ // Frameworks that enable this capability can define how they
+ // would like to handle partitioned tasks. Frameworks will
+ // receive TASK_UNREACHABLE for tasks on agents that are
+ // partitioned from the master. If/when a partitioned agent
+ // reregisters, tasks on the agent that were started by
+ // PARTITION_AWARE frameworks will not killed.
+ //
+ // Without this capability, frameworks will receive TASK_LOST
+ // for tasks on partitioned agents; such tasks will be killed by
+ // Mesos when the agent reregisters (unless the master has
+ // failed over).
+ PARTITION_AWARE = 5;
+
+ // This expresses the ability for the framework to be
+ // "multi-tenant" via using the newly introduced `roles`
+ // field, and examining `Offer.allocation_info` to determine
+ // which role the offers are being made to. We also
+ // expect that "single-tenant" schedulers eventually
+ // provide this and move away from the deprecated
+ // `role` field.
+ MULTI_ROLE = 6;
+
+ // This capability has two effects for a framework.
+ //
+ // (1) The framework is offered resources in a new format.
+ //
+ // The offered resources have the `Resource.reservations` field set
+ // rather than `Resource.role` and `Resource.reservation`. In short,
+ // an empty `reservations` field denotes unreserved resources, and
+ // each `ReservationInfo` in the `reservations` field denotes a
+ // reservation that refines the previous one.
+ //
+ // See the 'Resource Format' section for more details.
+ //
+ // (2) The framework can create refined reservations.
+ //
+ // A framework can refine an existing reservation via the
+ // `Resource.reservations` field. For example, a reservation for role
+ // `eng` can be refined to `eng/front_end`.
+ //
+ // See `ReservationInfo.reservations` for more details.
+ //
+ // NOTE: Without this capability, a framework is not offered resources
+ // that have refined reservations. A resource is said to have refined
+ // reservations if it uses the `Resource.reservations` field, and
+ // `Resource.reservations_size() > 1`.
+ RESERVATION_REFINEMENT = 7; // EXPERIMENTAL.
+
+ // Indicates that the framework is prepared to receive offers
+ // for agents whose region is different from the master's
+ // region. Network links between hosts in different regions
+ // typically have higher latency and lower bandwidth than
+ // network links within a region, so frameworks should be
+ // careful to only place suitable workloads in remote regions.
+ // Frameworks that are not region-aware will never receive
+ // offers for remote agents; region-aware frameworks are assumed
+ // to implement their own logic to decide which workloads (if
+ // any) are suitable for placement on remote agents.
+ REGION_AWARE = 8;
+ }
+
+ // Enum fields should be optional, see: MESOS-4997.
+ optional Type type = 1;
+ }
+
+ // This field allows a framework to advertise its set of
+ // capabilities (e.g., ability to receive offers for revocable
+ // resources).
+ repeated Capability capabilities = 10;
+
+ // Labels are free-form key value pairs supplied by the framework
+ // scheduler (e.g., to describe additional functionality offered by
+ // the framework). These labels are not interpreted by Mesos itself.
+ // Labels should not contain duplicate key-value pairs.
+ optional Labels labels = 11;
+}
+
+
+/**
+ * Describes a general non-interpreting non-killing check for a task or
+ * executor (or any arbitrary process/command). A type is picked by
+ * specifying one of the optional fields. Specifying more than one type
+ * is an error.
+ *
+ * NOTE: This API is unstable and the related feature is experimental.
+ */
+message CheckInfo {
+ enum Type {
+ UNKNOWN = 0;
+ COMMAND = 1;
+ HTTP = 2;
+ TCP = 3;
+
+ // TODO(alexr): Consider supporting custom user checks. They should
+ // probably be paired with a `data` field and complemented by a
+ // `data` response in `CheckStatusInfo`.
+ }
+
+ // Describes a command check. If applicable, enters mount and/or network
+ // namespaces of the task.
+ message Command {
+ required CommandInfo command = 1;
+ }
+
+ // Describes an HTTP check. Sends a GET request to
+ // http://<host>:port/path. Note that <host> is not configurable and is
+ // resolved automatically to 127.0.0.1.
+ message Http {
+ // Port to send the HTTP request.
+ required uint32 port = 1;
+
+ // HTTP request path.
+ optional string path = 2;
+
+ // TODO(alexr): Add support for HTTP method. While adding POST
+ // and PUT is simple, supporting payload is more involved.
+
+ // TODO(alexr): Add support for custom HTTP headers.
+
+ // TODO(alexr): Consider adding an optional message to describe TLS
+ // options and thus enabling https. Such message might contain certificate
+ // validation, TLS version.
+ }
+
+ // Describes a TCP check, i.e. based on establishing a TCP connection to
+ // the specified port. Note that <host> is not configurable and is resolved
+ // automatically to 127.0.0.1.
+ message Tcp {
+ required uint32 port = 1;
+ }
+
+ // The type of the check.
+ optional Type type = 1;
+
+ // Command check.
+ optional Command command = 2;
+
+ // HTTP check.
+ optional Http http = 3;
+
+ // TCP check.
+ optional Tcp tcp = 7;
+
+ // Amount of time to wait to start checking the task after it
+ // transitions to `TASK_RUNNING` or `TASK_STARTING` if the latter
+ // is used by the executor.
+ optional double delay_seconds = 4 [default = 15.0];
+
+ // Interval between check attempts, i.e., amount of time to wait after
+ // the previous check finished or timed out to start the next check.
+ optional double interval_seconds = 5 [default = 10.0];
+
+ // Amount of time to wait for the check to complete. Zero means infinite
+ // timeout.
+ //
+ // After this timeout, the check attempt is aborted and no result is
+ // reported. Note that this may be considered a state change and hence
+ // may trigger a check status change delivery to the corresponding
+ // scheduler. See `CheckStatusInfo` for more details.
+ optional double timeout_seconds = 6 [default = 20.0];
+}
+
+
+/**
+ * Describes a health check for a task or executor (or any arbitrary
+ * process/command). A type is picked by specifying one of the
+ * optional fields. Specifying more than one type is an error.
+ */
+message HealthCheck {
+ enum Type {
+ UNKNOWN = 0;
+ COMMAND = 1;
+ HTTP = 2;
+ TCP = 3;
+ }
+
+ // Describes an HTTP health check. Sends a GET request to
+ // scheme://<host>:port/path. Note that <host> is not configurable and is
+ // resolved automatically, in most cases to 127.0.0.1. Default executors
+ // treat return codes between 200 and 399 as success; custom executors
+ // may employ a different strategy, e.g. leveraging the `statuses` field.
+ message HTTPCheckInfo {
+ // Currently "http" and "https" are supported.
+ optional string scheme = 3;
+
+ // Port to send the HTTP request.
+ required uint32 port = 1;
+
+ // HTTP request path.
+ optional string path = 2;
+
+ // TODO(alexr): Add support for HTTP method. While adding POST
+ // and PUT is simple, supporting payload is more involved.
+
+ // TODO(alexr): Add support for custom HTTP headers.
+
+ // TODO(alexr): Add support for success and possibly failure
+ // statuses.
+
+ // NOTE: It is up to the custom executor to interpret and act on this
+ // field. Setting this field has no effect on the default executors.
+ //
+ // TODO(haosdent): Deprecate this field when we add better support for
+ // success and possibly failure statuses, e.g. ranges of success and
+ // failure statuses.
+ repeated uint32 statuses = 4;
+
+ // TODO(haosdent): Consider adding a flag to enable task's certificate
+ // validation for HTTPS health checks, see MESOS-5997.
+
+ // TODO(benh): Include an 'optional bytes data' field for checking
+ // for specific data in the response.
+ }
+
+ // Describes a TCP health check, i.e. based on establishing
+ // a TCP connection to the specified port.
+ message TCPCheckInfo {
+ // Port expected to be open.
+ required uint32 port = 1;
+ }
+
+ // TODO(benh): Consider adding a URL health check strategy which
+ // allows doing something similar to the HTTP strategy but
+ // encapsulates all the details in a single string field.
+
+ // Amount of time to wait to start health checking the task after it
+ // transitions to `TASK_RUNNING` or `TASK_STATING` if the latter is
+ // used by the executor.
+ optional double delay_seconds = 2 [default = 15.0];
+
+ // Interval between health checks, i.e., amount of time to wait after
+ // the previous health check finished or timed out to start the next
+ // health check.
+ optional double interval_seconds = 3 [default = 10.0];
+
+ // Amount of time to wait for the health check to complete. After this
+ // timeout, the health check is aborted and treated as a failure. Zero
+ // means infinite timeout.
+ optional double timeout_seconds = 4 [default = 20.0];
+
+ // Number of consecutive failures until the task is killed by the executor.
+ optional uint32 consecutive_failures = 5 [default = 3];
+
+ // Amount of time after the task is launched during which health check
+ // failures are ignored. Once a check succeeds for the first time,
+ // the grace period does not apply anymore. Note that it includes
+ // `delay_seconds`, i.e., setting `grace_period_seconds` < `delay_seconds`
+ // has no effect.
+ optional double grace_period_seconds = 6 [default = 10.0];
+
+ // TODO(alexr): Add an optional `KillPolicy` that should be used
+ // if the task is killed because of a health check failure.
+
+ // The type of health check.
+ optional Type type = 8;
+
+ // Command health check.
+ optional CommandInfo command = 7;
+
+ // HTTP health check.
+ optional HTTPCheckInfo http = 1;
+
+ // TCP health check.
+ optional TCPCheckInfo tcp = 9;
+}
+
+
+/**
+ * Describes a kill policy for a task. Currently does not express
+ * different policies (e.g. hitting HTTP endpoints), only controls
+ * how long to wait between graceful and forcible task kill:
+ *
+ * graceful kill --------------> forcible kill
+ * grace_period
+ *
+ * Kill policies are best-effort, because machine failures / forcible
+ * terminations may occur.
+ *
+ * NOTE: For executor-less command-based tasks, the kill is performed
+ * via sending a signal to the task process: SIGTERM for the graceful
+ * kill and SIGKILL for the forcible kill. For the docker executor-less
+ * tasks the grace period is passed to 'docker stop --time'.
+ */
+message KillPolicy {
+ // The grace period specifies how long to wait before forcibly
+ // killing the task. It is recommended to attempt to gracefully
+ // kill the task (and send TASK_KILLING) to indicate that the
+ // graceful kill is in progress. Once the grace period elapses,
+ // if the task has not terminated, a forcible kill should occur.
+ // The task should not assume that it will always be allotted
+ // the full grace period. For example, the executor may be
+ // shutdown more quickly by the agent, or failures / forcible
+ // terminations may occur.
+ optional DurationInfo grace_period = 1;
+}
+
+
+/**
+ * Describes a command, executed via: '/bin/sh -c value'. Any URIs specified
+ * are fetched before executing the command. If the executable field for an
+ * uri is set, executable file permission is set on the downloaded file.
+ * Otherwise, if the downloaded file has a recognized archive extension
+ * (currently [compressed] tar and zip) it is extracted into the executor's
+ * working directory. This extraction can be disabled by setting `extract` to
+ * false. In addition, any environment variables are set before executing
+ * the command (so they can be used to "parameterize" your command).
+ */
+message CommandInfo {
+ message URI {
+ required string value = 1;
+ optional bool executable = 2;
+
+ // In case the fetched file is recognized as an archive, extract
+ // its contents into the sandbox. Note that a cached archive is
+ // not copied from the cache to the sandbox in case extraction
+ // originates from an archive in the cache.
+ optional bool extract = 3 [default = true];
+
+ // If this field is "true", the fetcher cache will be used. If not,
+ // fetching bypasses the cache and downloads directly into the
+ // sandbox directory, no matter whether a suitable cache file is
+ // available or not. The former directs the fetcher to download to
+ // the file cache, then copy from there to the sandbox. Subsequent
+ // fetch attempts with the same URI will omit downloading and copy
+ // from the cache as long as the file is resident there. Cache files
+ // may get evicted at any time, which then leads to renewed
+ // downloading. See also "docs/fetcher.md" and
+ // "docs/fetcher-cache-internals.md".
+ optional bool cache = 4;
+
+ // The fetcher's default behavior is to use the URI string's basename to
+ // name the local copy. If this field is provided, the local copy will be
+ // named with its value instead. If there is a directory component (which
+ // must be a relative path), the local copy will be stored in that
+ // subdirectory inside the sandbox.
+ optional string output_file = 5;
+ }
+
+ repeated URI uris = 1;
+
+ optional Environment environment = 2;
+
+ // There are two ways to specify the command:
+ // 1) If 'shell == true', the command will be launched via shell
+ // (i.e., /bin/sh -c 'value'). The 'value' specified will be
+ // treated as the shell command. The 'arguments' will be ignored.
+ // 2) If 'shell == false', the command will be launched by passing
+ // arguments to an executable. The 'value' specified will be
+ // treated as the filename of the executable. The 'arguments'
+ // will be treated as the arguments to the executable. This is
+ // similar to how POSIX exec families launch processes (i.e.,
+ // execlp(value, arguments(0), arguments(1), ...)).
+ // NOTE: The field 'value' is changed from 'required' to 'optional'
+ // in 0.20.0. It will only cause issues if a new framework is
+ // connecting to an old master.
+ optional bool shell = 6 [default = true];
+ optional string value = 3;
+ repeated string arguments = 7;
+
+ // Enables executor and tasks to run as a specific user. If the user
+ // field is present both in FrameworkInfo and here, the CommandInfo
+ // user value takes precedence.
+ optional string user = 5;
+}
+
+
+/**
+ * Describes information about an executor.
+ */
+message ExecutorInfo {
+ enum Type {
+ UNKNOWN = 0;
+
+ // Mesos provides a simple built-in default executor that frameworks can
+ // leverage to run shell commands and containers.
+ //
+ // NOTES:
+ //
+ // 1) `command` must not be set when using a default executor.
+ //
+ // 2) Default executor only accepts a *single* `LAUNCH` or `LAUNCH_GROUP`
+ // offer operation.
+ //
+ // 3) If `container` is set, `container.type` must be `MESOS`
+ // and `container.mesos.image` must not be set.
+ DEFAULT = 1;
+
+ // For frameworks that need custom functionality to run tasks, a `CUSTOM`
+ // executor can be used. Note that `command` must be set when using a
+ // `CUSTOM` executor.
+ CUSTOM = 2;
+ }
+
+ // For backwards compatibility, if this field is not set when using `LAUNCH`
+ // offer operation, Mesos will infer the type by checking if `command` is
+ // set (`CUSTOM`) or unset (`DEFAULT`). `type` must be set when using
+ // `LAUNCH_GROUP` offer operation.
+ //
+ // TODO(vinod): Add support for explicitly setting `type` to `DEFAULT `
+ // in `LAUNCH` offer operation.
+ optional Type type = 15;
+
+ required ExecutorID executor_id = 1;
+ optional FrameworkID framework_id = 8; // TODO(benh): Make this required.
+ optional CommandInfo command = 7;
+
+ // Executor provided with a container will launch the container
+ // with the executor's CommandInfo and we expect the container to
+ // act as a Mesos executor.
+ optional ContainerInfo container = 11;
+
+ repeated Resource resources = 5;
+ optional string name = 9;
+
+ // 'source' is an identifier style string used by frameworks to
+ // track the source of an executor. This is useful when it's
+ // possible for different executor ids to be related semantically.
+ //
+ // NOTE: 'source' is exposed alongside the resource usage of the
+ // executor via JSON on the slave. This allows users to import usage
+ // information into a time series database for monitoring.
+ //
+ // This field is deprecated since 1.0. Please use labels for
+ // free-form metadata instead.
+ optional string source = 10 [deprecated = true]; // Since 1.0.
+
+ // This field can be used to pass arbitrary bytes to an executor.
+ optional bytes data = 4;
+
+ // Service discovery information for the executor. It is not
+ // interpreted or acted upon by Mesos. It is up to a service
+ // discovery system to use this information as needed and to handle
+ // executors without service discovery information.
+ optional DiscoveryInfo discovery = 12;
+
+ // When shutting down an executor the agent will wait in a
+ // best-effort manner for the grace period specified here
+ // before forcibly destroying the container. The executor
+ // must not assume that it will always be allotted the full
+ // grace period, as the agent may decide to allot a shorter
+ // period and failures / forcible terminations may occur.
+ optional DurationInfo shutdown_grace_period = 13;
+
+ // Labels are free-form key value pairs which are exposed through
+ // master and slave endpoints. Labels will not be interpreted or
+ // acted upon by Mesos itself. As opposed to the data field, labels
+ // will be kept in memory on master and slave processes. Therefore,
+ // labels should be used to tag executors with lightweight metadata.
+ // Labels should not contain duplicate key-value pairs.
+ optional Labels labels = 14;
+}
+
+
+/**
+ * Describes a domain. A domain is a collection of hosts that have
+ * similar characteristics. Mesos currently only supports "fault
+ * domains", which identify groups of hosts with similar failure
+ * characteristics.
+ *
+ * Frameworks can generally assume that network links between hosts in
+ * the same fault domain have lower latency, higher bandwidth, and better
+ * availability than network links between hosts in different domains.
+ * Schedulers may prefer to place network-intensive workloads in the
+ * same domain, as this may improve performance. Conversely, a single
+ * failure that affects a host in a domain may be more likely to
+ * affect other hosts in the same domain; hence, schedulers may prefer
+ * to place workloads that require high availability in multiple
+ * domains. (For example, all the hosts in a single rack might lose
+ * power or network connectivity simultaneously.)
+ *
+ * There are two kinds of fault domains: regions and zones. Regions
+ * offer the highest degree of fault isolation, but network latency
+ * between regions is typically high (typically >50 ms). Zones offer a
+ * modest degree of fault isolation along with reasonably low network
+ * latency (typically <10 ms).
+ *
+ * The mapping from fault domains to physical infrastructure is up to
+ * the operator to configure. In cloud environments, regions and zones
+ * can be mapped to the "region" and "availability zone" concepts
+ * exposed by most cloud providers, respectively. In on-premise
+ * deployments, regions and zones can be mapped to data centers and
+ * racks, respectively.
+ *
+ * Both masters and agents can be configured with domains. Frameworks
+ * can compare the domains of two hosts to determine if the hosts are
+ * in the same zone, in different zones in the same region, or in
+ * different regions. Note that all masters in a given Mesos cluster
+ * must be in the same region.
+ */
+message DomainInfo {
+ message FaultDomain {
+ message RegionInfo {
+ required string name = 1;
+ }
+
+ message ZoneInfo {
+ required string name = 1;
+ }
+
+ required RegionInfo region = 1;
+ required ZoneInfo zone = 2;
+ }
+
+ optional FaultDomain fault_domain = 1;
+}
+
+
+/**
+ * Describes a master. This will probably have more fields in the
+ * future which might be used, for example, to link a framework webui
+ * to a master webui.
+ */
+message MasterInfo {
+ required string id = 1;
+
+ // The IP address (only IPv4) as a packed 4-bytes integer,
+ // stored in network order. Deprecated, use `address.ip` instead.
+ required uint32 ip = 2;
+
+ // The TCP port the Master is listening on for incoming
+ // HTTP requests; deprecated, use `address.port` instead.
+ required uint32 port = 3 [default = 5050];
+
+ // In the default implementation, this will contain information
+ // about both the IP address, port and Master name; it should really
+ // not be relied upon by external tooling/frameworks and be
+ // considered an "internal" implementation field.
+ optional string pid = 4;
+
+ // The server's hostname, if available; it may be unreliable
+ // in environments where the DNS configuration does not resolve
+ // internal hostnames (eg, some public cloud providers).
+ // Deprecated, use `address.hostname` instead.
+ optional string hostname = 5;
+
+ // The running Master version, as a string; taken from the
+ // generated "master/version.hpp".
+ optional string version = 6;
+
+ // The full IP address (supports both IPv4 and IPv6 formats)
+ // and supersedes the use of `ip`, `port` and `hostname`.
+ // Since Mesos 0.24.
+ optional Address address = 7;
+
+ // The domain that this master belongs to. All masters in a Mesos
+ // cluster should belong to the same region.
+ optional DomainInfo domain = 8;
+}
+
+
+/**
+ * Describes a slave. Note that the 'id' field is only available after
+ * a slave is registered with the master, and is made available here
+ * to facilitate re-registration.
+ */
+message SlaveInfo {
+ required string hostname = 1;
+ optional int32 port = 8 [default = 5051];
+
+ // The configured resources at the agent. This does not include any
+ // dynamic reservations or persistent volumes that may currently
+ // exist at the agent.
+ repeated Resource resources = 3;
+
+ repeated Attribute attributes = 5;
+ optional SlaveID id = 6;
+
+ // The domain that this slave belongs to. If the slave's region
+ // differs from the master's region, it will not appear in resource
+ // offers to frameworks that have not enabled the REGION_AWARE
+ // capability.
+ optional DomainInfo domain = 10;
+
+ // Slave checkpointing is always enabled in recent Mesos versions;
+ // the value of this field is ignored.
+ // TODO(joerg84): Remove checkpoint field after deprecation cycle starting
+ // with 0.27 (MESOS-2317).
+ optional bool checkpoint = 7 [default = false];
+
+ message Capability {
+ enum Type {
+ // This must be the first enum value in this list, to
+ // ensure that if 'type' is not set, the default value
+ // is UNKNOWN. This enables enum values to be added
+ // in a backwards-compatible way. See: MESOS-4997.
+ UNKNOWN = 0;
+
+ // This expresses the ability for the agent to be able
+ // to launch tasks of a 'multi-role' framework.
+ MULTI_ROLE = 1;
+
+ // This expresses the ability for the agent to be able to launch
+ // tasks, reserve resources, and create volumes using resources
+ // allocated to a 'hierarchical-role'.
+ // NOTE: This capability is required specifically for creating
+ // volumes because a hierchical role includes '/' (slashes) in them.
+ // Agents with this capability know to transform the '/' (slashes)
+ // into ' ' (spaces).
+ HIERARCHICAL_ROLE = 2;
+
+ // This capability has three effects for an agent.
+ //
+ // (1) The format of the checkpointed resources, and
+ // the resources reported to master.
+ //
+ // These resources are reported in the "pre-reservation-refinement"
+ // format if none of the resources have refined reservations. If any
+ // of the resources have refined reservations, they are reported in
+ // the "post-reservation-refinement" format. The purpose is to allow
+ // downgrading of an agent as well as communication with a pre-1.4.0
+ // master until the reservation refinement feature is actually used.
+ //
+ // See the 'Resource Format' section for more details.
+ //
+ // (2) The format of the resources reported by the HTTP endpoints.
+ //
+ // For resources reported by agent endpoints, the
+ // "pre-reservation-refinement" format is "injected" if possible.
+ // That is, resources without refined reservations will have the
+ // `Resource.role` and `Resource.reservation` set, whereas
+ // resources with refined reservations will not.
+ //
+ // See the 'Resource Format' section for more details.
+ //
+ // (3) The ability for the agent to launch tasks, reserve resources, and
+ // create volumes using resources that have refined reservations.
+ //
+ // See `ReservationInfo.reservations` section for more details.
+ //
+ // NOTE: Resources are said to have refined reservations if it uses the
+ // `Resource.reservations` field, and `Resource.reservations_size() > 1`.
+ RESERVATION_REFINEMENT = 3;
+ }
+
+ // Enum fields should be optional, see: MESOS-4997.
+ optional Type type = 1;
+ }
+}
+
+
+/**
+ * Describes a resource provider. Note that the 'id' field is only available
+ * after a resource provider is registered with the master, and is made
+ * available here to facilitate re-registration.
+ */
+message ResourceProviderInfo {
+ optional ResourceProviderID id = 1;
+ repeated Attribute attributes = 2;
+
+ // The type of the resource provider. This uniquely identifies a
+ // resource provider implementation. For instance:
+ // org.apache.mesos.rp.local.storage
+ //
+ // Please follow to Java package naming convention
+ // (https://en.wikipedia.org/wiki/Java_package#Package_naming_conventions)
+ // to avoid conflicts on type names.
+ required string type = 3;
+
+ // The name of the resource provider. There could be multiple
+ // instances of a type of resource provider. The name field is used
+ // to distinguish these instances.
+ required string name = 4;
+}
+
+
+/**
+ * Describes an Attribute or Resource "value". A value is described
+ * using the standard protocol buffer "union" trick.
+ */
+message Value {
+ enum Type {
+ SCALAR = 0;
+ RANGES = 1;
+ SET = 2;
+ TEXT = 3;
+ }
+
+ message Scalar {
+ // Scalar values are represented using floating point. To reduce
+ // the chance of unpredictable floating point behavior due to
+ // roundoff error, Mesos only supports three decimal digits of
+ // precision for scalar resource values. That is, floating point
+ // values are converted to a fixed point format that supports
+ // three decimal digits of precision, and then converted back to
+ // floating point on output. Any additional precision in scalar
+ // resource values is discarded (via rounding).
+ required double value = 1;
+ }
+
+ message Range {
+ required uint64 begin = 1;
+ required uint64 end = 2;
+ }
+
+ message Ranges {
+ repeated Range range = 1;
+ }
+
+ message Set {
+ repeated string item = 1;
+ }
+
+ message Text {
+ required string value = 1;
+ }
+
+ required Type type = 1;
+ optional Scalar scalar = 2;
+ optional Ranges ranges = 3;
+ optional Set set = 4;
+ optional Text text = 5;
+}
+
+
+/**
+ * Describes an attribute that can be set on a machine. For now,
+ * attributes and resources share the same "value" type, but this may
+ * change in the future and attributes may only be string based.
+ */
+message Attribute {
+ required string name = 1;
+ required Value.Type type = 2;
+ optional Value.Scalar scalar = 3;
+ optional Value.Ranges ranges = 4;
+ optional Value.Set set = 6;
+ optional Value.Text text = 5;
+}
+
+
+/**
+ * Describes a resource from a resource provider. The `name` field is
+ * a string like "cpus" or "mem" that indicates which kind of resource
+ * this is; the rest of the fields describe the properties of the
+ * resource. A resource can take on one of three types: scalar
+ * (double), a list of finite and discrete ranges (e.g., [1-10,
+ * 20-30]), or a set of items. A resource is described using the
+ * standard protocol buffer "union" trick.
+ *
+ * Note that "disk" and "mem" resources are scalar values expressed in
+ * megabytes. Fractional "cpus" values are allowed (e.g., "0.5"),
+ * which correspond to partial shares of a CPU.
+ */
+message Resource {
+ optional ResourceProviderID provider_id = 12;
+
+ required string name = 1;
+ required Value.Type type = 2;
+ optional Value.Scalar scalar = 3;
+ optional Value.Ranges ranges = 4;
+ optional Value.Set set = 5;
+
+ // The role that this resource is reserved for. If "*", this indicates
+ // that the resource is unreserved. Otherwise, the resource will only
+ // be offered to frameworks that belong to this role.
+ //
+ // NOTE: Frameworks must not set this field if `reservations` is set.
+ // See the 'Resource Format' section for more details.
+ //
+ // TODO(mpark): Deprecate once `reservations` is no longer experimental.
+ optional string role = 6 [default = "*", deprecated=true];
+
+ // This was initially introduced to support MULTI_ROLE capable
+ // frameworks. Frameworks that are not MULTI_ROLE capable can
+ // continue to assume that the offered resources are allocated
+ // to their role.
+ message AllocationInfo {
+ // If set, this resource is allocated to a role. Note that in the
+ // future, this may be unset and the scheduler may be responsible
+ // for allocating to one of its roles.
+ optional string role = 1;
+
+ // In the future, we may add additional fields here, e.g. priority
+ // tier, type of allocation (quota / fair share).
+ }
+
+ optional AllocationInfo allocation_info = 11;
+
+ // Resource Format:
+ //
+ // Frameworks receive resource offers in one of two formats, depending on
+ // whether the RESERVATION_REFINEMENT capability is enabled.
+ //
+ // __WITHOUT__ the RESERVATION_REFINEMENT capability, the framework is offered
+ // resources in the "pre-reservation-refinement" format. In this format, the
+ // `Resource.role` and `Resource.reservation` fields are used in conjunction
+ // to describe the reservation state of a `Resource` message.
+ //
+ // The following is an overview of the possible reservation states:
+ //
+ // +------------+------------------------------------------------------------+
+ // | unreserved | { |
+ // | | role: "*", |
+ // | | reservation: <not set>, |
+ // | | reservations: <unused> |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ // | static | { |
+ // | | role: "eng", |
+ // | | reservation: <not set>, |
+ // | | reservations: <unused> |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ // | dynamic | { |
+ // | | role: "eng", |
+ // | | reservation: { |
+ // | | type: <unused>, |
+ // | | role: <unused>, |
+ // | | principal: <optional>, |
+ // | | labels: <optional> |
+ // | | }, |
+ // | | reservations: <unused> |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ //
+ // __WITH__ the RESERVATION_REFINEMENT capability, the framework is offered
+ // resources in the "post-reservation-refinement" format. In this format, the
+ // reservation state of a `Resource` message is expressed solely in
+ // `Resource.reservations` field.
+ //
+ // The following is an overview of the possible reservation states:
+ //
+ // +------------+------------------------------------------------------------+
+ // | unreserved | { |
+ // | | role: <unused>, |
+ // | | reservation: <unused>, |
+ // | | reservations: [] |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ // | static | { |
+ // | | role: <unused>, |
+ // | | reservation: <unused>, |
+ // | | reservations: [ |
+ // | | { |
+ // | | type: STATIC, |
+ // | | role: "eng", |
+ // | | principal: <optional>, |
+ // | | labels: <optional> |
+ // | | } |
+ // | | ] |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ // | dynamic | { |
+ // | | role: <unused>, |
+ // | | reservation: <unused>, |
+ // | | reservations: [ |
+ // | | { |
+ // | | type: DYNAMIC, |
+ // | | role: "eng", |
+ // | | principal: <optional>, |
+ // | | labels: <optional> |
+ // | | } |
+ // | | ] |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ //
+ // We can also __refine__ reservations with this capability like so:
+ //
+ // +------------+------------------------------------------------------------+
+ // | refined | { |
+ // | | role: <unused>, |
+ // | | reservation: <unused>, |
+ // | | reservations: [ |
+ // | | { |
+ // | | type: STATIC or DYNAMIC, |
+ // | | role: "eng", |
+ // | | principal: <optional>, |
+ // | | labels: <optional> |
+ // | | }, |
+ // | | { |
+ // | | type: DYNAMIC, |
+ // | | role: "eng/front_end", |
+ // | | principal: <optional>, |
+ // | | labels: <optional> |
+ // | | } |
+ // | | ] |
+ // | | } |
+ // +------------+------------------------------------------------------------+
+ //
+ // NOTE: Each `ReservationInfo` in the `reservations` field denotes
+ // a reservation that refines the previous `ReservationInfo`.
+
+ message ReservationInfo {
+ // Describes a reservation. A static reservation is set by the operator on
+ // the command-line and they are immutable without agent restart. A dynamic
+ // reservation is made by an operator via the '/reserve' HTTP endpoint
+ // or by a framework via the offer cycle by sending back an
+ // 'Offer::Operation::Reserve' message.
+ //
+ // NOTE: We currently do not allow frameworks with role "*" to make dynamic
+ // reservations.
+
+ enum Type {
+ UNKNOWN = 0;
+ STATIC = 1;
+ DYNAMIC = 2;
+ }
+
+ // The type of this reservation.
+ //
+ // NOTE: This field must not be set for `Resource.reservation`.
+ // See the 'Resource Format' section for more details.
+ optional Type type = 4;
+
+ // The role to which this reservation is made for.
+ //
+ // NOTE: This field must not be set for `Resource.reservation`.
+ // See the 'Resource Format' section for more details.
+ optional string role = 3;
+
+ // Indicates the principal, if any, of the framework or operator
+ // that reserved this resource. If reserved by a framework, the
+ // field should match the `FrameworkInfo.principal`. It is used in
+ // conjunction with the `UnreserveResources` ACL to determine
+ // whether the entity attempting to unreserve this resource is
+ // permitted to do so.
+ optional string principal = 1;
+
+ // Labels are free-form key value pairs that can be used to
+ // associate arbitrary metadata with a reserved resource. For
+ // example, frameworks can use labels to identify the intended
+ // purpose for a portion of the resources the framework has
+ // reserved at a given slave. Labels should not contain duplicate
+ // key-value pairs.
+ optional Labels labels = 2;
+ }
+
+ // If this is set, this resource was dynamically reserved by an
+ // operator or a framework. Otherwise, this resource is either unreserved
+ // or statically reserved by an operator via the --resources flag.
+ //
+ // NOTE: Frameworks must not set this field if `reservations` is set.
+ // See the 'Resource Format' section for more details.
+ //
+ // TODO(mpark): Deprecate once `reservations` is no longer experimental.
+ optional ReservationInfo reservation = 8;
+
+ // The stack of reservations. If this field is empty, it indicates that this
+ // resource is unreserved. Otherwise, the resource is reserved. The first
+ // `ReservationInfo` may have type `STATIC` or `DYNAMIC`, but the rest must
+ // have `DYNAMIC`. One can create a new reservation on top of an existing
+ // one by pushing a new `ReservationInfo` to the back. The last
+ // `ReservationInfo` in this stack is the "current" reservation. The new
+ // reservation's role must be a child of the current reservation's role.
+ //
+ // NOTE: Frameworks must not set this field if `reservation` is set.
+ // See the 'Resource Format' section for more details.
+ //
+ // TODO(mpark): Deprecate `role` and `reservation` once this is stable.
+ repeated ReservationInfo reservations = 13; // EXPERIMENTAL.
+
+ message DiskInfo {
+ // Describes a persistent disk volume.
+ //
+ // A persistent disk volume will not be automatically garbage
+ // collected if the task/executor/slave terminates, but will be
+ // re-offered to the framework(s) belonging to the 'role'.
+ //
+ // NOTE: Currently, we do not allow persistent disk volumes
+ // without a reservation (i.e., 'role' cannot be '*').
+ message Persistence {
+ // A unique ID for the persistent disk volume. This ID must be
+ // unique per role on each slave. Although it is possible to use
+ // the same ID on different slaves in the cluster and to reuse
+ // IDs after a volume with that ID has been destroyed, both
+ // practices are discouraged.
+ required string id = 1;
+
+ // This field indicates the principal of the operator or
+ // framework that created this volume. It is used in conjunction
+ // with the "destroy" ACL to determine whether an entity
+ // attempting to destroy the volume is permitted to do so.
+ //
+ // NOTE: This field should match the FrameworkInfo.principal of
+ // the framework that created the volume.
+ optional string principal = 2;
+ }
+
+ optional Persistence persistence = 1;
+
+ // Describes how this disk resource will be mounted in the
+ // container. If not set, the disk resource will be used as the
+ // sandbox. Otherwise, it will be mounted according to the
+ // 'container_path' inside 'volume'. The 'host_path' inside
+ // 'volume' is ignored.
+ // NOTE: If 'volume' is set but 'persistence' is not set, the
+ // volume will be automatically garbage collected after
+ // task/executor terminates. Currently, if 'persistence' is set,
+ // 'volume' must be set.
+ optional Volume volume = 2;
+
+ // Describes where a disk originates from.
+ // TODO(jmlvanre): Add support for BLOCK devices.
+ message Source {
+ enum Type {
+ UNKNOWN = 0;
+ PATH = 1;
+ MOUNT = 2;
+ }
+
+ // A folder that can be located on a separate disk device. This
+ // can be shared and carved up as necessary between frameworks.
+ message Path {
+ // Path to the folder (e.g., /mnt/raid/disk0).
+ optional string root = 1;
+ }
+
+ // A mounted file-system set up by the Agent administrator. This
+ // can only be used exclusively: a framework cannot accept a
+ // partial amount of this disk.
+ message Mount {
+ // Path to mount point (e.g., /mnt/raid/disk0).
+ optional string root = 1;
+ }
+
+ required Type type = 1;
+ optional Path path = 2;
+ optional Mount mount = 3;
+ }
+
+ optional Source source = 3;
+ }
+
+ optional DiskInfo disk = 7;
+
+ message RevocableInfo {}
+
+ // If this is set, the resources are revocable, i.e., any tasks or
+ // executors launched using these resources could get preempted or
+ // throttled at any time. This could be used by frameworks to run
+ // best effort tasks that do not need strict uptime or performance
+ // guarantees. Note that if this is set, 'disk' or 'reservation'
+ // cannot be set.
+ optional RevocableInfo revocable = 9;
+
+ // Allow the resource to be shared across tasks.
+ message SharedInfo {}
+
+ // If this is set, the resources are shared, i.e. multiple tasks
+ // can be launched using this resource and all of them shall refer
+ // to the same physical resource on the cluster. Note that only
+ // persistent volumes can be shared currently.
+ optional SharedInfo shared = 10;
+}
+
+
+/**
+ * When the network bandwidth caps are enabled and the container
+ * is over its limit, outbound packets may be either delayed or
+ * dropped completely either because it exceeds the maximum bandwidth
+ * allocation for a single container (the cap) or because the combined
+ * network traffic of multiple containers on the host exceeds the
+ * transmit capacity of the host (the share). We can report the
+ * following statistics for each of these conditions exported directly
+ * from the Linux Traffic Control Queueing Discipline.
+ *
+ * id : name of the limiter, e.g. 'tx_bw_cap'
+ * backlog : number of packets currently delayed
+ * bytes : total bytes seen
+ * drops : number of packets dropped in total
+ * overlimits : number of packets which exceeded allocation
+ * packets : total packets seen
+ * qlen : number of packets currently queued
+ * rate_bps : throughput in bytes/sec
+ * rate_pps : throughput in packets/sec
+ * requeues : number of times a packet has been delayed due to
+ * locking or device contention issues
+ *
+ * More information on the operation of Linux Traffic Control can be
+ * found at http://www.lartc.org/lartc.html.
+ */
+message TrafficControlStatistics {
+ required string id = 1;
+ optional uint64 backlog = 2;
+ optional uint64 bytes = 3;
+ optional uint64 drops = 4;
+ optional uint64 overlimits = 5;
+ optional uint64 packets = 6;
+ optional uint64 qlen = 7;
+ optional uint64 ratebps = 8;
+ optional uint64 ratepps = 9;
+ optional uint64 requeues = 10;
+}
+
+
+message IpStatistics {
+ optional int64 Forwarding = 1;
+ optional int64 DefaultTTL = 2;
+ optional int64 InReceives = 3;
+ optional int64 InHdrErrors = 4;
+ optional int64 InAddrErrors = 5;
+ optional int64 ForwDatagrams = 6;
+ optional int64 InUnknownProtos = 7;
+ optional int64 InDiscards = 8;
+ optional int64 InDelivers = 9;
+ optional int64 OutRequests = 10;
+ optional int64 OutDiscards = 11;
+ optional int64 OutNoRoutes = 12;
+ optional int64 ReasmTimeout = 13;
+ optional int64 ReasmReqds = 14;
+ optional int64 ReasmOKs = 15;
+ optional int64 ReasmFails = 16;
+ optional int64 FragOKs = 17;
+ optional int64 FragFails = 18;
+ optional int64 FragCreates = 19;
+}
+
+
+message IcmpStatistics {
+ optional int64 InMsgs = 1;
+ optional int64 InErrors = 2;
+ optional int64 InCsumErrors = 3;
+ optional int64 InDestUnreachs = 4;
+ optional int64 InTimeExcds = 5;
+ optional int64 InParmProbs = 6;
+ optional int64 InSrcQuenchs = 7;
+ optional int64 InRedirects = 8;
+ optional int64 InEchos = 9;
+ optional int64 InEchoReps = 10;
+ optional int64 InTimestamps = 11;
+ optional int64 InTimestampReps = 12;
+ optional int64 InAddrMasks = 13;
+ optional int64 InAddrMaskReps = 14;
+ optional int64 OutMsgs = 15;
+ optional int64 OutErrors = 16;
+ optional int64 OutDestUnreachs = 17;
+ optional int64 OutTimeExcds = 18;
+ optional int64 OutParmProbs = 19;
+ optional int64 OutSrcQuenchs = 20;
+ optional int64 OutRedirects = 21;
+ optional int64 OutEchos = 22;
+ optional int64 OutEchoReps = 23;
+ optional int64 OutTimestamps = 24;
+ optional int64 OutTimestampReps = 25;
+ optional int64 OutAddrMasks = 26;
+ optional int64 OutAddrMaskReps = 27;
+}
+
+
+message TcpStatistics {
+ optional int64 RtoAlgorithm = 1;
+ optional int64 RtoMin = 2;
+ optional int64 RtoMax = 3;
+ optional int64 MaxConn = 4;
+ optional int64 ActiveOpens = 5;
+ optional int64 PassiveOpens = 6;
+ optional int64 AttemptFails = 7;
+ optional int64 EstabResets = 8;
+ optional int64 CurrEstab = 9;
+ optional int64 InSegs = 10;
+ optional int64 OutSegs = 11;
+ optional int64 RetransSegs = 12;
+ optional int64 InErrs = 13;
+ optional int64 OutRsts = 14;
+ optional int64 InCsumErrors = 15;
+}
+
+
+message UdpStatistics {
+ optional int64 InDatagrams = 1;
+ optional int64 NoPorts = 2;
+ optional int64 InErrors = 3;
+ optional int64 OutDatagrams = 4;
+ optional int64 RcvbufErrors = 5;
+ optional int64 SndbufErrors = 6;
+ optional int64 InCsumErrors = 7;
+ optional int64 IgnoredMulti = 8;
+}
+
+
+message SNMPStatistics {
+ optional IpStatistics ip_stats = 1;
+ optional IcmpStatistics icmp_stats = 2;
+ optional TcpStatistics tcp_stats = 3;
+ optional UdpStatistics udp_stats = 4;
+}
+
+
+message DiskStatistics {
+ optional Resource.DiskInfo.Source source = 1;
+ optional Resource.DiskInfo.Persistence persistence = 2;
+ optional uint64 limit_bytes = 3;
+ optional uint64 used_bytes = 4;
+}
+
+
+/**
+ * A snapshot of resource usage statistics.
+ */
+message ResourceStatistics {
+ required double timestamp = 1; // Snapshot time, in seconds since the Epoch.
+
+ optional uint32 processes = 30;
+ optional uint32 threads = 31;
+
+ // CPU Usage Information:
+ // Total CPU time spent in user mode, and kernel mode.
+ optional double cpus_user_time_secs = 2;
+ optional double cpus_system_time_secs = 3;
+
+ // Number of CPUs allocated.
+ optional double cpus_limit = 4;
+
+ // cpu.stat on process throttling (for contention issues).
+ optional uint32 cpus_nr_periods = 7;
+ optional uint32 cpus_nr_throttled = 8;
+ optional double cpus_throttled_time_secs = 9;
+
+ // Memory Usage Information:
+
+ // mem_total_bytes was added in 0.23.0 to represent the total memory
+ // of a process in RAM (as opposed to in Swap). This was previously
+ // reported as mem_rss_bytes, which was also changed in 0.23.0 to
+ // represent only the anonymous memory usage, to keep in sync with
+ // Linux kernel's (arguably erroneous) use of terminology.
+ optional uint64 mem_total_bytes = 36;
+
+ // Total memory + swap usage. This is set if swap is enabled.
+ optional uint64 mem_total_memsw_bytes = 37;
+
+ // Hard memory limit for a container.
+ optional uint64 mem_limit_bytes = 6;
+
+ // Soft memory limit for a container.
+ optional uint64 mem_soft_limit_bytes = 38;
+
+ // Broken out memory usage information: pagecache, rss (anonymous),
+ // mmaped files and swap.
+
+ // TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in
+ // 0.23.0 and will be removed in 0.24.0.
+ optional uint64 mem_file_bytes = 10;
+ optional uint64 mem_anon_bytes = 11;
+
+ // mem_cache_bytes is added in 0.23.0 to represent page cache usage.
+ optional uint64 mem_cache_bytes = 39;
+
+ // Since 0.23.0, mem_rss_bytes is changed to represent only
+ // anonymous memory usage. Note that neither its requiredness, type,
+ // name nor numeric tag has been changed.
+ optional uint64 mem_rss_bytes = 5;
+
+ optional uint64 mem_mapped_file_bytes = 12;
+ // This is only set if swap is enabled.
+ optional uint64 mem_swap_bytes = 40;
+ optional uint64 mem_unevictable_bytes = 41;
+
+ // Number of occurrences of different levels of memory pressure
+ // events reported by memory cgroup. Pressure listening (re)starts
+ // with these values set to 0 when slave (re)starts. See
+ // https://www.kernel.org/doc/Documentation/cgroups/memory.txt for
+ // more details.
+ optional uint64 mem_low_pressure_counter = 32;
+ optional uint64 mem_medium_pressure_counter = 33;
+ optional uint64 mem_critical_pressure_counter = 34;
+
+ // Disk Usage Information for executor working directory.
+ optional uint64 disk_limit_bytes = 26;
+ optional uint64 disk_used_bytes = 27;
+
+ // Per disk (resource) statistics.
+ repeated DiskStatistics disk_statistics = 43;
+
+ // Cgroups blkio statistics.
+ optional CgroupInfo.Blkio.Statistics blkio_statistics = 44;
+
+ // Perf statistics.
+ optional PerfStatistics perf = 13;
+
+ // Network Usage Information:
+ optional uint64 net_rx_packets = 14;
+ optional uint64 net_rx_bytes = 15;
+ optional uint64 net_rx_errors = 16;
+ optional uint64 net_rx_dropped = 17;
+ optional uint64 net_tx_packets = 18;
+ optional uint64 net_tx_bytes = 19;
+ optional uint64 net_tx_errors = 20;
+ optional uint64 net_tx_dropped = 21;
+
+ // The kernel keeps track of RTT (round-trip time) for its TCP
+ // sockets. RTT is a way to tell the latency of a container.
+ optional double net_tcp_rtt_microsecs_p50 = 22;
+ optional double net_tcp_rtt_microsecs_p90 = 23;
+ optional double net_tcp_rtt_microsecs_p95 = 24;
+ optional double net_tcp_rtt_microsecs_p99 = 25;
+
+ optional double net_tcp_active_connections = 28;
+ optional double net_tcp_time_wait_connections = 29;
+
+ // Network traffic flowing into or out of a container can be delayed
+ // or dropped due to congestion or policy inside and outside the
+ // container.
+ repeated TrafficControlStatistics net_traffic_control_statistics = 35;
+
+ // Network SNMP statistics for each container.
+ optional SNMPStatistics net_snmp_statistics = 42;
+}
+
+
+/**
+ * Describes a snapshot of the resource usage for executors.
+ */
+message ResourceUsage {
+ message Executor {
+ required ExecutorInfo executor_info = 1;
+
+ // This includes resources used by the executor itself
+ // as well as its active tasks.
+ repeated Resource allocated = 2;
+
+ // Current resource usage. If absent, the containerizer
+ // cannot provide resource usage.
+ optional ResourceStatistics statistics = 3;
+
+ // The container id for the executor specified in the executor_info field.
+ required ContainerID container_id = 4;
+
+ message Task {
+ required string name = 1;
+ required TaskID id = 2;
+ repeated Resource resources = 3;
+ optional Labels labels = 4;
+ }
+
+ // Non-terminal tasks.
+ repeated Task tasks = 5;
+ }
+
+ repeated Executor executors = 1;
+
+ // Slave's total resources including checkpointed dynamic
+ // reservations and persistent volumes.
+ repeated Resource total = 2;
+}
+
+
+/**
+ * Describes a sample of events from "perf stat". Only available on
+ * Linux.
+ *
+ * NOTE: Each optional field matches the name of a perf event (see
+ * "perf list") with the following changes:
+ * 1. Names are downcased.
+ * 2. Hyphens ('-') are replaced with underscores ('_').
+ * 3. Events with alternate names use the name "perf stat" returns,
+ * e.g., for the event "cycles OR cpu-cycles" perf always returns
+ * cycles.
+ */
+message PerfStatistics {
+ required double timestamp = 1; // Start of sample interval, in seconds since the Epoch.
+ required double duration = 2; // Duration of sample interval, in seconds.
+
+ // Hardware event.
+ optional uint64 cycles = 3;
+ optional uint64 stalled_cycles_frontend = 4;
+ optional uint64 stalled_cycles_backend = 5;
+ optional uint64 instructions = 6;
+ optional uint64 cache_references = 7;
+ optional uint64 cache_misses = 8;
+ optional uint64 branches = 9;
+ optional uint64 branch_misses = 10;
+ optional uint64 bus_cycles = 11;
+ optional uint64 ref_cycles = 12;
+
+ // Software event.
+ optional double cpu_clock = 13;
+ optional double task_clock = 14;
+ optional uint64 page_faults = 15;
+ optional uint64 minor_faults = 16;
+ optional uint64 major_faults = 17;
+ optional uint64 context_switches = 18;
+ optional uint64 cpu_migrations = 19;
+ optional uint64 alignment_faults = 20;
+ optional uint64 emulation_faults = 21;
+
+ // Hardware cache event.
+ optional uint64 l1_dcache_loads = 22;
+ optional uint64 l1_dcache_load_misses = 23;
+ optional uint64 l1_dcache_stores = 24;
+ optional uint64 l1_dcache_store_misses = 25;
+ optional uint64 l1_dcache_prefetches = 26;
+ optional uint64 l1_dcache_prefetch_misses = 27;
+ optional uint64 l1_icache_loads = 28;
+ optional uint64 l1_icache_load_misses = 29;
+ optional uint64 l1_icache_prefetches = 30;
+ optional uint64 l1_icache_prefetch_misses = 31;
+ optional uint64 llc_loads = 32;
+ optional uint64 llc_load_misses = 33;
+ optional uint64 llc_stores = 34;
+ optional uint64 llc_store_misses = 35;
+ optional uint64 llc_prefetches = 36;
+ optional uint64 llc_prefetch_misses = 37;
+ optional uint64 dtlb_loads = 38;
+ optional uint64 dtlb_load_misses = 39;
+ optional uint64 dtlb_stores = 40;
+ optional uint64 dtlb_store_misses = 41;
+ optional uint64 dtlb_prefetches = 42;
+ optional uint64 dtlb_prefetch_misses = 43;
+ optional uint64 itlb_loads = 44;
+ optional uint64 itlb_load_misses = 45;
+ optional uint64 branch_loads = 46;
+ optional uint64 branch_load_misses = 47;
+ optional uint64 node_loads = 48;
+ optional uint64 node_load_misses = 49;
+ optional uint64 node_stores = 50;
+ optional uint64 node_store_misses = 51;
+ optional uint64 node_prefetches = 52;
+ optional uint64 node_prefetch_misses = 53;
+}
+
+
+/**
+ * Describes a request for resources that can be used by a framework
+ * to proactively influence the allocator. If 'slave_id' is provided
+ * then this request is assumed to only apply to resources on that
+ * slave.
+ */
+message Request {
+ optional SlaveID slave_id = 1;
+ repeated Resource resources = 2;
+}
+
+
+/**
+ * Describes some resources available on a slave. An offer only
+ * contains resources from a single slave.
+ */
+message Offer {
+ required OfferID id = 1;
+ required FrameworkID framework_id = 2;
+ required SlaveID slave_id = 3;
+ required string hostname = 4;
+
+ // URL for reaching the slave running on the host.
+ optional URL url = 8;
+
+ // The domain of the slave.
+ optional DomainInfo domain = 11;
+
+ repeated Resource resources = 5;
+ repeated Attribute attributes = 7;
+ repeated ExecutorID executor_ids = 6;
+
+ // Signifies that the resources in this Offer may be unavailable during
+ // the given interval. Any tasks launched using these resources may be
+ // killed when the interval arrives. For example, these resources may be
+ // part of a planned maintenance schedule.
+ //
+ // This field only provides information about a planned unavailability.
+ // The unavailability interval may not necessarily start at exactly this
+ // interval, nor last for exactly the duration of this interval.
+ // The unavailability may also be forever! See comments in
+ // `Unavailability` for more details.
+ optional Unavailability unavailability = 9;
+
+ // An offer represents resources allocated to *one* of the
+ // roles managed by the scheduler. (Therefore, each
+ // `Offer.resources[i].allocation_info` will match the
+ // top level `Offer.allocation_info`).
+ optional Resource.AllocationInfo allocation_info = 10;
+
+ // Defines an operation that can be performed against offers.
+ message Operation {
+ enum Type {
+ UNKNOWN = 0;
+ LAUNCH = 1;
+ LAUNCH_GROUP = 6;
+ RESERVE = 2;
+ UNRESERVE = 3;
+ CREATE = 4;
+ DESTROY = 5;
+ }
+
+ // TODO(vinod): Deprecate this in favor of `LaunchGroup` below.
+ message Launch {
+ repeated TaskInfo task_infos = 1;
+ }
+
+ // Unlike `Launch` above, all the tasks in a `task_group` are
+ // atomically delivered to an executor.
+ //
+ // `NetworkInfo` set on executor will be shared by all tasks in
+ // the task group.
+ //
+ // TODO(vinod): Any volumes set on executor could be used by a
+ // task by explicitly setting `Volume.source` in its resources.
+ message LaunchGroup {
+ required ExecutorInfo executor = 1;
+ required TaskGroupInfo task_group = 2;
+ }
+
+ message Reserve {
+ repeated Resource resources = 1;
+ }
+
+ message Unreserve {
+ repeated Resource resources = 1;
+ }
+
+ message Create {
+ repeated Resource volumes = 1;
+ }
+
+ message Destroy {
+ repeated Resource volumes = 1;
+ }
+
+ optional Type type = 1;
+ optional Launch launch = 2;
+ optional LaunchGroup launch_group = 7;
+ optional Reserve reserve = 3;
+ optional Unreserve unreserve = 4;
+ optional Create create = 5;
+ optional Destroy destroy = 6;
+ }
+}
+
+
+/**
+ * A request to return some resources occupied by a framework.
+ */
+message InverseOffer {
+ // This is the same OfferID as found in normal offers, which allows
+ // re-use of some of the OfferID-only messages.
+ required OfferID id = 1;
+
+ // URL for reaching the slave running on the host. This enables some
+ // optimizations as described in MESOS-3012, such as allowing the
+ // scheduler driver to bypass the master and talk directly with a slave.
+ optional URL url = 2;
+
+ // The framework that should release its resources.
+ // If no specifics are provided (i.e. which slave), all the framework's
+ // resources are requested back.
+ required FrameworkID framework_id = 3;
+
+ // Specified if the resources need to be released from a particular slave.
+ // All the framework's resources on this slave are requested back,
+ // unless further qualified by the `resources` field.
+ optional SlaveID slave_id = 4;
+
+ // This InverseOffer represents a planned unavailability event in the
+ // specified interval. Any tasks running on the given framework or slave
+ // may be killed when the interval arrives. Therefore, frameworks should
+ // aim to gracefully terminate tasks prior to the arrival of the interval.
+ //
+ // For reserved resources, the resources are expected to be returned to the
+ // framework after the unavailability interval. This is an expectation,
+ // not a guarantee. For example, if the unavailability duration is not set,
+ // the resources may be removed permanently.
+ //
+ // For other resources, there is no guarantee that requested resources will
+ // be returned after the unavailability interval. The allocator has no
+ // obligation to re-offer these resources to the prior framework after
+ // the unavailability.
+ required Unavailability unavailability = 5;
+
+ // A list of resources being requested back from the framework,
+ // on the slave identified by `slave_id`. If no resources are specified
+ // then all resources are being requested back. For the purpose of
+ // maintenance, this field is always empty (maintenance always requests
+ // all resources back).
+ repeated Resource resources = 6;
+
+ // TODO(josephw): Add additional options for narrowing down the resources
+ // being requested back. Such as specific executors, tasks, etc.
+}
+
+
+/**
+ * Describes a task. Passed from the scheduler all the way to an
+ * executor (see SchedulerDriver::launchTasks and
+ * Executor::launchTask). Either ExecutorInfo or CommandInfo should be set.
+ * A different executor can be used to launch this task, and subsequent tasks
+ * meant for the same executor can reuse the same ExecutorInfo struct.
+ */
+message TaskInfo {
+ required string name = 1;
+ required TaskID task_id = 2;
+ required SlaveID slave_id = 3;
+ repeated Resource resources = 4;
+ optional ExecutorInfo executor = 5;
+ optional CommandInfo command = 7;
+
+ // Task provided with a container will launch the container as part
+ // of this task paired with the task's CommandInfo.
+ optional ContainerInfo container = 9;
+
+ // A health check for the task. Implemented for executor-less
+ // command-based tasks. For tasks that specify an executor, it is
+ // the executor's responsibility to implement the health checking.
+ optional HealthCheck health_check = 8;
+
+ // A general check for the task. Implemented for all built-in executors.
+ // For tasks that specify an executor, it is the executor's responsibility
+ // to implement checking support. Executors should (all built-in executors
+ // will) neither interpret nor act on the check's result.
+ //
+ // NOTE: Check support in built-in executors is experimental.
+ //
+ // TODO(alexr): Consider supporting multiple checks per task.
+ optional CheckInfo check = 13;
+
+ // A kill policy for the task. Implemented for executor-less
+ // command-based and docker tasks. For tasks that specify an
+ // executor, it is the executor's responsibility to implement
+ // the kill policy.
+ optional KillPolicy kill_policy = 12;
+
+ optional bytes data = 6;
+
+ // Labels are free-form key value pairs which are exposed through
+ // master and slave endpoints. Labels will not be interpreted or
+ // acted upon by Mesos itself. As opposed to the data field, labels
+ // will be kept in memory on master and slave processes. Therefore,
+ // labels should be used to tag tasks with light-weight meta-data.
+ // Labels should not contain duplicate key-value pairs.
+ optional Labels labels = 10;
+
+ // Service discovery information for the task. It is not interpreted
+ // or acted upon by Mesos. It is up to a service discovery system
+ // to use this information as needed and to handle tasks without
+ // service discovery information.
+ optional DiscoveryInfo discovery = 11;
+}
+
+
+/**
+ * Describes a group of tasks that belong to an executor. The
+ * executor will receive the task group in a single message to
+ * allow the group to be launched "atomically".
+ *
+ * NOTES:
+ * 1) `NetworkInfo` must not be set inside task's `ContainerInfo`.
+ * 2) `TaskInfo.executor` doesn't need to set. If set, it should match
+ * `LaunchGroup.executor`.
+ */
+message TaskGroupInfo {
+ repeated TaskInfo tasks = 1;
+}
+
+
+// TODO(bmahler): Add executor_uuid here, and send it to the master. This will
+// allow us to expose executor work directories for tasks in the webui when
+// looking from the master level. Currently only the slave knows which run the
+// task belongs to.
+/**
+ * Describes a task, similar to `TaskInfo`.
+ *
+ * `Task` is used in some of the Mesos messages found below.
+ * `Task` is used instead of `TaskInfo` if:
+ * 1) we need additional IDs, such as a specific
+ * framework, executor, or agent; or
+ * 2) we do not need the additional data, such as the command run by the
+ * task or the health checks. These additional fields may be large and
+ * unnecessary for some Mesos messages.
+ *
+ * `Task` is generally constructed from a `TaskInfo`. See protobuf::createTask.
+ */
+message Task {
+ required string name = 1;
+ required TaskID task_id = 2;
+ required FrameworkID framework_id = 3;
+ optional ExecutorID executor_id = 4;
+ required SlaveID slave_id = 5;
+ required TaskState state = 6; // Latest state of the task.
+ repeated Resource resources = 7;
+ repeated TaskStatus statuses = 8;
+
+ // These fields correspond to the state and uuid of the latest
+ // status update forwarded to the master.
+ // NOTE: Either both the fields must be set or both must be unset.
+ optional TaskState status_update_state = 9;
+ optional bytes status_update_uuid = 10;
+
+ optional Labels labels = 11;
+
+ // Service discovery information for the task. It is not interpreted
+ // or acted upon by Mesos. It is up to a service discovery system
+ // to use this information as needed and to handle tasks without
+ // service discovery information.
+ optional DiscoveryInfo discovery = 12;
+
+ // Container information for the task.
+ optional ContainerInfo container = 13;
+
+ // Specific user under which task is running.
+ optional string user = 14;
+}
+
+
+/**
+ * Describes possible task states. IMPORTANT: Mesos assumes tasks that
+ * enter terminal states (see below) imply the task is no longer
+ * running and thus clean up any thing associated with the task
+ * (ultimately offering any resources being consumed by that task to
+ * another task).
+ */
+enum TaskState {
+ TASK_STAGING = 6; // Initial state. Framework status updates should not use.
+ TASK_STARTING = 0; // The task is being launched by the executor.
+ TASK_RUNNING = 1;
+
+ // NOTE: This should only be sent when the framework has
+ // the TASK_KILLING_STATE capability.
+ TASK_KILLING = 8; // The task is being killed by the executor.
+
+ TASK_FINISHED = 2; // TERMINAL: The task finished successfully.
+ TASK_FAILED = 3; // TERMINAL: The task failed to finish successfully.
+ TASK_KILLED = 4; // TERMINAL: The task was killed by the executor.
+ TASK_ERROR = 7; // TERMINAL: The task description contains an error.
+
+ // In Mesos 1.3, this will only be sent when the framework does NOT
+ // opt-in to the PARTITION_AWARE capability.
+ //
+ // NOTE: This state is not always terminal. For example, tasks might
+ // transition from TASK_LOST to TASK_RUNNING or other states when a
+ // partitioned agent re-registers.
+ TASK_LOST = 5; // The task failed but can be rescheduled.
+
+ // The following task states are only sent when the framework
+ // opts-in to the PARTITION_AWARE capability.
+
+ // The task failed to launch because of a transient error. The
+ // task's executor never started running. Unlike TASK_ERROR, the
+ // task description is valid -- attempting to launch the task again
+ // may be successful.
+ TASK_DROPPED = 9; // TERMINAL.
+
+ // The task was running on an agent that has lost contact with the
+ // master, typically due to a network failure or partition. The task
+ // may or may not still be running.
+ TASK_UNREACHABLE = 10;
+
+ // The task is no longer running. This can occur if the agent has
+ // been terminated along with all of its tasks (e.g., the host that
+ // was running the agent was rebooted). It might also occur if the
+ // task was terminated due to an agent or containerizer error, or if
+ // the task was preempted by the QoS controller in an
+ // oversubscription scenario.
+ TASK_GONE = 11; // TERMINAL.
+
+ // The task was running on an agent that the master cannot contact;
+ // the operator has asserted that the agent has been shutdown, but
+ // this has not been directly confirmed by the master. If the
+ // operator is correct, the task is not running and this is a
+ // terminal state; if the operator is mistaken, the task may still
+ // be running and might return to RUNNING in the future.
+ TASK_GONE_BY_OPERATOR = 12;
+
+ // The master has no knowledge of the task. This is typically
+ // because either (a) the master never had knowledge of the task, or
+ // (b) the master forgot about the task because it garbage collected
+ // its metadata about the task. The task may or may not still be
+ // running.
+ TASK_UNKNOWN = 13;
+}
+
+
+/**
+* Describes the status of a check. Type and the corresponding field, i.e.,
+* `command` or `http` must be set. If the result of the check is not available
+* (e.g., the check timed out), these fields must contain empty messages, i.e.,
+* `exit_code` or `status_code` will be unset.
+*
+* NOTE: This API is unstable and the related feature is experimental.
+*/
+message CheckStatusInfo {
+ message Command {
+ // Exit code of a command check. It is the result of calling
+ // `WEXITSTATUS()` on `waitpid()` termination information on
+ // Posix and calling `GetExitCodeProcess()` on Windows.
+ optional int32 exit_code = 1;
+ }
+
+ message Http {
+ // HTTP status code of an HTTP check.
+ optional uint32 status_code = 1;
+ }
+
+ message Tcp {
+ // Whether a TCP connection succeeded.
+ optional bool succeeded = 1;
+ }
+
+ // TODO(alexr): Consider adding a `data` field, which can contain, e.g.,
+ // truncated stdout/stderr output for command checks or HTTP response body
+ // for HTTP checks. Alternatively, it can be an even shorter `message` field
+ // containing the last line of stdout or Reason-Phrase of the status line of
+ // the HTTP response.
+
+ // The type of the check this status corresponds to.
+ optional CheckInfo.Type type = 1;
+
+ // Status of a command check.
+ optional Command command = 2;
+
+ // Status of an HTTP check.
+ optional Http http = 3;
+
+ // Status of a TCP check.
+ optional Tcp tcp = 4;
+
+ // TODO(alexr): Consider introducing a "last changed at" timestamp, since
+ // task status update's timestamp may not correspond to the last check's
+ // state, e.g., for reconciliation.
+
+ // TODO(alexr): Consider introducing a `reason` enum here to explicitly
+ // distinguish between completed, delayed, and timed out checks.
+}
+
+
+/**
+ * Describes the current status of a task.
+ */
+message TaskStatus {
+ // Describes the source of the task status update.
+ enum Source {
+ SOURCE_MASTER = 0;
+ SOURCE_SLAVE = 1;
+ SOURCE_EXECUTOR = 2;
+ }
+
+ // Detailed reason for the task status update.
+ //
+ // TODO(bmahler): Differentiate between slave removal reasons
+ // (e.g. unhealthy vs. unregistered for maintenance).
+ enum Reason {
+ // TODO(jieyu): The default value when a caller doesn't check for
+ // presence is 0 and so ideally the 0 reason is not a valid one.
+ // Since this is not used anywhere, consider removing this reason.
+ REASON_COMMAND_EXECUTOR_FAILED = 0;
+
+ REASON_CONTAINER_LAUNCH_FAILED = 21;
+ REASON_CONTAINER_LIMITATION = 19;
+ REASON_CONTAINER_LIMITATION_DISK = 20;
+ REASON_CONTAINER_LIMITATION_MEMORY = 8;
+ REASON_CONTAINER_PREEMPTED = 17;
+ REASON_CONTAINER_UPDATE_FAILED = 22;
+ REASON_EXECUTOR_REGISTRATION_TIMEOUT = 23;
+ REASON_EXECUTOR_REREGISTRATION_TIMEOUT = 24;
+ REASON_EXECUTOR_TERMINATED = 1;
+ REASON_EXECUTOR_UNREGISTERED = 2; // No longer used.
+ REASON_FRAMEWORK_REMOVED = 3;
+ REASON_GC_ERROR = 4;
+ REASON_INVALID_FRAMEWORKID = 5;
+ REASON_INVALID_OFFERS = 6;
+ REASON_IO_SWITCHBOARD_EXITED = 27;
+ REASON_MASTER_DISCONNECTED = 7;
+ REASON_RECONCILIATION = 9;
+ REASON_RESOURCES_UNKNOWN = 18;
+ REASON_SLAVE_DISCONNECTED = 10;
+ REASON_SLAVE_REMOVED = 11;
+ REASON_SLAVE_RESTARTED = 12;
+ REASON_SLAVE_UNKNOWN = 13;
+ REASON_TASK_KILLED_DURING_LAUNCH = 30;
+ REASON_TASK_CHECK_STATUS_UPDATED = 28;
+ REASON_TASK_HEALTH_CHECK_STATUS_UPDATED = 29;
+ REASON_TASK_GROUP_INVALID = 25;
+ REASON_TASK_GROUP_UNAUTHORIZED = 26;
+ REASON_TASK_INVALID = 14;
+ REASON_TASK_UNAUTHORIZED = 15;
+ REASON_TASK_UNKNOWN = 16;
+ }
+
+ required TaskID task_id = 1;
+ required TaskState state = 2;
+ optional string message = 4; // Possible message explaining state.
+ optional Source source = 9;
+ optional Reason reason = 10;
+ optional bytes data = 3;
+ optional SlaveID slave_id = 5;
+ optional ExecutorID executor_id = 7; // TODO(benh): Use in master/slave.
+ optional double timestamp = 6;
+
+ // Statuses that are delivered reliably to the scheduler will
+ // include a 'uuid'. The status is considered delivered once
+ // it is acknowledged by the scheduler. Schedulers can choose
+ // to either explicitly acknowledge statuses or let the scheduler
+ // driver implicitly acknowledge (default).
+ //
+ // TODO(bmahler): This is currently overwritten in the scheduler
+ // driver and executor driver, but executors will need to set this
+ // to a valid RFC-4122 UUID if using the HTTP API.
+ optional bytes uuid = 11;
+
+ // Describes whether the task has been determined to be healthy (true) or
+ // unhealthy (false) according to the `health_check` field in `TaskInfo`.
+ optional bool healthy = 8;
+
+ // Contains check status for the check specified in the corresponding
+ // `TaskInfo`. If no check has been specified, this field must be
+ // absent, otherwise it must be present even if the check status is
+ // not available yet. If the status update is triggered for a different
+ // reason than `REASON_TASK_CHECK_STATUS_UPDATED`, this field will contain
+ // the last known value.
+ //
+ // NOTE: A check-related task status update is triggered if and only if
+ // the value or presence of any field in `CheckStatusInfo` changes.
+ //
+ // NOTE: Check support in built-in executors is experimental.
+ optional CheckStatusInfo check_status = 15;
+
+ // Labels are free-form key value pairs which are exposed through
+ // master and slave endpoints. Labels will not be interpreted or
+ // acted upon by Mesos itself. As opposed to the data field, labels
+ // will be kept in memory on master and slave processes. Therefore,
+ // labels should be used to tag TaskStatus message with light-weight
+ // meta-data. Labels should not contain duplicate key-value pairs.
+ optional Labels labels = 12;
+
+ // Container related information that is resolved dynamically such as
+ // network address.
+ optional ContainerStatus container_status = 13;
+
+ // The time (according to the master's clock) when the agent where
+ // this task was running became unreachable. This is only set on
+ // status updates for tasks running on agents that are unreachable
+ // (e.g., partitioned away from the master).
+ optional TimeInfo unreachable_time = 14;
+}
+
+
+/**
+ * Describes possible filters that can be applied to unused resources
+ * (see SchedulerDriver::launchTasks) to influence the allocator.
+ */
+message Filters {
+ // Time to consider unused resources refused. Note that all unused
+ // resources will be considered refused and use the default value
+ // (below) regardless of whether Filters was passed to
+ // SchedulerDriver::launchTasks. You MUST pass Filters with this
+ // field set to change this behavior (i.e., get another offer which
+ // includes unused resources sooner or later than the default).
+ optional double refuse_seconds = 1 [default = 5.0];
+}
+
+
+/**
+* Describes a collection of environment variables. This is used with
+* CommandInfo in order to set environment variables before running a
+* command. The contents of each variable
<TRUNCATED>
[22/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/proto/mesos/v1/scheduler.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/v1/scheduler.proto b/myriad-commons/proto/mesos/v1/scheduler.proto
deleted file mode 100644
index 1fb0254..0000000
--- a/myriad-commons/proto/mesos/v1/scheduler.proto
+++ /dev/null
@@ -1,420 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto2";
-
-import "mesos/v1/mesos.proto";
-
-package mesos.v1.scheduler;
-
-option java_package = "org.apache.mesos.v1.scheduler";
-option java_outer_classname = "Protos";
-
-
-/**
- * Scheduler event API.
- *
- * An event is described using the standard protocol buffer "union"
- * trick, see:
- * https://developers.google.com/protocol-buffers/docs/techniques#union.
- */
-message Event {
- // Possible event types, followed by message definitions if
- // applicable.
- enum Type {
- // This must be the first enum value in this list, to
- // ensure that if 'type' is not set, the default value
- // is UNKNOWN. This enables enum values to be added
- // in a backwards-compatible way. See: MESOS-4997.
- UNKNOWN = 0;
-
- SUBSCRIBED = 1; // See 'Subscribed' below.
- OFFERS = 2; // See 'Offers' below.
- INVERSE_OFFERS = 9; // See 'InverseOffers' below.
- RESCIND = 3; // See 'Rescind' below.
- RESCIND_INVERSE_OFFER = 10; // See 'RescindInverseOffer' below.
- UPDATE = 4; // See 'Update' below.
- MESSAGE = 5; // See 'Message' below.
- FAILURE = 6; // See 'Failure' below.
- ERROR = 7; // See 'Error' below.
-
- // Periodic message sent by the Mesos master according to
- // 'Subscribed.heartbeat_interval_seconds'. If the scheduler does
- // not receive any events (including heartbeats) for an extended
- // period of time (e.g., 5 x heartbeat_interval_seconds), there is
- // likely a network partition. In such a case the scheduler should
- // close the existing subscription connection and resubscribe
- // using a backoff strategy.
- HEARTBEAT = 8;
- }
-
- // First event received when the scheduler subscribes.
- message Subscribed {
- required FrameworkID framework_id = 1;
-
- // This value will be set if the master is sending heartbeats. See
- // the comment above on 'HEARTBEAT' for more details.
- optional double heartbeat_interval_seconds = 2;
-
- // Since Mesos 1.1.
- optional MasterInfo master_info = 3;
- }
-
- // Received whenever there are new resources that are offered to the
- // scheduler. Each offer corresponds to a set of resources on an
- // agent. Until the scheduler accepts or declines an offer the
- // resources are considered allocated to the scheduler.
- message Offers {
- repeated Offer offers = 1;
- }
-
- // Received whenever there are resources requested back from the
- // scheduler. Each inverse offer specifies the agent, and
- // optionally specific resources. Accepting or Declining an inverse
- // offer informs the allocator of the scheduler's ability to release
- // the specified resources without violating an SLA. If no resources
- // are specified then all resources on the agent are requested to be
- // released.
- message InverseOffers {
- repeated InverseOffer inverse_offers = 1;
- }
-
- // Received when a particular offer is no longer valid (e.g., the
- // agent corresponding to the offer has been removed) and hence
- // needs to be rescinded. Any future calls ('Accept' / 'Decline') made
- // by the scheduler regarding this offer will be invalid.
- message Rescind {
- required OfferID offer_id = 1;
- }
-
- // Received when a particular inverse offer is no longer valid
- // (e.g., the agent corresponding to the offer has been removed)
- // and hence needs to be rescinded. Any future calls ('Accept' /
- // 'Decline') made by the scheduler regarding this inverse offer
- // will be invalid.
- message RescindInverseOffer {
- required OfferID inverse_offer_id = 1;
- }
-
- // Received whenever there is a status update that is generated by
- // the executor or agent or master. Status updates should be used by
- // executors to reliably communicate the status of the tasks that
- // they manage. It is crucial that a terminal update (see TaskState
- // in v1/mesos.proto) is sent by the executor as soon as the task
- // terminates, in order for Mesos to release the resources allocated
- // to the task. It is also the responsibility of the scheduler to
- // explicitly acknowledge the receipt of a status update. See
- // 'Acknowledge' in the 'Call' section below for the semantics.
- //
- // A task status update may be used for guaranteed delivery of some
- // task-related information, e.g., task's health update. Such
- // information may be shadowed by subsequent task status updates, that
- // do not preserve fields of the previously sent message.
- message Update {
- required TaskStatus status = 1;
- }
-
- // Received when a custom message generated by the executor is
- // forwarded by the master. Note that this message is not
- // interpreted by Mesos and is only forwarded (without reliability
- // guarantees) to the scheduler. It is up to the executor to retry
- // if the message is dropped for any reason.
- message Message {
- required AgentID agent_id = 1;
- required ExecutorID executor_id = 2;
- required bytes data = 3;
- }
-
- // Received when an agent is removed from the cluster (e.g., failed
- // health checks) or when an executor is terminated. Note that, this
- // event coincides with receipt of terminal UPDATE events for any
- // active tasks belonging to the agent or executor and receipt of
- // 'Rescind' events for any outstanding offers belonging to the
- // agent. Note that there is no guaranteed order between the
- // 'Failure', 'Update' and 'Rescind' events when an agent or executor
- // is removed.
- // TODO(vinod): Consider splitting the lost agent and terminated
- // executor into separate events and ensure it's reliably generated.
- message Failure {
- optional AgentID agent_id = 1;
-
- // If this was just a failure of an executor on an agent then
- // 'executor_id' will be set and possibly 'status' (if we were
- // able to determine the exit status).
- optional ExecutorID executor_id = 2;
-
- // On Posix, `status` corresponds to termination information in the
- // `stat_loc` area returned from a `waitpid` call. On Windows, `status`
- // is obtained via calling the `GetExitCodeProcess()` function. For
- // messages coming from Posix agents, schedulers need to apply
- // `WEXITSTATUS` family macros or equivalent transformations to obtain
- // exit codes.
- //
- // TODO(alexr): Consider unifying Windows and Posix behavior by returning
- // exit code here, see MESOS-7241.
- optional int32 status = 3;
- }
-
- // Received when there is an unrecoverable error in the scheduler (e.g.,
- // scheduler failed over, rate limiting, authorization errors etc.). The
- // scheduler should abort on receiving this event.
- message Error {
- required string message = 1;
- }
-
- // Type of the event, indicates which optional field below should be
- // present if that type has a nested message definition.
- // Enum fields should be optional, see: MESOS-4997.
- optional Type type = 1;
-
- optional Subscribed subscribed = 2;
- optional Offers offers = 3;
- optional InverseOffers inverse_offers = 9;
- optional Rescind rescind = 4;
- optional RescindInverseOffer rescind_inverse_offer = 10;
- optional Update update = 5;
- optional Message message = 6;
- optional Failure failure = 7;
- optional Error error = 8;
-}
-
-
-/**
- * Scheduler call API.
- *
- * Like Event, a Call is described using the standard protocol buffer
- * "union" trick (see above).
- */
-message Call {
- // Possible call types, followed by message definitions if
- // applicable.
- enum Type {
- // See comments above on `Event::Type` for more details on this enum value.
- UNKNOWN = 0;
-
- SUBSCRIBE = 1; // See 'Subscribe' below.
- TEARDOWN = 2; // Shuts down all tasks/executors and removes framework.
- ACCEPT = 3; // See 'Accept' below.
- DECLINE = 4; // See 'Decline' below.
- ACCEPT_INVERSE_OFFERS = 13; // See 'AcceptInverseOffers' below.
- DECLINE_INVERSE_OFFERS = 14; // See 'DeclineInverseOffers' below.
- REVIVE = 5; // Removes any previous filters set via ACCEPT or DECLINE.
- KILL = 6; // See 'Kill' below.
- SHUTDOWN = 7; // See 'Shutdown' below.
- ACKNOWLEDGE = 8; // See 'Acknowledge' below.
- RECONCILE = 9; // See 'Reconcile' below.
- MESSAGE = 10; // See 'Message' below.
- REQUEST = 11; // See 'Request' below.
- SUPPRESS = 12; // Inform master to stop sending offers to the framework.
-
- // TODO(benh): Consider adding an 'ACTIVATE' and 'DEACTIVATE' for
- // already subscribed frameworks as a way of stopping offers from
- // being generated and other events from being sent by the master.
- // Note that this functionality existed originally to support
- // SchedulerDriver::abort which was only necessary to handle
- // exceptions getting thrown from within Scheduler callbacks,
- // something that is not an issue with the Event/Call API.
- }
-
- // Subscribes the scheduler with the master to receive events. A
- // scheduler must send other calls only after it has received the
- // SUBCRIBED event.
- message Subscribe {
- // See the comments below on 'framework_id' on the semantics for
- // 'framework_info.id'.
- required FrameworkInfo framework_info = 1;
-
- // List of suppressed roles for which the framework does not wish to be
- // offered resources. The framework can decide to suppress all or a subset
- // of roles the framework (re)registers as.
- repeated string suppressed_roles = 2;
- }
-
- // Accepts an offer, performing the specified operations
- // in a sequential manner.
- //
- // E.g. Launch a task with a newly reserved persistent volume:
- //
- // Accept {
- // offer_ids: [ ... ]
- // operations: [
- // { type: RESERVE,
- // reserve: { resources: [ disk(role):2 ] } }
- // { type: CREATE,
- // create: { volumes: [ disk(role):1+persistence ] } }
- // { type: LAUNCH,
- // launch: { task_infos ... disk(role):1;disk(role):1+persistence } }
- // ]
- // }
- //
- // Note that any of the offer’s resources not used in the 'Accept'
- // call (e.g., to launch a task) are considered unused and might be
- // reoffered to other frameworks. In other words, the same OfferID
- // cannot be used in more than one 'Accept' call.
- message Accept {
- repeated OfferID offer_ids = 1;
- repeated Offer.Operation operations = 2;
- optional Filters filters = 3;
- }
-
- // Declines an offer, signaling the master to potentially reoffer
- // the resources to a different framework. Note that this is same
- // as sending an Accept call with no operations. See comments on
- // top of 'Accept' for semantics.
- message Decline {
- repeated OfferID offer_ids = 1;
- optional Filters filters = 2;
- }
-
- // Accepts an inverse offer. Inverse offers should only be accepted
- // if the resources in the offer can be safely evacuated before the
- // provided unavailability.
- message AcceptInverseOffers {
- repeated OfferID inverse_offer_ids = 1;
- optional Filters filters = 2;
- }
-
- // Declines an inverse offer. Inverse offers should be declined if
- // the resources in the offer might not be safely evacuated before
- // the provided unavailability.
- message DeclineInverseOffers {
- repeated OfferID inverse_offer_ids = 1;
- optional Filters filters = 2;
- }
-
- // Revive offers for the specified roles. If `roles` is empty,
- // the `REVIVE` call will revive offers for all of the roles
- // the framework is currently subscribed to.
- message Revive {
- repeated string roles = 1;
- }
-
- // Kills a specific task. If the scheduler has a custom executor,
- // the kill is forwarded to the executor and it is up to the
- // executor to kill the task and send a TASK_KILLED (or TASK_FAILED)
- // update. Note that Mesos releases the resources for a task once it
- // receives a terminal update (See TaskState in v1/mesos.proto) for
- // it. If the task is unknown to the master, a TASK_LOST update is
- // generated.
- //
- // If a task within a task group is killed before the group is
- // delivered to the executor, all tasks in the task group are
- // killed. When a task group has been delivered to the executor,
- // it is up to the executor to decide how to deal with the kill.
- // Note The default Mesos executor will currently kill all the
- // tasks in the task group if it gets a kill for any task.
- message Kill {
- required TaskID task_id = 1;
- optional AgentID agent_id = 2;
-
- // If set, overrides any previously specified kill policy for this task.
- // This includes 'TaskInfo.kill_policy' and 'Executor.kill.kill_policy'.
- // Can be used to forcefully kill a task which is already being killed.
- optional KillPolicy kill_policy = 3;
- }
-
- // Shuts down a custom executor. When the executor gets a shutdown
- // event, it is expected to kill all its tasks (and send TASK_KILLED
- // updates) and terminate. If the executor doesn’t terminate within
- // a certain timeout (configurable via
- // '--executor_shutdown_grace_period' agent flag), the agent will
- // forcefully destroy the container (executor and its tasks) and
- // transition its active tasks to TASK_LOST.
- message Shutdown {
- required ExecutorID executor_id = 1;
- required AgentID agent_id = 2;
- }
-
- // Acknowledges the receipt of status update. Schedulers are
- // responsible for explicitly acknowledging the receipt of status
- // updates that have 'Update.status().uuid()' field set. Such status
- // updates are retried by the agent until they are acknowledged by
- // the scheduler.
- message Acknowledge {
- required AgentID agent_id = 1;
- required TaskID task_id = 2;
- required bytes uuid = 3;
- }
-
- // Allows the scheduler to query the status for non-terminal tasks.
- // This causes the master to send back the latest task status for
- // each task in 'tasks', if possible. Tasks that are no longer known
- // will result in a TASK_LOST, TASK_UNKNOWN, or TASK_UNREACHABLE update.
- // If 'tasks' is empty, then the master will send the latest status
- // for each task currently known.
- message Reconcile {
- // TODO(vinod): Support arbitrary queries than just state of tasks.
- message Task {
- required TaskID task_id = 1;
- optional AgentID agent_id = 2;
- }
-
- repeated Task tasks = 1;
- }
-
- // Sends arbitrary binary data to the executor. Note that Mesos
- // neither interprets this data nor makes any guarantees about the
- // delivery of this message to the executor.
- message Message {
- required AgentID agent_id = 1;
- required ExecutorID executor_id = 2;
- required bytes data = 3;
- }
-
- // Requests a specific set of resources from Mesos's allocator. If
- // the allocator has support for this, corresponding offers will be
- // sent asynchronously via the OFFERS event(s).
- //
- // NOTE: The built-in hierarchical allocator doesn't have support
- // for this call and hence simply ignores it.
- message Request {
- repeated mesos.v1.Request requests = 1;
- }
-
- // Suppress offers for the specified roles. If `roles` is empty,
- // the `SUPPRESS` call will suppress offers for all of the roles
- // the framework is currently subscribed to.
- message Suppress {
- repeated string roles = 1;
- }
-
- // Identifies who generated this call. Master assigns a framework id
- // when a new scheduler subscribes for the first time. Once assigned,
- // the scheduler must set the 'framework_id' here and within its
- // FrameworkInfo (in any further 'Subscribe' calls). This allows the
- // master to identify a scheduler correctly across disconnections,
- // failovers, etc.
- optional FrameworkID framework_id = 1;
-
- // Type of the call, indicates which optional field below should be
- // present if that type has a nested message definition.
- // See comments on `Event::Type` above on the reasoning behind this field being optional.
- optional Type type = 2;
-
- optional Subscribe subscribe = 3;
- optional Accept accept = 4;
- optional Decline decline = 5;
- optional AcceptInverseOffers accept_inverse_offers = 13;
- optional DeclineInverseOffers decline_inverse_offers = 14;
- optional Revive revive = 15;
- optional Kill kill = 6;
- optional Shutdown shutdown = 7;
- optional Acknowledge acknowledge = 8;
- optional Reconcile reconcile = 9;
- optional Message message = 10;
- optional Request request = 11;
- optional Suppress suppress = 16;
-}
[25/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/proto/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/myriad-commons/proto/mesos/mesos.proto b/myriad-commons/proto/mesos/mesos.proto
deleted file mode 100644
index 3449c2d..0000000
--- a/myriad-commons/proto/mesos/mesos.proto
+++ /dev/null
@@ -1,3190 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto2";
-
-package mesos;
-
-option java_package = "org.apache.mesos";
-option java_outer_classname = "Protos";
-
-
-/**
- * Status is used to indicate the state of the scheduler and executor
- * driver after function calls.
- */
-enum Status {
- DRIVER_NOT_STARTED = 1;
- DRIVER_RUNNING = 2;
- DRIVER_ABORTED = 3;
- DRIVER_STOPPED = 4;
-}
-
-
-/**
- * A unique ID assigned to a framework. A framework can reuse this ID
- * in order to do failover (see MesosSchedulerDriver).
- */
-message FrameworkID {
- required string value = 1;
-}
-
-
-/**
- * A unique ID assigned to an offer.
- */
-message OfferID {
- required string value = 1;
-}
-
-
-/**
- * A unique ID assigned to a slave. Currently, a slave gets a new ID
- * whenever it (re)registers with Mesos. Framework writers shouldn't
- * assume any binding between a slave ID and and a hostname.
- */
-message SlaveID {
- required string value = 1;
-}
-
-
-/**
- * A framework-generated ID to distinguish a task. The ID must remain
- * unique while the task is active. A framework can reuse an ID _only_
- * if the previous task with the same ID has reached a terminal state
- * (e.g., TASK_FINISHED, TASK_KILLED, etc.). However, reusing task IDs
- * is strongly discouraged (MESOS-2198).
- */
-message TaskID {
- required string value = 1;
-}
-
-
-/**
- * A framework-generated ID to distinguish an executor. Only one
- * executor with the same ID can be active on the same slave at a
- * time. However, reusing executor IDs is discouraged.
- */
-message ExecutorID {
- required string value = 1;
-}
-
-
-/**
- * ID used to uniquely identify a container. If the `parent` is not
- * specified, the ID is a UUID generated by the agent to uniquely
- * identify the container of an executor run. If the `parent` field is
- * specified, it represents a nested container.
- */
-message ContainerID {
- required string value = 1;
- optional ContainerID parent = 2;
-}
-
-
-/**
- * A unique ID assigned to a resource provider. Currently, a resource
- * provider gets a new ID whenever it (re)registers with Mesos.
- */
-message ResourceProviderID {
- required string value = 1;
-}
-
-
-/**
- * Represents time since the epoch, in nanoseconds.
- */
-message TimeInfo {
- required int64 nanoseconds = 1;
-}
-
-
-/**
- * Represents duration in nanoseconds.
- */
-message DurationInfo {
- required int64 nanoseconds = 1;
-}
-
-
-/**
- * A network address.
- *
- * TODO(bmahler): Use this more widely.
- */
-message Address {
- // May contain a hostname, IP address, or both.
- optional string hostname = 1;
- optional string ip = 2;
-
- required int32 port = 3;
-}
-
-
-/**
- * Represents a URL.
- */
-message URL {
- required string scheme = 1;
- required Address address = 2;
- optional string path = 3;
- repeated Parameter query = 4;
- optional string fragment = 5;
-}
-
-
-/**
- * Represents an interval, from a given start time over a given duration.
- * This interval pertains to an unavailability event, such as maintenance,
- * and is not a generic interval.
- */
-message Unavailability {
- required TimeInfo start = 1;
-
- // When added to `start`, this represents the end of the interval.
- // If unspecified, the duration is assumed to be infinite.
- optional DurationInfo duration = 2;
-
- // TODO(josephw): Add additional fields for expressing the purpose and
- // urgency of the unavailability event.
-}
-
-
-/**
- * Represents a single machine, which may hold one or more slaves.
- *
- * NOTE: In order to match a slave to a machine, both the `hostname` and
- * `ip` must match the values advertised by the slave to the master.
- * Hostname is not case-sensitive.
- */
-message MachineID {
- optional string hostname = 1;
- optional string ip = 2;
-}
-
-
-/**
- * Holds information about a single machine, its `mode`, and any other
- * relevant information which may affect the behavior of the machine.
- */
-message MachineInfo {
- // Describes the several states that a machine can be in. A `Mode`
- // applies to a machine and to all associated slaves on the machine.
- enum Mode {
- // In this mode, a machine is behaving normally;
- // offering resources, executing tasks, etc.
- UP = 1;
-
- // In this mode, all slaves on the machine are expected to cooperate with
- // frameworks to drain resources. In general, draining is done ahead of
- // a pending `unavailability`. The resources should be drained so as to
- // maximize utilization prior to the maintenance but without knowingly
- // violating the frameworks' requirements.
- DRAINING = 2;
-
- // In this mode, a machine is not running any tasks and will not offer
- // any of its resources. Slaves on the machine will not be allowed to
- // register with the master.
- DOWN = 3;
- }
-
- required MachineID id = 1;
- optional Mode mode = 2;
-
- // Signifies that the machine may be unavailable during the given interval.
- // See comments in `Unavailability` and for the `unavailability` fields
- // in `Offer` and `InverseOffer` for more information.
- optional Unavailability unavailability = 3;
-}
-
-
-/**
- * Describes a framework.
- */
-message FrameworkInfo {
- // Used to determine the Unix user that an executor or task should be
- // launched as.
- //
- // When using the MesosSchedulerDriver, if the field is set to an
- // empty string, it will automagically set it to the current user.
- //
- // When using the HTTP Scheduler API, the user has to be set
- // explicitly.
- required string user = 1;
-
- // Name of the framework that shows up in the Mesos Web UI.
- required string name = 2;
-
- // Note that 'id' is only available after a framework has
- // registered, however, it is included here in order to facilitate
- // scheduler failover (i.e., if it is set then the
- // MesosSchedulerDriver expects the scheduler is performing
- // failover).
- optional FrameworkID id = 3;
-
- // The amount of time (in seconds) that the master will wait for the
- // scheduler to failover before it tears down the framework by
- // killing all its tasks/executors. This should be non-zero if a
- // framework expects to reconnect after a failure and not lose its
- // tasks/executors.
- //
- // NOTE: To avoid accidental destruction of tasks, production
- // frameworks typically set this to a large value (e.g., 1 week).
- optional double failover_timeout = 4 [default = 0.0];
-
- // If set, agents running tasks started by this framework will write
- // the framework pid, executor pids and status updates to disk. If
- // the agent exits (e.g., due to a crash or as part of upgrading
- // Mesos), this checkpointed data allows the restarted agent to
- // reconnect to executors that were started by the old instance of
- // the agent. Enabling checkpointing improves fault tolerance, at
- // the cost of a (usually small) increase in disk I/O.
- optional bool checkpoint = 5 [default = false];
-
- // Roles are the entities to which allocations are made.
- // The framework must have at least one role in order to
- // be offered resources. Note that `role` is deprecated
- // in favor of `roles` and only one of these fields must
- // be used. Since we cannot distinguish between empty
- // `roles` and the default unset `role`, we require that
- // frameworks set the `MULTI_ROLE` capability if
- // setting the `roles` field.
- optional string role = 6 [default = "*", deprecated=true];
- repeated string roles = 12;
-
- // Used to indicate the current host from which the scheduler is
- // registered in the Mesos Web UI. If set to an empty string Mesos
- // will automagically set it to the current hostname if one is
- // available.
- optional string hostname = 7;
-
- // This field should match the credential's principal the framework
- // uses for authentication. This field is used for framework API
- // rate limiting and dynamic reservations. It should be set even
- // if authentication is not enabled if these features are desired.
- optional string principal = 8;
-
- // This field allows a framework to advertise its web UI, so that
- // the Mesos web UI can link to it. It is expected to be a full URL,
- // for example http://my-scheduler.example.com:8080/.
- optional string webui_url = 9;
-
- message Capability {
- enum Type {
- // This must be the first enum value in this list, to
- // ensure that if 'type' is not set, the default value
- // is UNKNOWN. This enables enum values to be added
- // in a backwards-compatible way. See: MESOS-4997.
- UNKNOWN = 0;
-
- // Receive offers with revocable resources. See 'Resource'
- // message for details.
- REVOCABLE_RESOURCES = 1;
-
- // Receive the TASK_KILLING TaskState when a task is being
- // killed by an executor. The executor will examine this
- // capability to determine whether it can send TASK_KILLING.
- TASK_KILLING_STATE = 2;
-
- // Indicates whether the framework is aware of GPU resources.
- // Frameworks that are aware of GPU resources are expected to
- // avoid placing non-GPU workloads on GPU agents, in order
- // to avoid occupying a GPU agent and preventing GPU workloads
- // from running! Currently, if a framework is unaware of GPU
- // resources, it will not be offered *any* of the resources on
- // an agent with GPUs. This restriction is in place because we
- // do not have a revocation mechanism that ensures GPU workloads
- // can evict GPU agent occupants if necessary.
- //
- // TODO(bmahler): As we add revocation we can relax the
- // restriction here. See MESOS-5634 for more information.
- GPU_RESOURCES = 3;
-
- // Receive offers with resources that are shared.
- SHARED_RESOURCES = 4;
-
- // Indicates that (1) the framework is prepared to handle the
- // following TaskStates: TASK_UNREACHABLE, TASK_DROPPED,
- // TASK_GONE, TASK_GONE_BY_OPERATOR, and TASK_UNKNOWN, and (2)
- // the framework will assume responsibility for managing
- // partitioned tasks that reregister with the master.
- //
- // Frameworks that enable this capability can define how they
- // would like to handle partitioned tasks. Frameworks will
- // receive TASK_UNREACHABLE for tasks on agents that are
- // partitioned from the master. If/when a partitioned agent
- // reregisters, tasks on the agent that were started by
- // PARTITION_AWARE frameworks will not killed.
- //
- // Without this capability, frameworks will receive TASK_LOST
- // for tasks on partitioned agents; such tasks will be killed by
- // Mesos when the agent reregisters (unless the master has
- // failed over).
- PARTITION_AWARE = 5;
-
- // This expresses the ability for the framework to be
- // "multi-tenant" via using the newly introduced `roles`
- // field, and examining `Offer.allocation_info` to determine
- // which role the offers are being made to. We also
- // expect that "single-tenant" schedulers eventually
- // provide this and move away from the deprecated
- // `role` field.
- MULTI_ROLE = 6;
-
- // This capability has two effects for a framework.
- //
- // (1) The framework is offered resources in a new format.
- //
- // The offered resources have the `Resource.reservations` field set
- // rather than `Resource.role` and `Resource.reservation`. In short,
- // an empty `reservations` field denotes unreserved resources, and
- // each `ReservationInfo` in the `reservations` field denotes a
- // reservation that refines the previous one.
- //
- // See the 'Resource Format' section for more details.
- //
- // (2) The framework can create refined reservations.
- //
- // A framework can refine an existing reservation via the
- // `Resource.reservations` field. For example, a reservation for role
- // `eng` can be refined to `eng/front_end`.
- //
- // See `ReservationInfo.reservations` for more details.
- //
- // NOTE: Without this capability, a framework is not offered resources
- // that have refined reservations. A resource is said to have refined
- // reservations if it uses the `Resource.reservations` field, and
- // `Resource.reservations_size() > 1`.
- RESERVATION_REFINEMENT = 7; // EXPERIMENTAL.
-
- // Indicates that the framework is prepared to receive offers
- // for agents whose region is different from the master's
- // region. Network links between hosts in different regions
- // typically have higher latency and lower bandwidth than
- // network links within a region, so frameworks should be
- // careful to only place suitable workloads in remote regions.
- // Frameworks that are not region-aware will never receive
- // offers for remote agents; region-aware frameworks are assumed
- // to implement their own logic to decide which workloads (if
- // any) are suitable for placement on remote agents.
- REGION_AWARE = 8;
- }
-
- // Enum fields should be optional, see: MESOS-4997.
- optional Type type = 1;
- }
-
- // This field allows a framework to advertise its set of
- // capabilities (e.g., ability to receive offers for revocable
- // resources).
- repeated Capability capabilities = 10;
-
- // Labels are free-form key value pairs supplied by the framework
- // scheduler (e.g., to describe additional functionality offered by
- // the framework). These labels are not interpreted by Mesos itself.
- // Labels should not contain duplicate key-value pairs.
- optional Labels labels = 11;
-}
-
-
-/**
- * Describes a general non-interpreting non-killing check for a task or
- * executor (or any arbitrary process/command). A type is picked by
- * specifying one of the optional fields. Specifying more than one type
- * is an error.
- *
- * NOTE: This API is unstable and the related feature is experimental.
- */
-message CheckInfo {
- enum Type {
- UNKNOWN = 0;
- COMMAND = 1;
- HTTP = 2;
- TCP = 3;
-
- // TODO(alexr): Consider supporting custom user checks. They should
- // probably be paired with a `data` field and complemented by a
- // `data` response in `CheckStatusInfo`.
- }
-
- // Describes a command check. If applicable, enters mount and/or network
- // namespaces of the task.
- message Command {
- required CommandInfo command = 1;
- }
-
- // Describes an HTTP check. Sends a GET request to
- // http://<host>:port/path. Note that <host> is not configurable and is
- // resolved automatically to 127.0.0.1.
- message Http {
- // Port to send the HTTP request.
- required uint32 port = 1;
-
- // HTTP request path.
- optional string path = 2;
-
- // TODO(alexr): Add support for HTTP method. While adding POST
- // and PUT is simple, supporting payload is more involved.
-
- // TODO(alexr): Add support for custom HTTP headers.
-
- // TODO(alexr): Consider adding an optional message to describe TLS
- // options and thus enabling https. Such message might contain certificate
- // validation, TLS version.
- }
-
- // Describes a TCP check, i.e. based on establishing a TCP connection to
- // the specified port. Note that <host> is not configurable and is resolved
- // automatically to 127.0.0.1.
- message Tcp {
- required uint32 port = 1;
- }
-
- // The type of the check.
- optional Type type = 1;
-
- // Command check.
- optional Command command = 2;
-
- // HTTP check.
- optional Http http = 3;
-
- // TCP check.
- optional Tcp tcp = 7;
-
- // Amount of time to wait to start checking the task after it
- // transitions to `TASK_RUNNING` or `TASK_STARTING` if the latter
- // is used by the executor.
- optional double delay_seconds = 4 [default = 15.0];
-
- // Interval between check attempts, i.e., amount of time to wait after
- // the previous check finished or timed out to start the next check.
- optional double interval_seconds = 5 [default = 10.0];
-
- // Amount of time to wait for the check to complete. Zero means infinite
- // timeout.
- //
- // After this timeout, the check attempt is aborted and no result is
- // reported. Note that this may be considered a state change and hence
- // may trigger a check status change delivery to the corresponding
- // scheduler. See `CheckStatusInfo` for more details.
- optional double timeout_seconds = 6 [default = 20.0];
-}
-
-
-/**
- * Describes a health check for a task or executor (or any arbitrary
- * process/command). A type is picked by specifying one of the
- * optional fields. Specifying more than one type is an error.
- */
-message HealthCheck {
- enum Type {
- UNKNOWN = 0;
- COMMAND = 1;
- HTTP = 2;
- TCP = 3;
- }
-
- // Describes an HTTP health check. Sends a GET request to
- // scheme://<host>:port/path. Note that <host> is not configurable and is
- // resolved automatically, in most cases to 127.0.0.1. Default executors
- // treat return codes between 200 and 399 as success; custom executors
- // may employ a different strategy, e.g. leveraging the `statuses` field.
- message HTTPCheckInfo {
- // Currently "http" and "https" are supported.
- optional string scheme = 3;
-
- // Port to send the HTTP request.
- required uint32 port = 1;
-
- // HTTP request path.
- optional string path = 2;
-
- // TODO(alexr): Add support for HTTP method. While adding POST
- // and PUT is simple, supporting payload is more involved.
-
- // TODO(alexr): Add support for custom HTTP headers.
-
- // TODO(alexr): Add support for success and possibly failure
- // statuses.
-
- // NOTE: It is up to the custom executor to interpret and act on this
- // field. Setting this field has no effect on the default executors.
- //
- // TODO(haosdent): Deprecate this field when we add better support for
- // success and possibly failure statuses, e.g. ranges of success and
- // failure statuses.
- repeated uint32 statuses = 4;
-
- // TODO(haosdent): Consider adding a flag to enable task's certificate
- // validation for HTTPS health checks, see MESOS-5997.
-
- // TODO(benh): Include an 'optional bytes data' field for checking
- // for specific data in the response.
- }
-
- // Describes a TCP health check, i.e. based on establishing
- // a TCP connection to the specified port.
- message TCPCheckInfo {
- // Port expected to be open.
- required uint32 port = 1;
- }
-
- // TODO(benh): Consider adding a URL health check strategy which
- // allows doing something similar to the HTTP strategy but
- // encapsulates all the details in a single string field.
-
- // Amount of time to wait to start health checking the task after it
- // transitions to `TASK_RUNNING` or `TASK_STATING` if the latter is
- // used by the executor.
- optional double delay_seconds = 2 [default = 15.0];
-
- // Interval between health checks, i.e., amount of time to wait after
- // the previous health check finished or timed out to start the next
- // health check.
- optional double interval_seconds = 3 [default = 10.0];
-
- // Amount of time to wait for the health check to complete. After this
- // timeout, the health check is aborted and treated as a failure. Zero
- // means infinite timeout.
- optional double timeout_seconds = 4 [default = 20.0];
-
- // Number of consecutive failures until the task is killed by the executor.
- optional uint32 consecutive_failures = 5 [default = 3];
-
- // Amount of time after the task is launched during which health check
- // failures are ignored. Once a check succeeds for the first time,
- // the grace period does not apply anymore. Note that it includes
- // `delay_seconds`, i.e., setting `grace_period_seconds` < `delay_seconds`
- // has no effect.
- optional double grace_period_seconds = 6 [default = 10.0];
-
- // TODO(alexr): Add an optional `KillPolicy` that should be used
- // if the task is killed because of a health check failure.
-
- // The type of health check.
- optional Type type = 8;
-
- // Command health check.
- optional CommandInfo command = 7;
-
- // HTTP health check.
- optional HTTPCheckInfo http = 1;
-
- // TCP health check.
- optional TCPCheckInfo tcp = 9;
-}
-
-
-/**
- * Describes a kill policy for a task. Currently does not express
- * different policies (e.g. hitting HTTP endpoints), only controls
- * how long to wait between graceful and forcible task kill:
- *
- * graceful kill --------------> forcible kill
- * grace_period
- *
- * Kill policies are best-effort, because machine failures / forcible
- * terminations may occur.
- *
- * NOTE: For executor-less command-based tasks, the kill is performed
- * via sending a signal to the task process: SIGTERM for the graceful
- * kill and SIGKILL for the forcible kill. For the docker executor-less
- * tasks the grace period is passed to 'docker stop --time'.
- */
-message KillPolicy {
- // The grace period specifies how long to wait before forcibly
- // killing the task. It is recommended to attempt to gracefully
- // kill the task (and send TASK_KILLING) to indicate that the
- // graceful kill is in progress. Once the grace period elapses,
- // if the task has not terminated, a forcible kill should occur.
- // The task should not assume that it will always be allotted
- // the full grace period. For example, the executor may be
- // shutdown more quickly by the agent, or failures / forcible
- // terminations may occur.
- optional DurationInfo grace_period = 1;
-}
-
-
-/**
- * Describes a command, executed via: '/bin/sh -c value'. Any URIs specified
- * are fetched before executing the command. If the executable field for an
- * uri is set, executable file permission is set on the downloaded file.
- * Otherwise, if the downloaded file has a recognized archive extension
- * (currently [compressed] tar and zip) it is extracted into the executor's
- * working directory. This extraction can be disabled by setting `extract` to
- * false. In addition, any environment variables are set before executing
- * the command (so they can be used to "parameterize" your command).
- */
-message CommandInfo {
- message URI {
- required string value = 1;
- optional bool executable = 2;
-
- // In case the fetched file is recognized as an archive, extract
- // its contents into the sandbox. Note that a cached archive is
- // not copied from the cache to the sandbox in case extraction
- // originates from an archive in the cache.
- optional bool extract = 3 [default = true];
-
- // If this field is "true", the fetcher cache will be used. If not,
- // fetching bypasses the cache and downloads directly into the
- // sandbox directory, no matter whether a suitable cache file is
- // available or not. The former directs the fetcher to download to
- // the file cache, then copy from there to the sandbox. Subsequent
- // fetch attempts with the same URI will omit downloading and copy
- // from the cache as long as the file is resident there. Cache files
- // may get evicted at any time, which then leads to renewed
- // downloading. See also "docs/fetcher.md" and
- // "docs/fetcher-cache-internals.md".
- optional bool cache = 4;
-
- // The fetcher's default behavior is to use the URI string's basename to
- // name the local copy. If this field is provided, the local copy will be
- // named with its value instead. If there is a directory component (which
- // must be a relative path), the local copy will be stored in that
- // subdirectory inside the sandbox.
- optional string output_file = 5;
- }
-
- repeated URI uris = 1;
-
- optional Environment environment = 2;
-
- // There are two ways to specify the command:
- // 1) If 'shell == true', the command will be launched via shell
- // (i.e., /bin/sh -c 'value'). The 'value' specified will be
- // treated as the shell command. The 'arguments' will be ignored.
- // 2) If 'shell == false', the command will be launched by passing
- // arguments to an executable. The 'value' specified will be
- // treated as the filename of the executable. The 'arguments'
- // will be treated as the arguments to the executable. This is
- // similar to how POSIX exec families launch processes (i.e.,
- // execlp(value, arguments(0), arguments(1), ...)).
- // NOTE: The field 'value' is changed from 'required' to 'optional'
- // in 0.20.0. It will only cause issues if a new framework is
- // connecting to an old master.
- optional bool shell = 6 [default = true];
- optional string value = 3;
- repeated string arguments = 7;
-
- // Enables executor and tasks to run as a specific user. If the user
- // field is present both in FrameworkInfo and here, the CommandInfo
- // user value takes precedence.
- optional string user = 5;
-}
-
-
-/**
- * Describes information about an executor.
- */
-message ExecutorInfo {
- enum Type {
- UNKNOWN = 0;
-
- // Mesos provides a simple built-in default executor that frameworks can
- // leverage to run shell commands and containers.
- //
- // NOTES:
- //
- // 1) `command` must not be set when using a default executor.
- //
- // 2) Default executor only accepts a *single* `LAUNCH` or `LAUNCH_GROUP`
- // offer operation.
- //
- // 3) If `container` is set, `container.type` must be `MESOS`
- // and `container.mesos.image` must not be set.
- DEFAULT = 1;
-
- // For frameworks that need custom functionality to run tasks, a `CUSTOM`
- // executor can be used. Note that `command` must be set when using a
- // `CUSTOM` executor.
- CUSTOM = 2;
- }
-
- // For backwards compatibility, if this field is not set when using `LAUNCH`
- // offer operation, Mesos will infer the type by checking if `command` is
- // set (`CUSTOM`) or unset (`DEFAULT`). `type` must be set when using
- // `LAUNCH_GROUP` offer operation.
- //
- // TODO(vinod): Add support for explicitly setting `type` to `DEFAULT `
- // in `LAUNCH` offer operation.
- optional Type type = 15;
-
- required ExecutorID executor_id = 1;
- optional FrameworkID framework_id = 8; // TODO(benh): Make this required.
- optional CommandInfo command = 7;
-
- // Executor provided with a container will launch the container
- // with the executor's CommandInfo and we expect the container to
- // act as a Mesos executor.
- optional ContainerInfo container = 11;
-
- repeated Resource resources = 5;
- optional string name = 9;
-
- // 'source' is an identifier style string used by frameworks to
- // track the source of an executor. This is useful when it's
- // possible for different executor ids to be related semantically.
- //
- // NOTE: 'source' is exposed alongside the resource usage of the
- // executor via JSON on the slave. This allows users to import usage
- // information into a time series database for monitoring.
- //
- // This field is deprecated since 1.0. Please use labels for
- // free-form metadata instead.
- optional string source = 10 [deprecated = true]; // Since 1.0.
-
- // This field can be used to pass arbitrary bytes to an executor.
- optional bytes data = 4;
-
- // Service discovery information for the executor. It is not
- // interpreted or acted upon by Mesos. It is up to a service
- // discovery system to use this information as needed and to handle
- // executors without service discovery information.
- optional DiscoveryInfo discovery = 12;
-
- // When shutting down an executor the agent will wait in a
- // best-effort manner for the grace period specified here
- // before forcibly destroying the container. The executor
- // must not assume that it will always be allotted the full
- // grace period, as the agent may decide to allot a shorter
- // period and failures / forcible terminations may occur.
- optional DurationInfo shutdown_grace_period = 13;
-
- // Labels are free-form key value pairs which are exposed through
- // master and slave endpoints. Labels will not be interpreted or
- // acted upon by Mesos itself. As opposed to the data field, labels
- // will be kept in memory on master and slave processes. Therefore,
- // labels should be used to tag executors with lightweight metadata.
- // Labels should not contain duplicate key-value pairs.
- optional Labels labels = 14;
-}
-
-
-/**
- * Describes a domain. A domain is a collection of hosts that have
- * similar characteristics. Mesos currently only supports "fault
- * domains", which identify groups of hosts with similar failure
- * characteristics.
- *
- * Frameworks can generally assume that network links between hosts in
- * the same fault domain have lower latency, higher bandwidth, and better
- * availability than network links between hosts in different domains.
- * Schedulers may prefer to place network-intensive workloads in the
- * same domain, as this may improve performance. Conversely, a single
- * failure that affects a host in a domain may be more likely to
- * affect other hosts in the same domain; hence, schedulers may prefer
- * to place workloads that require high availability in multiple
- * domains. (For example, all the hosts in a single rack might lose
- * power or network connectivity simultaneously.)
- *
- * There are two kinds of fault domains: regions and zones. Regions
- * offer the highest degree of fault isolation, but network latency
- * between regions is typically high (typically >50 ms). Zones offer a
- * modest degree of fault isolation along with reasonably low network
- * latency (typically <10 ms).
- *
- * The mapping from fault domains to physical infrastructure is up to
- * the operator to configure. In cloud environments, regions and zones
- * can be mapped to the "region" and "availability zone" concepts
- * exposed by most cloud providers, respectively. In on-premise
- * deployments, regions and zones can be mapped to data centers and
- * racks, respectively.
- *
- * Both masters and agents can be configured with domains. Frameworks
- * can compare the domains of two hosts to determine if the hosts are
- * in the same zone, in different zones in the same region, or in
- * different regions. Note that all masters in a given Mesos cluster
- * must be in the same region.
- */
-message DomainInfo {
- message FaultDomain {
- message RegionInfo {
- required string name = 1;
- }
-
- message ZoneInfo {
- required string name = 1;
- }
-
- required RegionInfo region = 1;
- required ZoneInfo zone = 2;
- }
-
- optional FaultDomain fault_domain = 1;
-}
-
-
-/**
- * Describes a master. This will probably have more fields in the
- * future which might be used, for example, to link a framework webui
- * to a master webui.
- */
-message MasterInfo {
- required string id = 1;
-
- // The IP address (only IPv4) as a packed 4-bytes integer,
- // stored in network order. Deprecated, use `address.ip` instead.
- required uint32 ip = 2;
-
- // The TCP port the Master is listening on for incoming
- // HTTP requests; deprecated, use `address.port` instead.
- required uint32 port = 3 [default = 5050];
-
- // In the default implementation, this will contain information
- // about both the IP address, port and Master name; it should really
- // not be relied upon by external tooling/frameworks and be
- // considered an "internal" implementation field.
- optional string pid = 4;
-
- // The server's hostname, if available; it may be unreliable
- // in environments where the DNS configuration does not resolve
- // internal hostnames (eg, some public cloud providers).
- // Deprecated, use `address.hostname` instead.
- optional string hostname = 5;
-
- // The running Master version, as a string; taken from the
- // generated "master/version.hpp".
- optional string version = 6;
-
- // The full IP address (supports both IPv4 and IPv6 formats)
- // and supersedes the use of `ip`, `port` and `hostname`.
- // Since Mesos 0.24.
- optional Address address = 7;
-
- // The domain that this master belongs to. All masters in a Mesos
- // cluster should belong to the same region.
- optional DomainInfo domain = 8;
-}
-
-
-/**
- * Describes a slave. Note that the 'id' field is only available after
- * a slave is registered with the master, and is made available here
- * to facilitate re-registration.
- */
-message SlaveInfo {
- required string hostname = 1;
- optional int32 port = 8 [default = 5051];
-
- // The configured resources at the agent. This does not include any
- // dynamic reservations or persistent volumes that may currently
- // exist at the agent.
- repeated Resource resources = 3;
-
- repeated Attribute attributes = 5;
- optional SlaveID id = 6;
-
- // The domain that this slave belongs to. If the slave's region
- // differs from the master's region, it will not appear in resource
- // offers to frameworks that have not enabled the REGION_AWARE
- // capability.
- optional DomainInfo domain = 10;
-
- // Slave checkpointing is always enabled in recent Mesos versions;
- // the value of this field is ignored.
- // TODO(joerg84): Remove checkpoint field after deprecation cycle starting
- // with 0.27 (MESOS-2317).
- optional bool checkpoint = 7 [default = false];
-
- message Capability {
- enum Type {
- // This must be the first enum value in this list, to
- // ensure that if 'type' is not set, the default value
- // is UNKNOWN. This enables enum values to be added
- // in a backwards-compatible way. See: MESOS-4997.
- UNKNOWN = 0;
-
- // This expresses the ability for the agent to be able
- // to launch tasks of a 'multi-role' framework.
- MULTI_ROLE = 1;
-
- // This expresses the ability for the agent to be able to launch
- // tasks, reserve resources, and create volumes using resources
- // allocated to a 'hierarchical-role'.
- // NOTE: This capability is required specifically for creating
- // volumes because a hierchical role includes '/' (slashes) in them.
- // Agents with this capability know to transform the '/' (slashes)
- // into ' ' (spaces).
- HIERARCHICAL_ROLE = 2;
-
- // This capability has three effects for an agent.
- //
- // (1) The format of the checkpointed resources, and
- // the resources reported to master.
- //
- // These resources are reported in the "pre-reservation-refinement"
- // format if none of the resources have refined reservations. If any
- // of the resources have refined reservations, they are reported in
- // the "post-reservation-refinement" format. The purpose is to allow
- // downgrading of an agent as well as communication with a pre-1.4.0
- // master until the reservation refinement feature is actually used.
- //
- // See the 'Resource Format' section for more details.
- //
- // (2) The format of the resources reported by the HTTP endpoints.
- //
- // For resources reported by agent endpoints, the
- // "pre-reservation-refinement" format is "injected" if possible.
- // That is, resources without refined reservations will have the
- // `Resource.role` and `Resource.reservation` set, whereas
- // resources with refined reservations will not.
- //
- // See the 'Resource Format' section for more details.
- //
- // (3) The ability for the agent to launch tasks, reserve resources, and
- // create volumes using resources that have refined reservations.
- //
- // See `ReservationInfo.reservations` section for more details.
- //
- // NOTE: Resources are said to have refined reservations if it uses the
- // `Resource.reservations` field, and `Resource.reservations_size() > 1`.
- RESERVATION_REFINEMENT = 3;
- }
-
- // Enum fields should be optional, see: MESOS-4997.
- optional Type type = 1;
- }
-}
-
-
-/**
- * Describes a resource provider. Note that the 'id' field is only available
- * after a resource provider is registered with the master, and is made
- * available here to facilitate re-registration.
- */
-message ResourceProviderInfo {
- optional ResourceProviderID id = 1;
- repeated Attribute attributes = 2;
-
- // The type of the resource provider. This uniquely identifies a
- // resource provider implementation. For instance:
- // org.apache.mesos.rp.local.storage
- //
- // Please follow to Java package naming convention
- // (https://en.wikipedia.org/wiki/Java_package#Package_naming_conventions)
- // to avoid conflicts on type names.
- required string type = 3;
-
- // The name of the resource provider. There could be multiple
- // instances of a type of resource provider. The name field is used
- // to distinguish these instances.
- required string name = 4;
-}
-
-
-/**
- * Describes an Attribute or Resource "value". A value is described
- * using the standard protocol buffer "union" trick.
- */
-message Value {
- enum Type {
- SCALAR = 0;
- RANGES = 1;
- SET = 2;
- TEXT = 3;
- }
-
- message Scalar {
- // Scalar values are represented using floating point. To reduce
- // the chance of unpredictable floating point behavior due to
- // roundoff error, Mesos only supports three decimal digits of
- // precision for scalar resource values. That is, floating point
- // values are converted to a fixed point format that supports
- // three decimal digits of precision, and then converted back to
- // floating point on output. Any additional precision in scalar
- // resource values is discarded (via rounding).
- required double value = 1;
- }
-
- message Range {
- required uint64 begin = 1;
- required uint64 end = 2;
- }
-
- message Ranges {
- repeated Range range = 1;
- }
-
- message Set {
- repeated string item = 1;
- }
-
- message Text {
- required string value = 1;
- }
-
- required Type type = 1;
- optional Scalar scalar = 2;
- optional Ranges ranges = 3;
- optional Set set = 4;
- optional Text text = 5;
-}
-
-
-/**
- * Describes an attribute that can be set on a machine. For now,
- * attributes and resources share the same "value" type, but this may
- * change in the future and attributes may only be string based.
- */
-message Attribute {
- required string name = 1;
- required Value.Type type = 2;
- optional Value.Scalar scalar = 3;
- optional Value.Ranges ranges = 4;
- optional Value.Set set = 6;
- optional Value.Text text = 5;
-}
-
-
-/**
- * Describes a resource from a resource provider. The `name` field is
- * a string like "cpus" or "mem" that indicates which kind of resource
- * this is; the rest of the fields describe the properties of the
- * resource. A resource can take on one of three types: scalar
- * (double), a list of finite and discrete ranges (e.g., [1-10,
- * 20-30]), or a set of items. A resource is described using the
- * standard protocol buffer "union" trick.
- *
- * Note that "disk" and "mem" resources are scalar values expressed in
- * megabytes. Fractional "cpus" values are allowed (e.g., "0.5"),
- * which correspond to partial shares of a CPU.
- */
-message Resource {
- optional ResourceProviderID provider_id = 12;
-
- required string name = 1;
- required Value.Type type = 2;
- optional Value.Scalar scalar = 3;
- optional Value.Ranges ranges = 4;
- optional Value.Set set = 5;
-
- // The role that this resource is reserved for. If "*", this indicates
- // that the resource is unreserved. Otherwise, the resource will only
- // be offered to frameworks that belong to this role.
- //
- // NOTE: Frameworks must not set this field if `reservations` is set.
- // See the 'Resource Format' section for more details.
- //
- // TODO(mpark): Deprecate once `reservations` is no longer experimental.
- optional string role = 6 [default = "*", deprecated=true];
-
- // This was initially introduced to support MULTI_ROLE capable
- // frameworks. Frameworks that are not MULTI_ROLE capable can
- // continue to assume that the offered resources are allocated
- // to their role.
- message AllocationInfo {
- // If set, this resource is allocated to a role. Note that in the
- // future, this may be unset and the scheduler may be responsible
- // for allocating to one of its roles.
- optional string role = 1;
-
- // In the future, we may add additional fields here, e.g. priority
- // tier, type of allocation (quota / fair share).
- }
-
- optional AllocationInfo allocation_info = 11;
-
- // Resource Format:
- //
- // Frameworks receive resource offers in one of two formats, depending on
- // whether the RESERVATION_REFINEMENT capability is enabled.
- //
- // __WITHOUT__ the RESERVATION_REFINEMENT capability, the framework is offered
- // resources in the "pre-reservation-refinement" format. In this format, the
- // `Resource.role` and `Resource.reservation` fields are used in conjunction
- // to describe the reservation state of a `Resource` message.
- //
- // The following is an overview of the possible reservation states:
- //
- // +------------+------------------------------------------------------------+
- // | unreserved | { |
- // | | role: "*", |
- // | | reservation: <not set>, |
- // | | reservations: <unused> |
- // | | } |
- // +------------+------------------------------------------------------------+
- // | static | { |
- // | | role: "eng", |
- // | | reservation: <not set>, |
- // | | reservations: <unused> |
- // | | } |
- // +------------+------------------------------------------------------------+
- // | dynamic | { |
- // | | role: "eng", |
- // | | reservation: { |
- // | | type: <unused>, |
- // | | role: <unused>, |
- // | | principal: <optional>, |
- // | | labels: <optional> |
- // | | }, |
- // | | reservations: <unused> |
- // | | } |
- // +------------+------------------------------------------------------------+
- //
- // __WITH__ the RESERVATION_REFINEMENT capability, the framework is offered
- // resources in the "post-reservation-refinement" format. In this format, the
- // reservation state of a `Resource` message is expressed solely in
- // `Resource.reservations` field.
- //
- // The following is an overview of the possible reservation states:
- //
- // +------------+------------------------------------------------------------+
- // | unreserved | { |
- // | | role: <unused>, |
- // | | reservation: <unused>, |
- // | | reservations: [] |
- // | | } |
- // +------------+------------------------------------------------------------+
- // | static | { |
- // | | role: <unused>, |
- // | | reservation: <unused>, |
- // | | reservations: [ |
- // | | { |
- // | | type: STATIC, |
- // | | role: "eng", |
- // | | principal: <optional>, |
- // | | labels: <optional> |
- // | | } |
- // | | ] |
- // | | } |
- // +------------+------------------------------------------------------------+
- // | dynamic | { |
- // | | role: <unused>, |
- // | | reservation: <unused>, |
- // | | reservations: [ |
- // | | { |
- // | | type: DYNAMIC, |
- // | | role: "eng", |
- // | | principal: <optional>, |
- // | | labels: <optional> |
- // | | } |
- // | | ] |
- // | | } |
- // +------------+------------------------------------------------------------+
- //
- // We can also __refine__ reservations with this capability like so:
- //
- // +------------+------------------------------------------------------------+
- // | refined | { |
- // | | role: <unused>, |
- // | | reservation: <unused>, |
- // | | reservations: [ |
- // | | { |
- // | | type: STATIC or DYNAMIC, |
- // | | role: "eng", |
- // | | principal: <optional>, |
- // | | labels: <optional> |
- // | | }, |
- // | | { |
- // | | type: DYNAMIC, |
- // | | role: "eng/front_end", |
- // | | principal: <optional>, |
- // | | labels: <optional> |
- // | | } |
- // | | ] |
- // | | } |
- // +------------+------------------------------------------------------------+
- //
- // NOTE: Each `ReservationInfo` in the `reservations` field denotes
- // a reservation that refines the previous `ReservationInfo`.
-
- message ReservationInfo {
- // Describes a reservation. A static reservation is set by the operator on
- // the command-line and they are immutable without agent restart. A dynamic
- // reservation is made by an operator via the '/reserve' HTTP endpoint
- // or by a framework via the offer cycle by sending back an
- // 'Offer::Operation::Reserve' message.
- //
- // NOTE: We currently do not allow frameworks with role "*" to make dynamic
- // reservations.
-
- enum Type {
- UNKNOWN = 0;
- STATIC = 1;
- DYNAMIC = 2;
- }
-
- // The type of this reservation.
- //
- // NOTE: This field must not be set for `Resource.reservation`.
- // See the 'Resource Format' section for more details.
- optional Type type = 4;
-
- // The role to which this reservation is made for.
- //
- // NOTE: This field must not be set for `Resource.reservation`.
- // See the 'Resource Format' section for more details.
- optional string role = 3;
-
- // Indicates the principal, if any, of the framework or operator
- // that reserved this resource. If reserved by a framework, the
- // field should match the `FrameworkInfo.principal`. It is used in
- // conjunction with the `UnreserveResources` ACL to determine
- // whether the entity attempting to unreserve this resource is
- // permitted to do so.
- optional string principal = 1;
-
- // Labels are free-form key value pairs that can be used to
- // associate arbitrary metadata with a reserved resource. For
- // example, frameworks can use labels to identify the intended
- // purpose for a portion of the resources the framework has
- // reserved at a given slave. Labels should not contain duplicate
- // key-value pairs.
- optional Labels labels = 2;
- }
-
- // If this is set, this resource was dynamically reserved by an
- // operator or a framework. Otherwise, this resource is either unreserved
- // or statically reserved by an operator via the --resources flag.
- //
- // NOTE: Frameworks must not set this field if `reservations` is set.
- // See the 'Resource Format' section for more details.
- //
- // TODO(mpark): Deprecate once `reservations` is no longer experimental.
- optional ReservationInfo reservation = 8;
-
- // The stack of reservations. If this field is empty, it indicates that this
- // resource is unreserved. Otherwise, the resource is reserved. The first
- // `ReservationInfo` may have type `STATIC` or `DYNAMIC`, but the rest must
- // have `DYNAMIC`. One can create a new reservation on top of an existing
- // one by pushing a new `ReservationInfo` to the back. The last
- // `ReservationInfo` in this stack is the "current" reservation. The new
- // reservation's role must be a child of the current reservation's role.
- //
- // NOTE: Frameworks must not set this field if `reservation` is set.
- // See the 'Resource Format' section for more details.
- //
- // TODO(mpark): Deprecate `role` and `reservation` once this is stable.
- repeated ReservationInfo reservations = 13; // EXPERIMENTAL.
-
- message DiskInfo {
- // Describes a persistent disk volume.
- //
- // A persistent disk volume will not be automatically garbage
- // collected if the task/executor/slave terminates, but will be
- // re-offered to the framework(s) belonging to the 'role'.
- //
- // NOTE: Currently, we do not allow persistent disk volumes
- // without a reservation (i.e., 'role' cannot be '*').
- message Persistence {
- // A unique ID for the persistent disk volume. This ID must be
- // unique per role on each slave. Although it is possible to use
- // the same ID on different slaves in the cluster and to reuse
- // IDs after a volume with that ID has been destroyed, both
- // practices are discouraged.
- required string id = 1;
-
- // This field indicates the principal of the operator or
- // framework that created this volume. It is used in conjunction
- // with the "destroy" ACL to determine whether an entity
- // attempting to destroy the volume is permitted to do so.
- //
- // NOTE: This field should match the FrameworkInfo.principal of
- // the framework that created the volume.
- optional string principal = 2;
- }
-
- optional Persistence persistence = 1;
-
- // Describes how this disk resource will be mounted in the
- // container. If not set, the disk resource will be used as the
- // sandbox. Otherwise, it will be mounted according to the
- // 'container_path' inside 'volume'. The 'host_path' inside
- // 'volume' is ignored.
- // NOTE: If 'volume' is set but 'persistence' is not set, the
- // volume will be automatically garbage collected after
- // task/executor terminates. Currently, if 'persistence' is set,
- // 'volume' must be set.
- optional Volume volume = 2;
-
- // Describes where a disk originates from.
- // TODO(jmlvanre): Add support for BLOCK devices.
- message Source {
- enum Type {
- UNKNOWN = 0;
- PATH = 1;
- MOUNT = 2;
- }
-
- // A folder that can be located on a separate disk device. This
- // can be shared and carved up as necessary between frameworks.
- message Path {
- // Path to the folder (e.g., /mnt/raid/disk0).
- optional string root = 1;
- }
-
- // A mounted file-system set up by the Agent administrator. This
- // can only be used exclusively: a framework cannot accept a
- // partial amount of this disk.
- message Mount {
- // Path to mount point (e.g., /mnt/raid/disk0).
- optional string root = 1;
- }
-
- required Type type = 1;
- optional Path path = 2;
- optional Mount mount = 3;
- }
-
- optional Source source = 3;
- }
-
- optional DiskInfo disk = 7;
-
- message RevocableInfo {}
-
- // If this is set, the resources are revocable, i.e., any tasks or
- // executors launched using these resources could get preempted or
- // throttled at any time. This could be used by frameworks to run
- // best effort tasks that do not need strict uptime or performance
- // guarantees. Note that if this is set, 'disk' or 'reservation'
- // cannot be set.
- optional RevocableInfo revocable = 9;
-
- // Allow the resource to be shared across tasks.
- message SharedInfo {}
-
- // If this is set, the resources are shared, i.e. multiple tasks
- // can be launched using this resource and all of them shall refer
- // to the same physical resource on the cluster. Note that only
- // persistent volumes can be shared currently.
- optional SharedInfo shared = 10;
-}
-
-
-/**
- * When the network bandwidth caps are enabled and the container
- * is over its limit, outbound packets may be either delayed or
- * dropped completely either because it exceeds the maximum bandwidth
- * allocation for a single container (the cap) or because the combined
- * network traffic of multiple containers on the host exceeds the
- * transmit capacity of the host (the share). We can report the
- * following statistics for each of these conditions exported directly
- * from the Linux Traffic Control Queueing Discipline.
- *
- * id : name of the limiter, e.g. 'tx_bw_cap'
- * backlog : number of packets currently delayed
- * bytes : total bytes seen
- * drops : number of packets dropped in total
- * overlimits : number of packets which exceeded allocation
- * packets : total packets seen
- * qlen : number of packets currently queued
- * rate_bps : throughput in bytes/sec
- * rate_pps : throughput in packets/sec
- * requeues : number of times a packet has been delayed due to
- * locking or device contention issues
- *
- * More information on the operation of Linux Traffic Control can be
- * found at http://www.lartc.org/lartc.html.
- */
-message TrafficControlStatistics {
- required string id = 1;
- optional uint64 backlog = 2;
- optional uint64 bytes = 3;
- optional uint64 drops = 4;
- optional uint64 overlimits = 5;
- optional uint64 packets = 6;
- optional uint64 qlen = 7;
- optional uint64 ratebps = 8;
- optional uint64 ratepps = 9;
- optional uint64 requeues = 10;
-}
-
-
-message IpStatistics {
- optional int64 Forwarding = 1;
- optional int64 DefaultTTL = 2;
- optional int64 InReceives = 3;
- optional int64 InHdrErrors = 4;
- optional int64 InAddrErrors = 5;
- optional int64 ForwDatagrams = 6;
- optional int64 InUnknownProtos = 7;
- optional int64 InDiscards = 8;
- optional int64 InDelivers = 9;
- optional int64 OutRequests = 10;
- optional int64 OutDiscards = 11;
- optional int64 OutNoRoutes = 12;
- optional int64 ReasmTimeout = 13;
- optional int64 ReasmReqds = 14;
- optional int64 ReasmOKs = 15;
- optional int64 ReasmFails = 16;
- optional int64 FragOKs = 17;
- optional int64 FragFails = 18;
- optional int64 FragCreates = 19;
-}
-
-
-message IcmpStatistics {
- optional int64 InMsgs = 1;
- optional int64 InErrors = 2;
- optional int64 InCsumErrors = 3;
- optional int64 InDestUnreachs = 4;
- optional int64 InTimeExcds = 5;
- optional int64 InParmProbs = 6;
- optional int64 InSrcQuenchs = 7;
- optional int64 InRedirects = 8;
- optional int64 InEchos = 9;
- optional int64 InEchoReps = 10;
- optional int64 InTimestamps = 11;
- optional int64 InTimestampReps = 12;
- optional int64 InAddrMasks = 13;
- optional int64 InAddrMaskReps = 14;
- optional int64 OutMsgs = 15;
- optional int64 OutErrors = 16;
- optional int64 OutDestUnreachs = 17;
- optional int64 OutTimeExcds = 18;
- optional int64 OutParmProbs = 19;
- optional int64 OutSrcQuenchs = 20;
- optional int64 OutRedirects = 21;
- optional int64 OutEchos = 22;
- optional int64 OutEchoReps = 23;
- optional int64 OutTimestamps = 24;
- optional int64 OutTimestampReps = 25;
- optional int64 OutAddrMasks = 26;
- optional int64 OutAddrMaskReps = 27;
-}
-
-
-message TcpStatistics {
- optional int64 RtoAlgorithm = 1;
- optional int64 RtoMin = 2;
- optional int64 RtoMax = 3;
- optional int64 MaxConn = 4;
- optional int64 ActiveOpens = 5;
- optional int64 PassiveOpens = 6;
- optional int64 AttemptFails = 7;
- optional int64 EstabResets = 8;
- optional int64 CurrEstab = 9;
- optional int64 InSegs = 10;
- optional int64 OutSegs = 11;
- optional int64 RetransSegs = 12;
- optional int64 InErrs = 13;
- optional int64 OutRsts = 14;
- optional int64 InCsumErrors = 15;
-}
-
-
-message UdpStatistics {
- optional int64 InDatagrams = 1;
- optional int64 NoPorts = 2;
- optional int64 InErrors = 3;
- optional int64 OutDatagrams = 4;
- optional int64 RcvbufErrors = 5;
- optional int64 SndbufErrors = 6;
- optional int64 InCsumErrors = 7;
- optional int64 IgnoredMulti = 8;
-}
-
-
-message SNMPStatistics {
- optional IpStatistics ip_stats = 1;
- optional IcmpStatistics icmp_stats = 2;
- optional TcpStatistics tcp_stats = 3;
- optional UdpStatistics udp_stats = 4;
-}
-
-
-message DiskStatistics {
- optional Resource.DiskInfo.Source source = 1;
- optional Resource.DiskInfo.Persistence persistence = 2;
- optional uint64 limit_bytes = 3;
- optional uint64 used_bytes = 4;
-}
-
-
-/**
- * A snapshot of resource usage statistics.
- */
-message ResourceStatistics {
- required double timestamp = 1; // Snapshot time, in seconds since the Epoch.
-
- optional uint32 processes = 30;
- optional uint32 threads = 31;
-
- // CPU Usage Information:
- // Total CPU time spent in user mode, and kernel mode.
- optional double cpus_user_time_secs = 2;
- optional double cpus_system_time_secs = 3;
-
- // Number of CPUs allocated.
- optional double cpus_limit = 4;
-
- // cpu.stat on process throttling (for contention issues).
- optional uint32 cpus_nr_periods = 7;
- optional uint32 cpus_nr_throttled = 8;
- optional double cpus_throttled_time_secs = 9;
-
- // Memory Usage Information:
-
- // mem_total_bytes was added in 0.23.0 to represent the total memory
- // of a process in RAM (as opposed to in Swap). This was previously
- // reported as mem_rss_bytes, which was also changed in 0.23.0 to
- // represent only the anonymous memory usage, to keep in sync with
- // Linux kernel's (arguably erroneous) use of terminology.
- optional uint64 mem_total_bytes = 36;
-
- // Total memory + swap usage. This is set if swap is enabled.
- optional uint64 mem_total_memsw_bytes = 37;
-
- // Hard memory limit for a container.
- optional uint64 mem_limit_bytes = 6;
-
- // Soft memory limit for a container.
- optional uint64 mem_soft_limit_bytes = 38;
-
- // Broken out memory usage information: pagecache, rss (anonymous),
- // mmaped files and swap.
-
- // TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in
- // 0.23.0 and will be removed in 0.24.0.
- optional uint64 mem_file_bytes = 10;
- optional uint64 mem_anon_bytes = 11;
-
- // mem_cache_bytes is added in 0.23.0 to represent page cache usage.
- optional uint64 mem_cache_bytes = 39;
-
- // Since 0.23.0, mem_rss_bytes is changed to represent only
- // anonymous memory usage. Note that neither its requiredness, type,
- // name nor numeric tag has been changed.
- optional uint64 mem_rss_bytes = 5;
-
- optional uint64 mem_mapped_file_bytes = 12;
- // This is only set if swap is enabled.
- optional uint64 mem_swap_bytes = 40;
- optional uint64 mem_unevictable_bytes = 41;
-
- // Number of occurrences of different levels of memory pressure
- // events reported by memory cgroup. Pressure listening (re)starts
- // with these values set to 0 when slave (re)starts. See
- // https://www.kernel.org/doc/Documentation/cgroups/memory.txt for
- // more details.
- optional uint64 mem_low_pressure_counter = 32;
- optional uint64 mem_medium_pressure_counter = 33;
- optional uint64 mem_critical_pressure_counter = 34;
-
- // Disk Usage Information for executor working directory.
- optional uint64 disk_limit_bytes = 26;
- optional uint64 disk_used_bytes = 27;
-
- // Per disk (resource) statistics.
- repeated DiskStatistics disk_statistics = 43;
-
- // Cgroups blkio statistics.
- optional CgroupInfo.Blkio.Statistics blkio_statistics = 44;
-
- // Perf statistics.
- optional PerfStatistics perf = 13;
-
- // Network Usage Information:
- optional uint64 net_rx_packets = 14;
- optional uint64 net_rx_bytes = 15;
- optional uint64 net_rx_errors = 16;
- optional uint64 net_rx_dropped = 17;
- optional uint64 net_tx_packets = 18;
- optional uint64 net_tx_bytes = 19;
- optional uint64 net_tx_errors = 20;
- optional uint64 net_tx_dropped = 21;
-
- // The kernel keeps track of RTT (round-trip time) for its TCP
- // sockets. RTT is a way to tell the latency of a container.
- optional double net_tcp_rtt_microsecs_p50 = 22;
- optional double net_tcp_rtt_microsecs_p90 = 23;
- optional double net_tcp_rtt_microsecs_p95 = 24;
- optional double net_tcp_rtt_microsecs_p99 = 25;
-
- optional double net_tcp_active_connections = 28;
- optional double net_tcp_time_wait_connections = 29;
-
- // Network traffic flowing into or out of a container can be delayed
- // or dropped due to congestion or policy inside and outside the
- // container.
- repeated TrafficControlStatistics net_traffic_control_statistics = 35;
-
- // Network SNMP statistics for each container.
- optional SNMPStatistics net_snmp_statistics = 42;
-}
-
-
-/**
- * Describes a snapshot of the resource usage for executors.
- */
-message ResourceUsage {
- message Executor {
- required ExecutorInfo executor_info = 1;
-
- // This includes resources used by the executor itself
- // as well as its active tasks.
- repeated Resource allocated = 2;
-
- // Current resource usage. If absent, the containerizer
- // cannot provide resource usage.
- optional ResourceStatistics statistics = 3;
-
- // The container id for the executor specified in the executor_info field.
- required ContainerID container_id = 4;
-
- message Task {
- required string name = 1;
- required TaskID id = 2;
- repeated Resource resources = 3;
- optional Labels labels = 4;
- }
-
- // Non-terminal tasks.
- repeated Task tasks = 5;
- }
-
- repeated Executor executors = 1;
-
- // Slave's total resources including checkpointed dynamic
- // reservations and persistent volumes.
- repeated Resource total = 2;
-}
-
-
-/**
- * Describes a sample of events from "perf stat". Only available on
- * Linux.
- *
- * NOTE: Each optional field matches the name of a perf event (see
- * "perf list") with the following changes:
- * 1. Names are downcased.
- * 2. Hyphens ('-') are replaced with underscores ('_').
- * 3. Events with alternate names use the name "perf stat" returns,
- * e.g., for the event "cycles OR cpu-cycles" perf always returns
- * cycles.
- */
-message PerfStatistics {
- required double timestamp = 1; // Start of sample interval, in seconds since the Epoch.
- required double duration = 2; // Duration of sample interval, in seconds.
-
- // Hardware event.
- optional uint64 cycles = 3;
- optional uint64 stalled_cycles_frontend = 4;
- optional uint64 stalled_cycles_backend = 5;
- optional uint64 instructions = 6;
- optional uint64 cache_references = 7;
- optional uint64 cache_misses = 8;
- optional uint64 branches = 9;
- optional uint64 branch_misses = 10;
- optional uint64 bus_cycles = 11;
- optional uint64 ref_cycles = 12;
-
- // Software event.
- optional double cpu_clock = 13;
- optional double task_clock = 14;
- optional uint64 page_faults = 15;
- optional uint64 minor_faults = 16;
- optional uint64 major_faults = 17;
- optional uint64 context_switches = 18;
- optional uint64 cpu_migrations = 19;
- optional uint64 alignment_faults = 20;
- optional uint64 emulation_faults = 21;
-
- // Hardware cache event.
- optional uint64 l1_dcache_loads = 22;
- optional uint64 l1_dcache_load_misses = 23;
- optional uint64 l1_dcache_stores = 24;
- optional uint64 l1_dcache_store_misses = 25;
- optional uint64 l1_dcache_prefetches = 26;
- optional uint64 l1_dcache_prefetch_misses = 27;
- optional uint64 l1_icache_loads = 28;
- optional uint64 l1_icache_load_misses = 29;
- optional uint64 l1_icache_prefetches = 30;
- optional uint64 l1_icache_prefetch_misses = 31;
- optional uint64 llc_loads = 32;
- optional uint64 llc_load_misses = 33;
- optional uint64 llc_stores = 34;
- optional uint64 llc_store_misses = 35;
- optional uint64 llc_prefetches = 36;
- optional uint64 llc_prefetch_misses = 37;
- optional uint64 dtlb_loads = 38;
- optional uint64 dtlb_load_misses = 39;
- optional uint64 dtlb_stores = 40;
- optional uint64 dtlb_store_misses = 41;
- optional uint64 dtlb_prefetches = 42;
- optional uint64 dtlb_prefetch_misses = 43;
- optional uint64 itlb_loads = 44;
- optional uint64 itlb_load_misses = 45;
- optional uint64 branch_loads = 46;
- optional uint64 branch_load_misses = 47;
- optional uint64 node_loads = 48;
- optional uint64 node_load_misses = 49;
- optional uint64 node_stores = 50;
- optional uint64 node_store_misses = 51;
- optional uint64 node_prefetches = 52;
- optional uint64 node_prefetch_misses = 53;
-}
-
-
-/**
- * Describes a request for resources that can be used by a framework
- * to proactively influence the allocator. If 'slave_id' is provided
- * then this request is assumed to only apply to resources on that
- * slave.
- */
-message Request {
- optional SlaveID slave_id = 1;
- repeated Resource resources = 2;
-}
-
-
-/**
- * Describes some resources available on a slave. An offer only
- * contains resources from a single slave.
- */
-message Offer {
- required OfferID id = 1;
- required FrameworkID framework_id = 2;
- required SlaveID slave_id = 3;
- required string hostname = 4;
-
- // URL for reaching the slave running on the host.
- optional URL url = 8;
-
- // The domain of the slave.
- optional DomainInfo domain = 11;
-
- repeated Resource resources = 5;
- repeated Attribute attributes = 7;
- repeated ExecutorID executor_ids = 6;
-
- // Signifies that the resources in this Offer may be unavailable during
- // the given interval. Any tasks launched using these resources may be
- // killed when the interval arrives. For example, these resources may be
- // part of a planned maintenance schedule.
- //
- // This field only provides information about a planned unavailability.
- // The unavailability interval may not necessarily start at exactly this
- // interval, nor last for exactly the duration of this interval.
- // The unavailability may also be forever! See comments in
- // `Unavailability` for more details.
- optional Unavailability unavailability = 9;
-
- // An offer represents resources allocated to *one* of the
- // roles managed by the scheduler. (Therefore, each
- // `Offer.resources[i].allocation_info` will match the
- // top level `Offer.allocation_info`).
- optional Resource.AllocationInfo allocation_info = 10;
-
- // Defines an operation that can be performed against offers.
- message Operation {
- enum Type {
- UNKNOWN = 0;
- LAUNCH = 1;
- LAUNCH_GROUP = 6;
- RESERVE = 2;
- UNRESERVE = 3;
- CREATE = 4;
- DESTROY = 5;
- }
-
- // TODO(vinod): Deprecate this in favor of `LaunchGroup` below.
- message Launch {
- repeated TaskInfo task_infos = 1;
- }
-
- // Unlike `Launch` above, all the tasks in a `task_group` are
- // atomically delivered to an executor.
- //
- // `NetworkInfo` set on executor will be shared by all tasks in
- // the task group.
- //
- // TODO(vinod): Any volumes set on executor could be used by a
- // task by explicitly setting `Volume.source` in its resources.
- message LaunchGroup {
- required ExecutorInfo executor = 1;
- required TaskGroupInfo task_group = 2;
- }
-
- message Reserve {
- repeated Resource resources = 1;
- }
-
- message Unreserve {
- repeated Resource resources = 1;
- }
-
- message Create {
- repeated Resource volumes = 1;
- }
-
- message Destroy {
- repeated Resource volumes = 1;
- }
-
- optional Type type = 1;
- optional Launch launch = 2;
- optional LaunchGroup launch_group = 7;
- optional Reserve reserve = 3;
- optional Unreserve unreserve = 4;
- optional Create create = 5;
- optional Destroy destroy = 6;
- }
-}
-
-
-/**
- * A request to return some resources occupied by a framework.
- */
-message InverseOffer {
- // This is the same OfferID as found in normal offers, which allows
- // re-use of some of the OfferID-only messages.
- required OfferID id = 1;
-
- // URL for reaching the slave running on the host. This enables some
- // optimizations as described in MESOS-3012, such as allowing the
- // scheduler driver to bypass the master and talk directly with a slave.
- optional URL url = 2;
-
- // The framework that should release its resources.
- // If no specifics are provided (i.e. which slave), all the framework's
- // resources are requested back.
- required FrameworkID framework_id = 3;
-
- // Specified if the resources need to be released from a particular slave.
- // All the framework's resources on this slave are requested back,
- // unless further qualified by the `resources` field.
- optional SlaveID slave_id = 4;
-
- // This InverseOffer represents a planned unavailability event in the
- // specified interval. Any tasks running on the given framework or slave
- // may be killed when the interval arrives. Therefore, frameworks should
- // aim to gracefully terminate tasks prior to the arrival of the interval.
- //
- // For reserved resources, the resources are expected to be returned to the
- // framework after the unavailability interval. This is an expectation,
- // not a guarantee. For example, if the unavailability duration is not set,
- // the resources may be removed permanently.
- //
- // For other resources, there is no guarantee that requested resources will
- // be returned after the unavailability interval. The allocator has no
- // obligation to re-offer these resources to the prior framework after
- // the unavailability.
- required Unavailability unavailability = 5;
-
- // A list of resources being requested back from the framework,
- // on the slave identified by `slave_id`. If no resources are specified
- // then all resources are being requested back. For the purpose of
- // maintenance, this field is always empty (maintenance always requests
- // all resources back).
- repeated Resource resources = 6;
-
- // TODO(josephw): Add additional options for narrowing down the resources
- // being requested back. Such as specific executors, tasks, etc.
-}
-
-
-/**
- * Describes a task. Passed from the scheduler all the way to an
- * executor (see SchedulerDriver::launchTasks and
- * Executor::launchTask). Either ExecutorInfo or CommandInfo should be set.
- * A different executor can be used to launch this task, and subsequent tasks
- * meant for the same executor can reuse the same ExecutorInfo struct.
- */
-message TaskInfo {
- required string name = 1;
- required TaskID task_id = 2;
- required SlaveID slave_id = 3;
- repeated Resource resources = 4;
- optional ExecutorInfo executor = 5;
- optional CommandInfo command = 7;
-
- // Task provided with a container will launch the container as part
- // of this task paired with the task's CommandInfo.
- optional ContainerInfo container = 9;
-
- // A health check for the task. Implemented for executor-less
- // command-based tasks. For tasks that specify an executor, it is
- // the executor's responsibility to implement the health checking.
- optional HealthCheck health_check = 8;
-
- // A general check for the task. Implemented for all built-in executors.
- // For tasks that specify an executor, it is the executor's responsibility
- // to implement checking support. Executors should (all built-in executors
- // will) neither interpret nor act on the check's result.
- //
- // NOTE: Check support in built-in executors is experimental.
- //
- // TODO(alexr): Consider supporting multiple checks per task.
- optional CheckInfo check = 13;
-
- // A kill policy for the task. Implemented for executor-less
- // command-based and docker tasks. For tasks that specify an
- // executor, it is the executor's responsibility to implement
- // the kill policy.
- optional KillPolicy kill_policy = 12;
-
- optional bytes data = 6;
-
- // Labels are free-form key value pairs which are exposed through
- // master and slave endpoints. Labels will not be interpreted or
- // acted upon by Mesos itself. As opposed to the data field, labels
- // will be kept in memory on master and slave processes. Therefore,
- // labels should be used to tag tasks with light-weight meta-data.
- // Labels should not contain duplicate key-value pairs.
- optional Labels labels = 10;
-
- // Service discovery information for the task. It is not interpreted
- // or acted upon by Mesos. It is up to a service discovery system
- // to use this information as needed and to handle tasks without
- // service discovery information.
- optional DiscoveryInfo discovery = 11;
-}
-
-
-/**
- * Describes a group of tasks that belong to an executor. The
- * executor will receive the task group in a single message to
- * allow the group to be launched "atomically".
- *
- * NOTES:
- * 1) `NetworkInfo` must not be set inside task's `ContainerInfo`.
- * 2) `TaskInfo.executor` doesn't need to set. If set, it should match
- * `LaunchGroup.executor`.
- */
-message TaskGroupInfo {
- repeated TaskInfo tasks = 1;
-}
-
-
-// TODO(bmahler): Add executor_uuid here, and send it to the master. This will
-// allow us to expose executor work directories for tasks in the webui when
-// looking from the master level. Currently only the slave knows which run the
-// task belongs to.
-/**
- * Describes a task, similar to `TaskInfo`.
- *
- * `Task` is used in some of the Mesos messages found below.
- * `Task` is used instead of `TaskInfo` if:
- * 1) we need additional IDs, such as a specific
- * framework, executor, or agent; or
- * 2) we do not need the additional data, such as the command run by the
- * task or the health checks. These additional fields may be large and
- * unnecessary for some Mesos messages.
- *
- * `Task` is generally constructed from a `TaskInfo`. See protobuf::createTask.
- */
-message Task {
- required string name = 1;
- required TaskID task_id = 2;
- required FrameworkID framework_id = 3;
- optional ExecutorID executor_id = 4;
- required SlaveID slave_id = 5;
- required TaskState state = 6; // Latest state of the task.
- repeated Resource resources = 7;
- repeated TaskStatus statuses = 8;
-
- // These fields correspond to the state and uuid of the latest
- // status update forwarded to the master.
- // NOTE: Either both the fields must be set or both must be unset.
- optional TaskState status_update_state = 9;
- optional bytes status_update_uuid = 10;
-
- optional Labels labels = 11;
-
- // Service discovery information for the task. It is not interpreted
- // or acted upon by Mesos. It is up to a service discovery system
- // to use this information as needed and to handle tasks without
- // service discovery information.
- optional DiscoveryInfo discovery = 12;
-
- // Container information for the task.
- optional ContainerInfo container = 13;
-
- // Specific user under which task is running.
- optional string user = 14;
-}
-
-
-/**
- * Describes possible task states. IMPORTANT: Mesos assumes tasks that
- * enter terminal states (see below) imply the task is no longer
- * running and thus clean up any thing associated with the task
- * (ultimately offering any resources being consumed by that task to
- * another task).
- */
-enum TaskState {
- TASK_STAGING = 6; // Initial state. Framework status updates should not use.
- TASK_STARTING = 0; // The task is being launched by the executor.
- TASK_RUNNING = 1;
-
- // NOTE: This should only be sent when the framework has
- // the TASK_KILLING_STATE capability.
- TASK_KILLING = 8; // The task is being killed by the executor.
-
- TASK_FINISHED = 2; // TERMINAL: The task finished successfully.
- TASK_FAILED = 3; // TERMINAL: The task failed to finish successfully.
- TASK_KILLED = 4; // TERMINAL: The task was killed by the executor.
- TASK_ERROR = 7; // TERMINAL: The task description contains an error.
-
- // In Mesos 1.3, this will only be sent when the framework does NOT
- // opt-in to the PARTITION_AWARE capability.
- //
- // NOTE: This state is not always terminal. For example, tasks might
- // transition from TASK_LOST to TASK_RUNNING or other states when a
- // partitioned agent re-registers.
- TASK_LOST = 5; // The task failed but can be rescheduled.
-
- // The following task states are only sent when the framework
- // opts-in to the PARTITION_AWARE capability.
-
- // The task failed to launch because of a transient error. The
- // task's executor never started running. Unlike TASK_ERROR, the
- // task description is valid -- attempting to launch the task again
- // may be successful.
- TASK_DROPPED = 9; // TERMINAL.
-
- // The task was running on an agent that has lost contact with the
- // master, typically due to a network failure or partition. The task
- // may or may not still be running.
- TASK_UNREACHABLE = 10;
-
- // The task is no longer running. This can occur if the agent has
- // been terminated along with all of its tasks (e.g., the host that
- // was running the agent was rebooted). It might also occur if the
- // task was terminated due to an agent or containerizer error, or if
- // the task was preempted by the QoS controller in an
- // oversubscription scenario.
- TASK_GONE = 11; // TERMINAL.
-
- // The task was running on an agent that the master cannot contact;
- // the operator has asserted that the agent has been shutdown, but
- // this has not been directly confirmed by the master. If the
- // operator is correct, the task is not running and this is a
- // terminal state; if the operator is mistaken, the task may still
- // be running and might return to RUNNING in the future.
- TASK_GONE_BY_OPERATOR = 12;
-
- // The master has no knowledge of the task. This is typically
- // because either (a) the master never had knowledge of the task, or
- // (b) the master forgot about the task because it garbage collected
- // its metadata about the task. The task may or may not still be
- // running.
- TASK_UNKNOWN = 13;
-}
-
-
-/**
-* Describes the status of a check. Type and the corresponding field, i.e.,
-* `command` or `http` must be set. If the result of the check is not available
-* (e.g., the check timed out), these fields must contain empty messages, i.e.,
-* `exit_code` or `status_code` will be unset.
-*
-* NOTE: This API is unstable and the related feature is experimental.
-*/
-message CheckStatusInfo {
- message Command {
- // Exit code of a command check. It is the result of calling
- // `WEXITSTATUS()` on `waitpid()` termination information on
- // Posix and calling `GetExitCodeProcess()` on Windows.
- optional int32 exit_code = 1;
- }
-
- message Http {
- // HTTP status code of an HTTP check.
- optional uint32 status_code = 1;
- }
-
- message Tcp {
- // Whether a TCP connection succeeded.
- optional bool succeeded = 1;
- }
-
- // TODO(alexr): Consider adding a `data` field, which can contain, e.g.,
- // truncated stdout/stderr output for command checks or HTTP response body
- // for HTTP checks. Alternatively, it can be an even shorter `message` field
- // containing the last line of stdout or Reason-Phrase of the status line of
- // the HTTP response.
-
- // The type of the check this status corresponds to.
- optional CheckInfo.Type type = 1;
-
- // Status of a command check.
- optional Command command = 2;
-
- // Status of an HTTP check.
- optional Http http = 3;
-
- // Status of a TCP check.
- optional Tcp tcp = 4;
-
- // TODO(alexr): Consider introducing a "last changed at" timestamp, since
- // task status update's timestamp may not correspond to the last check's
- // state, e.g., for reconciliation.
-
- // TODO(alexr): Consider introducing a `reason` enum here to explicitly
- // distinguish between completed, delayed, and timed out checks.
-}
-
-
-/**
- * Describes the current status of a task.
- */
-message TaskStatus {
- // Describes the source of the task status update.
- enum Source {
- SOURCE_MASTER = 0;
- SOURCE_SLAVE = 1;
- SOURCE_EXECUTOR = 2;
- }
-
- // Detailed reason for the task status update.
- //
- // TODO(bmahler): Differentiate between slave removal reasons
- // (e.g. unhealthy vs. unregistered for maintenance).
- enum Reason {
- // TODO(jieyu): The default value when a caller doesn't check for
- // presence is 0 and so ideally the 0 reason is not a valid one.
- // Since this is not used anywhere, consider removing this reason.
- REASON_COMMAND_EXECUTOR_FAILED = 0;
-
- REASON_CONTAINER_LAUNCH_FAILED = 21;
- REASON_CONTAINER_LIMITATION = 19;
- REASON_CONTAINER_LIMITATION_DISK = 20;
- REASON_CONTAINER_LIMITATION_MEMORY = 8;
- REASON_CONTAINER_PREEMPTED = 17;
- REASON_CONTAINER_UPDATE_FAILED = 22;
- REASON_EXECUTOR_REGISTRATION_TIMEOUT = 23;
- REASON_EXECUTOR_REREGISTRATION_TIMEOUT = 24;
- REASON_EXECUTOR_TERMINATED = 1;
- REASON_EXECUTOR_UNREGISTERED = 2; // No longer used.
- REASON_FRAMEWORK_REMOVED = 3;
- REASON_GC_ERROR = 4;
- REASON_INVALID_FRAMEWORKID = 5;
- REASON_INVALID_OFFERS = 6;
- REASON_IO_SWITCHBOARD_EXITED = 27;
- REASON_MASTER_DISCONNECTED = 7;
- REASON_RECONCILIATION = 9;
- REASON_RESOURCES_UNKNOWN = 18;
- REASON_SLAVE_DISCONNECTED = 10;
- REASON_SLAVE_REMOVED = 11;
- REASON_SLAVE_RESTARTED = 12;
- REASON_SLAVE_UNKNOWN = 13;
- REASON_TASK_KILLED_DURING_LAUNCH = 30;
- REASON_TASK_CHECK_STATUS_UPDATED = 28;
- REASON_TASK_HEALTH_CHECK_STATUS_UPDATED = 29;
- REASON_TASK_GROUP_INVALID = 25;
- REASON_TASK_GROUP_UNAUTHORIZED = 26;
- REASON_TASK_INVALID = 14;
- REASON_TASK_UNAUTHORIZED = 15;
- REASON_TASK_UNKNOWN = 16;
- }
-
- required TaskID task_id = 1;
- required TaskState state = 2;
- optional string message = 4; // Possible message explaining state.
- optional Source source = 9;
- optional Reason reason = 10;
- optional bytes data = 3;
- optional SlaveID slave_id = 5;
- optional ExecutorID executor_id = 7; // TODO(benh): Use in master/slave.
- optional double timestamp = 6;
-
- // Statuses that are delivered reliably to the scheduler will
- // include a 'uuid'. The status is considered delivered once
- // it is acknowledged by the scheduler. Schedulers can choose
- // to either explicitly acknowledge statuses or let the scheduler
- // driver implicitly acknowledge (default).
- //
- // TODO(bmahler): This is currently overwritten in the scheduler
- // driver and executor driver, but executors will need to set this
- // to a valid RFC-4122 UUID if using the HTTP API.
- optional bytes uuid = 11;
-
- // Describes whether the task has been determined to be healthy (true) or
- // unhealthy (false) according to the `health_check` field in `TaskInfo`.
- optional bool healthy = 8;
-
- // Contains check status for the check specified in the corresponding
- // `TaskInfo`. If no check has been specified, this field must be
- // absent, otherwise it must be present even if the check status is
- // not available yet. If the status update is triggered for a different
- // reason than `REASON_TASK_CHECK_STATUS_UPDATED`, this field will contain
- // the last known value.
- //
- // NOTE: A check-related task status update is triggered if and only if
- // the value or presence of any field in `CheckStatusInfo` changes.
- //
- // NOTE: Check support in built-in executors is experimental.
- optional CheckStatusInfo check_status = 15;
-
- // Labels are free-form key value pairs which are exposed through
- // master and slave endpoints. Labels will not be interpreted or
- // acted upon by Mesos itself. As opposed to the data field, labels
- // will be kept in memory on master and slave processes. Therefore,
- // labels should be used to tag TaskStatus message with light-weight
- // meta-data. Labels should not contain duplicate key-value pairs.
- optional Labels labels = 12;
-
- // Container related information that is resolved dynamically such as
- // network address.
- optional ContainerStatus container_status = 13;
-
- // The time (according to the master's clock) when the agent where
- // this task was running became unreachable. This is only set on
- // status updates for tasks running on agents that are unreachable
- // (e.g., partitioned away from the master).
- optional TimeInfo unreachable_time = 14;
-}
-
-
-/**
- * Describes possible filters that can be applied to unused resources
- * (see SchedulerDriver::launchTasks) to influence the allocator.
- */
-message Filters {
- // Time to consider unused resources refused. Note that all unused
- // resources will be considered refused and use the default value
- // (below) regardless of whether Filters was passed to
- // SchedulerDriver::launchTasks. You MUST pass Filters with this
- // field set to change this behavior (i.e., get another offer which
- // includes unused resources sooner or later than the default).
- optional double refuse_seconds = 1 [default = 5.0];
-}
-
-
-/**
-* Describes a collection of environment variables. This is used with
-* CommandInfo in order to set environment variables before running a
-* command. The contents of each vari
<TRUNCATED>
[07/26] incubator-myriad git commit: Upgrade mesos driver to Mesos
1.5 with protobuf 2.5
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/b5b468b9/myriad-commons/src/main/java/org/apache/mesos/scheduler/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/scheduler/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/scheduler/Protos.java
new file mode 100644
index 0000000..bda044a
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/scheduler/Protos.java
@@ -0,0 +1,24780 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/scheduler.proto
+
+package org.apache.mesos.scheduler;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface EventOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional .mesos.scheduler.Event.Type type = 1;
+ /**
+ * <code>optional .mesos.scheduler.Event.Type type = 1;</code>
+ *
+ * <pre>
+ * Type of the event, indicates which optional field below should be
+ * present if that type has a nested message definition.
+ * Enum fields should be optional, see: MESOS-4997.
+ * </pre>
+ */
+ boolean hasType();
+ /**
+ * <code>optional .mesos.scheduler.Event.Type type = 1;</code>
+ *
+ * <pre>
+ * Type of the event, indicates which optional field below should be
+ * present if that type has a nested message definition.
+ * Enum fields should be optional, see: MESOS-4997.
+ * </pre>
+ */
+ org.apache.mesos.scheduler.Protos.Event.Type getType();
+
+ // optional .mesos.scheduler.Event.Subscribed subscribed = 2;
+ /**
+ * <code>optional .mesos.scheduler.Event.Subscribed subscribed = 2;</code>
+ */
+ boolean hasSubscribed();
+ /**
+ * <code>optional .mesos.scheduler.Event.Subscribed subscribed = 2;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.Subscribed getSubscribed();
+ /**
+ * <code>optional .mesos.scheduler.Event.Subscribed subscribed = 2;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.SubscribedOrBuilder getSubscribedOrBuilder();
+
+ // optional .mesos.scheduler.Event.Offers offers = 3;
+ /**
+ * <code>optional .mesos.scheduler.Event.Offers offers = 3;</code>
+ */
+ boolean hasOffers();
+ /**
+ * <code>optional .mesos.scheduler.Event.Offers offers = 3;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.Offers getOffers();
+ /**
+ * <code>optional .mesos.scheduler.Event.Offers offers = 3;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.OffersOrBuilder getOffersOrBuilder();
+
+ // optional .mesos.scheduler.Event.InverseOffers inverse_offers = 9;
+ /**
+ * <code>optional .mesos.scheduler.Event.InverseOffers inverse_offers = 9;</code>
+ */
+ boolean hasInverseOffers();
+ /**
+ * <code>optional .mesos.scheduler.Event.InverseOffers inverse_offers = 9;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.InverseOffers getInverseOffers();
+ /**
+ * <code>optional .mesos.scheduler.Event.InverseOffers inverse_offers = 9;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.InverseOffersOrBuilder getInverseOffersOrBuilder();
+
+ // optional .mesos.scheduler.Event.Rescind rescind = 4;
+ /**
+ * <code>optional .mesos.scheduler.Event.Rescind rescind = 4;</code>
+ */
+ boolean hasRescind();
+ /**
+ * <code>optional .mesos.scheduler.Event.Rescind rescind = 4;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.Rescind getRescind();
+ /**
+ * <code>optional .mesos.scheduler.Event.Rescind rescind = 4;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.RescindOrBuilder getRescindOrBuilder();
+
+ // optional .mesos.scheduler.Event.RescindInverseOffer rescind_inverse_offer = 10;
+ /**
+ * <code>optional .mesos.scheduler.Event.RescindInverseOffer rescind_inverse_offer = 10;</code>
+ */
+ boolean hasRescindInverseOffer();
+ /**
+ * <code>optional .mesos.scheduler.Event.RescindInverseOffer rescind_inverse_offer = 10;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.RescindInverseOffer getRescindInverseOffer();
+ /**
+ * <code>optional .mesos.scheduler.Event.RescindInverseOffer rescind_inverse_offer = 10;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.RescindInverseOfferOrBuilder getRescindInverseOfferOrBuilder();
+
+ // optional .mesos.scheduler.Event.Update update = 5;
+ /**
+ * <code>optional .mesos.scheduler.Event.Update update = 5;</code>
+ */
+ boolean hasUpdate();
+ /**
+ * <code>optional .mesos.scheduler.Event.Update update = 5;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.Update getUpdate();
+ /**
+ * <code>optional .mesos.scheduler.Event.Update update = 5;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.UpdateOrBuilder getUpdateOrBuilder();
+
+ // optional .mesos.scheduler.Event.Message message = 6;
+ /**
+ * <code>optional .mesos.scheduler.Event.Message message = 6;</code>
+ */
+ boolean hasMessage();
+ /**
+ * <code>optional .mesos.scheduler.Event.Message message = 6;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.Message getMessage();
+ /**
+ * <code>optional .mesos.scheduler.Event.Message message = 6;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.MessageOrBuilder getMessageOrBuilder();
+
+ // optional .mesos.scheduler.Event.Failure failure = 7;
+ /**
+ * <code>optional .mesos.scheduler.Event.Failure failure = 7;</code>
+ */
+ boolean hasFailure();
+ /**
+ * <code>optional .mesos.scheduler.Event.Failure failure = 7;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.Failure getFailure();
+ /**
+ * <code>optional .mesos.scheduler.Event.Failure failure = 7;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.FailureOrBuilder getFailureOrBuilder();
+
+ // optional .mesos.scheduler.Event.Error error = 8;
+ /**
+ * <code>optional .mesos.scheduler.Event.Error error = 8;</code>
+ */
+ boolean hasError();
+ /**
+ * <code>optional .mesos.scheduler.Event.Error error = 8;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.Error getError();
+ /**
+ * <code>optional .mesos.scheduler.Event.Error error = 8;</code>
+ */
+ org.apache.mesos.scheduler.Protos.Event.ErrorOrBuilder getErrorOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.scheduler.Event}
+ *
+ * <pre>
+ **
+ * Scheduler event API.
+ *
+ * An event is described using the standard protocol buffer "union"
+ * trick, see:
+ * https://developers.google.com/protocol-buffers/docs/techniques#union.
+ * </pre>
+ */
+ public static final class Event extends
+ com.google.protobuf.GeneratedMessage
+ implements EventOrBuilder {
+ // Use Event.newBuilder() to construct.
+ private Event(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Event(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Event defaultInstance;
+ public static Event getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Event getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Event(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ int rawValue = input.readEnum();
+ org.apache.mesos.scheduler.Protos.Event.Type value = org.apache.mesos.scheduler.Protos.Event.Type.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(1, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ type_ = value;
+ }
+ break;
+ }
+ case 18: {
+ org.apache.mesos.scheduler.Protos.Event.Subscribed.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = subscribed_.toBuilder();
+ }
+ subscribed_ = input.readMessage(org.apache.mesos.scheduler.Protos.Event.Subscribed.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(subscribed_);
+ subscribed_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.apache.mesos.scheduler.Protos.Event.Offers.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = offers_.toBuilder();
+ }
+ offers_ = input.readMessage(org.apache.mesos.scheduler.Protos.Event.Offers.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(offers_);
+ offers_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ org.apache.mesos.scheduler.Protos.Event.Rescind.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ subBuilder = rescind_.toBuilder();
+ }
+ rescind_ = input.readMessage(org.apache.mesos.scheduler.Protos.Event.Rescind.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(rescind_);
+ rescind_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
+ case 42: {
+ org.apache.mesos.scheduler.Protos.Event.Update.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
+ subBuilder = update_.toBuilder();
+ }
+ update_ = input.readMessage(org.apache.mesos.scheduler.Protos.Event.Update.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(update_);
+ update_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000040;
+ break;
+ }
+ case 50: {
+ org.apache.mesos.scheduler.Protos.Event.Message.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ subBuilder = message_.toBuilder();
+ }
+ message_ = input.readMessage(org.apache.mesos.scheduler.Protos.Event.Message.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(message_);
+ message_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000080;
+ break;
+ }
+ case 58: {
+ org.apache.mesos.scheduler.Protos.Event.Failure.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000100) == 0x00000100)) {
+ subBuilder = failure_.toBuilder();
+ }
+ failure_ = input.readMessage(org.apache.mesos.scheduler.Protos.Event.Failure.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(failure_);
+ failure_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000100;
+ break;
+ }
+ case 66: {
+ org.apache.mesos.scheduler.Protos.Event.Error.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000200) == 0x00000200)) {
+ subBuilder = error_.toBuilder();
+ }
+ error_ = input.readMessage(org.apache.mesos.scheduler.Protos.Event.Error.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(error_);
+ error_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000200;
+ break;
+ }
+ case 74: {
+ org.apache.mesos.scheduler.Protos.Event.InverseOffers.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ subBuilder = inverseOffers_.toBuilder();
+ }
+ inverseOffers_ = input.readMessage(org.apache.mesos.scheduler.Protos.Event.InverseOffers.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(inverseOffers_);
+ inverseOffers_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 82: {
+ org.apache.mesos.scheduler.Protos.Event.RescindInverseOffer.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ subBuilder = rescindInverseOffer_.toBuilder();
+ }
+ rescindInverseOffer_ = input.readMessage(org.apache.mesos.scheduler.Protos.Event.RescindInverseOffer.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(rescindInverseOffer_);
+ rescindInverseOffer_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000020;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.scheduler.Protos.Event.class, org.apache.mesos.scheduler.Protos.Event.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Event> PARSER =
+ new com.google.protobuf.AbstractParser<Event>() {
+ public Event parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Event(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Event> getParserForType() {
+ return PARSER;
+ }
+
+ /**
+ * Protobuf enum {@code mesos.scheduler.Event.Type}
+ *
+ * <pre>
+ * Possible event types, followed by message definitions if
+ * applicable.
+ * </pre>
+ */
+ public enum Type
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * This must be the first enum value in this list, to
+ * ensure that if 'type' is not set, the default value
+ * is UNKNOWN. This enables enum values to be added
+ * in a backwards-compatible way. See: MESOS-4997.
+ * </pre>
+ */
+ UNKNOWN(0, 0),
+ /**
+ * <code>SUBSCRIBED = 1;</code>
+ *
+ * <pre>
+ * See 'Subscribed' below.
+ * </pre>
+ */
+ SUBSCRIBED(1, 1),
+ /**
+ * <code>OFFERS = 2;</code>
+ *
+ * <pre>
+ * See 'Offers' below.
+ * </pre>
+ */
+ OFFERS(2, 2),
+ /**
+ * <code>INVERSE_OFFERS = 9;</code>
+ *
+ * <pre>
+ * See 'InverseOffers' below.
+ * </pre>
+ */
+ INVERSE_OFFERS(3, 9),
+ /**
+ * <code>RESCIND = 3;</code>
+ *
+ * <pre>
+ * See 'Rescind' below.
+ * </pre>
+ */
+ RESCIND(4, 3),
+ /**
+ * <code>RESCIND_INVERSE_OFFER = 10;</code>
+ *
+ * <pre>
+ * See 'RescindInverseOffer' below.
+ * </pre>
+ */
+ RESCIND_INVERSE_OFFER(5, 10),
+ /**
+ * <code>UPDATE = 4;</code>
+ *
+ * <pre>
+ * See 'Update' below.
+ * </pre>
+ */
+ UPDATE(6, 4),
+ /**
+ * <code>MESSAGE = 5;</code>
+ *
+ * <pre>
+ * See 'Message' below.
+ * </pre>
+ */
+ MESSAGE(7, 5),
+ /**
+ * <code>FAILURE = 6;</code>
+ *
+ * <pre>
+ * See 'Failure' below.
+ * </pre>
+ */
+ FAILURE(8, 6),
+ /**
+ * <code>ERROR = 7;</code>
+ *
+ * <pre>
+ * See 'Error' below.
+ * </pre>
+ */
+ ERROR(9, 7),
+ /**
+ * <code>HEARTBEAT = 8;</code>
+ *
+ * <pre>
+ * Periodic message sent by the Mesos master according to
+ * 'Subscribed.heartbeat_interval_seconds'. If the scheduler does
+ * not receive any events (including heartbeats) for an extended
+ * period of time (e.g., 5 x heartbeat_interval_seconds), there is
+ * likely a network partition. In such a case the scheduler should
+ * close the existing subscription connection and resubscribe
+ * using a backoff strategy.
+ * </pre>
+ */
+ HEARTBEAT(10, 8),
+ ;
+
+ /**
+ * <code>UNKNOWN = 0;</code>
+ *
+ * <pre>
+ * This must be the first enum value in this list, to
+ * ensure that if 'type' is not set, the default value
+ * is UNKNOWN. This enables enum values to be added
+ * in a backwards-compatible way. See: MESOS-4997.
+ * </pre>
+ */
+ public static final int UNKNOWN_VALUE = 0;
+ /**
+ * <code>SUBSCRIBED = 1;</code>
+ *
+ * <pre>
+ * See 'Subscribed' below.
+ * </pre>
+ */
+ public static final int SUBSCRIBED_VALUE = 1;
+ /**
+ * <code>OFFERS = 2;</code>
+ *
+ * <pre>
+ * See 'Offers' below.
+ * </pre>
+ */
+ public static final int OFFERS_VALUE = 2;
+ /**
+ * <code>INVERSE_OFFERS = 9;</code>
+ *
+ * <pre>
+ * See 'InverseOffers' below.
+ * </pre>
+ */
+ public static final int INVERSE_OFFERS_VALUE = 9;
+ /**
+ * <code>RESCIND = 3;</code>
+ *
+ * <pre>
+ * See 'Rescind' below.
+ * </pre>
+ */
+ public static final int RESCIND_VALUE = 3;
+ /**
+ * <code>RESCIND_INVERSE_OFFER = 10;</code>
+ *
+ * <pre>
+ * See 'RescindInverseOffer' below.
+ * </pre>
+ */
+ public static final int RESCIND_INVERSE_OFFER_VALUE = 10;
+ /**
+ * <code>UPDATE = 4;</code>
+ *
+ * <pre>
+ * See 'Update' below.
+ * </pre>
+ */
+ public static final int UPDATE_VALUE = 4;
+ /**
+ * <code>MESSAGE = 5;</code>
+ *
+ * <pre>
+ * See 'Message' below.
+ * </pre>
+ */
+ public static final int MESSAGE_VALUE = 5;
+ /**
+ * <code>FAILURE = 6;</code>
+ *
+ * <pre>
+ * See 'Failure' below.
+ * </pre>
+ */
+ public static final int FAILURE_VALUE = 6;
+ /**
+ * <code>ERROR = 7;</code>
+ *
+ * <pre>
+ * See 'Error' below.
+ * </pre>
+ */
+ public static final int ERROR_VALUE = 7;
+ /**
+ * <code>HEARTBEAT = 8;</code>
+ *
+ * <pre>
+ * Periodic message sent by the Mesos master according to
+ * 'Subscribed.heartbeat_interval_seconds'. If the scheduler does
+ * not receive any events (including heartbeats) for an extended
+ * period of time (e.g., 5 x heartbeat_interval_seconds), there is
+ * likely a network partition. In such a case the scheduler should
+ * close the existing subscription connection and resubscribe
+ * using a backoff strategy.
+ * </pre>
+ */
+ public static final int HEARTBEAT_VALUE = 8;
+
+
+ public final int getNumber() { return value; }
+
+ public static Type valueOf(int value) {
+ switch (value) {
+ case 0: return UNKNOWN;
+ case 1: return SUBSCRIBED;
+ case 2: return OFFERS;
+ case 9: return INVERSE_OFFERS;
+ case 3: return RESCIND;
+ case 10: return RESCIND_INVERSE_OFFER;
+ case 4: return UPDATE;
+ case 5: return MESSAGE;
+ case 6: return FAILURE;
+ case 7: return ERROR;
+ case 8: return HEARTBEAT;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static com.google.protobuf.Internal.EnumLiteMap<Type>
+ internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap<Type>() {
+ public Type findValueByNumber(int number) {
+ return Type.valueOf(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(index);
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.apache.mesos.scheduler.Protos.Event.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final Type[] VALUES = values();
+
+ public static Type valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int index;
+ private final int value;
+
+ private Type(int index, int value) {
+ this.index = index;
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:mesos.scheduler.Event.Type)
+ }
+
+ public interface SubscribedOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .mesos.FrameworkID framework_id = 1;
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ boolean hasFrameworkId();
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ org.apache.mesos.Protos.FrameworkID getFrameworkId();
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ org.apache.mesos.Protos.FrameworkIDOrBuilder getFrameworkIdOrBuilder();
+
+ // optional double heartbeat_interval_seconds = 2;
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ boolean hasHeartbeatIntervalSeconds();
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ double getHeartbeatIntervalSeconds();
+
+ // optional .mesos.MasterInfo master_info = 3;
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ boolean hasMasterInfo();
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ org.apache.mesos.Protos.MasterInfo getMasterInfo();
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ org.apache.mesos.Protos.MasterInfoOrBuilder getMasterInfoOrBuilder();
+ }
+ /**
+ * Protobuf type {@code mesos.scheduler.Event.Subscribed}
+ *
+ * <pre>
+ * First event received when the scheduler subscribes.
+ * </pre>
+ */
+ public static final class Subscribed extends
+ com.google.protobuf.GeneratedMessage
+ implements SubscribedOrBuilder {
+ // Use Subscribed.newBuilder() to construct.
+ private Subscribed(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Subscribed(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Subscribed defaultInstance;
+ public static Subscribed getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Subscribed getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Subscribed(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ org.apache.mesos.Protos.FrameworkID.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = frameworkId_.toBuilder();
+ }
+ frameworkId_ = input.readMessage(org.apache.mesos.Protos.FrameworkID.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(frameworkId_);
+ frameworkId_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 17: {
+ bitField0_ |= 0x00000002;
+ heartbeatIntervalSeconds_ = input.readDouble();
+ break;
+ }
+ case 26: {
+ org.apache.mesos.Protos.MasterInfo.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = masterInfo_.toBuilder();
+ }
+ masterInfo_ = input.readMessage(org.apache.mesos.Protos.MasterInfo.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(masterInfo_);
+ masterInfo_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_Subscribed_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_Subscribed_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.scheduler.Protos.Event.Subscribed.class, org.apache.mesos.scheduler.Protos.Event.Subscribed.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Subscribed> PARSER =
+ new com.google.protobuf.AbstractParser<Subscribed>() {
+ public Subscribed parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Subscribed(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Subscribed> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required .mesos.FrameworkID framework_id = 1;
+ public static final int FRAMEWORK_ID_FIELD_NUMBER = 1;
+ private org.apache.mesos.Protos.FrameworkID frameworkId_;
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public boolean hasFrameworkId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public org.apache.mesos.Protos.FrameworkID getFrameworkId() {
+ return frameworkId_;
+ }
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public org.apache.mesos.Protos.FrameworkIDOrBuilder getFrameworkIdOrBuilder() {
+ return frameworkId_;
+ }
+
+ // optional double heartbeat_interval_seconds = 2;
+ public static final int HEARTBEAT_INTERVAL_SECONDS_FIELD_NUMBER = 2;
+ private double heartbeatIntervalSeconds_;
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public boolean hasHeartbeatIntervalSeconds() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public double getHeartbeatIntervalSeconds() {
+ return heartbeatIntervalSeconds_;
+ }
+
+ // optional .mesos.MasterInfo master_info = 3;
+ public static final int MASTER_INFO_FIELD_NUMBER = 3;
+ private org.apache.mesos.Protos.MasterInfo masterInfo_;
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public boolean hasMasterInfo() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public org.apache.mesos.Protos.MasterInfo getMasterInfo() {
+ return masterInfo_;
+ }
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public org.apache.mesos.Protos.MasterInfoOrBuilder getMasterInfoOrBuilder() {
+ return masterInfo_;
+ }
+
+ private void initFields() {
+ frameworkId_ = org.apache.mesos.Protos.FrameworkID.getDefaultInstance();
+ heartbeatIntervalSeconds_ = 0D;
+ masterInfo_ = org.apache.mesos.Protos.MasterInfo.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasFrameworkId()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getFrameworkId().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (hasMasterInfo()) {
+ if (!getMasterInfo().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, frameworkId_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeDouble(2, heartbeatIntervalSeconds_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeMessage(3, masterInfo_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, frameworkId_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeDoubleSize(2, heartbeatIntervalSeconds_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, masterInfo_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.scheduler.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Subscribed parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Subscribed parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Subscribed parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Subscribed parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Subscribed parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Subscribed parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Subscribed parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.scheduler.Protos.Event.Subscribed prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.scheduler.Event.Subscribed}
+ *
+ * <pre>
+ * First event received when the scheduler subscribes.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.scheduler.Protos.Event.SubscribedOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_Subscribed_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_Subscribed_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.scheduler.Protos.Event.Subscribed.class, org.apache.mesos.scheduler.Protos.Event.Subscribed.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.scheduler.Protos.Event.Subscribed.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getFrameworkIdFieldBuilder();
+ getMasterInfoFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (frameworkIdBuilder_ == null) {
+ frameworkId_ = org.apache.mesos.Protos.FrameworkID.getDefaultInstance();
+ } else {
+ frameworkIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ heartbeatIntervalSeconds_ = 0D;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (masterInfoBuilder_ == null) {
+ masterInfo_ = org.apache.mesos.Protos.MasterInfo.getDefaultInstance();
+ } else {
+ masterInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_Subscribed_descriptor;
+ }
+
+ public org.apache.mesos.scheduler.Protos.Event.Subscribed getDefaultInstanceForType() {
+ return org.apache.mesos.scheduler.Protos.Event.Subscribed.getDefaultInstance();
+ }
+
+ public org.apache.mesos.scheduler.Protos.Event.Subscribed build() {
+ org.apache.mesos.scheduler.Protos.Event.Subscribed result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.scheduler.Protos.Event.Subscribed buildPartial() {
+ org.apache.mesos.scheduler.Protos.Event.Subscribed result = new org.apache.mesos.scheduler.Protos.Event.Subscribed(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (frameworkIdBuilder_ == null) {
+ result.frameworkId_ = frameworkId_;
+ } else {
+ result.frameworkId_ = frameworkIdBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.heartbeatIntervalSeconds_ = heartbeatIntervalSeconds_;
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ if (masterInfoBuilder_ == null) {
+ result.masterInfo_ = masterInfo_;
+ } else {
+ result.masterInfo_ = masterInfoBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.scheduler.Protos.Event.Subscribed) {
+ return mergeFrom((org.apache.mesos.scheduler.Protos.Event.Subscribed)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.scheduler.Protos.Event.Subscribed other) {
+ if (other == org.apache.mesos.scheduler.Protos.Event.Subscribed.getDefaultInstance()) return this;
+ if (other.hasFrameworkId()) {
+ mergeFrameworkId(other.getFrameworkId());
+ }
+ if (other.hasHeartbeatIntervalSeconds()) {
+ setHeartbeatIntervalSeconds(other.getHeartbeatIntervalSeconds());
+ }
+ if (other.hasMasterInfo()) {
+ mergeMasterInfo(other.getMasterInfo());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasFrameworkId()) {
+
+ return false;
+ }
+ if (!getFrameworkId().isInitialized()) {
+
+ return false;
+ }
+ if (hasMasterInfo()) {
+ if (!getMasterInfo().isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.scheduler.Protos.Event.Subscribed parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.scheduler.Protos.Event.Subscribed) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required .mesos.FrameworkID framework_id = 1;
+ private org.apache.mesos.Protos.FrameworkID frameworkId_ = org.apache.mesos.Protos.FrameworkID.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.FrameworkID, org.apache.mesos.Protos.FrameworkID.Builder, org.apache.mesos.Protos.FrameworkIDOrBuilder> frameworkIdBuilder_;
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public boolean hasFrameworkId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public org.apache.mesos.Protos.FrameworkID getFrameworkId() {
+ if (frameworkIdBuilder_ == null) {
+ return frameworkId_;
+ } else {
+ return frameworkIdBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public Builder setFrameworkId(org.apache.mesos.Protos.FrameworkID value) {
+ if (frameworkIdBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ frameworkId_ = value;
+ onChanged();
+ } else {
+ frameworkIdBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public Builder setFrameworkId(
+ org.apache.mesos.Protos.FrameworkID.Builder builderForValue) {
+ if (frameworkIdBuilder_ == null) {
+ frameworkId_ = builderForValue.build();
+ onChanged();
+ } else {
+ frameworkIdBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public Builder mergeFrameworkId(org.apache.mesos.Protos.FrameworkID value) {
+ if (frameworkIdBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ frameworkId_ != org.apache.mesos.Protos.FrameworkID.getDefaultInstance()) {
+ frameworkId_ =
+ org.apache.mesos.Protos.FrameworkID.newBuilder(frameworkId_).mergeFrom(value).buildPartial();
+ } else {
+ frameworkId_ = value;
+ }
+ onChanged();
+ } else {
+ frameworkIdBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public Builder clearFrameworkId() {
+ if (frameworkIdBuilder_ == null) {
+ frameworkId_ = org.apache.mesos.Protos.FrameworkID.getDefaultInstance();
+ onChanged();
+ } else {
+ frameworkIdBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public org.apache.mesos.Protos.FrameworkID.Builder getFrameworkIdBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getFrameworkIdFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ public org.apache.mesos.Protos.FrameworkIDOrBuilder getFrameworkIdOrBuilder() {
+ if (frameworkIdBuilder_ != null) {
+ return frameworkIdBuilder_.getMessageOrBuilder();
+ } else {
+ return frameworkId_;
+ }
+ }
+ /**
+ * <code>required .mesos.FrameworkID framework_id = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.FrameworkID, org.apache.mesos.Protos.FrameworkID.Builder, org.apache.mesos.Protos.FrameworkIDOrBuilder>
+ getFrameworkIdFieldBuilder() {
+ if (frameworkIdBuilder_ == null) {
+ frameworkIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.FrameworkID, org.apache.mesos.Protos.FrameworkID.Builder, org.apache.mesos.Protos.FrameworkIDOrBuilder>(
+ frameworkId_,
+ getParentForChildren(),
+ isClean());
+ frameworkId_ = null;
+ }
+ return frameworkIdBuilder_;
+ }
+
+ // optional double heartbeat_interval_seconds = 2;
+ private double heartbeatIntervalSeconds_ ;
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public boolean hasHeartbeatIntervalSeconds() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public double getHeartbeatIntervalSeconds() {
+ return heartbeatIntervalSeconds_;
+ }
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public Builder setHeartbeatIntervalSeconds(double value) {
+ bitField0_ |= 0x00000002;
+ heartbeatIntervalSeconds_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional double heartbeat_interval_seconds = 2;</code>
+ *
+ * <pre>
+ * This value will be set if the master is sending heartbeats. See
+ * the comment above on 'HEARTBEAT' for more details.
+ * </pre>
+ */
+ public Builder clearHeartbeatIntervalSeconds() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ heartbeatIntervalSeconds_ = 0D;
+ onChanged();
+ return this;
+ }
+
+ // optional .mesos.MasterInfo master_info = 3;
+ private org.apache.mesos.Protos.MasterInfo masterInfo_ = org.apache.mesos.Protos.MasterInfo.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.MasterInfo, org.apache.mesos.Protos.MasterInfo.Builder, org.apache.mesos.Protos.MasterInfoOrBuilder> masterInfoBuilder_;
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public boolean hasMasterInfo() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public org.apache.mesos.Protos.MasterInfo getMasterInfo() {
+ if (masterInfoBuilder_ == null) {
+ return masterInfo_;
+ } else {
+ return masterInfoBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public Builder setMasterInfo(org.apache.mesos.Protos.MasterInfo value) {
+ if (masterInfoBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ masterInfo_ = value;
+ onChanged();
+ } else {
+ masterInfoBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public Builder setMasterInfo(
+ org.apache.mesos.Protos.MasterInfo.Builder builderForValue) {
+ if (masterInfoBuilder_ == null) {
+ masterInfo_ = builderForValue.build();
+ onChanged();
+ } else {
+ masterInfoBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public Builder mergeMasterInfo(org.apache.mesos.Protos.MasterInfo value) {
+ if (masterInfoBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) == 0x00000004) &&
+ masterInfo_ != org.apache.mesos.Protos.MasterInfo.getDefaultInstance()) {
+ masterInfo_ =
+ org.apache.mesos.Protos.MasterInfo.newBuilder(masterInfo_).mergeFrom(value).buildPartial();
+ } else {
+ masterInfo_ = value;
+ }
+ onChanged();
+ } else {
+ masterInfoBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public Builder clearMasterInfo() {
+ if (masterInfoBuilder_ == null) {
+ masterInfo_ = org.apache.mesos.Protos.MasterInfo.getDefaultInstance();
+ onChanged();
+ } else {
+ masterInfoBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public org.apache.mesos.Protos.MasterInfo.Builder getMasterInfoBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getMasterInfoFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ public org.apache.mesos.Protos.MasterInfoOrBuilder getMasterInfoOrBuilder() {
+ if (masterInfoBuilder_ != null) {
+ return masterInfoBuilder_.getMessageOrBuilder();
+ } else {
+ return masterInfo_;
+ }
+ }
+ /**
+ * <code>optional .mesos.MasterInfo master_info = 3;</code>
+ *
+ * <pre>
+ * Since Mesos 1.1.
+ * </pre>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.MasterInfo, org.apache.mesos.Protos.MasterInfo.Builder, org.apache.mesos.Protos.MasterInfoOrBuilder>
+ getMasterInfoFieldBuilder() {
+ if (masterInfoBuilder_ == null) {
+ masterInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.mesos.Protos.MasterInfo, org.apache.mesos.Protos.MasterInfo.Builder, org.apache.mesos.Protos.MasterInfoOrBuilder>(
+ masterInfo_,
+ getParentForChildren(),
+ isClean());
+ masterInfo_ = null;
+ }
+ return masterInfoBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.scheduler.Event.Subscribed)
+ }
+
+ static {
+ defaultInstance = new Subscribed(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.scheduler.Event.Subscribed)
+ }
+
+ public interface OffersOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // repeated .mesos.Offer offers = 1;
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ java.util.List<org.apache.mesos.Protos.Offer>
+ getOffersList();
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ org.apache.mesos.Protos.Offer getOffers(int index);
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ int getOffersCount();
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ java.util.List<? extends org.apache.mesos.Protos.OfferOrBuilder>
+ getOffersOrBuilderList();
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ org.apache.mesos.Protos.OfferOrBuilder getOffersOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code mesos.scheduler.Event.Offers}
+ *
+ * <pre>
+ * Received whenever there are new resources that are offered to the
+ * scheduler. Each offer corresponds to a set of resources on an
+ * agent. Until the scheduler accepts or declines an offer the
+ * resources are considered allocated to the scheduler.
+ * </pre>
+ */
+ public static final class Offers extends
+ com.google.protobuf.GeneratedMessage
+ implements OffersOrBuilder {
+ // Use Offers.newBuilder() to construct.
+ private Offers(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private Offers(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final Offers defaultInstance;
+ public static Offers getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public Offers getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Offers(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ offers_ = new java.util.ArrayList<org.apache.mesos.Protos.Offer>();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ offers_.add(input.readMessage(org.apache.mesos.Protos.Offer.PARSER, extensionRegistry));
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ offers_ = java.util.Collections.unmodifiableList(offers_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_Offers_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_Offers_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.scheduler.Protos.Event.Offers.class, org.apache.mesos.scheduler.Protos.Event.Offers.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<Offers> PARSER =
+ new com.google.protobuf.AbstractParser<Offers>() {
+ public Offers parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Offers(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<Offers> getParserForType() {
+ return PARSER;
+ }
+
+ // repeated .mesos.Offer offers = 1;
+ public static final int OFFERS_FIELD_NUMBER = 1;
+ private java.util.List<org.apache.mesos.Protos.Offer> offers_;
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public java.util.List<org.apache.mesos.Protos.Offer> getOffersList() {
+ return offers_;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public java.util.List<? extends org.apache.mesos.Protos.OfferOrBuilder>
+ getOffersOrBuilderList() {
+ return offers_;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public int getOffersCount() {
+ return offers_.size();
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.Protos.Offer getOffers(int index) {
+ return offers_.get(index);
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.Protos.OfferOrBuilder getOffersOrBuilder(
+ int index) {
+ return offers_.get(index);
+ }
+
+ private void initFields() {
+ offers_ = java.util.Collections.emptyList();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ for (int i = 0; i < getOffersCount(); i++) {
+ if (!getOffers(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ for (int i = 0; i < offers_.size(); i++) {
+ output.writeMessage(1, offers_.get(i));
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < offers_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, offers_.get(i));
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.scheduler.Protos.Event.Offers parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Offers parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Offers parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Offers parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Offers parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Offers parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Offers parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Offers parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Offers parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.scheduler.Protos.Event.Offers parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.scheduler.Protos.Event.Offers prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.scheduler.Event.Offers}
+ *
+ * <pre>
+ * Received whenever there are new resources that are offered to the
+ * scheduler. Each offer corresponds to a set of resources on an
+ * agent. Until the scheduler accepts or declines an offer the
+ * resources are considered allocated to the scheduler.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.scheduler.Protos.Event.OffersOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_Offers_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_Offers_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.scheduler.Protos.Event.Offers.class, org.apache.mesos.scheduler.Protos.Event.Offers.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.scheduler.Protos.Event.Offers.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getOffersFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (offersBuilder_ == null) {
+ offers_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ offersBuilder_.clear();
+ }
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.scheduler.Protos.internal_static_mesos_scheduler_Event_Offers_descriptor;
+ }
+
+ public org.apache.mesos.scheduler.Protos.Event.Offers getDefaultInstanceForType() {
+ return org.apache.mesos.scheduler.Protos.Event.Offers.getDefaultInstance();
+ }
+
+ public org.apache.mesos.scheduler.Protos.Event.Offers build() {
+ org.apache.mesos.scheduler.Protos.Event.Offers result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.scheduler.Protos.Event.Offers buildPartial() {
+ org.apache.mesos.scheduler.Protos.Event.Offers result = new org.apache.mesos.scheduler.Protos.Event.Offers(this);
+ int from_bitField0_ = bitField0_;
+ if (offersBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ offers_ = java.util.Collections.unmodifiableList(offers_);
+ bitField0_ = (bitField0_ & ~0x00000001);
+ }
+ result.offers_ = offers_;
+ } else {
+ result.offers_ = offersBuilder_.build();
+ }
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.scheduler.Protos.Event.Offers) {
+ return mergeFrom((org.apache.mesos.scheduler.Protos.Event.Offers)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.scheduler.Protos.Event.Offers other) {
+ if (other == org.apache.mesos.scheduler.Protos.Event.Offers.getDefaultInstance()) return this;
+ if (offersBuilder_ == null) {
+ if (!other.offers_.isEmpty()) {
+ if (offers_.isEmpty()) {
+ offers_ = other.offers_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ ensureOffersIsMutable();
+ offers_.addAll(other.offers_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.offers_.isEmpty()) {
+ if (offersBuilder_.isEmpty()) {
+ offersBuilder_.dispose();
+ offersBuilder_ = null;
+ offers_ = other.offers_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ offersBuilder_ =
+ com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+ getOffersFieldBuilder() : null;
+ } else {
+ offersBuilder_.addAllMessages(other.offers_);
+ }
+ }
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ for (int i = 0; i < getOffersCount(); i++) {
+ if (!getOffers(i).isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.scheduler.Protos.Event.Offers parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.scheduler.Protos.Event.Offers) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // repeated .mesos.Offer offers = 1;
+ private java.util.List<org.apache.mesos.Protos.Offer> offers_ =
+ java.util.Collections.emptyList();
+ private void ensureOffersIsMutable() {
+ if (!((bitField0_ & 0x00000001) == 0x00000001)) {
+ offers_ = new java.util.ArrayList<org.apache.mesos.Protos.Offer>(offers_);
+ bitField0_ |= 0x00000001;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.Protos.Offer, org.apache.mesos.Protos.Offer.Builder, org.apache.mesos.Protos.OfferOrBuilder> offersBuilder_;
+
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public java.util.List<org.apache.mesos.Protos.Offer> getOffersList() {
+ if (offersBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(offers_);
+ } else {
+ return offersBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public int getOffersCount() {
+ if (offersBuilder_ == null) {
+ return offers_.size();
+ } else {
+ return offersBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.Protos.Offer getOffers(int index) {
+ if (offersBuilder_ == null) {
+ return offers_.get(index);
+ } else {
+ return offersBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public Builder setOffers(
+ int index, org.apache.mesos.Protos.Offer value) {
+ if (offersBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOffersIsMutable();
+ offers_.set(index, value);
+ onChanged();
+ } else {
+ offersBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public Builder setOffers(
+ int index, org.apache.mesos.Protos.Offer.Builder builderForValue) {
+ if (offersBuilder_ == null) {
+ ensureOffersIsMutable();
+ offers_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ offersBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public Builder addOffers(org.apache.mesos.Protos.Offer value) {
+ if (offersBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOffersIsMutable();
+ offers_.add(value);
+ onChanged();
+ } else {
+ offersBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public Builder addOffers(
+ int index, org.apache.mesos.Protos.Offer value) {
+ if (offersBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOffersIsMutable();
+ offers_.add(index, value);
+ onChanged();
+ } else {
+ offersBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public Builder addOffers(
+ org.apache.mesos.Protos.Offer.Builder builderForValue) {
+ if (offersBuilder_ == null) {
+ ensureOffersIsMutable();
+ offers_.add(builderForValue.build());
+ onChanged();
+ } else {
+ offersBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public Builder addOffers(
+ int index, org.apache.mesos.Protos.Offer.Builder builderForValue) {
+ if (offersBuilder_ == null) {
+ ensureOffersIsMutable();
+ offers_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ offersBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public Builder addAllOffers(
+ java.lang.Iterable<? extends org.apache.mesos.Protos.Offer> values) {
+ if (offersBuilder_ == null) {
+ ensureOffersIsMutable();
+ super.addAll(values, offers_);
+ onChanged();
+ } else {
+ offersBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public Builder clearOffers() {
+ if (offersBuilder_ == null) {
+ offers_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ offersBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public Builder removeOffers(int index) {
+ if (offersBuilder_ == null) {
+ ensureOffersIsMutable();
+ offers_.remove(index);
+ onChanged();
+ } else {
+ offersBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.Protos.Offer.Builder getOffersBuilder(
+ int index) {
+ return getOffersFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.Protos.OfferOrBuilder getOffersOrBuilder(
+ int index) {
+ if (offersBuilder_ == null) {
+ return offers_.get(index); } else {
+ return offersBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public java.util.List<? extends org.apache.mesos.Protos.OfferOrBuilder>
+ getOffersOrBuilderList() {
+ if (offersBuilder_ != null) {
+ return offersBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(offers_);
+ }
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.Protos.Offer.Builder addOffersBuilder() {
+ return getOffersFieldBuilder().addBuilder(
+ org.apache.mesos.Protos.Offer.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public org.apache.mesos.Protos.Offer.Builder addOffersBuilder(
+ int index) {
+ return getOffersFieldBuilder().addBuilder(
+ index, org.apache.mesos.Protos.Offer.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.Offer offers = 1;</code>
+ */
+ public java.util.List<org.apache.mesos.Protos.Offer.Builder>
+ getOffersBuilderList() {
+ return getOffersFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.Protos.Offer, org.apache.mesos.Protos.Offer.Builder, org.apache.mesos.Protos.OfferOrBuilder>
+ getOffersFieldBuilder() {
+ if (offersBuilder_ == null) {
+ offersBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.Protos.Offer, org.apache.mesos.Protos.Offer.Builder, org.apache.mesos.Protos.OfferOrBuilder>(
+ offers_,
+ ((bitField0_ & 0x00000001) == 0x00000001),
+ getParentForChildren(),
+ isClean());
+ offers_ = null;
+ }
+ return offersBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.scheduler.Event.Offers)
+ }
+
+ static {
+ defaultInstance = new Offers(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.scheduler.Event.Offers)
+ }
+
+ public interface InverseOffersOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // repeated .mesos.InverseOffer inverse_offers = 1;
+ /**
+ * <code>repeated .mesos.InverseOffer inverse_offers = 1;</code>
+ */
+ java.util.List<org.apache.mesos.Protos.InverseOffer>
+ getInverseOffersList();
+ /**
+ * <code>repeated .mesos.InverseOffer inverse_offers = 1;</code>
+ */
+ org.apache.mesos.Protos.InverseOffer getInverseOffers(int index);
+ /**
+ * <code>repeated .mesos.InverseOffer inverse_offers = 1;</code>
+ */
+ int getInverseOffersCount();
+ /**
+ * <code>repeated .mesos.InverseOffer inverse_offers = 1;</code>
+ */
+ java.util.List<? extends org.apache.mesos.Protos.InverseOfferOrBuilder>
+ getInverseOffersOrBuilderList();
+ /**
+ * <code>repeated .mesos.InverseOffer inverse_offers = 1;</code>
+ */
+ org.apache.mesos.Protos.InverseOfferOrBuilder getInverseOffersOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code mesos.scheduler.Event.InverseOffers}
+ *
+ * <pre>
+ * Received whenever there are resources requested back from the
+ * scheduler. Each inverse offer specifies the agent, and
+ * optionally specific resources. Accepting or Declining an inverse
+ * offer informs the allocator of the scheduler's ability to release
+ * the specified resources without violating an SLA. If no resources
+ * are specified then all resources on the agent are requested to be
+ * released.
+ * </pre>
+ */
+ public static final class InverseOffers extends
+ com.google.protobuf.GeneratedMessage
+ implements InverseOffersOrBuilder {
+ // Use InverseOffers.newBuilder() to construct.
+ private InverseOffers(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private InverseOffers(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final InverseOffers defaultInstance;
+ public static InverseOffers getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public InverseOffers getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private InverseOffers(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ inverseOffers_ = new java.util.ArrayList<org.apache.mesos.Protos.InverseOffer>();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ inverseOffers_
<TRUNCATED>
[17/26] incubator-myriad git commit: Add compatibility with mesos v1
Posted by jp...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/16467f39/myriad-commons/src/main/java/org/apache/mesos/v1/quota/Protos.java
----------------------------------------------------------------------
diff --git a/myriad-commons/src/main/java/org/apache/mesos/v1/quota/Protos.java b/myriad-commons/src/main/java/org/apache/mesos/v1/quota/Protos.java
new file mode 100644
index 0000000..fd707a5
--- /dev/null
+++ b/myriad-commons/src/main/java/org/apache/mesos/v1/quota/Protos.java
@@ -0,0 +1,3332 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: mesos/v1/quota/quota.proto
+
+package org.apache.mesos.v1.quota;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ }
+ public interface QuotaInfoOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional string role = 1;
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ boolean hasRole();
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ java.lang.String getRole();
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ com.google.protobuf.ByteString
+ getRoleBytes();
+
+ // optional string principal = 2;
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ boolean hasPrincipal();
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ java.lang.String getPrincipal();
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ com.google.protobuf.ByteString
+ getPrincipalBytes();
+
+ // repeated .mesos.v1.Resource guarantee = 3;
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ java.util.List<org.apache.mesos.v1.Protos.Resource>
+ getGuaranteeList();
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.Resource getGuarantee(int index);
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ int getGuaranteeCount();
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ java.util.List<? extends org.apache.mesos.v1.Protos.ResourceOrBuilder>
+ getGuaranteeOrBuilderList();
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.ResourceOrBuilder getGuaranteeOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code mesos.v1.quota.QuotaInfo}
+ *
+ * <pre>
+ * TODO(joerg84): Add limits, i.e. upper bounds of resources that a
+ * role is allowed to use.
+ * </pre>
+ */
+ public static final class QuotaInfo extends
+ com.google.protobuf.GeneratedMessage
+ implements QuotaInfoOrBuilder {
+ // Use QuotaInfo.newBuilder() to construct.
+ private QuotaInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private QuotaInfo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final QuotaInfo defaultInstance;
+ public static QuotaInfo getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public QuotaInfo getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private QuotaInfo(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ role_ = input.readBytes();
+ break;
+ }
+ case 18: {
+ bitField0_ |= 0x00000002;
+ principal_ = input.readBytes();
+ break;
+ }
+ case 26: {
+ if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+ guarantee_ = new java.util.ArrayList<org.apache.mesos.v1.Protos.Resource>();
+ mutable_bitField0_ |= 0x00000004;
+ }
+ guarantee_.add(input.readMessage(org.apache.mesos.v1.Protos.Resource.PARSER, extensionRegistry));
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+ guarantee_ = java.util.Collections.unmodifiableList(guarantee_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.quota.Protos.internal_static_mesos_v1_quota_QuotaInfo_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.quota.Protos.internal_static_mesos_v1_quota_QuotaInfo_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.quota.Protos.QuotaInfo.class, org.apache.mesos.v1.quota.Protos.QuotaInfo.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<QuotaInfo> PARSER =
+ new com.google.protobuf.AbstractParser<QuotaInfo>() {
+ public QuotaInfo parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new QuotaInfo(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<QuotaInfo> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // optional string role = 1;
+ public static final int ROLE_FIELD_NUMBER = 1;
+ private java.lang.Object role_;
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ public boolean hasRole() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ public java.lang.String getRole() {
+ java.lang.Object ref = role_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ role_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getRoleBytes() {
+ java.lang.Object ref = role_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ role_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ // optional string principal = 2;
+ public static final int PRINCIPAL_FIELD_NUMBER = 2;
+ private java.lang.Object principal_;
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ public boolean hasPrincipal() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ public java.lang.String getPrincipal() {
+ java.lang.Object ref = principal_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ principal_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getPrincipalBytes() {
+ java.lang.Object ref = principal_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ principal_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ // repeated .mesos.v1.Resource guarantee = 3;
+ public static final int GUARANTEE_FIELD_NUMBER = 3;
+ private java.util.List<org.apache.mesos.v1.Protos.Resource> guarantee_;
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.Resource> getGuaranteeList() {
+ return guarantee_;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.Protos.ResourceOrBuilder>
+ getGuaranteeOrBuilderList() {
+ return guarantee_;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public int getGuaranteeCount() {
+ return guarantee_.size();
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Resource getGuarantee(int index) {
+ return guarantee_.get(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.ResourceOrBuilder getGuaranteeOrBuilder(
+ int index) {
+ return guarantee_.get(index);
+ }
+
+ private void initFields() {
+ role_ = "";
+ principal_ = "";
+ guarantee_ = java.util.Collections.emptyList();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ for (int i = 0; i < getGuaranteeCount(); i++) {
+ if (!getGuarantee(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getRoleBytes());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeBytes(2, getPrincipalBytes());
+ }
+ for (int i = 0; i < guarantee_.size(); i++) {
+ output.writeMessage(3, guarantee_.get(i));
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getRoleBytes());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, getPrincipalBytes());
+ }
+ for (int i = 0; i < guarantee_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, guarantee_.get(i));
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.quota.Protos.QuotaInfo parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaInfo parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaInfo parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaInfo parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaInfo parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaInfo parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaInfo parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaInfo parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaInfo parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaInfo parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.quota.Protos.QuotaInfo prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.quota.QuotaInfo}
+ *
+ * <pre>
+ * TODO(joerg84): Add limits, i.e. upper bounds of resources that a
+ * role is allowed to use.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.quota.Protos.QuotaInfoOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.quota.Protos.internal_static_mesos_v1_quota_QuotaInfo_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.quota.Protos.internal_static_mesos_v1_quota_QuotaInfo_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.quota.Protos.QuotaInfo.class, org.apache.mesos.v1.quota.Protos.QuotaInfo.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.quota.Protos.QuotaInfo.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getGuaranteeFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ role_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ principal_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (guaranteeBuilder_ == null) {
+ guarantee_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000004);
+ } else {
+ guaranteeBuilder_.clear();
+ }
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.quota.Protos.internal_static_mesos_v1_quota_QuotaInfo_descriptor;
+ }
+
+ public org.apache.mesos.v1.quota.Protos.QuotaInfo getDefaultInstanceForType() {
+ return org.apache.mesos.v1.quota.Protos.QuotaInfo.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.quota.Protos.QuotaInfo build() {
+ org.apache.mesos.v1.quota.Protos.QuotaInfo result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.quota.Protos.QuotaInfo buildPartial() {
+ org.apache.mesos.v1.quota.Protos.QuotaInfo result = new org.apache.mesos.v1.quota.Protos.QuotaInfo(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.role_ = role_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.principal_ = principal_;
+ if (guaranteeBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ guarantee_ = java.util.Collections.unmodifiableList(guarantee_);
+ bitField0_ = (bitField0_ & ~0x00000004);
+ }
+ result.guarantee_ = guarantee_;
+ } else {
+ result.guarantee_ = guaranteeBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.quota.Protos.QuotaInfo) {
+ return mergeFrom((org.apache.mesos.v1.quota.Protos.QuotaInfo)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.quota.Protos.QuotaInfo other) {
+ if (other == org.apache.mesos.v1.quota.Protos.QuotaInfo.getDefaultInstance()) return this;
+ if (other.hasRole()) {
+ bitField0_ |= 0x00000001;
+ role_ = other.role_;
+ onChanged();
+ }
+ if (other.hasPrincipal()) {
+ bitField0_ |= 0x00000002;
+ principal_ = other.principal_;
+ onChanged();
+ }
+ if (guaranteeBuilder_ == null) {
+ if (!other.guarantee_.isEmpty()) {
+ if (guarantee_.isEmpty()) {
+ guarantee_ = other.guarantee_;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ } else {
+ ensureGuaranteeIsMutable();
+ guarantee_.addAll(other.guarantee_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.guarantee_.isEmpty()) {
+ if (guaranteeBuilder_.isEmpty()) {
+ guaranteeBuilder_.dispose();
+ guaranteeBuilder_ = null;
+ guarantee_ = other.guarantee_;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ guaranteeBuilder_ =
+ com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+ getGuaranteeFieldBuilder() : null;
+ } else {
+ guaranteeBuilder_.addAllMessages(other.guarantee_);
+ }
+ }
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ for (int i = 0; i < getGuaranteeCount(); i++) {
+ if (!getGuarantee(i).isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.quota.Protos.QuotaInfo parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.quota.Protos.QuotaInfo) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // optional string role = 1;
+ private java.lang.Object role_ = "";
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ public boolean hasRole() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ public java.lang.String getRole() {
+ java.lang.Object ref = role_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ role_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getRoleBytes() {
+ java.lang.Object ref = role_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ role_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ public Builder setRole(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ role_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ public Builder clearRole() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ role_ = getDefaultInstance().getRole();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string role = 1;</code>
+ *
+ * <pre>
+ * Quota is granted per role and not per framework, similar to
+ * dynamic reservations.
+ * </pre>
+ */
+ public Builder setRoleBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ role_ = value;
+ onChanged();
+ return this;
+ }
+
+ // optional string principal = 2;
+ private java.lang.Object principal_ = "";
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ public boolean hasPrincipal() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ public java.lang.String getPrincipal() {
+ java.lang.Object ref = principal_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ principal_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getPrincipalBytes() {
+ java.lang.Object ref = principal_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ principal_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ public Builder setPrincipal(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ principal_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ public Builder clearPrincipal() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ principal_ = getDefaultInstance().getPrincipal();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string principal = 2;</code>
+ *
+ * <pre>
+ * Principal which set the quota. Currently only operators can set quotas.
+ * </pre>
+ */
+ public Builder setPrincipalBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ principal_ = value;
+ onChanged();
+ return this;
+ }
+
+ // repeated .mesos.v1.Resource guarantee = 3;
+ private java.util.List<org.apache.mesos.v1.Protos.Resource> guarantee_ =
+ java.util.Collections.emptyList();
+ private void ensureGuaranteeIsMutable() {
+ if (!((bitField0_ & 0x00000004) == 0x00000004)) {
+ guarantee_ = new java.util.ArrayList<org.apache.mesos.v1.Protos.Resource>(guarantee_);
+ bitField0_ |= 0x00000004;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.Resource, org.apache.mesos.v1.Protos.Resource.Builder, org.apache.mesos.v1.Protos.ResourceOrBuilder> guaranteeBuilder_;
+
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.Resource> getGuaranteeList() {
+ if (guaranteeBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(guarantee_);
+ } else {
+ return guaranteeBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public int getGuaranteeCount() {
+ if (guaranteeBuilder_ == null) {
+ return guarantee_.size();
+ } else {
+ return guaranteeBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Resource getGuarantee(int index) {
+ if (guaranteeBuilder_ == null) {
+ return guarantee_.get(index);
+ } else {
+ return guaranteeBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public Builder setGuarantee(
+ int index, org.apache.mesos.v1.Protos.Resource value) {
+ if (guaranteeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureGuaranteeIsMutable();
+ guarantee_.set(index, value);
+ onChanged();
+ } else {
+ guaranteeBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public Builder setGuarantee(
+ int index, org.apache.mesos.v1.Protos.Resource.Builder builderForValue) {
+ if (guaranteeBuilder_ == null) {
+ ensureGuaranteeIsMutable();
+ guarantee_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ guaranteeBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public Builder addGuarantee(org.apache.mesos.v1.Protos.Resource value) {
+ if (guaranteeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureGuaranteeIsMutable();
+ guarantee_.add(value);
+ onChanged();
+ } else {
+ guaranteeBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public Builder addGuarantee(
+ int index, org.apache.mesos.v1.Protos.Resource value) {
+ if (guaranteeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureGuaranteeIsMutable();
+ guarantee_.add(index, value);
+ onChanged();
+ } else {
+ guaranteeBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public Builder addGuarantee(
+ org.apache.mesos.v1.Protos.Resource.Builder builderForValue) {
+ if (guaranteeBuilder_ == null) {
+ ensureGuaranteeIsMutable();
+ guarantee_.add(builderForValue.build());
+ onChanged();
+ } else {
+ guaranteeBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public Builder addGuarantee(
+ int index, org.apache.mesos.v1.Protos.Resource.Builder builderForValue) {
+ if (guaranteeBuilder_ == null) {
+ ensureGuaranteeIsMutable();
+ guarantee_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ guaranteeBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public Builder addAllGuarantee(
+ java.lang.Iterable<? extends org.apache.mesos.v1.Protos.Resource> values) {
+ if (guaranteeBuilder_ == null) {
+ ensureGuaranteeIsMutable();
+ super.addAll(values, guarantee_);
+ onChanged();
+ } else {
+ guaranteeBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public Builder clearGuarantee() {
+ if (guaranteeBuilder_ == null) {
+ guarantee_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000004);
+ onChanged();
+ } else {
+ guaranteeBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public Builder removeGuarantee(int index) {
+ if (guaranteeBuilder_ == null) {
+ ensureGuaranteeIsMutable();
+ guarantee_.remove(index);
+ onChanged();
+ } else {
+ guaranteeBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Resource.Builder getGuaranteeBuilder(
+ int index) {
+ return getGuaranteeFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.ResourceOrBuilder getGuaranteeOrBuilder(
+ int index) {
+ if (guaranteeBuilder_ == null) {
+ return guarantee_.get(index); } else {
+ return guaranteeBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.Protos.ResourceOrBuilder>
+ getGuaranteeOrBuilderList() {
+ if (guaranteeBuilder_ != null) {
+ return guaranteeBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(guarantee_);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Resource.Builder addGuaranteeBuilder() {
+ return getGuaranteeFieldBuilder().addBuilder(
+ org.apache.mesos.v1.Protos.Resource.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Resource.Builder addGuaranteeBuilder(
+ int index) {
+ return getGuaranteeFieldBuilder().addBuilder(
+ index, org.apache.mesos.v1.Protos.Resource.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The guarantee that these resources are allocatable for the above role.
+ * NOTE: `guarantee.role` should not specify any role except '*',
+ * because quota does not reserve specific resources.
+ * </pre>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.Resource.Builder>
+ getGuaranteeBuilderList() {
+ return getGuaranteeFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.Resource, org.apache.mesos.v1.Protos.Resource.Builder, org.apache.mesos.v1.Protos.ResourceOrBuilder>
+ getGuaranteeFieldBuilder() {
+ if (guaranteeBuilder_ == null) {
+ guaranteeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.Resource, org.apache.mesos.v1.Protos.Resource.Builder, org.apache.mesos.v1.Protos.ResourceOrBuilder>(
+ guarantee_,
+ ((bitField0_ & 0x00000004) == 0x00000004),
+ getParentForChildren(),
+ isClean());
+ guarantee_ = null;
+ }
+ return guaranteeBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.quota.QuotaInfo)
+ }
+
+ static {
+ defaultInstance = new QuotaInfo(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.quota.QuotaInfo)
+ }
+
+ public interface QuotaRequestOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional bool force = 1 [default = false];
+ /**
+ * <code>optional bool force = 1 [default = false];</code>
+ *
+ * <pre>
+ * Disables the capacity heuristic check if set to `true`.
+ * </pre>
+ */
+ boolean hasForce();
+ /**
+ * <code>optional bool force = 1 [default = false];</code>
+ *
+ * <pre>
+ * Disables the capacity heuristic check if set to `true`.
+ * </pre>
+ */
+ boolean getForce();
+
+ // optional string role = 2;
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ boolean hasRole();
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ java.lang.String getRole();
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ com.google.protobuf.ByteString
+ getRoleBytes();
+
+ // repeated .mesos.v1.Resource guarantee = 3;
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ java.util.List<org.apache.mesos.v1.Protos.Resource>
+ getGuaranteeList();
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.Resource getGuarantee(int index);
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ int getGuaranteeCount();
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ java.util.List<? extends org.apache.mesos.v1.Protos.ResourceOrBuilder>
+ getGuaranteeOrBuilderList();
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ org.apache.mesos.v1.Protos.ResourceOrBuilder getGuaranteeOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code mesos.v1.quota.QuotaRequest}
+ *
+ * <pre>
+ **
+ * `QuotaRequest` provides a schema for set quota JSON requests.
+ * </pre>
+ */
+ public static final class QuotaRequest extends
+ com.google.protobuf.GeneratedMessage
+ implements QuotaRequestOrBuilder {
+ // Use QuotaRequest.newBuilder() to construct.
+ private QuotaRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private QuotaRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final QuotaRequest defaultInstance;
+ public static QuotaRequest getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public QuotaRequest getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private QuotaRequest(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ bitField0_ |= 0x00000001;
+ force_ = input.readBool();
+ break;
+ }
+ case 18: {
+ bitField0_ |= 0x00000002;
+ role_ = input.readBytes();
+ break;
+ }
+ case 26: {
+ if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+ guarantee_ = new java.util.ArrayList<org.apache.mesos.v1.Protos.Resource>();
+ mutable_bitField0_ |= 0x00000004;
+ }
+ guarantee_.add(input.readMessage(org.apache.mesos.v1.Protos.Resource.PARSER, extensionRegistry));
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e.getMessage()).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+ guarantee_ = java.util.Collections.unmodifiableList(guarantee_);
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.quota.Protos.internal_static_mesos_v1_quota_QuotaRequest_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.quota.Protos.internal_static_mesos_v1_quota_QuotaRequest_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.quota.Protos.QuotaRequest.class, org.apache.mesos.v1.quota.Protos.QuotaRequest.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<QuotaRequest> PARSER =
+ new com.google.protobuf.AbstractParser<QuotaRequest>() {
+ public QuotaRequest parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new QuotaRequest(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<QuotaRequest> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // optional bool force = 1 [default = false];
+ public static final int FORCE_FIELD_NUMBER = 1;
+ private boolean force_;
+ /**
+ * <code>optional bool force = 1 [default = false];</code>
+ *
+ * <pre>
+ * Disables the capacity heuristic check if set to `true`.
+ * </pre>
+ */
+ public boolean hasForce() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional bool force = 1 [default = false];</code>
+ *
+ * <pre>
+ * Disables the capacity heuristic check if set to `true`.
+ * </pre>
+ */
+ public boolean getForce() {
+ return force_;
+ }
+
+ // optional string role = 2;
+ public static final int ROLE_FIELD_NUMBER = 2;
+ private java.lang.Object role_;
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ public boolean hasRole() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ public java.lang.String getRole() {
+ java.lang.Object ref = role_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ role_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getRoleBytes() {
+ java.lang.Object ref = role_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ role_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ // repeated .mesos.v1.Resource guarantee = 3;
+ public static final int GUARANTEE_FIELD_NUMBER = 3;
+ private java.util.List<org.apache.mesos.v1.Protos.Resource> guarantee_;
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.Resource> getGuaranteeList() {
+ return guarantee_;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.Protos.ResourceOrBuilder>
+ getGuaranteeOrBuilderList() {
+ return guarantee_;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public int getGuaranteeCount() {
+ return guarantee_.size();
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Resource getGuarantee(int index) {
+ return guarantee_.get(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.ResourceOrBuilder getGuaranteeOrBuilder(
+ int index) {
+ return guarantee_.get(index);
+ }
+
+ private void initFields() {
+ force_ = false;
+ role_ = "";
+ guarantee_ = java.util.Collections.emptyList();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ for (int i = 0; i < getGuaranteeCount(); i++) {
+ if (!getGuarantee(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBool(1, force_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeBytes(2, getRoleBytes());
+ }
+ for (int i = 0; i < guarantee_.size(); i++) {
+ output.writeMessage(3, guarantee_.get(i));
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBoolSize(1, force_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, getRoleBytes());
+ }
+ for (int i = 0; i < guarantee_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, guarantee_.get(i));
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ protected java.lang.Object writeReplace()
+ throws java.io.ObjectStreamException {
+ return super.writeReplace();
+ }
+
+ public static org.apache.mesos.v1.quota.Protos.QuotaRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaRequest parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaRequest parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaRequest parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaRequest parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input, extensionRegistry);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaRequest parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.mesos.v1.quota.Protos.QuotaRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input, extensionRegistry);
+ }
+
+ public static Builder newBuilder() { return Builder.create(); }
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder(org.apache.mesos.v1.quota.Protos.QuotaRequest prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code mesos.v1.quota.QuotaRequest}
+ *
+ * <pre>
+ **
+ * `QuotaRequest` provides a schema for set quota JSON requests.
+ * </pre>
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.mesos.v1.quota.Protos.QuotaRequestOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.mesos.v1.quota.Protos.internal_static_mesos_v1_quota_QuotaRequest_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.mesos.v1.quota.Protos.internal_static_mesos_v1_quota_QuotaRequest_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.mesos.v1.quota.Protos.QuotaRequest.class, org.apache.mesos.v1.quota.Protos.QuotaRequest.Builder.class);
+ }
+
+ // Construct using org.apache.mesos.v1.quota.Protos.QuotaRequest.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getGuaranteeFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ force_ = false;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ role_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (guaranteeBuilder_ == null) {
+ guarantee_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000004);
+ } else {
+ guaranteeBuilder_.clear();
+ }
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.mesos.v1.quota.Protos.internal_static_mesos_v1_quota_QuotaRequest_descriptor;
+ }
+
+ public org.apache.mesos.v1.quota.Protos.QuotaRequest getDefaultInstanceForType() {
+ return org.apache.mesos.v1.quota.Protos.QuotaRequest.getDefaultInstance();
+ }
+
+ public org.apache.mesos.v1.quota.Protos.QuotaRequest build() {
+ org.apache.mesos.v1.quota.Protos.QuotaRequest result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.mesos.v1.quota.Protos.QuotaRequest buildPartial() {
+ org.apache.mesos.v1.quota.Protos.QuotaRequest result = new org.apache.mesos.v1.quota.Protos.QuotaRequest(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.force_ = force_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.role_ = role_;
+ if (guaranteeBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ guarantee_ = java.util.Collections.unmodifiableList(guarantee_);
+ bitField0_ = (bitField0_ & ~0x00000004);
+ }
+ result.guarantee_ = guarantee_;
+ } else {
+ result.guarantee_ = guaranteeBuilder_.build();
+ }
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.mesos.v1.quota.Protos.QuotaRequest) {
+ return mergeFrom((org.apache.mesos.v1.quota.Protos.QuotaRequest)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.mesos.v1.quota.Protos.QuotaRequest other) {
+ if (other == org.apache.mesos.v1.quota.Protos.QuotaRequest.getDefaultInstance()) return this;
+ if (other.hasForce()) {
+ setForce(other.getForce());
+ }
+ if (other.hasRole()) {
+ bitField0_ |= 0x00000002;
+ role_ = other.role_;
+ onChanged();
+ }
+ if (guaranteeBuilder_ == null) {
+ if (!other.guarantee_.isEmpty()) {
+ if (guarantee_.isEmpty()) {
+ guarantee_ = other.guarantee_;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ } else {
+ ensureGuaranteeIsMutable();
+ guarantee_.addAll(other.guarantee_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.guarantee_.isEmpty()) {
+ if (guaranteeBuilder_.isEmpty()) {
+ guaranteeBuilder_.dispose();
+ guaranteeBuilder_ = null;
+ guarantee_ = other.guarantee_;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ guaranteeBuilder_ =
+ com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+ getGuaranteeFieldBuilder() : null;
+ } else {
+ guaranteeBuilder_.addAllMessages(other.guarantee_);
+ }
+ }
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ for (int i = 0; i < getGuaranteeCount(); i++) {
+ if (!getGuarantee(i).isInitialized()) {
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.apache.mesos.v1.quota.Protos.QuotaRequest parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.mesos.v1.quota.Protos.QuotaRequest) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // optional bool force = 1 [default = false];
+ private boolean force_ ;
+ /**
+ * <code>optional bool force = 1 [default = false];</code>
+ *
+ * <pre>
+ * Disables the capacity heuristic check if set to `true`.
+ * </pre>
+ */
+ public boolean hasForce() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional bool force = 1 [default = false];</code>
+ *
+ * <pre>
+ * Disables the capacity heuristic check if set to `true`.
+ * </pre>
+ */
+ public boolean getForce() {
+ return force_;
+ }
+ /**
+ * <code>optional bool force = 1 [default = false];</code>
+ *
+ * <pre>
+ * Disables the capacity heuristic check if set to `true`.
+ * </pre>
+ */
+ public Builder setForce(boolean value) {
+ bitField0_ |= 0x00000001;
+ force_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional bool force = 1 [default = false];</code>
+ *
+ * <pre>
+ * Disables the capacity heuristic check if set to `true`.
+ * </pre>
+ */
+ public Builder clearForce() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ force_ = false;
+ onChanged();
+ return this;
+ }
+
+ // optional string role = 2;
+ private java.lang.Object role_ = "";
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ public boolean hasRole() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ public java.lang.String getRole() {
+ java.lang.Object ref = role_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ role_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getRoleBytes() {
+ java.lang.Object ref = role_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ role_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ public Builder setRole(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ role_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ public Builder clearRole() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ role_ = getDefaultInstance().getRole();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string role = 2;</code>
+ *
+ * <pre>
+ * The role for which to set quota.
+ * </pre>
+ */
+ public Builder setRoleBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ role_ = value;
+ onChanged();
+ return this;
+ }
+
+ // repeated .mesos.v1.Resource guarantee = 3;
+ private java.util.List<org.apache.mesos.v1.Protos.Resource> guarantee_ =
+ java.util.Collections.emptyList();
+ private void ensureGuaranteeIsMutable() {
+ if (!((bitField0_ & 0x00000004) == 0x00000004)) {
+ guarantee_ = new java.util.ArrayList<org.apache.mesos.v1.Protos.Resource>(guarantee_);
+ bitField0_ |= 0x00000004;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.Resource, org.apache.mesos.v1.Protos.Resource.Builder, org.apache.mesos.v1.Protos.ResourceOrBuilder> guaranteeBuilder_;
+
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.Resource> getGuaranteeList() {
+ if (guaranteeBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(guarantee_);
+ } else {
+ return guaranteeBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public int getGuaranteeCount() {
+ if (guaranteeBuilder_ == null) {
+ return guarantee_.size();
+ } else {
+ return guaranteeBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Resource getGuarantee(int index) {
+ if (guaranteeBuilder_ == null) {
+ return guarantee_.get(index);
+ } else {
+ return guaranteeBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public Builder setGuarantee(
+ int index, org.apache.mesos.v1.Protos.Resource value) {
+ if (guaranteeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureGuaranteeIsMutable();
+ guarantee_.set(index, value);
+ onChanged();
+ } else {
+ guaranteeBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public Builder setGuarantee(
+ int index, org.apache.mesos.v1.Protos.Resource.Builder builderForValue) {
+ if (guaranteeBuilder_ == null) {
+ ensureGuaranteeIsMutable();
+ guarantee_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ guaranteeBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public Builder addGuarantee(org.apache.mesos.v1.Protos.Resource value) {
+ if (guaranteeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureGuaranteeIsMutable();
+ guarantee_.add(value);
+ onChanged();
+ } else {
+ guaranteeBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public Builder addGuarantee(
+ int index, org.apache.mesos.v1.Protos.Resource value) {
+ if (guaranteeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureGuaranteeIsMutable();
+ guarantee_.add(index, value);
+ onChanged();
+ } else {
+ guaranteeBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public Builder addGuarantee(
+ org.apache.mesos.v1.Protos.Resource.Builder builderForValue) {
+ if (guaranteeBuilder_ == null) {
+ ensureGuaranteeIsMutable();
+ guarantee_.add(builderForValue.build());
+ onChanged();
+ } else {
+ guaranteeBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public Builder addGuarantee(
+ int index, org.apache.mesos.v1.Protos.Resource.Builder builderForValue) {
+ if (guaranteeBuilder_ == null) {
+ ensureGuaranteeIsMutable();
+ guarantee_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ guaranteeBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public Builder addAllGuarantee(
+ java.lang.Iterable<? extends org.apache.mesos.v1.Protos.Resource> values) {
+ if (guaranteeBuilder_ == null) {
+ ensureGuaranteeIsMutable();
+ super.addAll(values, guarantee_);
+ onChanged();
+ } else {
+ guaranteeBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public Builder clearGuarantee() {
+ if (guaranteeBuilder_ == null) {
+ guarantee_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000004);
+ onChanged();
+ } else {
+ guaranteeBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public Builder removeGuarantee(int index) {
+ if (guaranteeBuilder_ == null) {
+ ensureGuaranteeIsMutable();
+ guarantee_.remove(index);
+ onChanged();
+ } else {
+ guaranteeBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Resource.Builder getGuaranteeBuilder(
+ int index) {
+ return getGuaranteeFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.ResourceOrBuilder getGuaranteeOrBuilder(
+ int index) {
+ if (guaranteeBuilder_ == null) {
+ return guarantee_.get(index); } else {
+ return guaranteeBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public java.util.List<? extends org.apache.mesos.v1.Protos.ResourceOrBuilder>
+ getGuaranteeOrBuilderList() {
+ if (guaranteeBuilder_ != null) {
+ return guaranteeBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(guarantee_);
+ }
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Resource.Builder addGuaranteeBuilder() {
+ return getGuaranteeFieldBuilder().addBuilder(
+ org.apache.mesos.v1.Protos.Resource.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public org.apache.mesos.v1.Protos.Resource.Builder addGuaranteeBuilder(
+ int index) {
+ return getGuaranteeFieldBuilder().addBuilder(
+ index, org.apache.mesos.v1.Protos.Resource.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .mesos.v1.Resource guarantee = 3;</code>
+ *
+ * <pre>
+ * The requested guarantee that these resources will be allocatable for
+ * the above role.
+ * </pre>
+ */
+ public java.util.List<org.apache.mesos.v1.Protos.Resource.Builder>
+ getGuaranteeBuilderList() {
+ return getGuaranteeFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.Resource, org.apache.mesos.v1.Protos.Resource.Builder, org.apache.mesos.v1.Protos.ResourceOrBuilder>
+ getGuaranteeFieldBuilder() {
+ if (guaranteeBuilder_ == null) {
+ guaranteeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+ org.apache.mesos.v1.Protos.Resource, org.apache.mesos.v1.Protos.Resource.Builder, org.apache.mesos.v1.Protos.ResourceOrBuilder>(
+ guarantee_,
+ ((bitField0_ & 0x00000004) == 0x00000004),
+ getParentForChildren(),
+ isClean());
+ guarantee_ = null;
+ }
+ return guaranteeBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:mesos.v1.quota.QuotaRequest)
+ }
+
+ static {
+ defaultInstance = new QuotaRequest(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:mesos.v1.quota.QuotaRequest)
+ }
+
+ public interface QuotaStatusOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // repeated .mesos.v1.quota.QuotaInfo infos = 1;
+ /**
+ * <code>repeated .mesos.v1.quota.QuotaInfo infos = 1;</code>
+ *
+ * <pre>
+ * Quotas which are currently set, i.e. known to the master.
+ * </pre>
+ */
+ java.util.List<org.apache.mesos.v1.quota.Protos.QuotaInfo>
+ getInfosList();
+ /**
+ * <code>repeated .mesos.v1.quota.QuotaInfo infos = 1;</code>
+ *
+ * <pre>
+ * Quotas which are currently set, i.e. known to the master.
+ * </pre>
+ */
+ org.apache.mesos.v1.quota.Protos.QuotaInfo getInfos(int index);
+ /**
+ * <code>repeated .mesos.v1.quota.QuotaInfo infos = 1;</code>
+ *
+ * <pre>
+ * Quotas which are currently set, i.e. known to the master.
+ * </pre>
+ */
+ int getInfosCount();
+ /**
+ * <code>repeated .mesos.v1.quota.QuotaInfo infos = 1;</code>
+ *
+ * <pre>
+ * Quotas which are currently set, i.e. known to the master.
+ * </pre>
+ */
+ java.util.List<? extends org.apache.mesos.v1.quota.Protos.QuotaInfoOrBuilder>
+ getInfosOrBuilderList();
+ /**
+ * <code>repeated .mesos.v1.quota.QuotaInfo infos = 1;</code>
+ *
+ * <pre>
+ * Quotas which are currently set, i.e. known to the master.
+ * </pre>
+ */
+ org.apache.mesos.v1.quota.Protos.QuotaInfoOrBuilder getInfosOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code mesos.v1.quota.QuotaStatus}
+ *
+ * <pre>
+ **
+ * `QuotaStatus` describes the internal representation for the /quota/status
+ * response.
+ * </pre>
+ */
+ public static final class QuotaStatus extends
+ com.google.protobuf.GeneratedMessage
+ implements QuotaStatusOrBuilder {
+ // Use QuotaStatus.newBuilder() to construct.
+ private QuotaStatus(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private QuotaStatus(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final QuotaStatus defaultInstance;
+ public static QuotaStatus getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public QuotaStatus getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private QuotaStatus(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ infos_ = new java.util.ArrayList<org.apache.mesos.v1.quota.Protos.QuotaInfo>();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ infos_.add(input.readMessage(org.apache.mesos.v1.quota.Protos.QuotaInfo.PARSER, extensionRegistry));
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
<TRUNCATED>