HBASE-26286: Add support for specifying store file tracker when restoring or cloning...
[hbase.git] / hbase-server / src / main / java / org / apache / hadoop / hbase / ipc / PluggableBlockingQueue.java
blob0b88b6ccaa755d2b7ad758e688f647d34d6e3625
1 /**
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.util.concurrent.BlockingQueue;
21 import org.apache.hadoop.conf.Configuration;
22 import org.apache.yetus.audience.InterfaceAudience;
23 import org.apache.yetus.audience.InterfaceStability;
25 /**
26 * Abstract class template for defining a pluggable blocking queue implementation to be used
27 * by the 'pluggable' call queue type in the RpcExecutor.
29 * The intention is that the constructor shape helps re-inforce the expected parameters needed
30 * to match up to how the RpcExecutor will instantiate instances of the queue.
32 * If the implementation class implements the
33 * {@link org.apache.hadoop.hbase.conf.ConfigurationObserver} interface, it will also be wired
34 * into configuration changes.
36 * Instantiation requires a constructor with {@code
37 * final int maxQueueLength,
38 * final PriorityFunction priority,
39 * final Configuration conf)}
40 * as the arguments.
42 @InterfaceAudience.Public
43 @InterfaceStability.Evolving
44 public abstract class PluggableBlockingQueue implements BlockingQueue<CallRunner> {
45 protected final int maxQueueLength;
46 protected final PriorityFunction priority;
47 protected final Configuration conf;
49 public PluggableBlockingQueue(final int maxQueueLength,
50 final PriorityFunction priority, final Configuration conf) {
51 this.maxQueueLength = maxQueueLength;
52 this.priority = priority;
53 this.conf = conf;