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.thrift; 019 020import org.apache.yetus.audience.InterfaceAudience; 021 022/** 023 * Thrift related constants 024 */ 025@InterfaceAudience.Private 026public final class Constants { 027 private Constants() { 028 } 029 030 // Jetty's max header size is Character.MAX_VALUE - 1, See ArrayTernaryTrie for more details 031 // And in newer jetty version, they add a check when creating a server so we must follow this 032 // limitation otherwise the UTs will fail 033 public static final int DEFAULT_HTTP_MAX_HEADER_SIZE = Character.MAX_VALUE - 1; 034 035 public static final String SERVER_TYPE_CONF_KEY = "hbase.regionserver.thrift.server.type"; 036 037 public static final String COMPACT_CONF_KEY = "hbase.regionserver.thrift.compact"; 038 public static final boolean COMPACT_CONF_DEFAULT = false; 039 040 public static final String FRAMED_CONF_KEY = "hbase.regionserver.thrift.framed"; 041 public static final boolean FRAMED_CONF_DEFAULT = false; 042 043 public static final String MAX_FRAME_SIZE_CONF_KEY = 044 "hbase.regionserver.thrift.framed.max_frame_size_in_mb"; 045 public static final int MAX_FRAME_SIZE_CONF_DEFAULT = 2; 046 047 public static final String COALESCE_INC_KEY = "hbase.regionserver.thrift.coalesceIncrement"; 048 public static final String USE_HTTP_CONF_KEY = "hbase.regionserver.thrift.http"; 049 050 public static final String HTTP_MIN_THREADS_KEY = "hbase.thrift.http_threads.min"; 051 public static final int HTTP_MIN_THREADS_KEY_DEFAULT = 2; 052 053 public static final String HTTP_MAX_THREADS_KEY = "hbase.thrift.http_threads.max"; 054 public static final int HTTP_MAX_THREADS_KEY_DEFAULT = 100; 055 056 // ssl related configs 057 public static final String THRIFT_SSL_ENABLED_KEY = "hbase.thrift.ssl.enabled"; 058 public static final String THRIFT_SSL_KEYSTORE_STORE_KEY = "hbase.thrift.ssl.keystore.store"; 059 public static final String THRIFT_SSL_KEYSTORE_PASSWORD_KEY = 060 "hbase.thrift.ssl.keystore.password"; 061 public static final String THRIFT_SSL_KEYSTORE_KEYPASSWORD_KEY = 062 "hbase.thrift.ssl.keystore.keypassword"; 063 public static final String THRIFT_SSL_EXCLUDE_CIPHER_SUITES_KEY = 064 "hbase.thrift.ssl.exclude.cipher.suites"; 065 public static final String THRIFT_SSL_INCLUDE_CIPHER_SUITES_KEY = 066 "hbase.thrift.ssl.include.cipher.suites"; 067 public static final String THRIFT_SSL_EXCLUDE_PROTOCOLS_KEY = 068 "hbase.thrift.ssl.exclude.protocols"; 069 public static final String THRIFT_SSL_INCLUDE_PROTOCOLS_KEY = 070 "hbase.thrift.ssl.include.protocols"; 071 public static final String THRIFT_SSL_KEYSTORE_TYPE_KEY = "hbase.thrift.ssl.keystore.type"; 072 public static final String THRIFT_SSL_KEYSTORE_TYPE_DEFAULT = "jks"; 073 074 /** 075 * Role-scoped SSL configuration for single-EKU certificate support. The server-scoped 076 * hbase.thrift.ssl.server.* keys are what ThriftServer reads on the Thrift-over-HTTP transport; 077 * when set they take precedence over the corresponding unscoped hbase.thrift.ssl.* keys; when 078 * unset the unscoped keys are used as a fallback so existing deployments keep working. 079 */ 080 public static final String THRIFT_SSL_SERVER_KEYSTORE_STORE_KEY = 081 "hbase.thrift.ssl.server.keystore.store"; 082 public static final String THRIFT_SSL_SERVER_KEYSTORE_PASSWORD_KEY = 083 "hbase.thrift.ssl.server.keystore.password"; 084 public static final String THRIFT_SSL_SERVER_KEYSTORE_KEYPASSWORD_KEY = 085 "hbase.thrift.ssl.server.keystore.keypassword"; 086 public static final String THRIFT_SSL_SERVER_KEYSTORE_TYPE_KEY = 087 "hbase.thrift.ssl.server.keystore.type"; 088 public static final String THRIFT_SSL_SERVER_TRUSTSTORE_STORE_KEY = 089 "hbase.thrift.ssl.server.truststore.store"; 090 public static final String THRIFT_SSL_SERVER_TRUSTSTORE_PASSWORD_KEY = 091 "hbase.thrift.ssl.server.truststore.password"; 092 public static final String THRIFT_SSL_SERVER_TRUSTSTORE_TYPE_KEY = 093 "hbase.thrift.ssl.server.truststore.type"; 094 095 /** 096 * Client-auth mode for the Thrift server's HTTP-transport TLS connector. Valid values: 097 * {@code NONE}, {@code WANT}, {@code NEED} (see {@code X509Util.ClientAuth}). Default is 098 * {@code NONE}, which preserves the historical behavior of never requesting client certificates. 099 */ 100 public static final String THRIFT_SSL_CLIENT_AUTH_MODE_KEY = 101 "hbase.thrift.ssl.server.client.auth.mode"; 102 103 public static final String THRIFT_SUPPORT_PROXYUSER_KEY = "hbase.thrift.support.proxyuser"; 104 105 // kerberos related configs 106 public static final String THRIFT_DNS_INTERFACE_KEY = "hbase.thrift.dns.interface"; 107 public static final String THRIFT_DNS_NAMESERVER_KEY = "hbase.thrift.dns.nameserver"; 108 public static final String THRIFT_KERBEROS_PRINCIPAL_KEY = "hbase.thrift.kerberos.principal"; 109 public static final String THRIFT_KEYTAB_FILE_KEY = "hbase.thrift.keytab.file"; 110 public static final String THRIFT_SPNEGO_PRINCIPAL_KEY = "hbase.thrift.spnego.principal"; 111 public static final String THRIFT_SPNEGO_KEYTAB_FILE_KEY = "hbase.thrift.spnego.keytab.file"; 112 113 /** 114 * Amount of time in milliseconds before a server thread will timeout waiting for client to send 115 * data on a connected socket. Currently, applies only to TBoundedThreadPoolServer 116 */ 117 public static final String THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY = 118 "hbase.thrift.server.socket.read.timeout"; 119 public static final int THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 60000; 120 121 /** 122 * Thrift quality of protection configuration key. Valid values can be: auth-conf: authentication, 123 * integrity and confidentiality checking auth-int: authentication and integrity checking auth: 124 * authentication only This is used to authenticate the callers and support impersonation. The 125 * thrift server and the HBase cluster must run in secure mode. 126 */ 127 public static final String THRIFT_QOP_KEY = "hbase.thrift.security.qop"; 128 129 public static final String BACKLOG_CONF_KEY = "hbase.regionserver.thrift.backlog"; 130 public static final int BACKLOG_CONF_DEAFULT = 0; 131 132 public static final String BIND_CONF_KEY = "hbase.regionserver.thrift.ipaddress"; 133 public static final String DEFAULT_BIND_ADDR = "0.0.0.0"; 134 135 public static final String PORT_CONF_KEY = "hbase.regionserver.thrift.port"; 136 public static final int DEFAULT_LISTEN_PORT = 9090; 137 138 public static final String THRIFT_HTTP_ALLOW_OPTIONS_METHOD = 139 "hbase.thrift.http.allow.options.method"; 140 public static final boolean THRIFT_HTTP_ALLOW_OPTIONS_METHOD_DEFAULT = false; 141 142 public static final String THRIFT_INFO_SERVER_PORT = "hbase.thrift.info.port"; 143 public static final int THRIFT_INFO_SERVER_PORT_DEFAULT = 9095; 144 145 public static final String THRIFT_INFO_SERVER_BINDING_ADDRESS = "hbase.thrift.info.bindAddress"; 146 public static final String THRIFT_INFO_SERVER_BINDING_ADDRESS_DEFAULT = "0.0.0.0"; 147 148 public static final String THRIFT_QUEUE_SIZE = "hbase.thrift.queue.size"; 149 public static final int THRIFT_QUEUE_SIZE_DEFAULT = Integer.MAX_VALUE; 150 151 public static final String THRIFT_SELECTOR_NUM = "hbase.thrift.selector.num"; 152 153 public static final String THRIFT_FILTERS = "hbase.thrift.filters"; 154 155 // Command line options 156 157 public static final String READ_TIMEOUT_OPTION = "readTimeout"; 158 public static final String MIN_WORKERS_OPTION = "minWorkers"; 159 public static final String MAX_WORKERS_OPTION = "workers"; 160 public static final String MAX_QUEUE_SIZE_OPTION = "queue"; 161 public static final String SELECTOR_NUM_OPTION = "selectors"; 162 public static final String KEEP_ALIVE_SEC_OPTION = "keepAliveSec"; 163 public static final String BIND_OPTION = "bind"; 164 public static final String COMPACT_OPTION = "compact"; 165 public static final String FRAMED_OPTION = "framed"; 166 public static final String PORT_OPTION = "port"; 167 public static final String INFOPORT_OPTION = "infoport"; 168 169 // for thrift2 server 170 public static final String READONLY_OPTION = "readonly"; 171 172 public static final String THRIFT_READONLY_ENABLED = "hbase.thrift.readonly"; 173 public static final boolean THRIFT_READONLY_ENABLED_DEFAULT = false; 174 175 public static final String HBASE_THRIFT_CLIENT_SCANNER_CACHING = 176 "hbase.thrift.client.scanner.caching"; 177 178 public static final int HBASE_THRIFT_CLIENT_SCANNER_CACHING_DEFAULT = 20; 179 180 public static final String HBASE_THRIFT_SERVER_NAME = "hbase.thrift.server.name"; 181 public static final String HBASE_THRIFT_SERVER_PORT = "hbase.thrift.server.port"; 182 183 public static final String HBASE_THRIFT_CLIENT_BUIDLER_CLASS = 184 "hbase.thrift.client.builder.class"; 185 186}