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 String REST_THREAD_POOL_THREADS_MAX = "hbase.rest.threads.max"; 064 String REST_THREAD_POOL_THREADS_MIN = "hbase.rest.threads.min"; 065 String REST_THREAD_POOL_TASK_QUEUE_SIZE = "hbase.rest.task.queue.size"; 066 String REST_THREAD_POOL_THREAD_IDLE_TIMEOUT = "hbase.rest.thread.idle.timeout"; 067 String REST_CONNECTOR_ACCEPT_QUEUE_SIZE = "hbase.rest.connector.accept.queue.size"; 068 069 String REST_DNS_NAMESERVER = "hbase.rest.dns.nameserver"; 070 String REST_DNS_INTERFACE = "hbase.rest.dns.interface"; 071 072 String REST_SCANNERCACHE_SIZE = "hbase.rest.scannercache.size"; 073 final int DEFAULT_REST_SCANNERCACHE_SIZE = 10000; 074 075 String REST_SCANNERCACHE_EXPIRE_TIME = "hbase.rest.scannercache.expire.time"; 076 final long DEFAULT_REST_SCANNERCACHE_EXPIRE_TIME_MS = 60 * 60 * 1000; 077 078 String FILTER_CLASSES = "hbase.rest.filter.classes"; 079 String SCAN_START_ROW = "startrow"; 080 String SCAN_END_ROW = "endrow"; 081 String SCAN_COLUMN = "column"; 082 String SCAN_START_TIME = "starttime"; 083 String SCAN_END_TIME = "endtime"; 084 String SCAN_MAX_VERSIONS = "maxversions"; 085 String SCAN_BATCH_SIZE = "batchsize"; 086 String SCAN_LIMIT = "limit"; 087 String SCAN_FETCH_SIZE = "hbase.rest.scan.fetchsize"; 088 String FILTER = "filter"; 089 /** 090 * @deprecated Since 2.4.18/2.5.9/2.6.0, will be removed in 4.0.0. Please use {@link #FILTER} 091 * instead. 092 */ 093 @Deprecated 094 String SCAN_FILTER = FILTER; 095 String FILTER_B64 = "filter_b64"; 096 String SCAN_REVERSED = "reversed"; 097 String SCAN_CACHE_BLOCKS = "cacheblocks"; 098 String CUSTOM_FILTERS = "hbase.rest.custom.filters"; 099 100 String ROW_KEYS_PARAM_NAME = "row"; 101 String KEY_ENCODING_QUERY_PARAM_NAME = "e"; 102 /** 103 * If this query parameter is present when processing row or scanner resources, it disables server 104 * side block caching 105 */ 106 String NOCACHE_PARAM_NAME = "nocache"; 107 108 /** Configuration parameter to set rest client connection timeout */ 109 String REST_CLIENT_CONN_TIMEOUT = "hbase.rest.client.conn.timeout"; 110 int DEFAULT_REST_CLIENT_CONN_TIMEOUT = 2 * 1000; 111 112 /** Configuration parameter to set rest client socket timeout */ 113 String REST_CLIENT_SOCKET_TIMEOUT = "hbase.rest.client.socket.timeout"; 114 int DEFAULT_REST_CLIENT_SOCKET_TIMEOUT = 30 * 1000; 115}