aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject [45/51] [partial] Rename twitter* and com.twitter to apache and org.apache directories to preserve all file history before the refactor.
Date Tue, 31 Dec 2013 21:20:38 GMT
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/http/Slaves.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/http/Slaves.java b/src/main/java/com/twitter/aurora/scheduler/http/Slaves.java
deleted file mode 100644
index 401ee30..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/http/Slaves.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.http;
-
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Ordering;
-
-import org.antlr.stringtemplate.StringTemplate;
-
-import com.twitter.aurora.gen.Attribute;
-import com.twitter.aurora.gen.HostAttributes;
-import com.twitter.aurora.gen.MaintenanceMode;
-import com.twitter.aurora.scheduler.storage.Storage;
-import com.twitter.common.base.Closure;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import static com.twitter.aurora.scheduler.storage.Storage.StoreProvider;
-import static com.twitter.aurora.scheduler.storage.Storage.Work;
-import static com.twitter.common.base.MorePreconditions.checkNotBlank;
-
-/**
- * HTTP interface to serve as a HUD for the mesos slaves tracked in the scheduler.
- */
-@Path("/slaves")
-public class Slaves extends JerseyTemplateServlet {
-  private final String clusterName;
-  private Storage storage;
-
-  /**
-   * Injected constructor.
-   *
-   * @param clusterName cluster name
-   * @param storage store to fetch the host attributes from
-   */
-  @Inject
-  public Slaves(@ClusterName String clusterName, Storage storage) {
-    super("slaves");
-    this.clusterName = checkNotBlank(clusterName);
-    this.storage = checkNotNull(storage);
-  }
-
-  private Iterable<HostAttributes> getHostAttributes() {
-    return storage.weaklyConsistentRead(new Work.Quiet<Iterable<HostAttributes>>() {
-      @Override public Iterable<HostAttributes> apply(StoreProvider storeProvider) {
-        return storeProvider.getAttributeStore().getHostAttributes();
-      }
-    });
-  }
-
-  private static final Function<HostAttributes, Slave> TO_SLAVE =
-      new Function<HostAttributes, Slave>() {
-        @Override public Slave apply(HostAttributes attributes) {
-          return new Slave(attributes);
-        }
-      };
-
-  /**
-   * Fetches the listing of known slaves.
-   *
-   * @return HTTP response.
-   */
-  @GET
-  @Produces(MediaType.TEXT_HTML)
-  public Response get() {
-    return fillTemplate(new Closure<StringTemplate>() {
-      @Override public void execute(StringTemplate template) {
-        template.setAttribute("cluster_name", clusterName);
-
-        template.setAttribute("slaves",
-            FluentIterable.from(getHostAttributes()).transform(TO_SLAVE).toList());
-      }
-    });
-  }
-
-  private static final Ordering<Attribute> ATTR_ORDER = Ordering.natural().onResultOf(
-      new Function<Attribute, String>() {
-        @Override public String apply(Attribute attr) {
-          return attr .getName();
-        }
-      });
-
-  /**
-   * Template object to represent a slave.
-   */
-  private static class Slave {
-    private final HostAttributes attributes;
-
-    Slave(HostAttributes attributes) {
-      this.attributes = attributes;
-    }
-
-    public String getHost() {
-      return attributes.getHost();
-    }
-
-    public String getId() {
-      return attributes.getSlaveId();
-    }
-
-    public MaintenanceMode getMode() {
-      return attributes.getMode();
-    }
-
-    private static final Function<Attribute, String> ATTR_TO_STRING =
-        new Function<Attribute, String>() {
-          @Override public String apply(Attribute attr) {
-            return attr.getName() + "=[" + Joiner.on(",").join(attr.getValues()) + "]";
-          }
-        };
-
-    public String getAttributes() {
-      return Joiner.on(", ").join(
-          Iterables.transform(ATTR_ORDER.sortedCopy(attributes.getAttributes()), ATTR_TO_STRING));
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/http/StructDump.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/http/StructDump.java b/src/main/java/com/twitter/aurora/scheduler/http/StructDump.java
deleted file mode 100644
index 8da8b80..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/http/StructDump.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.http;
-
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Iterables;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.apache.thrift.TBase;
-
-import com.twitter.aurora.gen.JobConfiguration;
-import com.twitter.aurora.scheduler.base.JobKeys;
-import com.twitter.aurora.scheduler.base.Query;
-import com.twitter.aurora.scheduler.state.CronJobManager;
-import com.twitter.aurora.scheduler.storage.Storage;
-import com.twitter.aurora.scheduler.storage.Storage.StoreProvider;
-import com.twitter.aurora.scheduler.storage.Storage.Work;
-import com.twitter.aurora.scheduler.storage.Storage.Work.Quiet;
-import com.twitter.aurora.scheduler.storage.entities.IJobConfiguration;
-import com.twitter.aurora.scheduler.storage.entities.IJobKey;
-import com.twitter.common.base.Closure;
-import com.twitter.common.thrift.Util;
-
-/**
- * Servlet that prints out the raw configuration for a specified struct.
- */
-@Path("/structdump")
-public class StructDump extends JerseyTemplateServlet {
-
-  private final Storage storage;
-
-  @Inject
-  public StructDump(Storage storage) {
-    super("structdump");
-    this.storage = Preconditions.checkNotNull(storage);
-  }
-
-  @GET
-  @Produces(MediaType.TEXT_HTML)
-  public Response getUsage() {
-    return Response
-        .status(Status.BAD_REQUEST)
-        .entity("<html>Usage: /structdump/{task_id} or /structdump/job/{role}/{env}/{job}</html>")
-        .build();
-  }
-
-  /**
-   * Dumps a task struct.
-   *
-   * @return HTTP response.
-   */
-  @GET
-  @Path("/task/{task}")
-  @Produces(MediaType.TEXT_HTML)
-  public Response dumpJob(
-      @PathParam("task") final String taskId) {
-
-    return dumpEntity("Task " + taskId, new Work.Quiet<Optional<? extends TBase<?, ?>>>() {
-      @Override public Optional<? extends TBase<?, ?>> apply(StoreProvider storeProvider) {
-        // Deep copy the struct to sidestep any subclass trickery inside the storage system.
-        return Optional.fromNullable(Iterables.getOnlyElement(
-                storeProvider.getTaskStore().fetchTasks(Query.taskScoped(taskId)),
-                null)
-            .newBuilder());
-      }
-    });
-  }
-
-  /**
-   * Dumps a cron job struct.
-   *
-   * @return HTTP response.
-   */
-  @GET
-  @Path("/cron/{role}/{environment}/{job}")
-  @Produces(MediaType.TEXT_HTML)
-  public Response dump(
-      @PathParam("role") final String role,
-      @PathParam("environment") final String environment,
-      @PathParam("job") final String job) {
-
-    final IJobKey jobKey = JobKeys.from(role, environment, job);
-    return dumpEntity("Cron job " + JobKeys.toPath(jobKey),
-        new Work.Quiet<Optional<? extends TBase<?, ?>>>() {
-          @Override public Optional<JobConfiguration> apply(StoreProvider storeProvider) {
-            return storeProvider.getJobStore().fetchJob(CronJobManager.MANAGER_KEY, jobKey)
-                .transform(IJobConfiguration.TO_BUILDER);
-          }
-        });
-  }
-
-  private Response dumpEntity(final String id, final Quiet<Optional<? extends TBase<?, ?>>> work) {
-    return fillTemplate(new Closure<StringTemplate>() {
-      @Override public void execute(StringTemplate template) {
-        template.setAttribute("id", id);
-        Optional<? extends TBase<?, ?>> struct = storage.weaklyConsistentRead(work);
-        if (!struct.isPresent()) {
-          template.setAttribute("exception", "Entity not found");
-        } else {
-          template.setAttribute("structPretty", Util.prettyPrint(struct.get()));
-        }
-      }
-    });
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/http/TransformationUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/http/TransformationUtils.java b/src/main/java/com/twitter/aurora/scheduler/http/TransformationUtils.java
deleted file mode 100644
index 2f531a7..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/http/TransformationUtils.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.http;
-
-import java.util.Collection;
-
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Range;
-
-import com.twitter.aurora.scheduler.base.Numbers;
-import com.twitter.aurora.scheduler.storage.entities.IPackage;
-
-/**
- * Utility class to hold common object to string transformation helper functions.
- */
-final class TransformationUtils {
-  public static final Function<IPackage, String> PACKAGE_TOSTRING =
-      new Function<IPackage, String>() {
-        @Override public String apply(IPackage pkg) {
-          return pkg.getRole() + "/" + pkg.getName() + " v" + pkg.getVersion();
-        }
-      };
-
-  public static final Function<Range<Integer>, String> RANGE_TOSTRING =
-      new Function<Range<Integer>, String>() {
-        @Override public String apply(Range<Integer> range) {
-          int lower = range.lowerEndpoint();
-          int upper = range.upperEndpoint();
-          return (lower == upper) ? String.valueOf(lower) : (lower + " - " + upper);
-        }
-      };
-
-  public static final Function<Collection<Integer>, String> INSTANCES_TOSTRING =
-      new Function<Collection<Integer>, String>() {
-        @Override public String apply(Collection<Integer> instances) {
-          return Joiner.on(", ")
-              .join(Iterables.transform(Numbers.toRanges(instances), RANGE_TOSTRING));
-        }
-      };
-
-  private TransformationUtils() {
-    // Utility class
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/http/Utilization.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/http/Utilization.java b/src/main/java/com/twitter/aurora/scheduler/http/Utilization.java
deleted file mode 100644
index 60a7d95..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/http/Utilization.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.http;
-
-import java.io.StringWriter;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.annotation.Nullable;
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
-import com.google.common.base.Function;
-import com.google.common.base.Objects;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.FluentIterable;
-
-import org.antlr.stringtemplate.StringTemplate;
-
-import com.twitter.aurora.scheduler.base.Query;
-import com.twitter.aurora.scheduler.stats.ResourceCounter;
-import com.twitter.aurora.scheduler.stats.ResourceCounter.GlobalMetric;
-import com.twitter.aurora.scheduler.stats.ResourceCounter.Metric;
-import com.twitter.aurora.scheduler.stats.ResourceCounter.MetricType;
-import com.twitter.aurora.scheduler.storage.entities.ITaskConfig;
-import com.twitter.common.base.Closure;
-import com.twitter.common.base.MorePreconditions;
-import com.twitter.common.util.templating.StringTemplateHelper;
-import com.twitter.common.util.templating.StringTemplateHelper.TemplateException;
-
-/**
- * A servlet to give an aggregate view of cluster resources consumed, grouped by category.
- */
-@Path("/utilization")
-public class Utilization {
-
-  private final String clusterName;
-  private final ResourceCounter counter;
-  private final StringTemplateHelper templateHelper;
-
-  @Inject
-  Utilization(ResourceCounter counter, @ClusterName String clusterName) {
-    templateHelper = new StringTemplateHelper(getClass(), "utilization", true);
-    this.counter = Preconditions.checkNotNull(counter);
-    this.clusterName = MorePreconditions.checkNotBlank(clusterName);
-  }
-
-  private String fillTemplate(Map<Display, Metric> metrics) {
-    Function<Entry<Display, Metric>, DisplayMetric> transform =
-        new Function<Entry<Display, Metric>, DisplayMetric>() {
-          @Override public DisplayMetric apply(Entry<Display, Metric> entry) {
-            return new DisplayMetric(entry.getKey(), entry.getValue());
-          }
-        };
-    return fillTemplate(FluentIterable.from(metrics.entrySet()).transform(transform).toList());
-  }
-
-  private String fillTemplate(final Iterable<DisplayMetric> metrics) {
-    StringWriter output = new StringWriter();
-    try {
-      templateHelper.writeTemplate(output, new Closure<StringTemplate>() {
-        @Override public void execute(StringTemplate template) {
-          template.setAttribute("cluster_name", clusterName);
-          template.setAttribute("metrics", metrics);
-        }
-      });
-    } catch (TemplateException e) {
-      throw new WebApplicationException(e);
-    }
-    return output.toString();
-  }
-
-  private static class Display {
-    private final String title;
-    @Nullable
-    private final String link;
-
-    Display(String title, @Nullable String link) {
-      this.title = title;
-      this.link = link;
-    }
-
-    @Override
-    public int hashCode() {
-      return Objects.hashCode(title, link);
-    }
-
-    @Override
-    public boolean equals(Object o) {
-      if (!(o instanceof  Display)) {
-        return false;
-      }
-
-      Display other = (Display) o;
-      return Objects.equal(title, other.title) && Objects.equal(link, other.link);
-    }
-  }
-
-  private static class DisplayMetric extends Metric {
-    private final Display display;
-
-    DisplayMetric(Display display, Metric wrapped) {
-      super(wrapped);
-      this.display = display;
-    }
-
-    public String getTitle() {
-      return display.title;
-    }
-
-    @Nullable
-    public String getLink() {
-      return display.link;
-    }
-  }
-
-  private static final Function<GlobalMetric, DisplayMetric> TO_DISPLAY =
-      new Function<GlobalMetric, DisplayMetric>() {
-        @Override public DisplayMetric apply(GlobalMetric count) {
-          return new DisplayMetric(
-              new Display(
-                  count.type.name().replace('_', ' ').toLowerCase(),
-                  count.type.name().toLowerCase()),
-              count);
-        }
-      };
-
-  /**
-   * Displays the aggregate utilization for the entire cluster.
-   *
-   * @return HTML-formatted cluster utilization.
-   */
-  @GET
-  @Produces(MediaType.TEXT_HTML)
-  public Response aggregateCluster() {
-    Iterable<DisplayMetric> metrics =
-        FluentIterable.from(counter.computeConsumptionTotals()).transform(TO_DISPLAY).toList();
-    return Response.ok(fillTemplate(metrics)).build();
-  }
-
-  private MetricType getTypeByName(String name) throws WebApplicationException {
-    MetricType type = MetricType.valueOf(name.toUpperCase());
-    if (type == null) {
-      throw new WebApplicationException(
-          Response.status(Status.BAD_REQUEST).entity("Invalid metric type.").build());
-    }
-    return type;
-  }
-
-  /**
-   * Displays the aggregate utilization for roles within a metric type.
-   *
-   * @param metric Metric id.
-   * @return HTML-formatted utilization within the metric type.
-   */
-  @GET
-  @Path("/{metric}")
-  @Produces(MediaType.TEXT_HTML)
-  public Response aggregateRoles(@PathParam("metric") final String metric) {
-    final MetricType type = getTypeByName(metric);
-
-    Function<ITaskConfig, Display> toKey = new Function<ITaskConfig, Display>() {
-      @Override public Display apply(ITaskConfig task) {
-        String role = task.getOwner().getRole();
-        return new Display(role, metric + "/" + role);
-      }
-    };
-    Map<Display, Metric> byRole =
-        counter.computeAggregates(Query.unscoped().active(), type.filter, toKey);
-    return Response.ok(fillTemplate(byRole)).build();
-  }
-
-  /**
-   * Displays the aggregate utilization for jobs within a role.
-   *
-   * @param metric Metric id.
-   * @param role Role for jobs to aggregate.
-   * @return HTML-formatted utilization within the metric/role.
-   */
-  @GET
-  @Path("/{metric}/{role}")
-  @Produces(MediaType.TEXT_HTML)
-  public Response aggregateJobs(
-      @PathParam("metric") String metric,
-      @PathParam("role") String role) {
-
-    MetricType type = getTypeByName(metric);
-    Function<ITaskConfig, Display> toKey = new Function<ITaskConfig, Display>() {
-      @Override public Display apply(ITaskConfig task) {
-        return new Display(task.getJobName(), null);
-      }
-    };
-    Map<Display, Metric> byJob =
-        counter.computeAggregates(Query.roleScoped(role).active(), type.filter, toKey);
-    return Response.ok(fillTemplate(byJob)).build();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/local/FakeDriverFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/local/FakeDriverFactory.java b/src/main/java/com/twitter/aurora/scheduler/local/FakeDriverFactory.java
deleted file mode 100644
index ae5062e..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/local/FakeDriverFactory.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.local;
-
-import java.util.Collection;
-
-import javax.annotation.Nullable;
-import javax.inject.Inject;
-import javax.inject.Provider;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-import org.apache.mesos.Protos.ExecutorID;
-import org.apache.mesos.Protos.Filters;
-import org.apache.mesos.Protos.FrameworkID;
-import org.apache.mesos.Protos.MasterInfo;
-import org.apache.mesos.Protos.OfferID;
-import org.apache.mesos.Protos.Request;
-import org.apache.mesos.Protos.SlaveID;
-import org.apache.mesos.Protos.Status;
-import org.apache.mesos.Protos.TaskID;
-import org.apache.mesos.Protos.TaskInfo;
-import org.apache.mesos.Protos.TaskStatus;
-import org.apache.mesos.Scheduler;
-import org.apache.mesos.SchedulerDriver;
-
-import com.twitter.aurora.scheduler.DriverFactory;
-import com.twitter.common.application.Lifecycle;
-
-/**
- * A factory for fake scheduler driver instances.
- */
-class FakeDriverFactory implements DriverFactory {
-
-  private final Provider<Scheduler> scheduler;
-  private final Lifecycle lifecycle;
-
-  @Inject
-  FakeDriverFactory(Provider<Scheduler> scheduler, Lifecycle lifecycle) {
-    this.scheduler = Preconditions.checkNotNull(scheduler);
-    this.lifecycle = Preconditions.checkNotNull(lifecycle);
-  }
-
-  @Override
-  public SchedulerDriver apply(@Nullable final String frameworkId) {
-    return new FakeSchedulerDriver() {
-      @Override public Status run() {
-        scheduler.get().registered(
-            this,
-            FrameworkID.newBuilder().setValue(
-                Optional.fromNullable(frameworkId).or("new-framework-id")).build(),
-            MasterInfo.newBuilder().setId("master-id").setIp(100).setPort(200).build());
-        lifecycle.awaitShutdown();
-        return null;
-      }
-    };
-  }
-
-  static class FakeSchedulerDriver implements SchedulerDriver {
-    @Override public Status start() {
-      return null;
-    }
-
-    @Override public Status stop(boolean b) {
-      return null;
-    }
-
-    @Override public Status stop() {
-      return null;
-    }
-
-    @Override public Status abort() {
-      return null;
-    }
-
-    @Override public Status join() {
-      return run();
-    }
-
-    @Override public Status run() {
-      return null;
-    }
-
-    @Override public Status requestResources(Collection<Request> requests) {
-      return null;
-    }
-
-    @Override public Status launchTasks(OfferID offerID, Collection<TaskInfo> taskInfos,
-        Filters filters) {
-      return null;
-    }
-
-    @Override public Status launchTasks(OfferID offerID, Collection<TaskInfo> taskInfos) {
-      return null;
-    }
-
-    @Override public Status killTask(TaskID taskID) {
-      return null;
-    }
-
-    @Override public Status declineOffer(OfferID offerID, Filters filters) {
-      return null;
-    }
-
-    @Override public Status declineOffer(OfferID offerID) {
-      return null;
-    }
-
-    @Override public Status reviveOffers() {
-      return null;
-    }
-
-    @Override public Status sendFrameworkMessage(ExecutorID executorID, SlaveID slaveID,
-        byte[] bytes) {
-      return null;
-    }
-
-    @Override
-    public Status reconcileTasks(Collection<TaskStatus> statuses) {
-      return null;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/local/IsolatedSchedulerModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/local/IsolatedSchedulerModule.java b/src/main/java/com/twitter/aurora/scheduler/local/IsolatedSchedulerModule.java
deleted file mode 100644
index c07359e..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/local/IsolatedSchedulerModule.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.local;
-
-import java.util.List;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.annotation.Nullable;
-import javax.inject.Inject;
-import javax.inject.Provider;
-import javax.inject.Singleton;
-
-import com.google.common.base.Function;
-import com.google.common.base.Throwables;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.eventbus.Subscribe;
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import com.google.inject.AbstractModule;
-
-import org.apache.mesos.Protos.Attribute;
-import org.apache.mesos.Protos.FrameworkID;
-import org.apache.mesos.Protos.Offer;
-import org.apache.mesos.Protos.OfferID;
-import org.apache.mesos.Protos.Resource;
-import org.apache.mesos.Protos.SlaveID;
-import org.apache.mesos.Protos.TaskID;
-import org.apache.mesos.Protos.TaskState;
-import org.apache.mesos.Protos.TaskStatus;
-import org.apache.mesos.Protos.Value.Scalar;
-import org.apache.mesos.Protos.Value.Text;
-import org.apache.mesos.Protos.Value.Type;
-import org.apache.mesos.Scheduler;
-import org.apache.mesos.SchedulerDriver;
-import org.apache.thrift.TException;
-
-import com.twitter.aurora.gen.AuroraAdmin;
-import com.twitter.aurora.gen.ExecutorConfig;
-import com.twitter.aurora.gen.Identity;
-import com.twitter.aurora.gen.JobConfiguration;
-import com.twitter.aurora.gen.Package;
-import com.twitter.aurora.gen.Quota;
-import com.twitter.aurora.gen.Response;
-import com.twitter.aurora.gen.SessionKey;
-import com.twitter.aurora.gen.TaskConfig;
-import com.twitter.aurora.scheduler.DriverFactory;
-import com.twitter.aurora.scheduler.base.JobKeys;
-import com.twitter.aurora.scheduler.configuration.ConfigurationManager;
-import com.twitter.aurora.scheduler.configuration.Resources;
-import com.twitter.aurora.scheduler.events.PubsubEvent.DriverRegistered;
-import com.twitter.aurora.scheduler.events.PubsubEvent.EventSubscriber;
-import com.twitter.aurora.scheduler.events.PubsubEvent.TaskStateChange;
-import com.twitter.aurora.scheduler.events.PubsubEventModule;
-import com.twitter.aurora.scheduler.local.FakeDriverFactory.FakeSchedulerDriver;
-import com.twitter.aurora.scheduler.log.testing.FileLogStreamModule;
-import com.twitter.common.application.ShutdownRegistry;
-import com.twitter.common.base.Command;
-import com.twitter.common.quantity.Amount;
-import com.twitter.common.quantity.Time;
-import com.twitter.common.stats.Stats;
-import com.twitter.common.util.concurrent.ExecutorServiceShutdown;
-
-/**
- * A module that binds a fake mesos driver factory and a local (non-replicated) storage system.
- * <p>
- * The easiest way to run the scheduler in local/isolated mode is by executing:
- * <pre>
- * $ ./pants goal bundle aurora:scheduler-local && ./aurora/scripts/scheduler.sh -c local
- * </pre>
- */
-public class IsolatedSchedulerModule extends AbstractModule {
-
-  private static final Logger LOG = Logger.getLogger(IsolatedSchedulerModule.class.getName());
-
-  @Override
-  protected void configure() {
-    bind(DriverFactory.class).to(FakeDriverFactory.class);
-    bind(FakeDriverFactory.class).in(Singleton.class);
-    PubsubEventModule.bindSubscriber(binder(), FakeClusterRunner.class);
-    install(new FileLogStreamModule());
-  }
-
-  static class FakeClusterRunner implements EventSubscriber {
-    private final FrameworkID frameworkId =
-        FrameworkID.newBuilder().setValue("framework-id").build();
-    private final List<FakeSlave> cluster = ImmutableList.of(
-        new FakeSlave(frameworkId, "fake-host1", "rack1", "slave-id1"),
-        new FakeSlave(frameworkId, "fake-host2", "rack2", "slave-id2")
-    );
-
-    private final AtomicLong offerId = new AtomicLong();
-    private final Function<FakeSlave, Offer> slaveToOffer = new Function<FakeSlave, Offer>() {
-      @Override public Offer apply(FakeSlave slave) {
-        return slave.makeOffer(offerId.incrementAndGet());
-      }
-    };
-
-    private final Provider<Scheduler> scheduler;
-    private final AuroraAdmin.Iface thrift;
-    private final ScheduledExecutorService executor;
-    private final SchedulerDriver driver;
-
-    @Inject
-    FakeClusterRunner(
-        Provider<Scheduler> scheduler,
-        AuroraAdmin.Iface thrift,
-        ShutdownRegistry shutdownRegistry) {
-
-      this.scheduler = scheduler;
-      this.thrift = thrift;
-      this.executor = createThreadPool(shutdownRegistry);
-      this.driver = new FakeSchedulerDriver();
-    }
-
-    private static ScheduledExecutorService createThreadPool(ShutdownRegistry shutdownRegistry) {
-      final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(
-          1,
-          new ThreadFactoryBuilder().setDaemon(true).setNameFormat("TaskScheduler-%d").build()) {
-
-        @Override protected void afterExecute(Runnable runnable, @Nullable Throwable throwable) {
-          if (throwable != null) {
-            LOG.log(Level.WARNING, "Error: " + throwable, throwable);
-          } else if (runnable instanceof Future) {
-            Future<?> future = (Future<?>) runnable;
-            try {
-              future.get();
-            } catch (InterruptedException | ExecutionException e) {
-              e.printStackTrace();
-            }
-          }
-        }
-      };
-      Stats.exportSize("schedule_queue_size", executor.getQueue());
-      shutdownRegistry.addAction(new Command() {
-        @Override public void execute() {
-          new ExecutorServiceShutdown(executor, Amount.of(1L, Time.SECONDS)).execute();
-        }
-      });
-      return executor;
-    }
-
-    private void offerClusterResources() {
-      executor.submit(new Runnable() {
-        @Override public void run() {
-          scheduler.get().resourceOffers(
-              driver,
-              FluentIterable.from(cluster).transform(slaveToOffer).toList());
-        }
-      });
-    }
-
-    private void setQuotas() {
-      executor.submit(new Runnable() {
-        @Override public void run() {
-          try {
-            thrift.setQuota(
-                "mesos",
-                new Quota(2.0 * 1000000, 100000000, 100000000),
-                new SessionKey());
-          } catch (TException e) {
-            throw Throwables.propagate(e);
-          }
-        }
-      });
-    }
-
-    @Subscribe
-    public void registered(DriverRegistered event) {
-      executor.submit(new Runnable() {
-        @Override public void run() {
-          Identity mesosUser = new Identity("mesos", "mesos");
-          for (int i = 0; i < 20; i++) {
-            JobConfiguration service = createJob("serviceJob" + i, mesosUser);
-            service.getTaskConfig().setProduction((i % 2) == 0);
-            service.getTaskConfig().setIsService(true);
-            submitJob(service);
-          }
-
-          for (int i = 0; i < 20; i++) {
-            JobConfiguration adhocJob = createJob("adhocJob" + i, mesosUser);
-            adhocJob.getTaskConfig().setProduction((i % 2) == 0);
-            adhocJob.getTaskConfig();
-            submitJob(adhocJob);
-          }
-
-          for (int i = 0; i < 20; i++) {
-            JobConfiguration cron = createJob("cronJob" + i, mesosUser);
-            cron.getTaskConfig().setProduction((i % 2) == 0);
-            cron.setCronSchedule("* * * * *");
-            submitJob(cron);
-          }
-        }
-      });
-
-      setQuotas();
-      offerClusterResources();
-      // Send the offers again, since the first batch of offers will be consumed by GC executors.
-      offerClusterResources();
-    }
-
-    private void moveTaskToState(final String taskId, final TaskState state, long delaySeconds) {
-      Runnable changeState = new Runnable() {
-        @Override public void run() {
-          scheduler.get().statusUpdate(
-              driver,
-              TaskStatus.newBuilder()
-                  .setTaskId(TaskID.newBuilder().setValue(taskId))
-                  .setState(state)
-                  .build());
-        }
-      };
-      executor.schedule(changeState, delaySeconds, TimeUnit.SECONDS);
-    }
-
-    @Subscribe
-    public void stateChanged(TaskStateChange stateChange) {
-      String taskId = stateChange.getTaskId();
-      switch (stateChange.getNewState()) {
-        case ASSIGNED:
-          moveTaskToState(taskId, TaskState.TASK_STARTING, 1);
-          break;
-
-        case STARTING:
-          moveTaskToState(taskId, TaskState.TASK_RUNNING, 1);
-          break;
-
-        case RUNNING:
-          // Let the task finish some time randomly in the next 5 minutes.
-          moveTaskToState(taskId, TaskState.TASK_FINISHED, (long) (Math.random() * 300));
-          break;
-
-        case FINISHED:
-          offerClusterResources();
-          break;
-
-        default:
-          break;
-      }
-    }
-
-    private JobConfiguration createJob(String jobName, Identity owner) {
-      return new JobConfiguration()
-          .setKey(JobKeys.from(owner.getRole(), "test", jobName).newBuilder())
-          .setOwner(owner)
-          .setInstanceCount(5)
-          .setTaskConfig(new TaskConfig()
-              .setOwner(owner)
-              .setJobName(jobName)
-              .setEnvironment("test")
-              .setNumCpus(1.0)
-              .setDiskMb(1024)
-              .setRamMb(1024)
-              .setPackages(ImmutableSet.of(new Package(owner.getRole(), "package", 15)))
-              .setExecutorConfig(new ExecutorConfig("aurora", "opaque")));
-    }
-
-    private void submitJob(JobConfiguration job) {
-      Response response;
-      try {
-        response = thrift.createJob(job, null, new SessionKey());
-      } catch (TException e) {
-        throw Throwables.propagate(e);
-      }
-      LOG.info("Create job response: " + response);
-    }
-  }
-
-  private static class FakeSlave {
-    private final FrameworkID framework;
-    private final String host;
-    private final String rack;
-    private final String slaveId;
-
-    FakeSlave(FrameworkID framework, String host, String rack, String slaveId) {
-      this.framework = framework;
-      this.host = host;
-      this.rack = rack;
-      this.slaveId = slaveId;
-    }
-
-    private static Resource.Builder scalar(String name, double value) {
-      return Resource.newBuilder()
-          .setName(name)
-          .setType(Type.SCALAR)
-          .setScalar(Scalar.newBuilder().setValue(value));
-    }
-
-    private static Attribute.Builder attribute(String name, String value) {
-      return Attribute.newBuilder()
-          .setName(name)
-          .setType(Type.TEXT)
-          .setText(Text.newBuilder().setValue(value));
-    }
-
-    Offer makeOffer(long offerId) {
-      return Offer.newBuilder()
-          .setId(OfferID.newBuilder().setValue("offer" + offerId))
-          .setFrameworkId(framework)
-          .setSlaveId(SlaveID.newBuilder().setValue(slaveId))
-          .setHostname(host)
-          .addResources(scalar(Resources.CPUS, 16))
-          .addResources(scalar(Resources.RAM_MB, 24576))
-          .addResources(scalar(Resources.DISK_MB, 102400))
-          .addAttributes(attribute(ConfigurationManager.RACK_CONSTRAINT, rack))
-          .addAttributes(attribute(ConfigurationManager.HOST_CONSTRAINT, host))
-          .build();
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/log/Log.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/log/Log.java b/src/main/java/com/twitter/aurora/scheduler/log/Log.java
deleted file mode 100644
index c1036e0..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/log/Log.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.log;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.util.Iterator;
-
-/**
- * Represents an append only log that can be read after and truncated before a known
- * {@link Position}.
- *
- * <p>Logs are accessed by {@link #open() opening} a {@link Stream}.  All stream
- * access occurs with references to log entry {@link Position positions} in the stream.
- */
-public interface Log {
-
-  /**
-   * An opaque ordered handle to a log entry's position in the log stream.
-   */
-  interface Position extends Comparable<Position> {
-  }
-
-  /**
-   * Represents a single entry in the log stream.
-   */
-  interface Entry {
-
-    /**
-     * Gets the contents of the log entry.
-     *
-     * @return the data stored in this log entry
-     */
-    byte[] contents();
-  }
-
-  /**
-   * An interface to the live {@link Log} stream that allows for appending, reading and writing
-   * entries.
-   */
-  interface Stream extends Closeable {
-
-    /**
-     * Indicates a {@link Position} that is not (currently) contained in this log stream.
-     * This might indicate the position id from a different log or that the position was from this
-     * log but has been truncated.
-     */
-    class InvalidPositionException extends RuntimeException {
-      public InvalidPositionException(String message) {
-        super(message);
-      }
-      public InvalidPositionException(String message, Throwable cause) {
-        super(message, cause);
-      }
-    }
-
-    /**
-     * Indicates a {@link Stream} could not be read from, written to or truncated due to some
-     * underlying IO error.
-     */
-    class StreamAccessException extends RuntimeException {
-      public StreamAccessException(String message, Throwable cause) {
-        super(message, cause);
-      }
-    }
-
-    /**
-     * Appends an {@link Entry} to the end of the log stream.
-     *
-     * @param contents the data to store in the appended entry
-     * @return the posiiton of the appended entry
-     * @throws StreamAccessException if contents could not be appended to the stream
-     */
-    Position append(byte[] contents) throws StreamAccessException;
-
-    /**
-     * Allows reading all entries from the log stream.  Implementations may
-     * materialize all entries at once or the may provide some form of streaming to back the
-     * returned entry iterator.  If the implementation does use some form of streaming or batching,
-     * it may throw a
-     * {@code StreamAccessException} on any call to {@link Iterator#hasNext()} or
-     * {@link Iterator#next()}.
-     *
-     * @return an iterator that ranges from the entry from the given {@code position} to the last
-     *     entry in the log.
-     * @throws InvalidPositionException if the specified position does not exist in this log
-     * @throws StreamAccessException if the stream could not be read from
-     */
-    Iterator<Entry> readAll() throws InvalidPositionException, StreamAccessException;
-
-    /**
-     * Removes all log entries preceding the log entry at the given {@code position}.
-     *
-     * @param position the position of the latest entry to remove
-     * @throws InvalidPositionException if the specified position does not exist in this log
-     * @throws StreamAccessException if the stream could not be truncated
-     */
-    void truncateBefore(Position position) throws InvalidPositionException, StreamAccessException;
-  }
-
-  /**
-   * Opens the log stream for reading writing and truncation.  Clients should ensure the stream is
-   * closed when they are done using it.
-   *
-   * @return the log stream
-   * @throws IOException if there was a problem opening the log stream
-   */
-  Stream open() throws IOException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/log/mesos/LogInterface.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/log/mesos/LogInterface.java b/src/main/java/com/twitter/aurora/scheduler/log/mesos/LogInterface.java
deleted file mode 100644
index 9ae4685..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/log/mesos/LogInterface.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.twitter.aurora.scheduler.log.mesos;
-
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import org.apache.mesos.Log;
-import org.apache.mesos.Log.Entry;
-import org.apache.mesos.Log.Position;
-
-/**
- * An interface for {@link Log}, since the mesos Java API doesn't provide one.
- * <p>
- * This is needed because a static initializer that loads a native library, prevents us from
- * mocking the Mesos Log API in tests. These wrapper interfaces and their corresponding
- * implementations that delegate the calls to the underlying Mesos Log objects will help
- * us mock the Log API.
- * <p>
- * TODO(Suman Karumuri): Remove this interface after https://issues.apache.org/jira/browse/MESOS-796
- * is resolved.
- */
-interface LogInterface {
-
-  Position position(byte[] identity);
-
-  interface ReaderInterface {
-    List<Entry> read(Position from, Position to, long timeout, TimeUnit unit)
-        throws TimeoutException, Log.OperationFailedException;
-
-    Position beginning();
-
-    Position ending();
-  }
-
-  interface WriterInterface {
-    Position append(byte[] data, long timeout, TimeUnit unit)
-        throws TimeoutException, Log.WriterFailedException;
-
-    Position truncate(Position to, long timeout, TimeUnit unit)
-        throws TimeoutException, Log.WriterFailedException;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/log/mesos/MesosLog.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/log/mesos/MesosLog.java b/src/main/java/com/twitter/aurora/scheduler/log/mesos/MesosLog.java
deleted file mode 100644
index d625734..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/log/mesos/MesosLog.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.log.mesos;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.inject.Inject;
-import javax.inject.Provider;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.UnmodifiableIterator;
-import com.google.common.primitives.Longs;
-import com.google.inject.BindingAnnotation;
-
-import org.apache.mesos.Log;
-
-import com.twitter.aurora.scheduler.log.mesos.LogInterface.ReaderInterface;
-import com.twitter.aurora.scheduler.log.mesos.LogInterface.WriterInterface;
-import com.twitter.common.base.Function;
-import com.twitter.common.base.MorePreconditions;
-import com.twitter.common.inject.TimedInterceptor.Timed;
-import com.twitter.common.quantity.Amount;
-import com.twitter.common.quantity.Time;
-import com.twitter.common.stats.SlidingStats;
-import com.twitter.common.stats.Stats;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-/**
- * A {@code Log} implementation backed by a true distributed log in mesos core.
- */
-public class MesosLog implements com.twitter.aurora.scheduler.log.Log {
-
-  private static final Logger LOG = Logger.getLogger(MesosLog.class.getName());
-
-  /**
-   * Binding annotation for the opaque value of a log noop entry.
-   */
-  @BindingAnnotation
-  @Retention(RUNTIME)
-  @Target({ PARAMETER, METHOD })
-  public @interface NoopEntry { }
-
-  /**
-   * Binding annotation for log read timeouts.
-   */
-  @BindingAnnotation
-  @Retention(RUNTIME)
-  @Target({ PARAMETER, METHOD })
-  public @interface ReadTimeout { }
-
-  /**
-   * Binding annotation for log write timeouts - used for truncates and appends.
-   */
-  @BindingAnnotation
-  @Retention(RUNTIME)
-  @Target({ PARAMETER, METHOD })
-  public @interface WriteTimeout { }
-
-  private final Provider<LogInterface> logFactory;
-
-  private final Provider<ReaderInterface> readerFactory;
-  private final Amount<Long, Time> readTimeout;
-
-  private final Provider<WriterInterface> writerFactory;
-  private final Amount<Long, Time> writeTimeout;
-
-  private final byte[] noopEntry;
-
-  /**
-   * Creates a new mesos log.
-   *
-   * @param logFactory Factory to provide access to log.
-   * @param readerFactory Factory to provide access to log readers.
-   * @param readTimeout Log read timeout.
-   * @param writerFactory Factory to provide access to log writers.
-   * @param writeTimeout Log write timeout.
-   * @param noopEntry A no-op log entry blob.
-   */
-  @Inject
-  public MesosLog(
-      Provider<LogInterface> logFactory,
-      Provider<ReaderInterface> readerFactory,
-      @ReadTimeout Amount<Long, Time> readTimeout,
-      Provider<WriterInterface> writerFactory,
-      @WriteTimeout Amount<Long, Time> writeTimeout,
-      @NoopEntry byte[] noopEntry) {
-
-    this.logFactory = Preconditions.checkNotNull(logFactory);
-
-    this.readerFactory = Preconditions.checkNotNull(readerFactory);
-    this.readTimeout = readTimeout;
-
-    this.writerFactory = Preconditions.checkNotNull(writerFactory);
-    this.writeTimeout = writeTimeout;
-
-    this.noopEntry = Preconditions.checkNotNull(noopEntry);
-  }
-
-  @Override
-  public Stream open() {
-    return new LogStream(
-        logFactory.get(), readerFactory.get(), readTimeout, writerFactory, writeTimeout, noopEntry);
-  }
-
-  @VisibleForTesting
-  static class LogStream implements com.twitter.aurora.scheduler.log.Log.Stream {
-    @VisibleForTesting
-    static final class OpStats {
-      private final String opName;
-      private final SlidingStats timing;
-      private final AtomicLong timeouts;
-      private final AtomicLong failures;
-
-      OpStats(String opName) {
-        this.opName = MorePreconditions.checkNotBlank(opName);
-        timing = new SlidingStats("scheduler_log_native_" + opName, "nanos");
-        timeouts = exportLongStat("scheduler_log_native_%s_timeouts", opName);
-        failures = exportLongStat("scheduler_log_native_%s_failures", opName);
-      }
-
-      private static AtomicLong exportLongStat(String template, Object... args) {
-        return Stats.exportLong(String.format(template, args));
-      }
-    }
-
-    private static final Function<Log.Entry, LogEntry> MESOS_ENTRY_TO_ENTRY =
-        new Function<Log.Entry, LogEntry>() {
-          @Override public LogEntry apply(Log.Entry entry) {
-            return new LogEntry(entry);
-          }
-        };
-
-    private final OpStats read = new OpStats("read");
-    private final OpStats append = new OpStats("append");
-    private final OpStats truncate = new OpStats("truncate");
-    private final AtomicLong entriesSkipped =
-        Stats.exportLong("scheduler_log_native_native_entries_skipped");
-
-    private final LogInterface log;
-
-    private final ReaderInterface reader;
-    private final long readTimeout;
-    private final TimeUnit readTimeUnit;
-
-    private final Provider<WriterInterface> writerFactory;
-    private final long writeTimeout;
-    private final TimeUnit writeTimeUnit;
-
-    private final byte[] noopEntry;
-
-    private WriterInterface writer;
-
-    LogStream(LogInterface log, ReaderInterface reader, Amount<Long, Time> readTimeout,
-        Provider<WriterInterface> writerFactory, Amount<Long, Time> writeTimeout,
-        byte[] noopEntry) {
-
-      this.log = log;
-
-      this.reader = reader;
-      this.readTimeout = readTimeout.getValue();
-      this.readTimeUnit = readTimeout.getUnit().getTimeUnit();
-
-      this.writerFactory = writerFactory;
-      this.writeTimeout = writeTimeout.getValue();
-      this.writeTimeUnit = writeTimeout.getUnit().getTimeUnit();
-
-      this.noopEntry = noopEntry;
-    }
-
-    @Override
-    public Iterator<Entry> readAll() throws StreamAccessException {
-      // TODO(John Sirois): Currently we must be the coordinator to ensure we get the 'full read'
-      // of log entries expected by the users of the com.twitter.aurora.scheduler.log.Log interface.
-      // Switch to another method of ensuring this when it becomes available in mesos' log
-      // interface.
-      try {
-        append(noopEntry);
-      } catch (StreamAccessException e) {
-        throw new StreamAccessException("Error writing noop prior to a read", e);
-      }
-
-      final Log.Position from = reader.beginning();
-      final Log.Position to = end().unwrap();
-
-      // Reading all the entries at once may cause large garbage collections. Instead, we
-      // lazily read the entries one by one as they are requested.
-      // TODO(Benjamin Hindman): Eventually replace this functionality with functionality
-      // from the Mesos Log.
-      return new UnmodifiableIterator<Entry>() {
-        private long position = Longs.fromByteArray(from.identity());
-        private final long endPosition = Longs.fromByteArray(to.identity());
-        private Entry entry = null;
-
-        @Override
-        public boolean hasNext() {
-          if (entry != null) {
-            return true;
-          }
-
-          while (position <= endPosition) {
-            long start = System.nanoTime();
-            try {
-              Log.Position p = log.position(Longs.toByteArray(position));
-              if (LOG.isLoggable(Level.FINE)) {
-                LOG.fine("Reading position " + position + " from the log");
-              }
-              List<Log.Entry> entries = reader.read(p, p, readTimeout, readTimeUnit);
-
-              // N.B. HACK! There is currently no way to "increment" a position. Until the Mesos
-              // Log actually provides a way to "stream" the log, we approximate as much by
-              // using longs via Log.Position.identity and Log.position.
-              position++;
-
-              // Reading positions in this way means it's possible that we get an "invalid" entry
-              // (e.g., in the underlying log terminology this would be anything but an append)
-              // which will be removed from the returned entries resulting in an empty list.
-              // We skip these.
-              if (entries.isEmpty()) {
-                entriesSkipped.getAndIncrement();
-              } else {
-                entry = MESOS_ENTRY_TO_ENTRY.apply(Iterables.getOnlyElement(entries));
-                return true;
-              }
-            } catch (TimeoutException e) {
-              read.timeouts.getAndIncrement();
-              throw new StreamAccessException("Timeout reading from log.", e);
-            } catch (Log.OperationFailedException e) {
-              read.failures.getAndIncrement();
-              throw new StreamAccessException("Problem reading from log", e);
-            } finally {
-              read.timing.accumulate(System.nanoTime() - start);
-            }
-          }
-          return false;
-        }
-
-        @Override
-        public Entry next() {
-          if (entry == null && !hasNext()) {
-            throw new NoSuchElementException();
-          }
-
-          Entry result = Preconditions.checkNotNull(entry);
-          entry = null;
-          return result;
-        }
-      };
-    }
-
-    @Override
-    public LogPosition append(final byte[] contents) throws StreamAccessException {
-      Preconditions.checkNotNull(contents);
-
-      Log.Position position = mutate(append, new Mutation<Log.Position>() {
-        @Override public Log.Position apply(WriterInterface logWriter)
-            throws TimeoutException, Log.WriterFailedException {
-          return logWriter.append(contents, writeTimeout, writeTimeUnit);
-        }
-      });
-      return LogPosition.wrap(position);
-    }
-
-    @Timed("scheduler_log_native_truncate_before")
-    @Override
-    public void truncateBefore(com.twitter.aurora.scheduler.log.Log.Position position)
-        throws StreamAccessException {
-
-      Preconditions.checkArgument(position instanceof LogPosition);
-
-      final Log.Position before = ((LogPosition) position).unwrap();
-      mutate(truncate, new Mutation<Void>() {
-        @Override public Void apply(WriterInterface logWriter)
-            throws TimeoutException, Log.WriterFailedException {
-          logWriter.truncate(before, writeTimeout, writeTimeUnit);
-          return null;
-        }
-      });
-    }
-
-    @VisibleForTesting
-    interface Mutation<T> {
-      T apply(WriterInterface writer) throws TimeoutException, Log.WriterFailedException;
-    }
-
-    @VisibleForTesting
-    synchronized <T> T mutate(OpStats stats, Mutation<T> mutation) {
-      long start = System.nanoTime();
-      if (writer == null) {
-        writer = writerFactory.get();
-      }
-      try {
-        return mutation.apply(writer);
-      } catch (TimeoutException e) {
-        stats.timeouts.getAndIncrement();
-        throw new StreamAccessException("Timeout performing log " + stats.opName, e);
-      } catch (Log.WriterFailedException e) {
-        stats.failures.getAndIncrement();
-
-        // We must throw away a writer on any write failure - this could be because of a coordinator
-        // election in which case we must trigger a new election.
-        writer = null;
-
-        throw new StreamAccessException("Problem performing log" + stats.opName, e);
-      } finally {
-        stats.timing.accumulate(System.nanoTime() - start);
-      }
-    }
-
-    private LogPosition end() {
-      return LogPosition.wrap(reader.ending());
-    }
-
-    @Override
-    public void close() {
-      // noop
-    }
-
-    private static class LogPosition implements com.twitter.aurora.scheduler.log.Log.Position {
-      private final Log.Position underlying;
-
-      LogPosition(Log.Position underlying) {
-        this.underlying = underlying;
-      }
-
-      static LogPosition wrap(Log.Position position) {
-        return new LogPosition(position);
-      }
-
-      Log.Position unwrap() {
-        return underlying;
-      }
-
-      @Override public int compareTo(Position o) {
-        Preconditions.checkArgument(o instanceof LogPosition);
-        return underlying.compareTo(((LogPosition) o).underlying);
-      }
-    }
-
-    private static class LogEntry implements com.twitter.aurora.scheduler.log.Log.Entry {
-      private final Log.Entry underlying;
-
-      public LogEntry(Log.Entry entry) {
-        this.underlying = entry;
-      }
-
-      @Override
-      public byte[] contents() {
-        return underlying.data;
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/log/mesos/MesosLogStreamModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/log/mesos/MesosLogStreamModule.java b/src/main/java/com/twitter/aurora/scheduler/log/mesos/MesosLogStreamModule.java
deleted file mode 100644
index 7063cb7..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/log/mesos/MesosLogStreamModule.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.log.mesos;
-
-import java.io.File;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import javax.inject.Singleton;
-
-import com.google.common.base.Joiner;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Iterables;
-import com.google.inject.PrivateModule;
-import com.google.inject.Provides;
-import com.google.inject.TypeLiteral;
-
-import org.apache.mesos.Log;
-import org.apache.zookeeper.common.PathUtils;
-
-import com.twitter.aurora.codec.ThriftBinaryCodec;
-import com.twitter.aurora.gen.storage.LogEntry;
-import com.twitter.aurora.scheduler.log.mesos.LogInterface.ReaderInterface;
-import com.twitter.aurora.scheduler.log.mesos.LogInterface.WriterInterface;
-import com.twitter.common.args.Arg;
-import com.twitter.common.args.CmdLine;
-import com.twitter.common.net.InetSocketAddressHelper;
-import com.twitter.common.quantity.Amount;
-import com.twitter.common.quantity.Time;
-import com.twitter.common.zookeeper.guice.client.ZooKeeperClientModule.ClientConfig;
-
-/**
- * Binds a native mesos Log implementation.
- *
- * <p>Exports the following bindings:
- * <ul>
- *   <li>{@link Log} - a log backed by the mesos native distributed log</li>
- * </ul>
- */
-public class MesosLogStreamModule extends PrivateModule {
-  @CmdLine(name = "native_log_quorum_size",
-           help = "The size of the quorum required for all log mutations.")
-  private static final Arg<Integer> QUORUM_SIZE = Arg.create(1);
-
-  @CmdLine(name = "native_log_file_path",
-           help = "Path to a file to store the native log data in.  If the parent directory does"
-               + "not exist it will be created.")
-  private static final Arg<File> LOG_PATH = Arg.create(null);
-
-  @CmdLine(name = "native_log_zk_group_path",
-           help = "A zookeeper node for use by the native log to track the master coordinator.")
-  private static final Arg<String> ZK_LOG_GROUP_PATH = Arg.create(null);
-
-  /*
-   * This timeout includes the time to get a quorum to promise leadership to the coordinator and
-   * the time to fill any holes in the coordinator's log.
-   */
-  @CmdLine(name = "native_log_election_timeout",
-           help = "The timeout for a single attempt to obtain a new log writer.")
-  private static final Arg<Amount<Long, Time>> COORDINATOR_ELECTION_TIMEOUT =
-      Arg.create(Amount.of(15L, Time.SECONDS));
-
-  /*
-   * Normally retries would not be expected to help much - however in the small replica set where
-   * a few down replicas doom a coordinator election attempt, retrying effectively gives us a wider
-   * window in which to await a live quorum before giving up and thrashing the global election
-   * process.  Observed log replica recovery times as of 4/6/2012 can be ~45 seconds so giving a
-   * window >= 2x this should support 1-round election events (that possibly use several retries in
-   * the single round).
-   */
-  @CmdLine(name = "native_log_election_retries",
-           help = "The maximum number of attempts to obtain a new log writer.")
-  private static final Arg<Integer> COORDINATOR_ELECTION_RETRIES = Arg.create(20);
-
-  @CmdLine(name = "native_log_read_timeout",
-           help = "The timeout for doing log reads.")
-  private static final Arg<Amount<Long, Time>> READ_TIMEOUT =
-      Arg.create(Amount.of(5L, Time.SECONDS));
-
-  @CmdLine(name = "native_log_write_timeout",
-           help = "The timeout for doing log appends and truncations.")
-  private static final Arg<Amount<Long, Time>> WRITE_TIMEOUT =
-      Arg.create(Amount.of(3L, Time.SECONDS));
-
-  private final ClientConfig zkClientConfig;
-
-  public MesosLogStreamModule(ClientConfig zkClientConfig) {
-    this.zkClientConfig = Preconditions.checkNotNull(zkClientConfig);
-  }
-
-  @Override
-  protected void configure() {
-    bind(new TypeLiteral<Amount<Long, Time>>() { }).annotatedWith(MesosLog.ReadTimeout.class)
-        .toInstance(READ_TIMEOUT.get());
-    bind(new TypeLiteral<Amount<Long, Time>>() { }).annotatedWith(MesosLog.WriteTimeout.class)
-        .toInstance(WRITE_TIMEOUT.get());
-
-    bind(com.twitter.aurora.scheduler.log.Log.class).to(MesosLog.class);
-    bind(MesosLog.class).in(Singleton.class);
-    expose(com.twitter.aurora.scheduler.log.Log.class);
-  }
-
-  @Provides
-  @Singleton
-  Log provideLog() {
-    File logPath = LOG_PATH.get();
-    File parentDir = logPath.getParentFile();
-    if (!parentDir.exists() && !parentDir.mkdirs()) {
-      addError("Failed to create parent directory to store native log at: %s", parentDir);
-    }
-
-    String zkConnectString = Joiner.on(',').join(
-        Iterables.transform(zkClientConfig.servers, InetSocketAddressHelper.INET_TO_STR));
-
-    PathUtils.validatePath(ZK_LOG_GROUP_PATH.get());
-    return new Log(
-        QUORUM_SIZE.get(),
-        logPath.getAbsolutePath(),
-        zkConnectString,
-        zkClientConfig.sessionTimeout.getValue(),
-        zkClientConfig.sessionTimeout.getUnit().getTimeUnit(),
-        ZK_LOG_GROUP_PATH.get(),
-        zkClientConfig.credentials.scheme(),
-        zkClientConfig.credentials.authToken());
-  }
-
-  @Provides
-  Log.Reader provideReader(Log log) {
-    return new Log.Reader(log);
-  }
-
-  @Provides
-  Log.Writer provideWriter(Log log) {
-    Amount<Long, Time> electionTimeout = COORDINATOR_ELECTION_TIMEOUT.get();
-    return new Log.Writer(log, electionTimeout.getValue(), electionTimeout.getUnit().getTimeUnit(),
-        COORDINATOR_ELECTION_RETRIES.get());
-  }
-
-  @Provides
-  LogInterface provideLogInterface(final Log log) {
-    return new LogInterface() {
-      @Override public Log.Position position(byte[] identity) {
-        return log.position(identity);
-      }
-    };
-  }
-
-  @Provides
-  ReaderInterface provideReaderInterface(final Log.Reader reader) {
-    return new ReaderInterface() {
-      @Override
-      public List<Log.Entry> read(Log.Position from, Log.Position to, long timeout, TimeUnit unit)
-          throws TimeoutException, Log.OperationFailedException {
-
-        return reader.read(from, to, timeout, unit);
-      }
-
-      @Override public Log.Position beginning() {
-        return reader.beginning();
-      }
-
-      @Override public Log.Position ending() {
-        return reader.ending();
-      }
-    };
-  }
-
-  @Provides
-  WriterInterface provideWriterInterface(final Log.Writer writer) {
-    return new WriterInterface() {
-      @Override public Log.Position append(byte[] data, long timeout, TimeUnit unit)
-          throws TimeoutException, Log.WriterFailedException {
-        return writer.append(data, timeout, unit);
-      }
-
-      @Override public Log.Position truncate(Log.Position to, long timeout, TimeUnit unit)
-          throws TimeoutException, Log.WriterFailedException {
-        return writer.truncate(to, timeout, unit);
-      }
-    };
-  }
-
-  @Provides
-  @Singleton
-  @MesosLog.NoopEntry
-  byte[] provideNoopEntry() throws ThriftBinaryCodec.CodingException {
-    return ThriftBinaryCodec.encodeNonNull(LogEntry.noop(true));
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/log/testing/FileLog.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/log/testing/FileLog.java b/src/main/java/com/twitter/aurora/scheduler/log/testing/FileLog.java
deleted file mode 100644
index 3dff4cf..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/log/testing/FileLog.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.log.testing;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.util.Iterator;
-
-import javax.inject.Inject;
-
-import com.google.common.base.Function;
-import com.google.common.base.Functions;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
-import com.google.common.base.Throwables;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Ordering;
-import com.google.common.io.Files;
-import com.google.common.primitives.Longs;
-
-import com.twitter.aurora.codec.ThriftBinaryCodec;
-import com.twitter.aurora.codec.ThriftBinaryCodec.CodingException;
-import com.twitter.aurora.gen.test.FileLogContents;
-import com.twitter.aurora.gen.test.LogRecord;
-import com.twitter.aurora.scheduler.log.Log;
-import com.twitter.common.base.Closure;
-
-/**
- * A log implementation that reads from and writes to a local file.
- * <p>
- * This should never be used in a production setting, it is only intended for local testing.
- * TODO(wfarner): Bind/inject a settable flag that indicates we are running with test settings.
- * Surface this in a banner on the web UI.
- */
-class FileLog implements Log {
-
-  private final File logFile;
-
-  @Inject
-  FileLog(File logFile) {
-    this.logFile = Preconditions.checkNotNull(logFile);
-  }
-
-  @Override
-  public Stream open() throws IOException {
-    try {
-      FileLogContents logContents;
-      // Treat an empty file as a new file.
-      // NOTE: we can't use logFile.length == 0 to test for an empty file, since empty unicode files
-      // contain a byte order mark (BOM) header that is 255 bytes in length.
-      if (logFile.createNewFile()
-          || Files.readFirstLine(logFile, Charset.defaultCharset()) == null) {
-        logContents = new FileLogContents(Maps.<Long, LogRecord>newHashMap());
-      } else {
-        logContents = ThriftBinaryCodec.decode(FileLogContents.class, Files.toByteArray(logFile));
-      }
-      Closure<FileLogContents> logWriter = new Closure<FileLogContents>() {
-        @Override public void execute(FileLogContents logContents) {
-          try {
-            Files.write(ThriftBinaryCodec.encode(logContents), logFile);
-          } catch (IOException | CodingException e) {
-            throw Throwables.propagate(e);
-          }
-        }
-      };
-      return new FileStream(logContents, logWriter);
-    } catch (CodingException e) {
-      throw new IOException("Failed to interpret log contents: " + e, e);
-    }
-  }
-
-  private static class FileStream implements Stream {
-    private final FileLogContents logContents;
-    private final Closure<FileLogContents> logWriter;
-    private long nextPosition;
-
-    FileStream(FileLogContents logContents, Closure<FileLogContents> logWriter) {
-      this.logContents = logContents;
-      this.logWriter = logWriter;
-      nextPosition = logContents.getRecords().isEmpty()
-          ? 1
-          : Ordering.natural().max(logContents.getRecords().keySet()) + 1;
-    }
-
-    @Override
-    public Position append(byte[] contents) throws StreamAccessException {
-      logContents.getRecords().put(nextPosition, new LogRecord(ByteBuffer.wrap(contents)));
-      Position position = new CounterPosition(nextPosition);
-      logWriter.execute(logContents);
-      nextPosition++;
-      return position;
-    }
-
-    private static final Function<LogRecord, Entry> TO_ENTRY = new Function<LogRecord, Entry>() {
-      @Override public Entry apply(final LogRecord record) {
-        return new Entry() {
-          @Override public byte[] contents() {
-            return record.getContents();
-          }
-        };
-      }
-    };
-
-    @Override
-    public Iterator<Entry> readAll() throws InvalidPositionException, StreamAccessException {
-      return FluentIterable.from(Ordering.natural().sortedCopy(logContents.getRecords().keySet()))
-          .transform(Functions.forMap(logContents.getRecords()))
-          .transform(TO_ENTRY)
-          .iterator();
-    }
-
-    @Override
-    public void truncateBefore(Position position)
-        throws InvalidPositionException, StreamAccessException {
-
-      if (!(position instanceof CounterPosition)) {
-        throw new InvalidPositionException("Unrecognized position " + position);
-      }
-
-      final long truncateBefore = ((CounterPosition) position).value;
-      Iterables.removeIf(logContents.getRecords().keySet(), new Predicate<Long>() {
-        @Override public boolean apply(Long recordPosition) {
-          return recordPosition < truncateBefore;
-        }
-      });
-      logWriter.execute(logContents);
-    }
-
-    @Override
-    public void close() throws IOException {
-      // No-op.
-    }
-
-    private static class CounterPosition implements Position {
-      private final long value;
-
-      CounterPosition(long value) {
-        this.value = value;
-      }
-
-      @Override
-      public int compareTo(Position position) {
-        return Longs.compare(value, ((CounterPosition) position).value);
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/log/testing/FileLogStreamModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/log/testing/FileLogStreamModule.java b/src/main/java/com/twitter/aurora/scheduler/log/testing/FileLogStreamModule.java
deleted file mode 100644
index 5ef3e8e..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/log/testing/FileLogStreamModule.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.log.testing;
-
-import java.io.File;
-
-import javax.inject.Singleton;
-
-import com.google.common.base.Preconditions;
-import com.google.inject.PrivateModule;
-
-import com.twitter.aurora.scheduler.log.Log;
-import com.twitter.common.args.Arg;
-import com.twitter.common.args.CmdLine;
-
-/**
- * Binding module that uses a local log file, intended for testing.
- */
-public class FileLogStreamModule extends PrivateModule {
-
-  // TODO(William Farner): Make this a required argument and ensure it is not included in production
-  //                       builds (MESOS-471).
-  //@NotNull
-  @CmdLine(name = "testing_log_file_path", help = "Path to a file to store local log file data in.")
-  private static final Arg<File> LOG_PATH = Arg.create(null);
-
-  @Override
-  protected void configure() {
-    Preconditions.checkNotNull(LOG_PATH.get());
-    bind(File.class).toInstance(LOG_PATH.get());
-    bind(Log.class).to(FileLog.class);
-    bind(FileLog.class).in(Singleton.class);
-    expose(Log.class);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/metadata/MetadataModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/metadata/MetadataModule.java b/src/main/java/com/twitter/aurora/scheduler/metadata/MetadataModule.java
deleted file mode 100644
index 08377ae..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/metadata/MetadataModule.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.metadata;
-
-import javax.inject.Singleton;
-
-import com.google.inject.AbstractModule;
-
-import com.twitter.aurora.scheduler.events.PubsubEventModule;
-
-/**
- * Binding module for scheduler metadata management.
- */
-public class MetadataModule extends AbstractModule {
-
-  @Override
-  protected void configure() {
-    bind(NearestFit.class).in(Singleton.class);
-    PubsubEventModule.bindSubscriber(binder(), NearestFit.class);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/bc1635df/src/main/java/com/twitter/aurora/scheduler/metadata/NearestFit.java
----------------------------------------------------------------------
diff --git a/src/main/java/com/twitter/aurora/scheduler/metadata/NearestFit.java b/src/main/java/com/twitter/aurora/scheduler/metadata/NearestFit.java
deleted file mode 100644
index 47c1f5c..0000000
--- a/src/main/java/com/twitter/aurora/scheduler/metadata/NearestFit.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed 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 com.twitter.aurora.scheduler.metadata;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
-import com.google.common.base.Ticker;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-import com.google.common.eventbus.Subscribe;
-
-import com.twitter.aurora.gen.ScheduleStatus;
-import com.twitter.aurora.scheduler.base.Tasks;
-import com.twitter.aurora.scheduler.events.PubsubEvent.EventSubscriber;
-import com.twitter.aurora.scheduler.events.PubsubEvent.TaskStateChange;
-import com.twitter.aurora.scheduler.events.PubsubEvent.TasksDeleted;
-import com.twitter.aurora.scheduler.events.PubsubEvent.Vetoed;
-import com.twitter.aurora.scheduler.filter.SchedulingFilter.Veto;
-import com.twitter.common.quantity.Amount;
-import com.twitter.common.quantity.Time;
-
-/**
- * Tracks vetoes against scheduling decisions and maintains the closest fit among all the vetoes
- * for a task.
- */
-public class NearestFit implements EventSubscriber {
-  @VisibleForTesting
-  static final Amount<Long, Time> EXPIRATION = Amount.of(10L, Time.MINUTES);
-
-  @VisibleForTesting
-  static final ImmutableSet<Veto> NO_VETO = ImmutableSet.of();
-
-  private final LoadingCache<String, Fit> fitByTask;
-
-  @VisibleForTesting
-  NearestFit(Ticker ticker) {
-    fitByTask = CacheBuilder.newBuilder()
-        .expireAfterWrite(EXPIRATION.getValue(), EXPIRATION.getUnit().getTimeUnit())
-        .ticker(ticker)
-        .build(new CacheLoader<String, Fit>() {
-          @Override public Fit load(String taskId) {
-            return new Fit();
-          }
-        });
-  }
-
-  @Inject
-  NearestFit() {
-    this(Ticker.systemTicker());
-  }
-
-  /**
-   * Gets the vetoes that represent the nearest fit for the given task.
-   *
-   * @param taskId The task to look up.
-   * @return The nearest fit vetoes for the given task.  This will return an empty set if
-   *         no vetoes have been recorded for the task.
-   */
-  public synchronized ImmutableSet<Veto> getNearestFit(String taskId) {
-    Fit fit = fitByTask.getIfPresent(taskId);
-    return (fit == null) ? NO_VETO : fit.vetoes;
-  }
-
-  /**
-   * Records a task deletion event.
-   *
-   * @param deletedEvent Task deleted event.
-   */
-  @Subscribe
-  public synchronized void remove(TasksDeleted deletedEvent) {
-    fitByTask.invalidateAll(Tasks.ids(deletedEvent.getTasks()));
-  }
-
-  /**
-   * Records a task state change event.
-   * This will ignore any events where the previous state is not {@link ScheduleStatus#PENDING}.
-   *
-   * @param stateChangeEvent Task state change.
-   */
-  @Subscribe
-  public synchronized void stateChanged(TaskStateChange stateChangeEvent) {
-    if (stateChangeEvent.getOldState() == ScheduleStatus.PENDING) {
-      fitByTask.invalidate(stateChangeEvent.getTaskId());
-    }
-  }
-
-  private static final Predicate<Veto> IS_CONSTRAINT_MISMATCH = new Predicate<Veto>() {
-    @Override public boolean apply(Veto veto) {
-      return veto.isConstraintMismatch();
-    }
-  };
-
-  /**
-   * Records a task veto event.
-   * This will ignore any veto events where any veto returns {@code true} from
-   * {@link Veto#isConstraintMismatch()}.
-   *
-   * @param vetoEvent Veto event.
-   */
-  @Subscribe
-  public synchronized void vetoed(Vetoed vetoEvent) {
-    Preconditions.checkNotNull(vetoEvent);
-    fitByTask.getUnchecked(vetoEvent.getTaskId()).maybeUpdate(vetoEvent.getVetoes());
-  }
-
-  private static class Fit {
-    private ImmutableSet<Veto> vetoes;
-
-    private static int score(Iterable<Veto> vetoes) {
-      int total = 0;
-      for (Veto veto : vetoes) {
-        total += veto.getScore();
-      }
-      return total;
-    }
-
-    private void update(Iterable<Veto> newVetoes) {
-      vetoes = ImmutableSet.copyOf(newVetoes);
-    }
-
-    /**
-     * Updates the nearest fit if the provided vetoes represents a closer fit than the current
-     * best fit.
-     * <p>
-     * There are two classes of vetoes: those with and without constraint mismatches. A set of
-     * vetoes without a constraint mismatch is always a better fit than a set with constraint
-     * mismatches.
-     * <p>
-     * If two sets are equivalent in that they do or do not have constraint mismatches, they are
-     * compared by the following criteria:
-     * <ul>
-     *   <li> the one with fewer vetoes is a better fit, irrespective of scores
-     *   <li> if the veto count is equal, the one with the smaller aggregate score is a better fit
-     * </ul>
-     *
-     * @param newVetoes The vetoes for the scheduling assignment with {@code newHost}.
-     */
-    void maybeUpdate(Set<Veto> newVetoes) {
-      if (vetoes == null) {
-        update(newVetoes);
-        return;
-      }
-
-      boolean valueMismatchOld = Iterables.any(vetoes, IS_CONSTRAINT_MISMATCH);
-      boolean valueMismatchNew = Iterables.any(newVetoes, IS_CONSTRAINT_MISMATCH);
-      if (valueMismatchOld == valueMismatchNew) {
-        if (newVetoes.size() < vetoes.size()) {
-          update(newVetoes);
-        } else if ((newVetoes.size() == vetoes.size()) && (score(newVetoes) < score(vetoes))) {
-          update(newVetoes);
-        }
-      } else if (valueMismatchOld) {
-        update(newVetoes);
-      }
-    }
-  }
-}


Mime
View raw message