1 /** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 package org.apache.hadoop.hbase.filter; 20 21 import org.apache.hadoop.hbase.classification.InterfaceAudience; 22 import org.apache.hadoop.hbase.classification.InterfaceStability; 23 24 import java.nio.ByteBuffer; 25 26 /** 27 * ParseConstants holds a bunch of constants related to parsing Filter Strings 28 * Used by {@link ParseFilter} 29 */ 30 @InterfaceAudience.Public 31 @InterfaceStability.Stable 32 public final class ParseConstants { 33 34 /** 35 * ASCII code for LPAREN 36 */ 37 public static final int LPAREN = '('; 38 39 /** 40 * ASCII code for RPAREN 41 */ 42 public static final int RPAREN = ')'; 43 44 /** 45 * ASCII code for whitespace 46 */ 47 public static final int WHITESPACE = ' '; 48 49 /** 50 * ASCII code for tab 51 */ 52 public static final int TAB = '\t'; 53 54 /** 55 * ASCII code for 'A' 56 */ 57 public static final int A = 'A'; 58 59 /** 60 * ASCII code for 'N' 61 */ 62 public static final int N = 'N'; 63 64 /** 65 * ASCII code for 'D' 66 */ 67 public static final int D = 'D'; 68 69 /** 70 * ASCII code for 'O' 71 */ 72 public static final int O = 'O'; 73 74 /** 75 * ASCII code for 'R' 76 */ 77 public static final int R = 'R'; 78 79 /** 80 * ASCII code for 'S' 81 */ 82 public static final int S = 'S'; 83 84 /** 85 * ASCII code for 'K' 86 */ 87 public static final int K = 'K'; 88 89 /** 90 * ASCII code for 'I' 91 */ 92 public static final int I = 'I'; 93 94 /** 95 * ASCII code for 'P' 96 */ 97 public static final int P = 'P'; 98 99 /** 100 * SKIP Array 101 */ 102 public static final byte [] SKIP_ARRAY = new byte [ ] {'S', 'K', 'I', 'P'}; 103 public static final ByteBuffer SKIP_BUFFER = ByteBuffer.wrap(SKIP_ARRAY); 104 105 /** 106 * ASCII code for 'W' 107 */ 108 public static final int W = 'W'; 109 110 /** 111 * ASCII code for 'H' 112 */ 113 public static final int H = 'H'; 114 115 /** 116 * ASCII code for 'L' 117 */ 118 public static final int L = 'L'; 119 120 /** 121 * ASCII code for 'E' 122 */ 123 public static final int E = 'E'; 124 125 /** 126 * WHILE Array 127 */ 128 public static final byte [] WHILE_ARRAY = new byte [] {'W', 'H', 'I', 'L', 'E'}; 129 public static final ByteBuffer WHILE_BUFFER = ByteBuffer.wrap(WHILE_ARRAY); 130 131 /** 132 * OR Array 133 */ 134 public static final byte [] OR_ARRAY = new byte [] {'O','R'}; 135 public static final ByteBuffer OR_BUFFER = ByteBuffer.wrap(OR_ARRAY); 136 137 /** 138 * AND Array 139 */ 140 public static final byte [] AND_ARRAY = new byte [] {'A','N', 'D'}; 141 public static final ByteBuffer AND_BUFFER = ByteBuffer.wrap(AND_ARRAY); 142 143 /** 144 * ASCII code for Backslash 145 */ 146 public static final int BACKSLASH = '\\'; 147 148 /** 149 * ASCII code for a single quote 150 */ 151 public static final int SINGLE_QUOTE = '\''; 152 153 /** 154 * ASCII code for a comma 155 */ 156 public static final int COMMA = ','; 157 158 /** 159 * LESS_THAN Array 160 */ 161 public static final byte [] LESS_THAN_ARRAY = new byte [] {'<'}; 162 public static final ByteBuffer LESS_THAN_BUFFER = ByteBuffer.wrap(LESS_THAN_ARRAY); 163 164 /** 165 * LESS_THAN_OR_EQUAL_TO Array 166 */ 167 public static final byte [] LESS_THAN_OR_EQUAL_TO_ARRAY = new byte [] {'<', '='}; 168 public static final ByteBuffer LESS_THAN_OR_EQUAL_TO_BUFFER = 169 ByteBuffer.wrap(LESS_THAN_OR_EQUAL_TO_ARRAY); 170 171 /** 172 * GREATER_THAN Array 173 */ 174 public static final byte [] GREATER_THAN_ARRAY = new byte [] {'>'}; 175 public static final ByteBuffer GREATER_THAN_BUFFER = ByteBuffer.wrap(GREATER_THAN_ARRAY); 176 177 /** 178 * GREATER_THAN_OR_EQUAL_TO Array 179 */ 180 public static final byte [] GREATER_THAN_OR_EQUAL_TO_ARRAY = new byte [] {'>', '='}; 181 public static final ByteBuffer GREATER_THAN_OR_EQUAL_TO_BUFFER = 182 ByteBuffer.wrap(GREATER_THAN_OR_EQUAL_TO_ARRAY); 183 184 /** 185 * EQUAL_TO Array 186 */ 187 public static final byte [] EQUAL_TO_ARRAY = new byte [] {'='}; 188 public static final ByteBuffer EQUAL_TO_BUFFER = ByteBuffer.wrap(EQUAL_TO_ARRAY); 189 190 /** 191 * NOT_EQUAL_TO Array 192 */ 193 public static final byte [] NOT_EQUAL_TO_ARRAY = new byte [] {'!', '='}; 194 public static final ByteBuffer NOT_EQUAL_TO_BUFFER = ByteBuffer.wrap(NOT_EQUAL_TO_ARRAY); 195 196 /** 197 * ASCII code for equal to (=) 198 */ 199 public static final int EQUAL_TO = '='; 200 201 /** 202 * AND Byte Array 203 */ 204 public static final byte [] AND = new byte [] {'A','N','D'}; 205 206 /** 207 * OR Byte Array 208 */ 209 public static final byte [] OR = new byte [] {'O', 'R'}; 210 211 /** 212 * LPAREN Array 213 */ 214 public static final byte [] LPAREN_ARRAY = new byte [] {'('}; 215 public static final ByteBuffer LPAREN_BUFFER = ByteBuffer.wrap(LPAREN_ARRAY); 216 217 /** 218 * ASCII code for colon (:) 219 */ 220 public static final int COLON = ':'; 221 222 /** 223 * ASCII code for Zero 224 */ 225 public static final int ZERO = '0'; 226 227 /** 228 * ASCII code foe Nine 229 */ 230 public static final int NINE = '9'; 231 232 /** 233 * BinaryType byte array 234 */ 235 public static final byte [] binaryType = new byte [] {'b','i','n','a','r','y'}; 236 237 /** 238 * BinaryPrefixType byte array 239 */ 240 public static final byte [] binaryPrefixType = new byte [] {'b','i','n','a','r','y', 241 'p','r','e','f','i','x'}; 242 243 /** 244 * RegexStringType byte array 245 */ 246 public static final byte [] regexStringType = new byte [] {'r','e','g','e', 'x', 247 's','t','r','i','n','g'}; 248 249 /** 250 * SubstringType byte array 251 */ 252 public static final byte [] substringType = new byte [] {'s','u','b','s','t','r','i','n','g'}; 253 254 /** 255 * ASCII for Minus Sign 256 */ 257 public static final int MINUS_SIGN = '-'; 258 259 /** 260 * Package containing filters 261 */ 262 public static final String FILTER_PACKAGE = "org.apache.hadoop.hbase.filter"; 263 } 264