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.regionserver.querymatcher;
019
020import org.apache.hadoop.conf.Configuration;
021import org.apache.hadoop.hbase.CellComparator;
022import org.apache.hadoop.hbase.HBaseConfiguration;
023import org.apache.hadoop.hbase.client.Get;
024import org.apache.hadoop.hbase.client.Scan;
025import org.apache.hadoop.hbase.util.Bytes;
026import org.junit.Before;
027
028public class AbstractTestScanQueryMatcher {
029
030  protected Configuration conf;
031
032  protected byte[] row1;
033  protected byte[] row2;
034  protected byte[] row3;
035  protected byte[] fam1;
036  protected byte[] fam2;
037  protected byte[] col1;
038  protected byte[] col2;
039  protected byte[] col3;
040  protected byte[] col4;
041  protected byte[] col5;
042
043  protected byte[] data;
044
045  protected Get get;
046
047  protected long ttl = Long.MAX_VALUE;
048  protected CellComparator rowComparator;
049  protected Scan scan;
050
051  @Before
052  public void setUp() throws Exception {
053    this.conf = HBaseConfiguration.create();
054    row1 = Bytes.toBytes("row1");
055    row2 = Bytes.toBytes("row2");
056    row3 = Bytes.toBytes("row3");
057    fam1 = Bytes.toBytes("fam1");
058    fam2 = Bytes.toBytes("fam2");
059    col1 = Bytes.toBytes("col1");
060    col2 = Bytes.toBytes("col2");
061    col3 = Bytes.toBytes("col3");
062    col4 = Bytes.toBytes("col4");
063    col5 = Bytes.toBytes("col5");
064
065    data = Bytes.toBytes("data");
066
067    // Create Get
068    get = new Get(row1);
069    get.addFamily(fam1);
070    get.addColumn(fam2, col2);
071    get.addColumn(fam2, col4);
072    get.addColumn(fam2, col5);
073    this.scan = new Scan(get);
074
075    rowComparator = CellComparator.getInstance();
076  }
077}