Search in sources :

Example 6 with NamedQueueGetRequest

use of org.apache.hadoop.hbase.namequeues.request.NamedQueueGetRequest in project hbase by apache.

the class MasterRpcServices method getBalancerRejections.

private MasterProtos.BalancerRejectionsResponse getBalancerRejections(MasterProtos.BalancerRejectionsRequest request) {
    final NamedQueueRecorder namedQueueRecorder = this.server.getNamedQueueRecorder();
    if (namedQueueRecorder == null) {
        return MasterProtos.BalancerRejectionsResponse.newBuilder().addAllBalancerRejection(Collections.emptyList()).build();
    }
    final NamedQueueGetRequest namedQueueGetRequest = new NamedQueueGetRequest();
    namedQueueGetRequest.setNamedQueueEvent(BalancerRejectionDetails.BALANCER_REJECTION_EVENT);
    namedQueueGetRequest.setBalancerRejectionsRequest(request);
    NamedQueueGetResponse namedQueueGetResponse = namedQueueRecorder.getNamedQueueRecords(namedQueueGetRequest);
    List<RecentLogs.BalancerRejection> balancerRejections = namedQueueGetResponse != null ? namedQueueGetResponse.getBalancerRejections() : Collections.emptyList();
    return MasterProtos.BalancerRejectionsResponse.newBuilder().addAllBalancerRejection(balancerRejections).build();
}
Also used : NamedQueueRecorder(org.apache.hadoop.hbase.namequeues.NamedQueueRecorder) NamedQueueGetResponse(org.apache.hadoop.hbase.namequeues.response.NamedQueueGetResponse) NamedQueueGetRequest(org.apache.hadoop.hbase.namequeues.request.NamedQueueGetRequest)

Example 7 with NamedQueueGetRequest

use of org.apache.hadoop.hbase.namequeues.request.NamedQueueGetRequest in project hbase by apache.

the class TestNamedQueueRecorder method getSlowLogPayloads.

private List<SlowLogPayload> getSlowLogPayloads(AdminProtos.SlowLogResponseRequest request) {
    NamedQueueGetRequest namedQueueGetRequest = new NamedQueueGetRequest();
    namedQueueGetRequest.setNamedQueueEvent(RpcLogDetails.SLOW_LOG_EVENT);
    namedQueueGetRequest.setSlowLogResponseRequest(request);
    NamedQueueGetResponse namedQueueGetResponse = namedQueueRecorder.getNamedQueueRecords(namedQueueGetRequest);
    return namedQueueGetResponse == null ? Collections.emptyList() : namedQueueGetResponse.getSlowLogPayloads();
}
Also used : NamedQueueGetResponse(org.apache.hadoop.hbase.namequeues.response.NamedQueueGetResponse) NamedQueueGetRequest(org.apache.hadoop.hbase.namequeues.request.NamedQueueGetRequest)

Aggregations

NamedQueueGetRequest (org.apache.hadoop.hbase.namequeues.request.NamedQueueGetRequest)7 NamedQueueGetResponse (org.apache.hadoop.hbase.namequeues.response.NamedQueueGetResponse)7 LogEntry (org.apache.hadoop.hbase.client.LogEntry)2 NamedQueueRecorder (org.apache.hadoop.hbase.namequeues.NamedQueueRecorder)2 MasterProtos (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos)2 List (java.util.List)1 Map (java.util.Map)1 ServerName (org.apache.hadoop.hbase.ServerName)1 TableName (org.apache.hadoop.hbase.TableName)1 RegionInfo (org.apache.hadoop.hbase.client.RegionInfo)1 MasterServices (org.apache.hadoop.hbase.master.MasterServices)1 RegionPlan (org.apache.hadoop.hbase.master.RegionPlan)1 SlowLogPayload (org.apache.hadoop.hbase.shaded.protobuf.generated.TooSlowLog.SlowLogPayload)1 Test (org.junit.Test)1