accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [22/54] [abbrv] accumulo git commit: ACCUMULO-2181/3005 Porting Monitor
Date Thu, 06 Jul 2017 20:43:16 GMT
http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/xml/XMLInformation.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/xml/XMLInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/xml/XMLInformation.java
new file mode 100644
index 0000000..12730b8
--- /dev/null
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/xml/XMLInformation.java
@@ -0,0 +1,115 @@
+/*
+ * 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.accumulo.monitor.rest.api.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.accumulo.monitor.rest.api.log.DeadLoggerList;
+import org.apache.accumulo.monitor.rest.api.master.MasterInformation;
+import org.apache.accumulo.monitor.rest.api.table.TableInformation;
+import org.apache.accumulo.monitor.rest.api.table.TableInformationList;
+import org.apache.accumulo.monitor.rest.api.table.TableNamespace;
+import org.apache.accumulo.monitor.rest.api.table.TablesList;
+import org.apache.accumulo.monitor.rest.api.tserver.BadTabletServers;
+import org.apache.accumulo.monitor.rest.api.tserver.DeadServerList;
+import org.apache.accumulo.monitor.rest.api.tserver.ServersShuttingDown;
+import org.apache.accumulo.monitor.rest.api.tserver.TabletServer;
+
+/**
+ *
+ * Generate XML summary of Monitor
+ *
+ * @since 2.0.0
+ *
+ */
+@XmlRootElement(name = "stats")
+public class XMLInformation {
+
+  // Variable names become JSON keys
+  public List<TabletServer> servers;
+
+  public String masterGoalState, masterState;
+
+  public BadTabletServers badTabletServers;
+  public ServersShuttingDown tabletServersShuttingDown;
+  public Integer unassignedTablets;
+  public DeadServerList deadTabletServers;
+
+  public DeadLoggerList deadLoggers;
+
+  public TableInformationList tables;
+
+  public Totals totals;
+
+  public XMLInformation() {
+    servers = new ArrayList<>();
+  }
+
+  /**
+   * Stores Monitor information as XML
+   *
+   * @param size
+   *          Number of tservers
+   * @param info
+   *          Master information
+   * @param tablesList
+   *          Table list
+   */
+  public XMLInformation(int size, MasterInformation info, TablesList tablesList) {
+    this.servers = new ArrayList<>(size);
+
+    this.masterGoalState = info.masterGoalState;
+    this.masterState = info.masterState;
+
+    this.badTabletServers = info.badTabletServers;
+    this.tabletServersShuttingDown = info.tabletServersShuttingDown;
+    this.unassignedTablets = info.unassignedTablets;
+    this.deadTabletServers = info.deadTabletServers;
+    this.deadLoggers = info.deadLoggers;
+
+    getTableInformationList(tablesList.tables);
+
+    this.totals = new Totals(info.ingestrate, info.queryrate, info.numentries);
+  }
+
+  /**
+   * Adds a new tablet to the XML
+   *
+   * @param tablet
+   *          Tablet to add
+   */
+  public void addTablet(TabletServer tablet) {
+    servers.add(tablet);
+  }
+
+  /**
+   * For backwards compatibility, gets all the tables without namespace information
+   */
+  private void getTableInformationList(List<TableNamespace> namespaces) {
+
+    this.tables = new TableInformationList();
+
+    for (TableNamespace namespace : namespaces) {
+      for (TableInformation info : namespace.table) {
+        tables.addTable(info);
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/xml/XMLResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/xml/XMLResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/xml/XMLResource.java
new file mode 100644
index 0000000..38f3e08
--- /dev/null
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/xml/XMLResource.java
@@ -0,0 +1,67 @@
+/*
+ * 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.accumulo.monitor.rest.api.xml;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response.Status;
+
+import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
+import org.apache.accumulo.core.master.thrift.TabletServerStatus;
+import org.apache.accumulo.monitor.Monitor;
+import org.apache.accumulo.monitor.rest.api.master.MasterResource;
+import org.apache.accumulo.monitor.rest.api.table.TablesResource;
+import org.apache.accumulo.monitor.rest.api.tserver.TabletServer;
+
+/**
+ *
+ * Responsible for generating an XML summary of the Monitor
+ *
+ * @since 2.0.0
+ *
+ */
+@Path("/xml")
+public class XMLResource {
+
+  /**
+   * Generates an XML summary of the Monitor
+   *
+   * @return XML summary
+   */
+  @GET
+  @Produces(MediaType.APPLICATION_XML)
+  public XMLInformation getXMLInformation() {
+
+    MasterMonitorInfo mmi = Monitor.getMmi();
+    if (null == mmi) {
+      throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
+    }
+
+    // Add Monitor information
+    XMLInformation xml = new XMLInformation(mmi.tServerInfo.size(), new MasterResource().getTables(), new TablesResource().getTables());
+
+    // Add tserver information
+    for (TabletServerStatus status : mmi.tServerInfo) {
+      xml.addTablet(new TabletServer(status));
+    }
+
+    return xml;
+  }
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZKInformation.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZKInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZKInformation.java
new file mode 100644
index 0000000..78f877d
--- /dev/null
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZKInformation.java
@@ -0,0 +1,50 @@
+/*
+ * 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.accumulo.monitor.rest.api.zookeeper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ * Generates a list of Zookeeper server information
+ *
+ * @since 2.0.0
+ *
+ */
+public class ZKInformation {
+
+  // Variable names become JSON keys
+  public List<ZooKeeper> zkServers;
+
+  /**
+   * Initializes zk servers list
+   */
+  public ZKInformation() {
+    zkServers = new ArrayList<>();
+  }
+
+  /**
+   * Adds a new zk server to the list
+   *
+   * @param server
+   *          ZK server to add
+   */
+  public void addZK(ZooKeeper server) {
+    zkServers.add(server);
+  }
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZooKeeper.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZooKeeper.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZooKeeper.java
new file mode 100644
index 0000000..0a9df0c
--- /dev/null
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZooKeeper.java
@@ -0,0 +1,49 @@
+/*
+ * 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.accumulo.monitor.rest.api.zookeeper;
+
+/**
+ *
+ * Generates a new zookeeper information as a JSON object
+ *
+ * @since 2.0.0
+ *
+ */
+public class ZooKeeper {
+
+  // Variable names become JSON keys
+  public String server, mode;
+  public Integer clients;
+
+  public ZooKeeper() {}
+
+  /**
+   * Stores Zookeeper information
+   *
+   * @param server
+   *          Location of the ZK
+   * @param mode
+   *          ZK mode
+   * @param clients
+   *          Number of clients per ZK
+   */
+  public ZooKeeper(String server, String mode, Integer clients) {
+    this.server = server;
+    this.mode = mode;
+    this.clients = clients;
+  }
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZookeeperResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZookeeperResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZookeeperResource.java
new file mode 100644
index 0000000..3b40d78
--- /dev/null
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/zookeeper/ZookeeperResource.java
@@ -0,0 +1,52 @@
+/*
+ * 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.accumulo.monitor.rest.api.zookeeper;
+
+import javax.ws.rs.GET;
+
+import org.apache.accumulo.monitor.ZooKeeperStatus;
+import org.apache.accumulo.monitor.ZooKeeperStatus.ZooKeeperState;
+import org.apache.accumulo.monitor.rest.api.BasicResource;
+
+/**
+ *
+ * Generates a new ZooKeeper information as a JSON object
+ *
+ * @since 2.0.0
+ *
+ */
+public class ZookeeperResource extends BasicResource {
+
+  /**
+   * Generates a list of zookeeper information
+   *
+   * @return Zookeeper information
+   */
+  @GET
+  public ZKInformation getZKInformation() {
+
+    ZKInformation zk = new ZKInformation();
+
+    // Adds new zk to the list
+    for (ZooKeeperState k : ZooKeeperStatus.getZooKeeperStatus()) {
+      if (k.clients >= 0) {
+        zk.addZK(new ZooKeeper(k.keeper, k.mode, k.clients));
+      }
+    }
+    return zk;
+  }
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/BasicResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/BasicResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/BasicResource.java
deleted file mode 100644
index 1abc71d..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/BasicResource.java
+++ /dev/null
@@ -1,98 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-@Path("/rest")
-@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-public class BasicResource {
-
-  @Path("/master")
-  public MasterResource getMasterResource() {
-
-    return new MasterResource();
-  }
-
-  @Path("/bulkImports")
-  public BulkImportResource getBulkImportResource() {
-
-    return new BulkImportResource();
-  }
-
-  @Path("/gc")
-  public GarbageCollectorResource getGarbageCollectorResource() {
-
-    return new GarbageCollectorResource();
-  }
-
-  @Path("/logs")
-  public LogResource getLogResource() {
-
-    return new LogResource();
-  }
-
-  @Path("/problems")
-  public ProblemsResource getProblemsResource() {
-
-    return new ProblemsResource();
-  }
-
-  @Path("/replication")
-  public ReplicationResource getReplicationResource() {
-
-    return new ReplicationResource();
-  }
-
-  @Path("/scans")
-  public ScansResource getScansResource() {
-
-    return new ScansResource();
-  }
-
-  @Path("/statistics")
-  public StatisticsResource getStatisticsResource() {
-
-    return new StatisticsResource();
-  }
-
-  @Path("/tables")
-  public TablesResource getTablesResource() {
-
-    return new TablesResource();
-  }
-
-  @Path("/{parameter: tservers|json}")
-  public TabletServerResource getTabletServerResource() {
-
-    return new TabletServerResource();
-  }
-
-  @Path("/trace")
-  public TracesResource getTracesResource() {
-
-    return new TracesResource();
-  }
-
-  @Path("/zk")
-  public ZookeeperResource getZookeeperResource() {
-
-    return new ZookeeperResource();
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/BulkImportResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/BulkImportResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/BulkImportResource.java
deleted file mode 100644
index 7958600..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/BulkImportResource.java
+++ /dev/null
@@ -1,64 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import java.util.List;
-
-import javax.ws.rs.GET;
-
-import org.apache.accumulo.core.master.thrift.BulkImportStatus;
-import org.apache.accumulo.core.master.thrift.TabletServerStatus;
-import org.apache.accumulo.monitor.Monitor;
-import org.apache.accumulo.monitor.rest.api.BulkImport;
-import org.apache.accumulo.monitor.rest.api.BulkImportInformation;
-import org.apache.accumulo.monitor.rest.api.TabletServerBulkImportInformation;
-
-public class BulkImportResource extends BasicResource {
-
-  @GET
-  public BulkImport getTables() {
-
-    BulkImport bulkImport = new BulkImport();
-
-    for (BulkImportStatus bulk : Monitor.getMmi().bulkImports) {
-      bulkImport.addBulkImport(new BulkImportInformation(bulk.filename, bulk.startTime, bulk.state));
-    }
-
-    for (TabletServerStatus tserverInfo : Monitor.getMmi().getTServerInfo()) {
-
-      int size = 0;
-      long oldest = 0L;
-
-      List<BulkImportStatus> stats = tserverInfo.bulkImports;
-      if (stats != null) {
-        size = stats.size();
-        oldest = Long.MAX_VALUE;
-        for (BulkImportStatus bulk : stats) {
-          oldest = Math.min(oldest, bulk.startTime);
-        }
-        if (oldest == Long.MAX_VALUE) {
-          oldest = 0L;
-        }
-      }
-
-      bulkImport.addTabletServerBulkImport(new TabletServerBulkImportInformation(tserverInfo, size, oldest));
-
-    }
-
-    return bulkImport;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/GarbageCollectorResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/GarbageCollectorResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/GarbageCollectorResource.java
deleted file mode 100644
index 0ec2075..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/GarbageCollectorResource.java
+++ /dev/null
@@ -1,97 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-import org.apache.accumulo.core.gc.thrift.GCStatus;
-import org.apache.accumulo.monitor.Monitor;
-import org.apache.accumulo.monitor.rest.api.GarbageCollection;
-import org.apache.accumulo.monitor.rest.api.GarbageCollectorCycle;
-import org.apache.accumulo.monitor.rest.api.GarbageCollectorStatus;
-
-/**
- * GarbageCollector metrics
- */
-public class GarbageCollectorResource extends BasicResource {
-
-  @GET
-  public GarbageCollectorStatus getStatus() {
-    return new GarbageCollectorStatus(Monitor.getGcStatus());
-  }
-
-  @Path("/files")
-  @GET
-  public GarbageCollection getFileStatus() {
-    GCStatus gcStatus = Monitor.getGcStatus();
-    if (null == gcStatus) {
-      return GarbageCollection.EMPTY;
-    }
-    return new GarbageCollection(gcStatus.last, gcStatus.current);
-  }
-
-  @Path("/files/last")
-  @GET
-  public GarbageCollectorCycle getLastCycle() {
-    GCStatus status = Monitor.getGcStatus();
-    if (null == status) {
-      return GarbageCollectorCycle.EMPTY;
-    }
-    return new GarbageCollectorCycle(status.last);
-  }
-
-  @Path("/files/current")
-  @GET
-  public GarbageCollectorCycle getCurrentCycle() {
-    GCStatus status = Monitor.getGcStatus();
-    if (null == status) {
-      return GarbageCollectorCycle.EMPTY;
-    }
-    return new GarbageCollectorCycle(status.current);
-  }
-
-  @Path("/wals")
-  @GET
-  public GarbageCollection getWalStatus() {
-    GCStatus gcStatus = Monitor.getGcStatus();
-    if (null == gcStatus) {
-      return GarbageCollection.EMPTY;
-    }
-    return new GarbageCollection(gcStatus.lastLog, gcStatus.currentLog);
-  }
-
-  @Path("/wals/last")
-  @GET
-  public GarbageCollectorCycle getLastWalCycle() {
-    GCStatus status = Monitor.getGcStatus();
-    if (null == status) {
-      return GarbageCollectorCycle.EMPTY;
-    }
-    return new GarbageCollectorCycle(status.lastLog);
-  }
-
-  @Path("/wals/current")
-  @GET
-  public GarbageCollectorCycle getCurrentWalCycle() {
-    GCStatus status = Monitor.getGcStatus();
-    if (null == status) {
-      return GarbageCollectorCycle.EMPTY;
-    }
-    return new GarbageCollectorCycle(status.currentLog);
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/LogResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/LogResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/LogResource.java
deleted file mode 100644
index 87830c1..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/LogResource.java
+++ /dev/null
@@ -1,54 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.ws.rs.GET;
-
-import org.apache.accumulo.monitor.rest.api.LogEvent;
-import org.apache.accumulo.server.monitor.DedupedLogEvent;
-import org.apache.accumulo.server.monitor.LogService;
-import org.apache.log4j.spi.LoggingEvent;
-
-public class LogResource extends BasicResource {
-
-  @GET
-  public List<LogEvent> getRecentLogs() {
-    List<DedupedLogEvent> dedupedLogEvents = LogService.getInstance().getEvents();
-    ArrayList<LogEvent> logEvents = new ArrayList<>(dedupedLogEvents.size());
-
-    final StringBuilder msg = new StringBuilder(64);
-    for (DedupedLogEvent dev : dedupedLogEvents) {
-      msg.setLength(0);
-      final LoggingEvent ev = dev.getEvent();
-      Object application = ev.getMDC("application");
-      if (application == null)
-        application = "";
-
-      msg.append(ev.getMessage().toString());
-      if (ev.getThrowableStrRep() != null)
-        for (String line : ev.getThrowableStrRep())
-          msg.append("\n\t").append(line);
-
-      logEvents.add(new LogEvent(ev.getTimeStamp(), application, dev.getCount(), ev.getLevel().toString(), msg.toString().trim()));
-    }
-
-    return logEvents;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/MasterResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/MasterResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/MasterResource.java
deleted file mode 100644
index 54a77bb..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/MasterResource.java
+++ /dev/null
@@ -1,205 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import java.lang.management.ManagementFactory;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-import org.apache.accumulo.core.master.thrift.DeadServer;
-import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
-import org.apache.accumulo.core.master.thrift.TabletServerStatus;
-import org.apache.accumulo.core.util.AddressUtil;
-import org.apache.accumulo.monitor.Monitor;
-import org.apache.accumulo.monitor.rest.api.BadTabletServerInformation;
-import org.apache.accumulo.monitor.rest.api.BadTabletServers;
-import org.apache.accumulo.monitor.rest.api.DeadLoggerInformation;
-import org.apache.accumulo.monitor.rest.api.DeadLoggerList;
-import org.apache.accumulo.monitor.rest.api.DeadServerInformation;
-import org.apache.accumulo.monitor.rest.api.DeadServerList;
-import org.apache.accumulo.monitor.rest.api.MasterInformation;
-import org.apache.accumulo.monitor.rest.api.ServerShuttingDownInformation;
-import org.apache.accumulo.monitor.rest.api.ServersShuttingDown;
-import org.apache.accumulo.server.master.state.TabletServerState;
-
-public class MasterResource extends BasicResource {
-  public static final String NO_MASTERS = "No Masters running";
-
-  /**
-   * Gets the MasterMonitorInfo, allowing for mocking frameworks for testability
-   */
-  protected MasterMonitorInfo getMmi() {
-    return Monitor.getMmi();
-  }
-
-  @GET
-  public MasterInformation getTables() {
-
-    MasterInformation masterInformation;
-
-    if (Monitor.getMmi() != null) {
-      String gcStatus = "Waiting";
-      String label = "";
-      if (Monitor.getGcStatus() != null) {
-        long start = 0;
-        if (Monitor.getGcStatus().current.started != 0 || Monitor.getGcStatus().currentLog.started != 0) {
-          start = Math.max(Monitor.getGcStatus().current.started, Monitor.getGcStatus().currentLog.started);
-          label = "Running";
-        } else if (Monitor.getGcStatus().lastLog.finished != 0) {
-          start = Monitor.getGcStatus().lastLog.finished;
-        }
-        if (start != 0) {
-          gcStatus = String.valueOf(start);
-        }
-      } else {
-        gcStatus = "Down";
-      }
-
-      List<String> tservers = new ArrayList<>();
-      for (TabletServerStatus up : Monitor.getMmi().tServerInfo) {
-        tservers.add(up.name);
-      }
-      for (DeadServer down : Monitor.getMmi().deadTabletServers) {
-        tservers.add(down.server);
-      }
-      List<String> masters = Monitor.getContext().getInstance().getMasterLocations();
-
-      String master = masters.size() == 0 ? "Down" : AddressUtil.parseAddress(masters.get(0), false).getHostText();
-      Integer onlineTabletServers = Monitor.getMmi().tServerInfo.size();
-      Integer totalTabletServers = tservers.size();
-      Integer tablets = Monitor.getTotalTabletCount();
-      Integer unassignedTablets = Monitor.getMmi().unassignedTablets;
-      long entries = Monitor.getTotalEntries();
-      double ingest = Monitor.getTotalIngestRate();
-      double entriesRead = Monitor.getTotalScanRate();
-      double entriesReturned = Monitor.getTotalQueryRate();
-      long holdTime = Monitor.getTotalHoldTime();
-      double osLoad = ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
-
-      int tables = Monitor.getTotalTables();
-      int deadTabletServers = Monitor.getMmi().deadTabletServers.size();
-      long lookups = Monitor.getTotalLookups();
-      long uptime = System.currentTimeMillis() - Monitor.getStartTime(); // TODO Check that this works when starting accumulo
-
-      System.out.println(Monitor.getStartTime());
-
-      masterInformation = new MasterInformation(master, onlineTabletServers, totalTabletServers, gcStatus, tablets, unassignedTablets, entries, ingest,
-          entriesRead, entriesReturned, holdTime, osLoad, tables, deadTabletServers, lookups, uptime, label, getGoalState(), getState(), getNumBadTservers(),
-          getServersShuttingDown(), getDeadTservers(), getDeadLoggers());
-
-    } else {
-      masterInformation = new MasterInformation();
-    }
-
-    return masterInformation;
-  }
-
-  public String getState() {
-    MasterMonitorInfo mmi = getMmi();
-    if (null == mmi) {
-      return NO_MASTERS;
-    }
-
-    return mmi.state.toString();
-  }
-
-  public String getGoalState() {
-    MasterMonitorInfo mmi = getMmi();
-    if (null == mmi) {
-      return NO_MASTERS;
-    }
-
-    return mmi.goalState.name();
-  }
-
-  public DeadServerList getDeadTservers() {
-    MasterMonitorInfo mmi = getMmi();
-    if (null == mmi) {
-      return new DeadServerList();
-    }
-
-    DeadServerList deadServers = new DeadServerList();
-    for (DeadServer dead : mmi.deadTabletServers) {
-      deadServers.addDeadServer(new DeadServerInformation(dead.server, dead.lastStatus, dead.status));
-    }
-    return deadServers;
-  }
-
-  public DeadLoggerList getDeadLoggers() {
-    MasterMonitorInfo mmi = getMmi();
-    if (null == mmi) {
-      return new DeadLoggerList();
-    }
-
-    DeadLoggerList deadLoggers = new DeadLoggerList();
-    for (DeadServer dead : mmi.deadTabletServers) {
-      deadLoggers.addDeadLogger(new DeadLoggerInformation(dead.server, dead.lastStatus, dead.status));
-    }
-    return deadLoggers;
-  }
-
-  public BadTabletServers getNumBadTservers() {
-    MasterMonitorInfo mmi = getMmi();
-    if (null == mmi) {
-      return new BadTabletServers();
-    }
-
-    Map<String,Byte> badServers = mmi.getBadTServers();
-
-    if (null == badServers || badServers.isEmpty()) {
-      return new BadTabletServers();
-    }
-
-    BadTabletServers readableBadServers = new BadTabletServers();
-    for (Entry<String,Byte> badServer : badServers.entrySet()) {
-      try {
-        TabletServerState state = TabletServerState.getStateById(badServer.getValue());
-        readableBadServers.addBadServer(new BadTabletServerInformation(badServer.getKey(), state.name()));
-      } catch (IndexOutOfBoundsException e) {
-        readableBadServers.addBadServer(new BadTabletServerInformation(badServer.getKey(), "Unknown state"));
-      }
-    }
-    return readableBadServers;
-  }
-
-  public ServersShuttingDown getServersShuttingDown() {
-    ServersShuttingDown servers = new ServersShuttingDown();
-
-    for (String server : Monitor.getMmi().serversShuttingDown) {
-      servers.addServerShuttingDown(new ServerShuttingDownInformation(server));
-    }
-
-    return servers;
-  }
-
-  @Path("/tserver_info")
-  @GET
-  public List<TabletServerStatus> getTabletServerInfo() {
-    MasterMonitorInfo mmi = getMmi();
-    if (null == mmi) {
-      return Collections.emptyList();
-    }
-
-    return mmi.getTServerInfo();
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ProblemsResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ProblemsResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ProblemsResource.java
deleted file mode 100644
index 61e544d..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ProblemsResource.java
+++ /dev/null
@@ -1,40 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import java.util.Map;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-import org.apache.accumulo.monitor.Monitor;
-import org.apache.accumulo.server.problems.ProblemType;
-
-public class ProblemsResource extends BasicResource {
-
-  @GET
-  public Map<String,Map<ProblemType,Integer>> getSummary() {
-    return Monitor.getProblemSummary();
-  }
-
-  @GET
-  @Path("/exception")
-  public Exception getException() {
-    return Monitor.getProblemException();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ReplicationResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ReplicationResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ReplicationResource.java
deleted file mode 100644
index 711b84c..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ReplicationResource.java
+++ /dev/null
@@ -1,188 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import javax.ws.rs.GET;
-
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.BatchScanner;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.TableOfflineException;
-import org.apache.accumulo.core.client.admin.TableOperations;
-import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Range;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.metadata.MetadataTable;
-import org.apache.accumulo.core.metadata.RootTable;
-import org.apache.accumulo.core.replication.ReplicationSchema.WorkSection;
-import org.apache.accumulo.core.replication.ReplicationTable;
-import org.apache.accumulo.core.replication.ReplicationTarget;
-import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.monitor.Monitor;
-import org.apache.accumulo.monitor.rest.api.ReplicationInformation;
-import org.apache.accumulo.server.replication.ReplicaSystem;
-import org.apache.accumulo.server.replication.ReplicaSystemFactory;
-import org.apache.hadoop.io.Text;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ReplicationResource extends BasicResource {
-  private static final Logger log = LoggerFactory.getLogger(ReplicationResource.class);
-
-  @GET
-  public List<ReplicationInformation> getReplicationInformation() throws AccumuloException, AccumuloSecurityException {
-    final Connector conn = Monitor.getContext().getConnector();
-
-    final TableOperations tops = conn.tableOperations();
-
-    final Map<String,String> properties = conn.instanceOperations().getSystemConfiguration();
-    final Map<String,String> peers = new HashMap<>();
-    final String definedPeersPrefix = Property.REPLICATION_PEERS.getKey();
-    final ReplicaSystemFactory replicaSystemFactory = new ReplicaSystemFactory();
-
-    // Get the defined peers and what ReplicaSystem impl they're using
-    for (Entry<String,String> property : properties.entrySet()) {
-      String key = property.getKey();
-      // Filter out cruft that we don't want
-      if (key.startsWith(definedPeersPrefix) && !key.startsWith(Property.REPLICATION_PEER_USER.getKey())
-          && !key.startsWith(Property.REPLICATION_PEER_PASSWORD.getKey())) {
-        String peerName = property.getKey().substring(definedPeersPrefix.length());
-        ReplicaSystem replica;
-        try {
-          replica = replicaSystemFactory.get(property.getValue());
-        } catch (Exception e) {
-          log.warn("Could not instantiate ReplicaSystem for {} with configuration {}", property.getKey(), property.getValue(), e);
-          continue;
-        }
-
-        peers.put(peerName, replica.getClass().getName());
-      }
-    }
-
-    final String targetPrefix = Property.TABLE_REPLICATION_TARGET.getKey();
-
-    // The total set of configured targets
-    Set<ReplicationTarget> allConfiguredTargets = new HashSet<>();
-
-    // Number of files per target we have to replicate
-    Map<ReplicationTarget,Long> targetCounts = new HashMap<>();
-
-    Map<String,String> tableNameToId = tops.tableIdMap();
-    Map<String,String> tableIdToName = invert(tableNameToId);
-
-    for (String table : tops.list()) {
-      if (MetadataTable.NAME.equals(table) || RootTable.NAME.equals(table)) {
-        continue;
-      }
-      String localId = tableNameToId.get(table);
-      if (null == localId) {
-        log.trace("Could not determine ID for {}", table);
-        continue;
-      }
-
-      Iterable<Entry<String,String>> propertiesForTable;
-      try {
-        propertiesForTable = tops.getProperties(table);
-      } catch (TableNotFoundException e) {
-        log.warn("Could not fetch properties for {}", table, e);
-        continue;
-      }
-
-      for (Entry<String,String> prop : propertiesForTable) {
-        if (prop.getKey().startsWith(targetPrefix)) {
-          String peerName = prop.getKey().substring(targetPrefix.length());
-          String remoteIdentifier = prop.getValue();
-          ReplicationTarget target = new ReplicationTarget(peerName, remoteIdentifier, localId);
-
-          allConfiguredTargets.add(target);
-        }
-      }
-    }
-
-    // Read over the queued work
-    BatchScanner bs;
-    try {
-      bs = conn.createBatchScanner(ReplicationTable.NAME, Authorizations.EMPTY, 4);
-    } catch (TableOfflineException | TableNotFoundException e) {
-      log.error("Could not read replication table", e);
-      return Collections.emptyList();
-    }
-
-    bs.setRanges(Collections.singleton(new Range()));
-    WorkSection.limit(bs);
-    try {
-      Text buffer = new Text();
-      for (Entry<Key,Value> entry : bs) {
-        Key k = entry.getKey();
-        k.getColumnQualifier(buffer);
-        ReplicationTarget target = ReplicationTarget.from(buffer);
-
-        // TODO ACCUMULO-2835 once explicit lengths are tracked, we can give size-based estimates instead of just file-based
-        Long count = targetCounts.get(target);
-        if (null == count) {
-          targetCounts.put(target, Long.valueOf(1l));
-        } else {
-          targetCounts.put(target, count + 1);
-        }
-      }
-    } finally {
-      bs.close();
-    }
-
-    List<ReplicationInformation> replicationInformation = new ArrayList<>();
-    for (ReplicationTarget configuredTarget : allConfiguredTargets) {
-      String tableName = tableIdToName.get(configuredTarget.getSourceTableId());
-      if (null == tableName) {
-        log.trace("Could not determine table name from id {}", configuredTarget.getSourceTableId());
-        continue;
-      }
-
-      String replicaSystemClass = peers.get(configuredTarget.getPeerName());
-      if (null == replicaSystemClass) {
-        log.trace("Could not determine configured ReplicaSystem for {}", configuredTarget.getPeerName());
-        continue;
-      }
-
-      Long numFiles = targetCounts.get(configuredTarget);
-
-      replicationInformation.add(new ReplicationInformation(tableName, configuredTarget.getPeerName(), configuredTarget.getRemoteIdentifier(),
-          replicaSystemClass, (null == numFiles) ? 0 : numFiles));
-    }
-
-    return replicationInformation;
-  }
-
-  protected Map<String,String> invert(Map<String,String> map) {
-    Map<String,String> newMap = new HashMap<>(map.size());
-    for (Entry<String,String> entry : map.entrySet()) {
-      newMap.put(entry.getValue(), entry.getKey());
-    }
-    return newMap;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ScansResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ScansResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ScansResource.java
deleted file mode 100644
index f7ab180..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ScansResource.java
+++ /dev/null
@@ -1,49 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import java.util.Map;
-
-import javax.ws.rs.GET;
-
-import org.apache.accumulo.core.master.thrift.TabletServerStatus;
-import org.apache.accumulo.monitor.Monitor;
-import org.apache.accumulo.monitor.Monitor.ScanStats;
-import org.apache.accumulo.monitor.rest.api.ScanInformation;
-import org.apache.accumulo.monitor.rest.api.Scans;
-
-import com.google.common.net.HostAndPort;
-
-public class ScansResource extends BasicResource {
-
-  @GET
-  public Scans getTables() {
-
-    Scans scans = new Scans();
-
-    Map<HostAndPort,ScanStats> entry = Monitor.getScans();
-
-    for (TabletServerStatus tserverInfo : Monitor.getMmi().getTServerInfo()) {
-      ScanStats stats = entry.get(HostAndPort.fromString(tserverInfo.name));
-      if (stats != null) {
-        scans.addScan(new ScanInformation(tserverInfo, stats.scanCount, stats.oldestScan));
-      }
-    }
-
-    return scans;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/StatisticsResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/StatisticsResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/StatisticsResource.java
deleted file mode 100644
index 28a33c7..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/StatisticsResource.java
+++ /dev/null
@@ -1,175 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-import org.apache.accumulo.core.gc.thrift.GCStatus;
-import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.monitor.Monitor;
-
-/**
- *
- */
-public class StatisticsResource extends BasicResource {
-
-  @GET
-  @Path("lookupRate")
-  public double getLookupRate() {
-    return Monitor.getLookupRate();
-  }
-
-  @GET
-  @Path("totalTables")
-  public int getTotalTables() {
-    return Monitor.getTotalTables();
-  }
-
-  @GET
-  @Path("totalTabletCount")
-  public int getTotalTabletCount() {
-    return Monitor.getTotalTabletCount();
-  }
-
-  @GET
-  @Path("totalEntries")
-  public long getTotalEntries() {
-    return Monitor.getTotalEntries();
-  }
-
-  @GET
-  @Path("totalIngestRate")
-  public double getTotalIngestRate() {
-    return Monitor.getTotalIngestRate();
-  }
-
-  @GET
-  @Path("totalQueryRate")
-  public double getTotalQueryRate() {
-    return Monitor.getTotalQueryRate();
-  }
-
-  @GET
-  @Path("totalScanRate")
-  public double getTotalScanRate() {
-    return Monitor.getTotalScanRate();
-  }
-
-  @GET
-  @Path("totalHoldTime")
-  public long getTotalHoldTime() {
-    return Monitor.getTotalHoldTime();
-  }
-
-  @GET
-  @Path("gcStatus")
-  public GCStatus getGcStatus() {
-    return Monitor.getGcStatus();
-  }
-
-  @GET
-  @Path("totalLookups")
-  public long getTotalLookups() {
-    return Monitor.getTotalLookups();
-  }
-
-  @GET
-  @Path("time/scanRate")
-  public List<Pair<Long,Integer>> getScanRate() {
-    return Monitor.getScanRateOverTime();
-  }
-
-  @GET
-  @Path("time/queryRate")
-  public List<Pair<Long,Integer>> getQueryRate() {
-    return Monitor.getQueryRateOverTime();
-  }
-
-  @GET
-  @Path("time/scanEntries")
-  public List<Pair<String,List<Pair<Long,Integer>>>> getScanEntries() {
-
-    List<Pair<String,List<Pair<Long,Integer>>>> scanEntries = new ArrayList<>();
-
-    Pair<String,List<Pair<Long,Integer>>> read = new Pair<>("Read", Monitor.getScanRateOverTime());
-    Pair<String,List<Pair<Long,Integer>>> returned = new Pair<>("Returned", Monitor.getQueryRateOverTime());
-
-    scanEntries.add(read);
-    scanEntries.add(returned);
-
-    return scanEntries;
-  }
-
-  @GET
-  @Path("time/queryByteRate")
-  public List<Pair<Long,Double>> getQueryByteRate() {
-    return Monitor.getQueryByteRateOverTime();
-  }
-
-  @GET
-  @Path("time/load")
-  public List<Pair<Long,Double>> getLoad() {
-    return Monitor.getLoadOverTime();
-  }
-
-  @GET
-  @Path("time/ingestRate")
-  public List<Pair<Long,Double>> getIngestRate() {
-    return Monitor.getIngestRateOverTime();
-  }
-
-  @GET
-  @Path("time/ingestByteRate")
-  public List<Pair<Long,Double>> getIngestByteRate() {
-    return Monitor.getIngestByteRateOverTime();
-  }
-
-  @GET
-  @Path("time/minorCompactions")
-  public List<Pair<Long,Integer>> getMinorCompactions() {
-    return Monitor.getMinorCompactionsOverTime();
-  }
-
-  @GET
-  @Path("time/majorCompactions")
-  public List<Pair<Long,Integer>> getMajorCompactions() {
-    return Monitor.getMajorCompactionsOverTime();
-  }
-
-  @GET
-  @Path("time/lookups")
-  public List<Pair<Long,Double>> getLookups() {
-    return Monitor.getLookupsOverTime();
-  }
-
-  @GET
-  @Path("time/indexCacheHitRate")
-  public List<Pair<Long,Double>> getIndexCacheHitRate() {
-    return Monitor.getIndexCacheHitRateOverTime();
-  }
-
-  @GET
-  @Path("time/dataCacheHitRate")
-  public List<Pair<Long,Double>> getDataCacheHitRate() {
-    return Monitor.getDataCacheHitRateOverTime();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TablesResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TablesResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TablesResource.java
deleted file mode 100644
index 0c02d47..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TablesResource.java
+++ /dev/null
@@ -1,166 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-import org.apache.accumulo.core.client.Instance;
-import org.apache.accumulo.core.client.impl.Namespaces;
-import org.apache.accumulo.core.client.impl.Tables;
-import org.apache.accumulo.core.data.Range;
-import org.apache.accumulo.core.data.impl.KeyExtent;
-import org.apache.accumulo.core.master.thrift.TableInfo;
-import org.apache.accumulo.core.master.thrift.TabletServerStatus;
-import org.apache.accumulo.core.metadata.MetadataTable;
-import org.apache.accumulo.core.metadata.RootTable;
-import org.apache.accumulo.monitor.Monitor;
-import org.apache.accumulo.monitor.rest.api.TableInformation;
-import org.apache.accumulo.monitor.rest.api.TableNamespace;
-import org.apache.accumulo.monitor.rest.api.TablesList;
-import org.apache.accumulo.monitor.rest.api.TabletServer;
-import org.apache.accumulo.monitor.rest.api.TabletServers;
-import org.apache.accumulo.server.client.HdfsZooInstance;
-import org.apache.accumulo.server.master.state.MetaDataTableScanner;
-import org.apache.accumulo.server.master.state.TabletLocationState;
-import org.apache.accumulo.server.tables.TableManager;
-import org.apache.accumulo.server.util.TableInfoUtil;
-import org.apache.hadoop.io.Text;
-
-public class TablesResource extends BasicResource {
-
-  private static final TabletServerStatus NO_STATUS = new TabletServerStatus();
-
-  @GET
-  public TablesList getTables() {
-    Map<String,String> tidToNameMap = Tables.getIdToNameMap(HdfsZooInstance.getInstance());
-    SortedMap<String,TableInfo> tableStats = new TreeMap<>();
-
-    if (Monitor.getMmi() != null && Monitor.getMmi().tableMap != null)
-      for (Entry<String,TableInfo> te : Monitor.getMmi().tableMap.entrySet())
-        tableStats.put(Tables.getPrintableTableNameFromId(tidToNameMap, te.getKey()), te.getValue());
-
-    Map<String,Double> compactingByTable = TableInfoUtil.summarizeTableStats(Monitor.getMmi());
-    TableManager tableManager = TableManager.getInstance();
-
-    SortedMap<String,String> namespaces = Namespaces.getNameToIdMap(Monitor.getContext().getInstance());
-
-    TablesList tableNamespace = new TablesList();
-    List<TableInformation> tables = new ArrayList<>();
-
-    for (String key : namespaces.keySet()) {
-      tableNamespace.addTable(new TableNamespace(key));
-    }
-
-    for (Entry<String,String> entry : Tables.getNameToIdMap(HdfsZooInstance.getInstance()).entrySet()) {
-      String tableName = entry.getKey(), tableId = entry.getValue();
-      TableInfo tableInfo = tableStats.get(tableName);
-      if (null != tableInfo) {
-        Double holdTime = compactingByTable.get(tableId);
-        if (holdTime == null)
-          holdTime = Double.valueOf(0.);
-
-        for (TableNamespace name : tableNamespace.tables) {
-          if (!tableName.contains(".") && name.namespace.equals("")) {
-            name.addTable(new TableInformation(tableName, tableId, tableInfo, holdTime, tableManager.getTableState(tableId).name()));
-          } else if (tableName.startsWith(name.namespace + ".")) {
-            name.addTable(new TableInformation(tableName, tableId, tableInfo, holdTime, tableManager.getTableState(tableId).name()));
-          }
-        }
-
-        tables.add(new TableInformation(tableName, tableId, tableInfo, holdTime, tableManager.getTableState(tableId).name()));
-      } else {
-        for (TableNamespace name : tableNamespace.tables) {
-          if (!tableName.contains(".") && name.namespace.equals("")) {
-            name.addTable(new TableInformation(tableName, tableId, tableManager.getTableState(tableId).name()));
-          } else if (tableName.startsWith(name.namespace + ".")) {
-            name.addTable(new TableInformation(tableName, tableId, tableManager.getTableState(tableId).name()));
-          }
-        }
-        tables.add(new TableInformation(tableName, tableId, tableManager.getTableState(tableId).name()));
-      }
-    }
-
-    return tableNamespace;
-  }
-
-  @Path("/{tableId}")
-  @GET
-  public TabletServers getParticipatingTabletServers(@PathParam("tableId") String tableId) throws Exception {
-    Instance instance = Monitor.getContext().getInstance();
-
-    TreeSet<String> locs = new TreeSet<>();
-    if (RootTable.ID.equals(tableId)) {
-      locs.add(instance.getRootTabletLocation());
-    } else {
-      String systemTableName = MetadataTable.ID.equals(tableId) ? RootTable.NAME : MetadataTable.NAME;
-      MetaDataTableScanner scanner = new MetaDataTableScanner(Monitor.getContext(), new Range(KeyExtent.getMetadataEntry(tableId, new Text()),
-          KeyExtent.getMetadataEntry(tableId, null)), systemTableName);
-
-      while (scanner.hasNext()) {
-        TabletLocationState state = scanner.next();
-        if (state.current != null) {
-          try {
-            locs.add(state.current.hostPort());
-          } catch (Exception ex) {}
-        }
-      }
-      scanner.close();
-    }
-
-    TabletServers tabletServers = new TabletServers(Monitor.getMmi().tServerInfo.size());
-
-    List<TabletServerStatus> tservers = new ArrayList<>();
-    if (Monitor.getMmi() != null) {
-      for (TabletServerStatus tss : Monitor.getMmi().tServerInfo) {
-        try {
-          if (tss.name != null && locs.contains(tss.name))
-            tservers.add(tss);
-        } catch (Exception ex) {
-
-        }
-      }
-    }
-
-    for (TabletServerStatus status : tservers) {
-      if (status == null)
-        status = NO_STATUS;
-      TableInfo summary = TableInfoUtil.summarizeTableStats(status);
-      if (tableId != null)
-        summary = status.tableMap.get(tableId);
-      if (summary == null)
-        continue;
-
-      TabletServer tabletServerInfo = new TabletServer();
-      tabletServerInfo.updateTabletServerInfo(status, summary);
-
-      tabletServers.addTablet(tabletServerInfo);
-    }
-
-    return tabletServers;
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TabletServerResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TabletServerResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TabletServerResource.java
deleted file mode 100644
index 5036f3f..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TabletServerResource.java
+++ /dev/null
@@ -1,255 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import java.lang.management.ManagementFactory;
-import java.security.MessageDigest;
-import java.util.ArrayList;
-import java.util.Base64;
-import java.util.List;
-import java.util.Map;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response.Status;
-
-import org.apache.accumulo.core.client.impl.ClientContext;
-import org.apache.accumulo.core.client.impl.Tables;
-import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.data.impl.KeyExtent;
-import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
-import org.apache.accumulo.core.master.thrift.TabletServerStatus;
-import org.apache.accumulo.core.rpc.ThriftUtil;
-import org.apache.accumulo.core.tabletserver.thrift.ActionStats;
-import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
-import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
-import org.apache.accumulo.core.trace.Tracer;
-import org.apache.accumulo.monitor.Monitor;
-import org.apache.accumulo.monitor.rest.api.AllTimeTabletResults;
-import org.apache.accumulo.monitor.rest.api.CurrentOperations;
-import org.apache.accumulo.monitor.rest.api.CurrentTabletResults;
-import org.apache.accumulo.monitor.rest.api.ServerStat;
-import org.apache.accumulo.monitor.rest.api.ServerStats;
-import org.apache.accumulo.monitor.rest.api.TabletServer;
-import org.apache.accumulo.monitor.rest.api.TabletServerDetailInformation;
-import org.apache.accumulo.monitor.rest.api.TabletServerSummary;
-import org.apache.accumulo.monitor.rest.api.TabletServers;
-import org.apache.accumulo.server.client.HdfsZooInstance;
-import org.apache.accumulo.server.util.ActionStatsUpdator;
-
-import com.google.common.net.HostAndPort;
-
-public class TabletServerResource extends BasicResource {
-
-  private TabletStats total, historical;
-
-  @GET
-  public TabletServers getTserverSummary() {
-    MasterMonitorInfo mmi = Monitor.getMmi();
-    if (null == mmi) {
-      throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
-    }
-
-    TabletServers tserverInfo = new TabletServers(mmi.tServerInfo.size());
-    for (TabletServerStatus status : mmi.tServerInfo) {
-      tserverInfo.addTablet(new TabletServer(status));
-    }
-
-    return tserverInfo;
-  }
-
-  @Path("/{address}")
-  @GET
-  public TabletServerSummary getTserverDetails(@PathParam("address") String tserverAddr) throws Exception {
-
-    String tserverAddress = tserverAddr;
-
-    boolean tserverExists = false;
-    if (tserverAddress != null && tserverAddress.isEmpty() == false) {
-      for (TabletServerStatus ts : Monitor.getMmi().getTServerInfo()) {
-        if (tserverAddress.equals(ts.getName())) {
-          tserverExists = true;
-          break;
-        }
-      }
-    }
-
-    if (tserverAddress == null || tserverAddress.isEmpty() || tserverExists == false) {
-
-      return null;
-    }
-
-    double totalElapsedForAll = 0;
-    double splitStdDev = 0;
-    double minorStdDev = 0;
-    double minorQueueStdDev = 0;
-    double majorStdDev = 0;
-    double majorQueueStdDev = 0;
-    double currentMinorAvg = 0;
-    double currentMajorAvg = 0;
-    double currentMinorStdDev = 0;
-    double currentMajorStdDev = 0;
-    total = new TabletStats(null, new ActionStats(), new ActionStats(), new ActionStats(), 0, 0, 0, 0);
-    HostAndPort address = HostAndPort.fromString(tserverAddress);
-    historical = new TabletStats(null, new ActionStats(), new ActionStats(), new ActionStats(), 0, 0, 0, 0);
-    List<TabletStats> tsStats = new ArrayList<>();
-
-    try {
-      ClientContext context = Monitor.getContext();
-      TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, context);
-      try {
-        for (String tableId : Monitor.getMmi().tableMap.keySet()) {
-          tsStats.addAll(client.getTabletStats(Tracer.traceInfo(), context.rpcCreds(), tableId));
-        }
-        historical = client.getHistoricalStats(Tracer.traceInfo(), context.rpcCreds());
-      } finally {
-        ThriftUtil.returnClient(client);
-      }
-    } catch (Exception e) {
-      return null;
-    }
-
-    List<CurrentOperations> currentOps = doCurrentOperations(tsStats);
-
-    if (total.minors.num != 0)
-      currentMinorAvg = (long) (total.minors.elapsed / total.minors.num);
-    if (total.minors.elapsed != 0 && total.minors.num != 0)
-      currentMinorStdDev = stddev(total.minors.elapsed, total.minors.num, total.minors.sumDev);
-    if (total.majors.num != 0)
-      currentMajorAvg = total.majors.elapsed / total.majors.num;
-    if (total.majors.elapsed != 0 && total.majors.num != 0 && total.majors.elapsed > total.majors.num)
-      currentMajorStdDev = stddev(total.majors.elapsed, total.majors.num, total.majors.sumDev);
-
-    ActionStatsUpdator.update(total.minors, historical.minors);
-    ActionStatsUpdator.update(total.majors, historical.majors);
-    totalElapsedForAll += total.majors.elapsed + historical.splits.elapsed + total.minors.elapsed;
-
-    minorStdDev = stddev(total.minors.elapsed, total.minors.num, total.minors.sumDev);
-    minorQueueStdDev = stddev(total.minors.queueTime, total.minors.num, total.minors.queueSumDev);
-    majorStdDev = stddev(total.majors.elapsed, total.majors.num, total.majors.sumDev);
-    majorQueueStdDev = stddev(total.majors.queueTime, total.majors.num, total.majors.queueSumDev);
-    splitStdDev = stddev(historical.splits.num, historical.splits.elapsed, historical.splits.sumDev);
-
-    TabletServerDetailInformation details = doDetails(address, tsStats.size());
-
-    List<AllTimeTabletResults> allTime = doAllTimeResults(majorQueueStdDev, minorQueueStdDev, totalElapsedForAll, splitStdDev, majorStdDev, minorStdDev);
-
-    CurrentTabletResults currentRes = doCurrentTabletResults(currentMinorAvg, currentMinorStdDev, currentMajorAvg, currentMajorStdDev);
-
-    TabletServerSummary tserverDetails = new TabletServerSummary(details, allTime, currentRes, currentOps);
-
-    return tserverDetails;
-  }
-
-  private static final int concurrentScans = Monitor.getContext().getConfiguration().getCount(Property.TSERV_READ_AHEAD_MAXCONCURRENT);
-
-  @Path("/serverStats")
-  @GET
-  public ServerStats getServerStats() {
-
-    ServerStats stats = new ServerStats();
-
-    stats.addStats(new ServerStat(ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors(), true, 100, "OS Load", "osload"));
-    stats.addStats(new ServerStat(1000, true, 1, "Ingest Entries", "ingest"));
-    stats.addStats(new ServerStat(10000, true, 1, "Scan Entries", "query"));
-    stats.addStats(new ServerStat(10, true, 10, "Ingest MB", "ingestMB"));
-    stats.addStats(new ServerStat(5, true, 10, "Scan MB", "queryMB"));
-    stats.addStats(new ServerStat(concurrentScans * 2, false, 1, "Running Scans", "scans"));
-    stats.addStats(new ServerStat(50, true, 10, "Scan Sessions", "scansessions"));
-    stats.addStats(new ServerStat(60000, false, 1, "Hold Time", "holdtime"));
-    stats.addStats(new ServerStat(1, false, 100, "Overall Avg", true, "allavg"));
-    stats.addStats(new ServerStat(1, false, 100, "Overall Max", true, "allmax"));
-
-    return stats;
-  }
-
-  private TabletServerDetailInformation doDetails(HostAndPort address, int numTablets) {
-
-    return new TabletServerDetailInformation(numTablets, total.numEntries, total.minors.status, total.majors.status, historical.splits.status);
-  }
-
-  private List<AllTimeTabletResults> doAllTimeResults(double majorQueueStdDev, double minorQueueStdDev, double totalElapsedForAll, double splitStdDev,
-      double majorStdDev, double minorStdDev) {
-
-    List<AllTimeTabletResults> allTime = new ArrayList<>();
-
-    // Minor Compaction Operation
-    allTime.add(new AllTimeTabletResults("Minor&nbsp;Compaction", total.minors.num, total.minors.fail,
-        total.minors.num != 0 ? (total.minors.queueTime / total.minors.num) : null, minorQueueStdDev,
-        total.minors.num != 0 ? (total.minors.elapsed / total.minors.num) : null, minorStdDev, total.minors.elapsed));
-
-    // Major Compaction Operation
-    allTime.add(new AllTimeTabletResults("Major&nbsp;Compaction", total.majors.num, total.majors.fail,
-        total.majors.num != 0 ? (total.majors.queueTime / total.majors.num) : null, majorQueueStdDev,
-        total.majors.num != 0 ? (total.majors.elapsed / total.majors.num) : null, majorStdDev, total.majors.elapsed));
-    // Split Operation
-    allTime.add(new AllTimeTabletResults("Split", historical.splits.num, historical.splits.fail, null, null,
-        historical.splits.num != 0 ? (historical.splits.elapsed / historical.splits.num) : null, splitStdDev, historical.splits.elapsed));
-
-    return allTime;
-  }
-
-  private CurrentTabletResults doCurrentTabletResults(double currentMinorAvg, double currentMinorStdDev, double currentMajorAvg, double currentMajorStdDev) {
-
-    return new CurrentTabletResults(currentMinorAvg, currentMinorStdDev, currentMajorAvg, currentMajorStdDev);
-  }
-
-  private List<CurrentOperations> doCurrentOperations(List<TabletStats> tsStats) throws Exception {
-
-    Map<String,String> tidToNameMap = Tables.getIdToNameMap(HdfsZooInstance.getInstance());
-
-    List<CurrentOperations> currentOperations = new ArrayList<>();
-
-    for (TabletStats info : tsStats) {
-      if (info.extent == null) {
-        historical = info;
-        continue;
-      }
-      total.numEntries += info.numEntries;
-      ActionStatsUpdator.update(total.minors, info.minors);
-      ActionStatsUpdator.update(total.majors, info.majors);
-
-      KeyExtent extent = new KeyExtent(info.extent);
-      String tableId = extent.getTableId();
-      MessageDigest digester = MessageDigest.getInstance("MD5");
-      if (extent.getEndRow() != null && extent.getEndRow().getLength() > 0) {
-        digester.update(extent.getEndRow().getBytes(), 0, extent.getEndRow().getLength());
-      }
-      String obscuredExtent = Base64.getEncoder().encodeToString(digester.digest());
-      String displayExtent = String.format("[%s]", obscuredExtent);
-
-      String tableName = Tables.getPrintableTableNameFromId(tidToNameMap, tableId);
-
-      currentOperations.add(new CurrentOperations(tableName, tableId, displayExtent, info.numEntries, info.ingestRate, info.queryRate,
-          info.minors.num != 0 ? info.minors.elapsed / info.minors.num : null, stddev(info.minors.elapsed, info.minors.num, info.minors.sumDev),
-          info.minors.elapsed != 0 ? info.minors.count / info.minors.elapsed : null, info.majors.num != 0 ? info.majors.elapsed / info.majors.num : null,
-          stddev(info.majors.elapsed, info.majors.num, info.majors.sumDev), info.majors.elapsed != 0 ? info.majors.count / info.majors.elapsed : null));
-    }
-
-    return currentOperations;
-  }
-
-  private static double stddev(double elapsed, double num, double sumDev) {
-    if (num != 0) {
-      double average = elapsed / num;
-      return Math.sqrt((sumDev / num) - (average * average));
-    }
-    return 0;
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TracesResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TracesResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TracesResource.java
deleted file mode 100644
index fb169fc..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/TracesResource.java
+++ /dev/null
@@ -1,354 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import static java.lang.Math.min;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import java.io.IOException;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
-import java.util.AbstractMap;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.TreeMap;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
-import org.apache.accumulo.core.client.security.tokens.AuthenticationToken.Properties;
-import org.apache.accumulo.core.client.security.tokens.KerberosToken;
-import org.apache.accumulo.core.client.security.tokens.PasswordToken;
-import org.apache.accumulo.core.conf.AccumuloConfiguration;
-import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Range;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.monitor.Monitor;
-import org.apache.accumulo.monitor.rest.api.AddlInformation;
-import org.apache.accumulo.monitor.rest.api.AnnotationInformation;
-import org.apache.accumulo.monitor.rest.api.DataInformation;
-import org.apache.accumulo.monitor.rest.api.RecentTracesInformation;
-import org.apache.accumulo.monitor.rest.api.RecentTracesList;
-import org.apache.accumulo.monitor.rest.api.TraceInformation;
-import org.apache.accumulo.monitor.rest.api.TraceList;
-import org.apache.accumulo.monitor.rest.api.TraceType;
-import org.apache.accumulo.monitor.rest.api.TracesForTypeInformation;
-import org.apache.accumulo.monitor.servlets.trace.NullScanner;
-import org.apache.accumulo.server.client.HdfsZooInstance;
-import org.apache.accumulo.server.security.SecurityUtil;
-import org.apache.accumulo.tracer.SpanTree;
-import org.apache.accumulo.tracer.SpanTreeVisitor;
-import org.apache.accumulo.tracer.TraceDump;
-import org.apache.accumulo.tracer.TraceFormatter;
-import org.apache.accumulo.tracer.thrift.Annotation;
-import org.apache.accumulo.tracer.thrift.RemoteSpan;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.security.UserGroupInformation;
-
-public class TracesResource extends BasicResource {
-
-  @Path("/summary/{minutes}")
-  @GET
-  public RecentTracesList getTraces(@PathParam("minutes") int minutes) throws Exception {
-
-    RecentTracesList recentTraces = new RecentTracesList();
-
-    Entry<Scanner,UserGroupInformation> pair = getScanner();
-    final Scanner scanner = pair.getKey();
-    if (scanner == null) {
-      return null;
-    }
-
-    Range range = getRangeForTrace(minutes);
-    scanner.setRange(range);
-
-    final Map<String,RecentTracesInformation> summary = new TreeMap<>();
-    if (null != pair.getValue()) {
-      pair.getValue().doAs(new PrivilegedAction<Void>() {
-        @Override
-        public Void run() {
-          parseSpans(scanner, summary);
-          return null;
-        }
-      });
-    } else {
-      parseSpans(scanner, summary);
-    }
-
-    for (Entry<String,RecentTracesInformation> entry : summary.entrySet()) {
-      RecentTracesInformation stat = entry.getValue();
-      recentTraces.addTrace(stat);
-    }
-
-    return recentTraces;
-  }
-
-  @Path("/listType/{type}/{minutes}")
-  @GET
-  public TraceType getTracesType(@PathParam("type") String type, @PathParam("minutes") int minutes) throws Exception {
-
-    TraceType typeTraces = new TraceType(type);
-
-    Entry<Scanner,UserGroupInformation> pair = getScanner();
-    final Scanner scanner = pair.getKey();
-    if (scanner == null) {
-      return null;
-    }
-
-    Range range = getRangeForTrace(minutes);
-
-    scanner.setRange(range);
-
-    if (null != pair.getValue()) {
-      pair.getValue().doAs(new PrivilegedAction<Void>() {
-        @Override
-        public Void run() {
-          for (Entry<Key,Value> entry : scanner) {
-            RemoteSpan span = TraceFormatter.getRemoteSpan(entry);
-
-            if (span.description.equals(type)) {
-              typeTraces.addTrace(new TracesForTypeInformation(span));
-            }
-          }
-          return null;
-        }
-      });
-    } else {
-      for (Entry<Key,Value> entry : scanner) {
-        RemoteSpan span = TraceFormatter.getRemoteSpan(entry);
-        if (span.description.equals(type)) {
-          typeTraces.addTrace(new TracesForTypeInformation(span));
-        }
-
-      }
-    }
-
-    return typeTraces;
-  }
-
-  @Path("/show/{id}")
-  @GET
-  public TraceList getTracesType(@PathParam("id") String id) throws Exception {
-    TraceList traces = new TraceList(id);
-
-    if (id == null) {
-      return null;
-    }
-
-    Entry<Scanner,UserGroupInformation> entry = getScanner();
-    final Scanner scanner = entry.getKey();
-    if (scanner == null) {
-      return null;
-    }
-
-    Range range = new Range(new Text(id));
-    scanner.setRange(range);
-    final SpanTree tree = new SpanTree();
-    long start;
-
-    if (null != entry.getValue()) {
-      start = entry.getValue().doAs(new PrivilegedAction<Long>() {
-        @Override
-        public Long run() {
-          return addSpans(scanner, tree, Long.MAX_VALUE);
-        }
-      });
-    } else {
-      start = addSpans(scanner, tree, Long.MAX_VALUE);
-    }
-
-    traces.addStartTime(start);
-
-    final long finalStart = start;
-    Set<Long> visited = tree.visit(new SpanTreeVisitor() {
-      @Override
-      public void visit(int level, RemoteSpan parent, RemoteSpan node, Collection<RemoteSpan> children) {
-        traces.addTrace(addTraceInformation(level, node, finalStart));
-      }
-    });
-    tree.nodes.keySet().removeAll(visited);
-    if (!tree.nodes.isEmpty()) {
-      for (RemoteSpan span : TraceDump.sortByStart(tree.nodes.values())) {
-        traces.addTrace(addTraceInformation(0, span, finalStart));
-      }
-    }
-
-    return traces;
-  }
-
-  private static TraceInformation addTraceInformation(int level, RemoteSpan node, long finalStart) {
-
-    boolean hasData = node.data != null && !node.data.isEmpty();
-    boolean hasAnnotations = node.annotations != null && !node.annotations.isEmpty();
-
-    AddlInformation addlData = new AddlInformation();
-
-    if (hasData || hasAnnotations) {
-
-      if (hasData) {
-        for (Entry<String,String> entry : node.data.entrySet()) {
-          DataInformation data = new DataInformation(entry.getKey(), entry.getValue());
-          addlData.addData(data);
-        }
-      }
-      if (hasAnnotations) {
-        for (Annotation entry : node.annotations) {
-          AnnotationInformation annotations = new AnnotationInformation(entry.getMsg(), entry.getTime() - finalStart);
-          addlData.addAnnotations(annotations);
-        }
-      }
-    }
-
-    return new TraceInformation(level, node.stop - node.start, node.start - finalStart, node.svc + "@" + node.sender, node.description, addlData);
-  }
-
-  protected Range getRangeForTrace(long minutesSince) {
-    long endTime = System.currentTimeMillis();
-    long millisSince = minutesSince * 60 * 1000;
-    // Catch the overflow
-    if (millisSince < minutesSince) {
-      millisSince = endTime;
-    }
-    long startTime = endTime - millisSince;
-
-    String startHexTime = Long.toHexString(startTime), endHexTime = Long.toHexString(endTime);
-    while (startHexTime.length() < endHexTime.length()) {
-      startHexTime = "0" + startHexTime;
-    }
-
-    return new Range(new Text("start:" + startHexTime), new Text("start:" + endHexTime));
-  }
-
-  private void parseSpans(Scanner scanner, Map<String,RecentTracesInformation> summary) {
-    for (Entry<Key,Value> entry : scanner) {
-      RemoteSpan span = TraceFormatter.getRemoteSpan(entry);
-      RecentTracesInformation stats = summary.get(span.description);
-      if (stats == null) {
-        summary.put(span.description, stats = new RecentTracesInformation(span.description));
-      }
-      stats.addSpan(span);
-    }
-  }
-
-  protected Entry<Scanner,UserGroupInformation> getScanner() throws AccumuloException, AccumuloSecurityException {
-    AccumuloConfiguration conf = Monitor.getContext().getConfiguration();
-    final boolean saslEnabled = conf.getBoolean(Property.INSTANCE_RPC_SASL_ENABLED);
-    UserGroupInformation traceUgi = null;
-    final String principal;
-    final AuthenticationToken at;
-    Map<String,String> loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX);
-    // May be null
-    String keytab = loginMap.get(Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey() + "keytab");
-    if (keytab == null || keytab.length() == 0) {
-      keytab = conf.getPath(Property.GENERAL_KERBEROS_KEYTAB);
-    }
-
-    if (saslEnabled && null != keytab) {
-      principal = SecurityUtil.getServerPrincipal(conf.get(Property.TRACE_USER));
-      try {
-        traceUgi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(principal, keytab);
-      } catch (IOException e) {
-        throw new RuntimeException("Failed to login as trace user", e);
-      }
-    } else {
-      principal = conf.get(Property.TRACE_USER);
-    }
-
-    if (!saslEnabled) {
-      if (loginMap.isEmpty()) {
-        Property p = Property.TRACE_PASSWORD;
-        at = new PasswordToken(conf.get(p).getBytes(UTF_8));
-      } else {
-        Properties props = new Properties();
-        int prefixLength = Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey().length();
-        for (Entry<String,String> entry : loginMap.entrySet()) {
-          props.put(entry.getKey().substring(prefixLength), entry.getValue());
-        }
-
-        AuthenticationToken token = Property.createInstanceFromPropertyName(conf, Property.TRACE_TOKEN_TYPE, AuthenticationToken.class, new PasswordToken());
-        token.init(props);
-        at = token;
-      }
-    } else {
-      at = null;
-    }
-
-    final String table = conf.get(Property.TRACE_TABLE);
-    Scanner scanner;
-    if (null != traceUgi) {
-      try {
-        scanner = traceUgi.doAs(new PrivilegedExceptionAction<Scanner>() {
-
-          @Override
-          public Scanner run() throws Exception {
-            // Make the KerberosToken inside the doAs
-            AuthenticationToken token = at;
-            if (null == token) {
-              token = new KerberosToken();
-            }
-            return getScanner(table, principal, token);
-          }
-
-        });
-      } catch (IOException | InterruptedException e) {
-        throw new RuntimeException("Failed to obtain scanner", e);
-      }
-    } else {
-      if (null == at) {
-        throw new AssertionError("AuthenticationToken should not be null");
-      }
-      scanner = getScanner(table, principal, at);
-    }
-
-    return new AbstractMap.SimpleEntry<>(scanner, traceUgi);
-  }
-
-  private Scanner getScanner(String table, String principal, AuthenticationToken at) throws AccumuloException, AccumuloSecurityException {
-    try {
-      Connector conn = HdfsZooInstance.getInstance().getConnector(principal, at);
-      if (!conn.tableOperations().exists(table)) {
-        return new NullScanner();
-      }
-      Scanner scanner = conn.createScanner(table, conn.securityOperations().getUserAuthorizations(principal));
-      return scanner;
-    } catch (AccumuloSecurityException ex) {
-      return null;
-    } catch (TableNotFoundException ex) {
-      return new NullScanner();
-    }
-  }
-
-  private long addSpans(Scanner scanner, SpanTree tree, long start) {
-    for (Entry<Key,Value> entry : scanner) {
-      RemoteSpan span = TraceFormatter.getRemoteSpan(entry);
-      tree.addNode(span);
-      start = min(start, span.start);
-    }
-    return start;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0ca5cd33/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/XMLResource.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/XMLResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/XMLResource.java
deleted file mode 100644
index a7f671d..0000000
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/XMLResource.java
+++ /dev/null
@@ -1,52 +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.
- */
-package org.apache.accumulo.monitor.rest.resources;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response.Status;
-
-import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
-import org.apache.accumulo.core.master.thrift.TabletServerStatus;
-import org.apache.accumulo.monitor.Monitor;
-import org.apache.accumulo.monitor.rest.api.TabletServer;
-import org.apache.accumulo.monitor.rest.api.XMLInformation;
-
-@Path("/xml")
-public class XMLResource {
-
-  @GET
-  @Produces(MediaType.APPLICATION_XML)
-  public XMLInformation getXMLInformation() {
-
-    MasterMonitorInfo mmi = Monitor.getMmi();
-    if (null == mmi) {
-      throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
-    }
-
-    XMLInformation xml = new XMLInformation(mmi.tServerInfo.size(), new MasterResource().getTables(), new TablesResource().getTables());
-
-    for (TabletServerStatus status : mmi.tServerInfo) {
-      xml.addTablet(new TabletServer(status));
-    }
-
-    return xml;
-  }
-}


Mime
View raw message