[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

classic Classic list List threaded Threaded
50 messages Options
123
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
GitHub user lstav opened a pull request:

    https://github.com/apache/accumulo/pull/194

    ACCUMULO-3005 Added REST API calls

    This pull request is to serve as a code review for the REST API (rest/api and rest/resources) code.
    This listens on a separate port from the current monitor.
    I will be working on the client side of the monitor next to use these calls.
   
    Some of the code was written to be able to run it from a separate port and will be removed when the UI is completed.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/lstav/accumulo ACCUMULO-3005

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/accumulo/pull/194.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #194
   
----
commit 8f6ab4c9d1a47275793ef0e3baf9e291c69cc0ae
Author: Josh Elser <[hidden email]>
Date:   2014-11-30T07:16:42Z

    Start revisiting rest service for the monitor without dropwizard

commit db253d363f134e7ffc9a91d30f82c5dc13efc57c
Author: Josh Elser <[hidden email]>
Date:   2014-12-01T01:03:11Z

    Move over to jackson2

commit d00c08a62854279b88486a90d2b7c2038337ac24
Author: Josh Elser <[hidden email]>
Date:   2014-12-01T02:57:11Z

    Get the build aggregating all of the jars in lib/

commit 545397bff5a6e73d6921bde26c5dc165c513fc84
Author: Josh Elser <[hidden email]>
Date:   2014-12-01T02:57:28Z

    Removing duplicate properties with different method names.

commit 9c11bd2a9f48e915e3f6312cef2f04b2a85a61d6
Author: Josh Elser <[hidden email]>
Date:   2014-12-01T05:36:45Z

    Get the build correctly placing the dependencies in the assembly.
   
    Consolidated one otherwise duplicative resource.

commit 5bec30d272bc141d5512037bbd2ff67e8ae86c64
Author: Josh Elser <[hidden email]>
Date:   2014-12-01T06:02:41Z

    Move monitor-rest into monitor-webapp

commit 27a4affe678797bba54dc45bf8655b941173795b
Author: Josh Elser <[hidden email]>
Date:   2015-07-29T18:54:32Z

    Rebase the changes on top of 1.8

commit ffc9b7517cde1fd26f34eae411f1c32ff7a18ae0
Author: Josh Elser <[hidden email]>
Date:   2015-07-29T21:04:32Z

    Clean up the poms and assembly a little

commit 81583613c5b3496c427b4810033dedff9beafc4d
Author: Josh Elser <[hidden email]>
Date:   2015-08-13T03:15:58Z

    Clean everything up and move to mustache.

commit 2d8a3b8c27c530b896ad009442d9586f584f1c5b
Author: Christopher Tubbs <[hidden email]>
Date:   2015-06-24T16:04:07Z

    ACCUMULO-3005 Rebase monitor webapp onto master
   
    * Rebase Josh's work in creating a rest webapp for the monitor onto master

commit 96e9b8588a9986b9165396fca8d451ff4551283d
Author: Josh Elser <[hidden email]>
Date:   2015-08-13T04:15:15Z

    nope, mustache is out, freemarker is in.
   
    mustache doesn't have any control flow which
    would require a bunch of BS partial generation
    in the controllers

commit eac3b0f75e1a8a26dd7208790b3b1ff9269f571b
Author: Josh Elser <[hidden email]>
Date:   2015-08-13T05:52:05Z

    Start stubbing out the overview page

commit 38f9912167262bad5d1b023eb2cd913999832247
Author: Luis Tavarez <[hidden email]>
Date:   2016-11-18T13:58:45Z

    ACCUMULO-3005 Added REST API Calls

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo issue #194: ACCUMULO-3005 Added REST API calls

joshelser
Github user lstav commented on the issue:

    https://github.com/apache/accumulo/pull/194
 
    I just added a JSON object for the ServerStats class, I forgot to include the JSON object for the array.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user mikewalch commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93786163
 
    --- Diff: server/monitor/src/main/resources/templates/org/apache/accumulo/monitor/rest/view/Overview/index.ftl ---
    @@ -0,0 +1,83 @@
    +<!--
    +  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.
    +-->
    +<html>
    +  <head>
    +    <title>${title} - Accumulo ${version}</title>
    +    <#if refresh gt 0 ><meta http-equiv='refresh' content='${refresh}' /></#if>
    +    <meta http-equiv='Content-Type' content='test/html"' />
    +    <meta http-equiv='Content-Script-Type' content='text/javascript' />
    +    <meta http-equiv='Content-Style-Type' content='text/css' />
    +    <link rel='shortcut icon' type='image/jpg' href='/web/favicon.png' />
    +    <link rel='stylesheet' type='text/css' href='/web/screen.css' media='screen' />
    +    <script src='/web/functions.js' type='text/javascript'></script>
    +
    +    <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="/web/flot/excanvas.min.js"></script><![endif]-->
    +    <script language="javascript" type="text/javascript" src="/web/flot/jquery.js"></script>
    +    <script language="javascript" type="text/javascript" src="/web/flot/jquery.flot.js"></script>
    +  </head>
    +
    +  <body>
    +    <div id='content-wrapper'>
    +      <div id='content'>
    +        <div id='header'>
    +          <div id='headertitle'>
    +            <h1>${title}</h1>
    +          </div>
    +          <div id='subheader'>Instance&nbsp;Name:&nbsp;${instance_name}&nbsp;&nbsp;&nbsp;Version:&nbsp;${version}
    +            <br><span class='smalltext'>Instance&nbsp;ID:&nbsp;${instance_id}</span>
    +            <br><span class='smalltext'>${current_date}</span>
    +          </div>
    +        </div>
    +
    +        <#include "/templates/sidebar.ftl">
    +
    +        <div id='main' style='bottom:0'>
    +        <#--
    --- End diff --
   
    Commented out HTML should be removed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user mikewalch commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93785751
 
    --- Diff: assemble/src/main/assemblies/component.xml ---
    @@ -40,15 +40,48 @@
             <include>org.apache.commons:commons-math3</include>
             <include>org.apache.commons:commons-vfs2</include>
             <include>org.apache.thrift:libthrift</include>
    +        <include>org.eclipse.jetty:jetty-continuation</include>
             <include>org.eclipse.jetty:jetty-http</include>
             <include>org.eclipse.jetty:jetty-io</include>
             <include>org.eclipse.jetty:jetty-security</include>
             <include>org.eclipse.jetty:jetty-server</include>
    +        <!-- jetty-servlet only needed by old monitor -->
             <include>org.eclipse.jetty:jetty-servlet</include>
             <include>org.eclipse.jetty:jetty-util</include>
             <include>org.apache.htrace:htrace-core</include>
             <include>org.slf4j:slf4j-api</include>
             <include>org.slf4j:slf4j-log4j12</include>
    +        <!-- Jersey/Jackson-based webservice -->
    --- End diff --
   
    Jersey brings in a lot of dependencies that will have to be distributed with Accumulo.  While I think Jersey is great for unreleased software, I think the [Spark microframework](http://sparkjava.com/) would be a better fit for the Accumulo monitor.  Spark only relies on Jetty (which is already a dependency).  You could generate JSON using GSON (which is also already a dependency). Spark also has a freemarker template engine.  If you use Spark, new dependencies should only be limited to the following:
   
    ```
    <include>com.sparkjava:spark-core</include>
    <include>com.sparkjava:spark-template-freemarker</include>
    <include>org.freemarker:freemarker</include>
    ```
    If you are interested in using Spark, I can send you some code examples.  With Spark, you might need to have separate REST & HTML routes but you can keep your code simple by wrapping your business logic in methods.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user ctubbsii commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93790652
 
    --- Diff: assemble/src/main/assemblies/component.xml ---
    @@ -40,15 +40,48 @@
             <include>org.apache.commons:commons-math3</include>
             <include>org.apache.commons:commons-vfs2</include>
             <include>org.apache.thrift:libthrift</include>
    +        <include>org.eclipse.jetty:jetty-continuation</include>
             <include>org.eclipse.jetty:jetty-http</include>
             <include>org.eclipse.jetty:jetty-io</include>
             <include>org.eclipse.jetty:jetty-security</include>
             <include>org.eclipse.jetty:jetty-server</include>
    +        <!-- jetty-servlet only needed by old monitor -->
             <include>org.eclipse.jetty:jetty-servlet</include>
             <include>org.eclipse.jetty:jetty-util</include>
             <include>org.apache.htrace:htrace-core</include>
             <include>org.slf4j:slf4j-api</include>
             <include>org.slf4j:slf4j-log4j12</include>
    +        <!-- Jersey/Jackson-based webservice -->
    --- End diff --
   
    Unfortunately, I disagree with @mikewalch on this point.
   
    I'd prefer jersey. As the JAX-RS (JSR 311 & JSR 339) reference implementation, it's the standard for webapps, widely available in many Linux distributions, community-established APIs, and easily ported to various containers. While we don't absolutely *have* to stick with Jersey, using the JAX-RS standards as closely as possible ensures we have the ability to switch out implementations with minimal code changes, as needed. I think that there's a compelling case to be made for sticking with standards.
   
    Jackson is useful with Jersey for automatic generation of JSON and XML, and provides a lot of standard providers for serialization in Java webapps. I wouldn't want us to switch to using Gson, as that would probably require writing a custom provider.
   
    While I find sparkjava compelling for quickly built applications, I'm not convinced it's the best choice for us. Keep in mind, we will probably still have to support some of the custom servlet stuff regardless (the shell servlet cannot be converted to a REST interface, and we're using the base servlet to load classpath resources). I'd rather stick to the standards to start, so we can get the work done, and then consider switching frameworks later, after we've stripped out all the servlet clutter.
   
    If your concern is about bundling, we could stop bundling in the tarball. But, a few extra jars, especially ones that are relatively small and standard, isn't really a big deal, in my opinion.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user mikewalch commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93795541
 
    --- Diff: assemble/src/main/assemblies/component.xml ---
    @@ -40,15 +40,48 @@
             <include>org.apache.commons:commons-math3</include>
             <include>org.apache.commons:commons-vfs2</include>
             <include>org.apache.thrift:libthrift</include>
    +        <include>org.eclipse.jetty:jetty-continuation</include>
             <include>org.eclipse.jetty:jetty-http</include>
             <include>org.eclipse.jetty:jetty-io</include>
             <include>org.eclipse.jetty:jetty-security</include>
             <include>org.eclipse.jetty:jetty-server</include>
    +        <!-- jetty-servlet only needed by old monitor -->
             <include>org.eclipse.jetty:jetty-servlet</include>
             <include>org.eclipse.jetty:jetty-util</include>
             <include>org.apache.htrace:htrace-core</include>
             <include>org.slf4j:slf4j-api</include>
             <include>org.slf4j:slf4j-log4j12</include>
    +        <!-- Jersey/Jackson-based webservice -->
    --- End diff --
   
    I looked at Spark vs Jersey packaging in Linux distributions and I agree with @ctubbsii's point that Jersey is a better choice for packaging.  Jersey is in Fedora and Ubuntu while Spark hasn't been packaged there yet.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user ctubbsii commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93807013
 
    --- Diff: assemble/src/main/assemblies/component.xml ---
    @@ -40,15 +40,48 @@
             <include>org.apache.commons:commons-math3</include>
             <include>org.apache.commons:commons-vfs2</include>
             <include>org.apache.thrift:libthrift</include>
    +        <include>org.eclipse.jetty:jetty-continuation</include>
             <include>org.eclipse.jetty:jetty-http</include>
             <include>org.eclipse.jetty:jetty-io</include>
             <include>org.eclipse.jetty:jetty-security</include>
             <include>org.eclipse.jetty:jetty-server</include>
    +        <!-- jetty-servlet only needed by old monitor -->
             <include>org.eclipse.jetty:jetty-servlet</include>
             <include>org.eclipse.jetty:jetty-util</include>
             <include>org.apache.htrace:htrace-core</include>
             <include>org.slf4j:slf4j-api</include>
             <include>org.slf4j:slf4j-log4j12</include>
    +        <!-- Jersey/Jackson-based webservice -->
    --- End diff --
   
    For fun, I might try to package sparkjava in Fedora. For the purposes of this effort, I think I'm more concerned about straying too far from established standards and running into novel problems to solve which would have been easily addressed with the more well-traveled path.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819758
 
    --- Diff: assemble/src/main/assemblies/component.xml ---
    @@ -40,15 +40,48 @@
             <include>org.apache.commons:commons-math3</include>
             <include>org.apache.commons:commons-vfs2</include>
             <include>org.apache.thrift:libthrift</include>
    +        <include>org.eclipse.jetty:jetty-continuation</include>
             <include>org.eclipse.jetty:jetty-http</include>
             <include>org.eclipse.jetty:jetty-io</include>
             <include>org.eclipse.jetty:jetty-security</include>
             <include>org.eclipse.jetty:jetty-server</include>
    +        <!-- jetty-servlet only needed by old monitor -->
             <include>org.eclipse.jetty:jetty-servlet</include>
             <include>org.eclipse.jetty:jetty-util</include>
             <include>org.apache.htrace:htrace-core</include>
             <include>org.slf4j:slf4j-api</include>
             <include>org.slf4j:slf4j-log4j12</include>
    +        <!-- Jersey/Jackson-based webservice -->
    --- End diff --
   
    > Jersey brings in a lot of dependencies that will have to be distributed with Accumulo
   
    This is a good point and one that I had punted on originally. I agree with Jersey being ideal as the reference implementation for jax-rs; however, depending on the size of what we actually need to include to make it work, I could be swayed. I'm not sure what this actually looks like transitively.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819855
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TableInformation.java ---
    @@ -0,0 +1,99 @@
    +/*
    + * 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;
    +
    +import org.apache.accumulo.core.master.thrift.TableInfo;
    +
    +public class TableInformation {
    +
    +  public String tablename, tableId, tableState;
    +
    +  public int tablets, onlineTablets;
    +  public long recs, recsInMemory;
    +
    +  public double ingest, ingestByteRate, query, queryByteRate;
    +
    +  public CompactionsList majorCompactions, minorCompactions, scans;
    +
    +  private int queuedMajorCompactions, runningMajorCompactions, queuedMinorCompactions, runningMinorCompactions, queuedScans, runningScans;
    +
    +  public double entriesRead, entriesReturned;
    +  public Double holdTime;
    +
    +  public int offlineTablets;
    +
    +  public TableInformation() {}
    +
    +  public TableInformation(String tableName, String tableId, String tableState) {
    +    this.tablename = tableName;
    +    this.tableId = tableId;
    +    this.tableState = tableState;
    +  }
    +
    +  public TableInformation(String tableName, String tableId, TableInfo info, Double holdTime, String tableState) {
    +    this.tablename = tableName;
    +    this.tableId = tableId;
    +
    +    this.tablets = info.tablets;
    +    this.offlineTablets = info.tablets - info.onlineTablets;
    +    this.onlineTablets = info.onlineTablets;
    +
    +    this.recs = info.recs;
    +    this.recsInMemory = info.recsInMemory;
    +
    +    this.ingest = info.getIngestRate();
    +    this.ingestByteRate = info.getIngestByteRate();
    +
    +    this.query = info.getQueryRate();
    +    this.queryByteRate = info.getQueryByteRate();
    +
    +    this.entriesRead = info.scanRate;
    +    this.entriesReturned = info.queryRate;
    +
    +    this.holdTime = holdTime;
    +
    +    if (null != info.scans) {
    +      this.queuedScans = info.scans.queued;
    +      this.runningScans = info.scans.running;
    +    } else {
    +      this.queuedScans = 0;
    --- End diff --
   
    Does it make sense to initialize these to `0` instead of setting them in the else-branch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819867
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerInformation.java ---
    @@ -0,0 +1,118 @@
    +/*
    + * 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;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import javax.xml.bind.annotation.XmlAttribute;
    +
    +import org.apache.accumulo.core.master.thrift.RecoveryStatus;
    +import org.apache.accumulo.core.master.thrift.TableInfo;
    +import org.apache.accumulo.core.master.thrift.TabletServerStatus;
    +import org.apache.accumulo.monitor.Monitor;
    +import org.apache.accumulo.server.util.TableInfoUtil;
    +
    +public class TabletServerInformation {
    +
    +  @XmlAttribute(name = "id")
    +  public String server;
    +
    +  public String hostname;
    +  public long lastContact;
    +  public double osload;
    +
    +  public CompactionsTypes compactions;
    +
    +  public int tablets;
    +  public double ingest, query, ingestMB, queryMB;
    +  public Integer scans; // For backwards compatibility, has same information as scansRunning
    +  public Double scansessions;
    +  public Double scanssessions; // For backwards compatibility
    +  public long holdtime;
    +
    +  // New variables
    +
    +  public String ip;
    +  private Integer scansRunning, scansQueued, minorRunning, minorQueued, majorRunning, majorQueued;
    +  private CompactionsList scansCompacting, major, minor; // if scans is removed, change scansCompacting to scans
    +  public long entries, lookups, indexCacheHits, indexCacheRequests, dataCacheHits, dataCacheRequests;
    +  public double indexCacheHitRate, dataCacheHitRate;
    +  public List<RecoveryStatusInformation> logRecoveries;
    +
    +  public TabletServerInformation() {}
    +
    +  public TabletServerInformation(TabletServerStatus thriftStatus) {
    +    TableInfo summary = TableInfoUtil.summarizeTableStats(thriftStatus);
    +    updateTabletServerInfo(thriftStatus, summary);
    +  }
    +
    +  public void updateTabletServerInfo(TabletServerStatus thriftStatus, TableInfo summary) {
    +
    +    long now = System.currentTimeMillis();
    +
    +    this.server = this.ip = this.hostname = thriftStatus.name;
    +    this.tablets = summary.tablets;
    --- End diff --
   
    Maybe a check that TableInfo is non-null before using it the first time? `Objects.requireNonNull(summary).tablets` would be an easy modification.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819806
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/AddlInformation.java ---
    @@ -0,0 +1,39 @@
    +/*
    + * 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;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +public class AddlInformation {
    --- End diff --
   
    Nit: What is this class used for? Add some javadoc, please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819894
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/resources/ReplicationResource.java ---
    @@ -0,0 +1,193 @@
    +/*
    + * 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 javax.ws.rs.Path;
    +import javax.ws.rs.Produces;
    +import javax.ws.rs.core.MediaType;
    +
    +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;
    +
    +@Path("/replication")
    +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    +public class ReplicationResource {
    +  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);
    --- End diff --
   
    Looking back, this shouldn't be at `error`, more like trace.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819830
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/DeadLoggerInformation.java ---
    @@ -0,0 +1,39 @@
    +/*
    + * 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;
    +
    +import javax.xml.bind.annotation.XmlAttribute;
    +
    +public class DeadLoggerInformation {
    --- End diff --
   
    I would guess that this is unnecessary. We haven't had loggers since Accumulo 1.4.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819762
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/GrizzlyMonitorApplication.java ---
    @@ -0,0 +1,21 @@
    +/*
    + * 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;
    +
    +public class GrizzlyMonitorApplication { // extends MonitorApplication {
    --- End diff --
   
    Is this used anymore?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819800
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/MonitorApplication.java ---
    @@ -0,0 +1,118 @@
    +/*
    + * 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;
    +
    +import static java.nio.charset.StandardCharsets.UTF_8;
    +
    +import java.net.URI;
    +
    +import org.apache.accumulo.core.Constants;
    +import org.apache.accumulo.core.client.Instance;
    +import org.apache.accumulo.core.util.Daemon;
    +import org.apache.accumulo.core.zookeeper.ZooUtil;
    +import org.apache.accumulo.fate.util.LoggingRunnable;
    +import org.apache.accumulo.fate.util.UtilWaitThread;
    +import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
    +import org.apache.accumulo.monitor.Monitor;
    +import org.apache.accumulo.monitor.ZooKeeperStatus;
    +import org.apache.accumulo.server.AccumuloServerContext;
    +import org.apache.accumulo.server.conf.ServerConfigurationFactory;
    +import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import com.google.common.net.HostAndPort;
    +
    +/**
    + *
    + */
    +public abstract class MonitorApplication implements Runnable {
    +  private static final Logger log = LoggerFactory.getLogger(MonitorApplication.class);
    +
    +  protected URI getServerUri() {
    +    return URI.create("http://localhost:50096/accumulo");
    --- End diff --
   
    The hostname and port to bind to needs to be pulled from configuration.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819822
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/AllTimeTabletResults.java ---
    @@ -0,0 +1,39 @@
    +/*
    + * 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;
    +
    +public class AllTimeTabletResults {
    +
    +  public String operation;
    --- End diff --
   
    Would prefer to see these be `private` with setters and getters. I believe Jackson is smart enough to use either the member fields or the appropriately named setters and getters.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819840
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/RecentTracesInformation.java ---
    @@ -0,0 +1,54 @@
    +/*
    + * 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;
    +
    +import org.apache.accumulo.tracer.thrift.RemoteSpan;
    +
    +public class RecentTracesInformation {
    +
    +  public String type;
    +  public Long avg;
    +
    +  public int total = 0;
    +
    +  public long min = Long.MAX_VALUE, max = Long.MIN_VALUE;
    --- End diff --
   
    Nit: stylistically, please place these on their own line.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819817
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/BadTabletServerInformation.java ---
    @@ -0,0 +1,32 @@
    +/*
    + * 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;
    +
    +import javax.xml.bind.annotation.XmlAttribute;
    +
    +public class BadTabletServerInformation {
    +
    +  @XmlAttribute
    --- End diff --
   
    Does the `@XmlAttribute` need to be on the other pojos?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819765
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/AccumuloExceptionMapper.java ---
    @@ -0,0 +1,34 @@
    +/*
    + * 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;
    +
    +import javax.ws.rs.core.Response;
    +import javax.ws.rs.ext.ExceptionMapper;
    +import javax.ws.rs.ext.Provider;
    +
    +import org.apache.commons.lang.exception.ExceptionUtils;
    +
    +/**
    + *
    --- End diff --
   
    Nit: add some javadoc or remove the empty block-comment.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] accumulo pull request #194: ACCUMULO-3005 Added REST API calls

joshelser
In reply to this post by joshelser
Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/194#discussion_r93819843
 
    --- Diff: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/RecentTracesInformation.java ---
    @@ -0,0 +1,54 @@
    +/*
    + * 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;
    +
    +import org.apache.accumulo.tracer.thrift.RemoteSpan;
    +
    +public class RecentTracesInformation {
    +
    +  public String type;
    +  public Long avg;
    +
    +  public int total = 0;
    +
    +  public long min = Long.MAX_VALUE, max = Long.MIN_VALUE;
    +  private long totalMS = 0l;
    +  public long histogram[] = new long[] {0l, 0l, 0l, 0l, 0l, 0l};
    +
    +  public RecentTracesInformation() {}
    +
    +  public RecentTracesInformation(String type) {
    +    this.type = type;
    +  }
    +
    +  public void addSpan(RemoteSpan span) {
    --- End diff --
   
    Should this be synchronized?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---
123
Loading...