Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.apache.helix.model;
  
  /*
   * 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.
  */
 
 import java.util.Map;
 
Statistics for an instance
 
 public class PersistentStats extends HelixProperty {
   private static final Logger _logger = Logger.getLogger(PersistentStats.class.getName());

  
High-level properties to provide context for these statistics
 
   public enum PersistentStatsProperty {
     SESSION_ID,
     FIELDS
   }
 
   // private final ZNRecord _record;
 
  
The name of the statistics ZNode
 
   public final static String nodeName = "PersistentStats";

  
Instantiate with an identifier

Parameters:
id record identifier
 
   public PersistentStats(String id) {
     super(id);
   }

  
Instantiate with a pre-populated record

Parameters:
record ZNRecord with fields corresponding to persistent stats
 
   public PersistentStats(ZNRecord record) {
     // _record = record;
     super(record);
 
   }
 
   /*
    * public PersistentStats(ZNRecord record, Stat stat)
    * {
    * super(record, stat);
    * }
    */

  
Set the session corresponding to these statistics

Parameters:
sessionId session id
 
   public void setSessionId(String sessionId) {
   }

  
Get the session corresponding to these statistics

Returns:
session id
 
   public String getSessionId() {
   }

  
Get the instance for which these stats have been collected

Returns:
instance name
 
   public String getInstanceName() {
     return .getId();
   }
 
   /*
    * public String getVersion()
   * {
   * return _record.getSimpleField(CLUSTER_MANAGER_VERSION.toString());
   * }
   */

  
Get all the statistics currently stored

Returns:
map of (stat name, stat attribute, value)
  public Map<StringMap<StringString>> getMapFields() {
    return .getMapFields();
  }

  
Get a specific statistic

Parameters:
statName the statistic to look up
Returns:
map of (stat attribute, value)
  public Map<StringStringgetStatFields(String statName) {
    return .getMapField(statName);
  }
  public boolean isValid() {
    // TODO Auto-generated method stub
    return true;
  }
New to GrepCode? Check out our FAQ X