accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lstav <...@git.apache.org>
Subject [GitHub] accumulo pull request #200: Accumulo 4558 Added shell command to display ser...
Date Thu, 12 Jan 2017 12:29:11 GMT
Github user lstav commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/200#discussion_r95780972
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/client/TServerStatus.java ---
    @@ -0,0 +1,182 @@
    +/*
    + * 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.core.client;
    +
    +/**
    + * This exception is thrown if a table is deleted after an operation starts.
    + *
    + * For example if table A exist when a scan is started, but is deleted during the scan
then this exception is thrown.
    + *
    + */
    +
    +public class TServerStatus extends RuntimeException {
    +
    +  private static final long serialVersionUID = 1L;
    +  private String name, version;
    +  int hostedTablets;
    +  long lastContact, entries, holdTime;
    +  double ingest, query, indexHitRate, dataHitRate, osLoad;
    +  Integer scans, minor, major;
    +
    +  public TServerStatus() {
    +    name = "";
    +    hostedTablets = 0;
    +    lastContact = 0l;
    +    entries = 0l;
    +    ingest = 0.0;
    +    query = 0.0;
    +    holdTime = 0l;
    +    scans = null;
    +    minor = null;
    +    major = null;
    +    indexHitRate = 0.0;
    +    dataHitRate = 0.0;
    +    osLoad = 0.0;
    +    version = "";
    +  }
    +
    +  public TServerStatus(String name, int hostedTablets, long lastContact, long entries,
double ingest, double query, long holdTime, Integer scans,
    +      Integer minor, Integer major, double indexHitRate, double dataHitRate, double osLoad,
String version) {
    +    this.name = name;
    +    this.hostedTablets = hostedTablets;
    +    this.lastContact = lastContact;
    +    this.entries = entries;
    +    this.ingest = ingest;
    +    this.query = query;
    +    this.holdTime = holdTime;
    +    this.scans = scans;
    +    this.minor = minor;
    +    this.major = major;
    +    this.indexHitRate = indexHitRate;
    +    this.dataHitRate = dataHitRate;
    +    this.osLoad = osLoad;
    +    this.version = version;
    +  }
    +
    +  public String getName() {
    +    return name;
    +  }
    +
    +  public void setName(String name) {
    +    this.name = name;
    +  }
    +
    +  public String getVersion() {
    +    return version;
    +  }
    +
    +  public void setVersion(String version) {
    +    this.version = version;
    +  }
    +
    +  public int getHostedTablets() {
    +    return hostedTablets;
    +  }
    +
    +  public void setHostedTablets(int hostedTablets) {
    +    this.hostedTablets = hostedTablets;
    +  }
    +
    +  public long getLastContact() {
    +    return lastContact;
    +  }
    +
    +  public void setLastContact(long lastContact) {
    +    this.lastContact = lastContact;
    +  }
    +
    +  public long getEntries() {
    +    return entries;
    +  }
    +
    +  public void setEntries(long entries) {
    +    this.entries = entries;
    +  }
    +
    +  public long getHoldTime() {
    +    return holdTime;
    +  }
    +
    +  public void setHoldTime(long holdTime) {
    +    this.holdTime = holdTime;
    +  }
    +
    +  public double getIngest() {
    +    return ingest;
    +  }
    +
    +  public void setIngest(double ingest) {
    +    this.ingest = ingest;
    +  }
    +
    +  public double getQuery() {
    +    return query;
    +  }
    +
    +  public void setQuery(double query) {
    +    this.query = query;
    +  }
    +
    +  public double getIndexHitRate() {
    --- End diff --
    
    After talking with @ctubbsii, he mentioned that since I'm returning the tablet server
status on the new API adition, I needed to create this class for that and then populate it
with the actual TabletServerStatus object, which I do on `IntanceOperationsImpl.java`. This
class only stores the values for the public API. If I misunderstood what you meant, please
let me know.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message