001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.executor;
019
020import org.apache.yetus.audience.InterfaceAudience;
021
022/**
023 * The following is a list of all executor types, both those that run in the master and those that
024 * run in the regionserver.
025 */
026@InterfaceAudience.Private
027public enum ExecutorType {
028
029  // Master executor services
030  MASTER_CLOSE_REGION(1),
031  MASTER_OPEN_REGION(2),
032  MASTER_SERVER_OPERATIONS(3),
033  MASTER_TABLE_OPERATIONS(4),
034  MASTER_RS_SHUTDOWN(5),
035  MASTER_META_SERVER_OPERATIONS(6),
036  M_LOG_REPLAY_OPS(7),
037  MASTER_SNAPSHOT_OPERATIONS(8),
038  MASTER_MERGE_OPERATIONS(9),
039
040  // RegionServer executor services
041  RS_OPEN_REGION(20),
042  RS_OPEN_ROOT(21),
043  RS_OPEN_META(22),
044  RS_CLOSE_REGION(23),
045  RS_CLOSE_ROOT(24),
046  RS_CLOSE_META(25),
047  RS_PARALLEL_SEEK(26),
048  RS_LOG_REPLAY_OPS(27),
049  RS_REGION_REPLICA_FLUSH_OPS(28),
050  RS_COMPACTED_FILES_DISCHARGER(29),
051  RS_OPEN_PRIORITY_REGION(30),
052  RS_REFRESH_PEER(31),
053  RS_REPLAY_SYNC_REPLICATION_WAL(32),
054  RS_SWITCH_RPC_THROTTLE(33),
055  RS_IN_MEMORY_COMPACTION(34),
056  RS_CLAIM_REPLICATION_QUEUE(35),
057  RS_SNAPSHOT_OPERATIONS(36);
058
059  ExecutorType(int value) {
060  }
061
062  /** Returns Conflation of the executor type and the passed {@code serverName}. */
063  String getExecutorName(String serverName) {
064    return this.toString() + "-" + serverName.replace("%", "%%");
065  }
066}