You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2014/06/23 23:13:31 UTC

git commit: Exposed constructors for types declared in Log.java.

Repository: mesos
Updated Branches:
  refs/heads/master 7200cca1c -> 38f0cade8


Exposed constructors for types declared in Log.java.

This allows java API users to construct objects in tests without extra
hoop-jumping.

This patch also fixed some javadoc errors.

Review: https://reviews.apache.org/r/22837


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/38f0cade
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/38f0cade
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/38f0cade

Branch: refs/heads/master
Commit: 38f0cade87930bd94b9ff2af08055689649dabbf
Parents: 7200cca
Author: Bill Farner <wf...@apache.org>
Authored: Mon Jun 23 14:11:32 2014 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon Jun 23 14:11:32 2014 -0700

----------------------------------------------------------------------
 src/java/src/org/apache/mesos/Executor.java     |  4 ++--
 src/java/src/org/apache/mesos/Log.java          | 23 ++++++++++++++++----
 .../src/org/apache/mesos/SchedulerDriver.java   |  9 ++------
 src/java/src/org/apache/mesos/state/State.java  |  3 ++-
 4 files changed, 25 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/38f0cade/src/java/src/org/apache/mesos/Executor.java
----------------------------------------------------------------------
diff --git a/src/java/src/org/apache/mesos/Executor.java b/src/java/src/org/apache/mesos/Executor.java
index cacb4e9..25f428e 100644
--- a/src/java/src/org/apache/mesos/Executor.java
+++ b/src/java/src/org/apache/mesos/Executor.java
@@ -38,7 +38,7 @@ 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 it's executors through the {@link ExecutorInfo#data}
+   * data to it's executors through the {@link ExecutorInfo#getData()}
    * field. TODO(vinod): Add a new reregistered callback for when the executor
    * re-connects with a restarted slave.
    *
@@ -70,7 +70,7 @@ public interface Executor {
 
   /**
    * Invoked when a task has been launched on this executor (initiated
-   * via {@link Scheduler#launchTasks}. Note that this task can be
+   * 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.

http://git-wip-us.apache.org/repos/asf/mesos/blob/38f0cade/src/java/src/org/apache/mesos/Log.java
----------------------------------------------------------------------
diff --git a/src/java/src/org/apache/mesos/Log.java b/src/java/src/org/apache/mesos/Log.java
index d27e4f9..8e2cd88 100644
--- a/src/java/src/org/apache/mesos/Log.java
+++ b/src/java/src/org/apache/mesos/Log.java
@@ -75,8 +75,15 @@ public class Log {
       return bytes;
     }
 
-    /* A Position is (and should only be) invoked by the underlying JNI. */
-    private Position(long value) {
+    /**
+     * 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;
     }
 
@@ -91,8 +98,16 @@ public class Log {
     public final Position position;
     public final byte[] data;
 
-    /* An Entry is (and should only be) invoked by the underlying JNI. */
-    private Entry(Position position, 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;
     }

http://git-wip-us.apache.org/repos/asf/mesos/blob/38f0cade/src/java/src/org/apache/mesos/SchedulerDriver.java
----------------------------------------------------------------------
diff --git a/src/java/src/org/apache/mesos/SchedulerDriver.java b/src/java/src/org/apache/mesos/SchedulerDriver.java
index 591984e..bd61a13 100644
--- a/src/java/src/org/apache/mesos/SchedulerDriver.java
+++ b/src/java/src/org/apache/mesos/SchedulerDriver.java
@@ -130,10 +130,7 @@ public interface SchedulerDriver {
   Status launchTasks(Collection<OfferID> offerIds, Collection<TaskInfo> tasks);
 
   /**
-   * @deprecated Use launchTasks(
-   *                     Collection<OfferID> offerId,
-   *                     Collection<TaskInfo> tasks,
-   *                     Filters filters) instead.
+   * @deprecated Use {@link #launchTasks(Collection, Collection, Filters)}.
    *
    * @param offerId The offer ID.
    * @param tasks The collection of tasks to be launched.
@@ -145,9 +142,7 @@ public interface SchedulerDriver {
                      Filters filters);
 
   /**
-   * @deprecated Use launchTasks(
-   *                     Collection<OfferID> offerId,
-   *                     Collection<TaskInfo> tasks) instead.
+   * @deprecated Use {@link #launchTasks(Collection, Collection)}.
    *
    * @param offerId The offer ID.
    * @param tasks The collection of tasks to be launched.

http://git-wip-us.apache.org/repos/asf/mesos/blob/38f0cade/src/java/src/org/apache/mesos/state/State.java
----------------------------------------------------------------------
diff --git a/src/java/src/org/apache/mesos/state/State.java b/src/java/src/org/apache/mesos/state/State.java
index d14d79b..ec354fe 100644
--- a/src/java/src/org/apache/mesos/state/State.java
+++ b/src/java/src/org/apache/mesos/state/State.java
@@ -36,13 +36,14 @@ import java.util.concurrent.Future;
  * other writes have been performed on the variable since your fetch.
  *
  * Example:
- *
+ * {@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();
+ * }
  */
 public interface State {
   /**