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;
 
Get characteristics of alerts, whether they were fired, and their context. An alert is triggered when cluster health violates pre-defined constraints to ensure that the cluster meets SLAs.
 
 public class AlertStatus extends HelixProperty {

  
The name of the ZNode containing alert status
 
   public final static String nodeName = "AlertStatus";

  
Instantiate with an identifier

Parameters:
id identifier representing this group of alert statuses
 
   public AlertStatus(String id) {
     super(id);
   }

  
Instantiate with a pre-populated record corresponding to alert status

Parameters:
record ZNRecord representing alert statuses
 
   public AlertStatus(ZNRecord record) {
     // _record = record;
     super(record);
 
   }
 
   /*
    * public Alerts(ZNRecord record, Stat stat) { super(record, stat); }
    */

  
Set the session that these alerts correspond to

Parameters:
sessionId session for which to look up alerts
 
   public void setSessionId(String sessionId) {
   }

  
Set the session that the alerts correspond to

Parameters:
sessionId the session for which alerts occurred
 
   public void setSessionId(SessionId sessionId) {
     if (sessionId != null) {
       setSessionId(sessionId.stringify());
     }
   }

  
Get the session that these alerts correspond to

Returns:
session identifier
 
   public String getSessionId() {
   }

  
Get the session that the alerts correspond to

Returns:
session identifier
 
   public SessionId getTypedSessionId() {
     return SessionId.from(getSessionId());
   }

  
Get the instance that these alerts correspond to

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

  
Get the properties of all alerts, such as if they were fired

Returns:
all alert statuses as a Map of alert to the status properties
  public Map<StringMap<StringString>> getMapFields() {
    return .getMapFields();
  }

  
Get the statistics of a single alert

Parameters:
statName Name of the alert
Returns:
alert statistics as a map of name, value pairs
  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