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.rest;
019
020import org.apache.yetus.audience.InterfaceAudience;
021
022/**
023 * Common constants for org.apache.hadoop.hbase.rest
024 */
025@InterfaceAudience.Public
026public interface Constants {
027  // All constants in a public interface are 'public static final'
028
029  String VERSION_STRING = "0.0.3";
030
031  int DEFAULT_MAX_AGE = 60 * 60 * 4; // 4 hours
032
033  int DEFAULT_LISTEN_PORT = 8080;
034
035  String MIMETYPE_TEXT = "text/plain";
036  String MIMETYPE_HTML = "text/html";
037  String MIMETYPE_XML = "text/xml";
038  String MIMETYPE_BINARY = "application/octet-stream";
039  String MIMETYPE_PROTOBUF = "application/x-protobuf";
040  String MIMETYPE_PROTOBUF_IETF = "application/protobuf";
041  String MIMETYPE_JSON = "application/json";
042
043  String CRLF = "\r\n";
044
045  String REST_KEYTAB_FILE = "hbase.rest.keytab.file";
046  String REST_KERBEROS_PRINCIPAL = "hbase.rest.kerberos.principal";
047  String REST_AUTHENTICATION_TYPE = "hbase.rest.authentication.type";
048  String REST_AUTHENTICATION_PRINCIPAL = "hbase.rest.authentication.kerberos.principal";
049
050  String REST_SSL_ENABLED = "hbase.rest.ssl.enabled";
051  String REST_SSL_KEYSTORE_STORE = "hbase.rest.ssl.keystore.store";
052  String REST_SSL_KEYSTORE_PASSWORD = "hbase.rest.ssl.keystore.password";
053  String REST_SSL_KEYSTORE_TYPE = "hbase.rest.ssl.keystore.type";
054  String REST_SSL_TRUSTSTORE_STORE = "hbase.rest.ssl.truststore.store";
055  String REST_SSL_TRUSTSTORE_PASSWORD = "hbase.rest.ssl.truststore.password";
056  String REST_SSL_TRUSTSTORE_TYPE = "hbase.rest.ssl.truststore.type";
057  String REST_SSL_KEYSTORE_KEYPASSWORD = "hbase.rest.ssl.keystore.keypassword";
058  String REST_SSL_EXCLUDE_CIPHER_SUITES = "hbase.rest.ssl.exclude.cipher.suites";
059  String REST_SSL_INCLUDE_CIPHER_SUITES = "hbase.rest.ssl.include.cipher.suites";
060  String REST_SSL_EXCLUDE_PROTOCOLS = "hbase.rest.ssl.exclude.protocols";
061  String REST_SSL_INCLUDE_PROTOCOLS = "hbase.rest.ssl.include.protocols";
062
063  // ---------------------------------------------------------------------------
064  // Role-scoped SSL configuration for single-EKU certificate support.
065  //
066  // The server-scoped keys are what RESTServer.java actually reads: hbase.rest.ssl.server.*
067  // takes precedence over the corresponding unscoped hbase.rest.ssl.* keys; when unset the
068  // unscoped keys are used as a fallback so existing deployments keep working. RESTServer
069  // only ever plays the TLS-server role on its port, so no parallel .client.* configuration
070  // is defined.
071  // ---------------------------------------------------------------------------
072  String REST_SSL_SERVER_KEYSTORE_STORE = "hbase.rest.ssl.server.keystore.store";
073  String REST_SSL_SERVER_KEYSTORE_PASSWORD = "hbase.rest.ssl.server.keystore.password";
074  String REST_SSL_SERVER_KEYSTORE_KEYPASSWORD = "hbase.rest.ssl.server.keystore.keypassword";
075  String REST_SSL_SERVER_KEYSTORE_TYPE = "hbase.rest.ssl.server.keystore.type";
076  String REST_SSL_SERVER_TRUSTSTORE_STORE = "hbase.rest.ssl.server.truststore.store";
077  String REST_SSL_SERVER_TRUSTSTORE_PASSWORD = "hbase.rest.ssl.server.truststore.password";
078  String REST_SSL_SERVER_TRUSTSTORE_TYPE = "hbase.rest.ssl.server.truststore.type";
079
080  /**
081   * Client-auth mode for the REST server's TLS connector. Valid values: {@code NONE}, {@code WANT},
082   * {@code NEED} (see {@code X509Util.ClientAuth}). Default is {@code NONE}, which preserves the
083   * historical behavior of never requesting client certificates. Set to {@code NEED} to enforce
084   * mTLS.
085   */
086  String REST_SSL_CLIENT_AUTH_MODE = "hbase.rest.ssl.server.client.auth.mode";
087
088  String REST_THREAD_POOL_THREADS_MAX = "hbase.rest.threads.max";
089  String REST_THREAD_POOL_THREADS_MIN = "hbase.rest.threads.min";
090  String REST_THREAD_POOL_TASK_QUEUE_SIZE = "hbase.rest.task.queue.size";
091  String REST_THREAD_POOL_THREAD_IDLE_TIMEOUT = "hbase.rest.thread.idle.timeout";
092  String REST_CONNECTOR_ACCEPT_QUEUE_SIZE = "hbase.rest.connector.accept.queue.size";
093
094  String REST_DNS_NAMESERVER = "hbase.rest.dns.nameserver";
095  String REST_DNS_INTERFACE = "hbase.rest.dns.interface";
096
097  String REST_SCANNERCACHE_SIZE = "hbase.rest.scannercache.size";
098  final int DEFAULT_REST_SCANNERCACHE_SIZE = 10000;
099
100  String REST_SCANNERCACHE_EXPIRE_TIME = "hbase.rest.scannercache.expire.time";
101  final long DEFAULT_REST_SCANNERCACHE_EXPIRE_TIME_MS = 60 * 60 * 1000;
102
103  String FILTER_CLASSES = "hbase.rest.filter.classes";
104  String SCAN_START_ROW = "startrow";
105  String SCAN_END_ROW = "endrow";
106  String SCAN_COLUMN = "column";
107  String SCAN_START_TIME = "starttime";
108  String SCAN_END_TIME = "endtime";
109  String SCAN_MAX_VERSIONS = "maxversions";
110  String SCAN_BATCH_SIZE = "batchsize";
111  String SCAN_LIMIT = "limit";
112  String SCAN_FETCH_SIZE = "hbase.rest.scan.fetchsize";
113  String FILTER = "filter";
114  /**
115   * @deprecated Since 2.4.18/2.5.9/2.6.0, will be removed in 4.0.0. Please use {@link #FILTER}
116   *             instead.
117   */
118  @Deprecated
119  String SCAN_FILTER = FILTER;
120  String FILTER_B64 = "filter_b64";
121  String SCAN_REVERSED = "reversed";
122  String SCAN_CACHE_BLOCKS = "cacheblocks";
123  String CUSTOM_FILTERS = "hbase.rest.custom.filters";
124
125  String ROW_KEYS_PARAM_NAME = "row";
126  String KEY_ENCODING_QUERY_PARAM_NAME = "e";
127  /**
128   * If this query parameter is present when processing row or scanner resources, it disables server
129   * side block caching
130   */
131  String NOCACHE_PARAM_NAME = "nocache";
132
133  /** Configuration parameter to set rest client connection timeout */
134  String REST_CLIENT_CONN_TIMEOUT = "hbase.rest.client.conn.timeout";
135  int DEFAULT_REST_CLIENT_CONN_TIMEOUT = 2 * 1000;
136
137  /** Configuration parameter to set rest client socket timeout */
138  String REST_CLIENT_SOCKET_TIMEOUT = "hbase.rest.client.socket.timeout";
139  int DEFAULT_REST_CLIENT_SOCKET_TIMEOUT = 30 * 1000;
140
141  String SCAN_INCLUDE_START_ROW = "includeStartRow";
142  String SCAN_INCLUDE_STOP_ROW = "includeStopRow";
143}