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 public static final String THRIFT_SUPPORT_PROXYUSER_KEY = "hbase.thrift.support.proxyuser"; 075 076 // kerberos related configs 077 public static final String THRIFT_DNS_INTERFACE_KEY = "hbase.thrift.dns.interface"; 078 public static final String THRIFT_DNS_NAMESERVER_KEY = "hbase.thrift.dns.nameserver"; 079 public static final String THRIFT_KERBEROS_PRINCIPAL_KEY = "hbase.thrift.kerberos.principal"; 080 public static final String THRIFT_KEYTAB_FILE_KEY = "hbase.thrift.keytab.file"; 081 public static final String THRIFT_SPNEGO_PRINCIPAL_KEY = "hbase.thrift.spnego.principal"; 082 public static final String THRIFT_SPNEGO_KEYTAB_FILE_KEY = "hbase.thrift.spnego.keytab.file"; 083 084 /** 085 * Amount of time in milliseconds before a server thread will timeout waiting for client to send 086 * data on a connected socket. Currently, applies only to TBoundedThreadPoolServer 087 */ 088 public static final String THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY = 089 "hbase.thrift.server.socket.read.timeout"; 090 public static final int THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 60000; 091 092 /** 093 * Thrift quality of protection configuration key. Valid values can be: auth-conf: authentication, 094 * integrity and confidentiality checking auth-int: authentication and integrity checking auth: 095 * authentication only This is used to authenticate the callers and support impersonation. The 096 * thrift server and the HBase cluster must run in secure mode. 097 */ 098 public static final String THRIFT_QOP_KEY = "hbase.thrift.security.qop"; 099 100 public static final String BACKLOG_CONF_KEY = "hbase.regionserver.thrift.backlog"; 101 public static final int BACKLOG_CONF_DEAFULT = 0; 102 103 public static final String BIND_CONF_KEY = "hbase.regionserver.thrift.ipaddress"; 104 public static final String DEFAULT_BIND_ADDR = "0.0.0.0"; 105 106 public static final String PORT_CONF_KEY = "hbase.regionserver.thrift.port"; 107 public static final int DEFAULT_LISTEN_PORT = 9090; 108 109 public static final String THRIFT_HTTP_ALLOW_OPTIONS_METHOD = 110 "hbase.thrift.http.allow.options.method"; 111 public static final boolean THRIFT_HTTP_ALLOW_OPTIONS_METHOD_DEFAULT = false; 112 113 public static final String THRIFT_INFO_SERVER_PORT = "hbase.thrift.info.port"; 114 public static final int THRIFT_INFO_SERVER_PORT_DEFAULT = 9095; 115 116 public static final String THRIFT_INFO_SERVER_BINDING_ADDRESS = "hbase.thrift.info.bindAddress"; 117 public static final String THRIFT_INFO_SERVER_BINDING_ADDRESS_DEFAULT = "0.0.0.0"; 118 119 public static final String THRIFT_QUEUE_SIZE = "hbase.thrift.queue.size"; 120 public static final int THRIFT_QUEUE_SIZE_DEFAULT = Integer.MAX_VALUE; 121 122 public static final String THRIFT_SELECTOR_NUM = "hbase.thrift.selector.num"; 123 124 public static final String THRIFT_FILTERS = "hbase.thrift.filters"; 125 126 // Command line options 127 128 public static final String READ_TIMEOUT_OPTION = "readTimeout"; 129 public static final String MIN_WORKERS_OPTION = "minWorkers"; 130 public static final String MAX_WORKERS_OPTION = "workers"; 131 public static final String MAX_QUEUE_SIZE_OPTION = "queue"; 132 public static final String SELECTOR_NUM_OPTION = "selectors"; 133 public static final String KEEP_ALIVE_SEC_OPTION = "keepAliveSec"; 134 public static final String BIND_OPTION = "bind"; 135 public static final String COMPACT_OPTION = "compact"; 136 public static final String FRAMED_OPTION = "framed"; 137 public static final String PORT_OPTION = "port"; 138 public static final String INFOPORT_OPTION = "infoport"; 139 140 // for thrift2 server 141 public static final String READONLY_OPTION = "readonly"; 142 143 public static final String THRIFT_READONLY_ENABLED = "hbase.thrift.readonly"; 144 public static final boolean THRIFT_READONLY_ENABLED_DEFAULT = false; 145 146 public static final String HBASE_THRIFT_CLIENT_SCANNER_CACHING = 147 "hbase.thrift.client.scanner.caching"; 148 149 public static final int HBASE_THRIFT_CLIENT_SCANNER_CACHING_DEFAULT = 20; 150 151 public static final String HBASE_THRIFT_SERVER_NAME = "hbase.thrift.server.name"; 152 public static final String HBASE_THRIFT_SERVER_PORT = "hbase.thrift.server.port"; 153 154 public static final String HBASE_THRIFT_CLIENT_BUIDLER_CLASS = 155 "hbase.thrift.client.builder.class"; 156 157}