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
024 * master and those that 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
039  // RegionServer executor services
040  RS_OPEN_REGION             (20),
041  RS_OPEN_ROOT               (21),
042  RS_OPEN_META               (22),
043  RS_CLOSE_REGION            (23),
044  RS_CLOSE_ROOT              (24),
045  RS_CLOSE_META              (25),
046  RS_PARALLEL_SEEK           (26),
047  RS_LOG_REPLAY_OPS          (27),
048  RS_REGION_REPLICA_FLUSH_OPS  (28),
049  RS_COMPACTED_FILES_DISCHARGER (29),
050  RS_OPEN_PRIORITY_REGION    (30),
051  RS_REFRESH_PEER(31),
052  RS_SWITCH_RPC_THROTTLE(33),
053  RS_IN_MEMORY_COMPACTION(34);
054
055  ExecutorType(int value) {
056  }
057
058  /**
059   * @return Conflation of the executor type and the passed {@code serverName}.
060   */
061  String getExecutorName(String serverName) {
062    return this.toString() + "-" + serverName.replace("%", "%%");
063  }
064}