View Javadoc

1   /*
2    *
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *     http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.hadoop.hbase.namequeues.response;
21  
22  import java.util.List;
23  import org.apache.commons.lang.builder.ToStringBuilder;
24  import org.apache.hadoop.hbase.classification.InterfaceAudience;
25  import org.apache.hadoop.hbase.namequeues.NamedQueuePayload;
26  import org.apache.hadoop.hbase.protobuf.generated.RecentLogs;
27  import org.apache.hadoop.hbase.protobuf.generated.TooSlowLog;
28  
29  /**
30   * Response object to be sent by namedQueue service back to caller
31   */
32  @InterfaceAudience.Private
33  public class NamedQueueGetResponse {
34  
35    private List<TooSlowLog.SlowLogPayload> slowLogPayloads;
36    private List<RecentLogs.BalancerDecision> balancerDecisions;
37    private NamedQueuePayload.NamedQueueEvent namedQueueEvent;
38  
39    public List<TooSlowLog.SlowLogPayload> getSlowLogPayloads() {
40      return slowLogPayloads;
41    }
42  
43    public void setSlowLogPayloads(List<TooSlowLog.SlowLogPayload> slowLogPayloads) {
44      this.slowLogPayloads = slowLogPayloads;
45    }
46  
47    public List<RecentLogs.BalancerDecision> getBalancerDecisions() {
48      return balancerDecisions;
49    }
50  
51    public void setBalancerDecisions(List<RecentLogs.BalancerDecision> balancerDecisions) {
52      this.balancerDecisions = balancerDecisions;
53    }
54  
55    public NamedQueuePayload.NamedQueueEvent getNamedQueueEvent() {
56      return namedQueueEvent;
57    }
58  
59    public void setNamedQueueEvent(int eventOrdinal) {
60      this.namedQueueEvent = NamedQueuePayload.NamedQueueEvent.getEventByOrdinal(eventOrdinal);
61    }
62  
63    @Override
64    public String toString() {
65      return new ToStringBuilder(this)
66        .append("slowLogPayloads", slowLogPayloads)
67        .append("balancerDecisions", balancerDecisions)
68        .append("namedQueueEvent", namedQueueEvent)
69        .toString();
70    }
71  
72  }