[ 
https://issues.apache.org/jira/browse/DRILL-4604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15258432#comment-15258432
 ] 

ASF GitHub Bot commented on DRILL-4604:
---------------------------------------

Github user sudheeshkatkam commented on a diff in the pull request:

    https://github.com/apache/drill/pull/482#discussion_r61121895
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DrillRoot.java 
---
    @@ -55,44 +59,89 @@ public Viewable getStats() {
       @GET
       @Path("/stats.json")
       @Produces(MediaType.APPLICATION_JSON)
    -  public List<Stat> getStatsJSON() {
    -    List<Stat> stats = Lists.newLinkedList();
    -    stats.add(new Stat("Number of Drill Bits", 
work.getContext().getBits().size()));
    -    int number = 0;
    -    for (CoordinationProtos.DrillbitEndpoint bit : 
work.getContext().getBits()) {
    -      String initialized = bit.isInitialized() ? " initialized" : " not 
initialized";
    -      stats.add(new Stat("Bit #" + number, bit.getAddress() + 
initialized));
    -      ++number;
    +  public Stats getStatsJSON() {
    +    String version = 
work.getContext().getOptionManager().getOption(ExecConstants.CLUSTER_VERSION).string_val;
    +
    +    Map<String, Object> props = Maps.newLinkedHashMap();
    +    props.put("Cluster Version", version);
    +    props.put("Number of Drill Bits", work.getContext().getBits().size());
    +    CoordinationProtos.DrillbitEndpoint currentEndpoint = 
work.getContext().getEndpoint();
    +    String address = currentEndpoint.getAddress();
    +    props.put("Data Port Address", address + ":" + 
currentEndpoint.getDataPort());
    +    props.put("User Port Address", address + ":" + 
currentEndpoint.getUserPort());
    +    props.put("Control Port Address", address + ":" + 
currentEndpoint.getControlPort());
    +    props.put("Maximum Direct Memory", DrillConfig.getMaxDirectMemory());
    +
    +    return new Stats(props, collectBits(version));
    +  }
    +
    +  private Collection<Bit> collectBits(String version) {
    +    Set<Bit> bits = Sets.newTreeSet();
    +    for (CoordinationProtos.DrillbitEndpoint endpoint : 
work.getContext().getBits()) {
    +      boolean versionMatch = version.equals(endpoint.getVersion());
    +      Bit bit = new Bit(endpoint.getAddress(), endpoint.isInitialized(), 
endpoint.getVersion(), versionMatch);
    +      bits.add(bit);
         }
    -    stats.add(new Stat("Data Port Address", 
work.getContext().getEndpoint().getAddress() +
    -      ":" + work.getContext().getEndpoint().getDataPort()));
    -    stats.add(new Stat("User Port Address", 
work.getContext().getEndpoint().getAddress() +
    -      ":" + work.getContext().getEndpoint().getUserPort()));
    -    stats.add(new Stat("Control Port Address", 
work.getContext().getEndpoint().getAddress() +
    -      ":" + work.getContext().getEndpoint().getControlPort()));
    -    stats.add(new Stat("Maximum Direct Memory", 
DrillConfig.getMaxDirectMemory()));
    -
    -    return stats;
    +    return bits;
       }
     
       @XmlRootElement
    -  public class Stat {
    -    private String name;
    -    private Object value;
    +  public class Stats {
    --- End diff --
    
    static class


> Generate warning on Web UI if drillbits version mismatch is detected
> --------------------------------------------------------------------
>
>                 Key: DRILL-4604
>                 URL: https://issues.apache.org/jira/browse/DRILL-4604
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.6.0
>            Reporter: Arina Ielchiieva
>            Assignee: Arina Ielchiieva
>             Fix For: 1.7.0
>
>         Attachments: index_page.JPG, index_page_mismatch.JPG
>
>
> Display drillbit version on web UI. If any of drillbits version doesn't match 
> with current drillbit, generate warning.
> Screenshots - TBA.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to