2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 package org
.apache
.hadoop
.hbase
.ipc
;
20 import java
.io
.IOException
;
21 import java
.net
.InetAddress
;
23 import org
.apache
.hadoop
.hbase
.CellScanner
;
24 import org
.apache
.hadoop
.hbase
.io
.ByteBuffAllocator
;
25 import org
.apache
.hadoop
.hbase
.ipc
.RpcServer
.CallCleanup
;
26 import org
.apache
.yetus
.audience
.InterfaceAudience
;
27 import org
.apache
.hbase
.thirdparty
.com
.google
.protobuf
.BlockingService
;
28 import org
.apache
.hbase
.thirdparty
.com
.google
.protobuf
.Descriptors
.MethodDescriptor
;
29 import org
.apache
.hbase
.thirdparty
.com
.google
.protobuf
.Message
;
30 import org
.apache
.hadoop
.hbase
.shaded
.protobuf
.generated
.RPCProtos
.RequestHeader
;
33 * Datastructure that holds all necessary to a method invocation and then afterward, carries the
37 @InterfaceAudience.Private
38 class NettyServerCall
extends ServerCall
<NettyServerRpcConnection
> {
40 NettyServerCall(int id
, BlockingService service
, MethodDescriptor md
, RequestHeader header
,
41 Message param
, CellScanner cellScanner
, NettyServerRpcConnection connection
, long size
,
42 InetAddress remoteAddress
, long receiveTime
, int timeout
, ByteBuffAllocator bbAllocator
,
43 CellBlockBuilder cellBlockBuilder
, CallCleanup reqCleanup
) {
44 super(id
, service
, md
, header
, param
, cellScanner
, connection
, size
, remoteAddress
, receiveTime
,
45 timeout
, bbAllocator
, cellBlockBuilder
, reqCleanup
);
49 * If we have a response, and delay is not set, then respond immediately. Otherwise, do not
50 * respond to client. This is called by the RPC code in the context of the Handler thread.
53 public synchronized void sendResponseIfReady() throws IOException
{
54 // set param null to reduce memory pressure
56 connection
.channel
.writeAndFlush(this);