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  public static final int DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
030
031  public static final String SERVER_TYPE_CONF_KEY =
032      "hbase.regionserver.thrift.server.type";
033
034  public static final String COMPACT_CONF_KEY = "hbase.regionserver.thrift.compact";
035  public static final boolean COMPACT_CONF_DEFAULT = false;
036
037  public static final String FRAMED_CONF_KEY = "hbase.regionserver.thrift.framed";
038  public static final boolean FRAMED_CONF_DEFAULT = false;
039
040  public static final String MAX_FRAME_SIZE_CONF_KEY =
041      "hbase.regionserver.thrift.framed.max_frame_size_in_mb";
042  public static final int MAX_FRAME_SIZE_CONF_DEFAULT = 2;
043
044  public static final String COALESCE_INC_KEY = "hbase.regionserver.thrift.coalesceIncrement";
045  public static final String USE_HTTP_CONF_KEY = "hbase.regionserver.thrift.http";
046
047  public static final String HTTP_MIN_THREADS_KEY = "hbase.thrift.http_threads.min";
048  public static final int HTTP_MIN_THREADS_KEY_DEFAULT = 2;
049
050  public static final String HTTP_MAX_THREADS_KEY = "hbase.thrift.http_threads.max";
051  public static final int HTTP_MAX_THREADS_KEY_DEFAULT = 100;
052
053  // ssl related configs
054  public static final String THRIFT_SSL_ENABLED_KEY = "hbase.thrift.ssl.enabled";
055  public static final String THRIFT_SSL_KEYSTORE_STORE_KEY = "hbase.thrift.ssl.keystore.store";
056  public static final String THRIFT_SSL_KEYSTORE_PASSWORD_KEY =
057      "hbase.thrift.ssl.keystore.password";
058  public static final String THRIFT_SSL_KEYSTORE_KEYPASSWORD_KEY
059      = "hbase.thrift.ssl.keystore.keypassword";
060  public static final String THRIFT_SSL_EXCLUDE_CIPHER_SUITES_KEY =
061      "hbase.thrift.ssl.exclude.cipher.suites";
062  public static final String THRIFT_SSL_INCLUDE_CIPHER_SUITES_KEY =
063      "hbase.thrift.ssl.include.cipher.suites";
064  public static final String THRIFT_SSL_EXCLUDE_PROTOCOLS_KEY =
065      "hbase.thrift.ssl.exclude.protocols";
066  public static final String THRIFT_SSL_INCLUDE_PROTOCOLS_KEY =
067      "hbase.thrift.ssl.include.protocols";
068
069
070  public static final String THRIFT_SUPPORT_PROXYUSER_KEY = "hbase.thrift.support.proxyuser";
071
072  //kerberos related configs
073  public static final String THRIFT_DNS_INTERFACE_KEY = "hbase.thrift.dns.interface";
074  public static final String THRIFT_DNS_NAMESERVER_KEY = "hbase.thrift.dns.nameserver";
075  public static final String THRIFT_KERBEROS_PRINCIPAL_KEY = "hbase.thrift.kerberos.principal";
076  public static final String THRIFT_KEYTAB_FILE_KEY = "hbase.thrift.keytab.file";
077  public static final String THRIFT_SPNEGO_PRINCIPAL_KEY = "hbase.thrift.spnego.principal";
078  public static final String THRIFT_SPNEGO_KEYTAB_FILE_KEY = "hbase.thrift.spnego.keytab.file";
079
080  /**
081   * Amount of time in milliseconds before a server thread will timeout
082   * waiting for client to send data on a connected socket. Currently,
083   * applies only to TBoundedThreadPoolServer
084   */
085  public static final String THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY =
086      "hbase.thrift.server.socket.read.timeout";
087  public static final int THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 60000;
088
089
090  /**
091   * Thrift quality of protection configuration key. Valid values can be:
092   * auth-conf: authentication, integrity and confidentiality checking
093   * auth-int: authentication and integrity checking
094   * auth: authentication only
095   *
096   * This is used to authenticate the callers and support impersonation.
097   * The thrift server and the HBase cluster must run in secure mode.
098   */
099  public static final String THRIFT_QOP_KEY = "hbase.thrift.security.qop";
100
101  public static final String BACKLOG_CONF_KEY = "hbase.regionserver.thrift.backlog";
102  public static final int BACKLOG_CONF_DEAFULT = 0;
103
104  public static final String BIND_CONF_KEY = "hbase.regionserver.thrift.ipaddress";
105  public static final String DEFAULT_BIND_ADDR = "0.0.0.0";
106
107  public static final String PORT_CONF_KEY = "hbase.regionserver.thrift.port";
108  public static final int DEFAULT_LISTEN_PORT = 9090;
109
110  public static final String THRIFT_HTTP_ALLOW_OPTIONS_METHOD =
111      "hbase.thrift.http.allow.options.method";
112  public static final boolean THRIFT_HTTP_ALLOW_OPTIONS_METHOD_DEFAULT = false;
113
114  public static final String THRIFT_INFO_SERVER_PORT = "hbase.thrift.info.port";
115  public static final int THRIFT_INFO_SERVER_PORT_DEFAULT = 9095;
116
117  public static final String THRIFT_INFO_SERVER_BINDING_ADDRESS = "hbase.thrift.info.bindAddress";
118  public static final String THRIFT_INFO_SERVER_BINDING_ADDRESS_DEFAULT = "0.0.0.0";
119
120  public static final String THRIFT_QUEUE_SIZE = "hbase.thrift.queue.size";
121  public static final int THRIFT_QUEUE_SIZE_DEFAULT = Integer.MAX_VALUE;
122
123  public static final String THRIFT_SELECTOR_NUM = "hbase.thrift.selector.num";
124
125  public static final String THRIFT_FILTERS = "hbase.thrift.filters";
126
127  // Command line options
128
129  public static final String READ_TIMEOUT_OPTION = "readTimeout";
130  public static final String MIN_WORKERS_OPTION = "minWorkers";
131  public static final String MAX_WORKERS_OPTION = "workers";
132  public static final String MAX_QUEUE_SIZE_OPTION = "queue";
133  public static final String SELECTOR_NUM_OPTION = "selectors";
134  public static final String KEEP_ALIVE_SEC_OPTION = "keepAliveSec";
135  public static final String BIND_OPTION = "bind";
136  public static final String COMPACT_OPTION = "compact";
137  public static final String FRAMED_OPTION = "framed";
138  public static final String PORT_OPTION = "port";
139  public static final String INFOPORT_OPTION = "infoport";
140
141  //for thrift2 server
142  public static final String READONLY_OPTION ="readonly";
143
144  public static final String THRIFT_READONLY_ENABLED = "hbase.thrift.readonly";
145  public static final boolean THRIFT_READONLY_ENABLED_DEFAULT = false;
146
147  public static final String HBASE_THRIFT_CLIENT_SCANNER_CACHING =
148      "hbase.thrift.client.scanner.caching";
149
150  public static final int HBASE_THRIFT_CLIENT_SCANNER_CACHING_DEFAULT = 20;
151
152  public static final String HBASE_THRIFT_SERVER_NAME = "hbase.thrift.server.name";
153  public static final String HBASE_THRIFT_SERVER_PORT = "hbase.thrift.server.port";
154
155  public static final String HBASE_THRIFT_CLIENT_BUIDLER_CLASS =
156      "hbase.thrift.client.builder.class";
157
158
159}