HBASE-23646 Resolved remaining Checkstyle violations in tests of hbase-rest

Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
Jan Hentschel 2020-01-11 21:09:14 +01:00 committed by GitHub
parent c8496bc694
commit 0a9e1f807d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 315 additions and 317 deletions

View File

@ -49,4 +49,6 @@
<suppress checks="LineLength" files="org.apache.hadoop.hbase.util.ZKDataMigrator.java"/>
<suppress checks="InnerAssignment" files="org.apache.hadoop.hbase.Waiter"/>
<suppress checks="EmptyBlock" files="org.apache.hadoop.hbase.TestTimeout"/>
<suppress checks="InnerAssignment" files="org.apache.hadoop.hbase.rest.PerformanceEvaluation"/>
<suppress checks="EmptyBlock" files="org.apache.hadoop.hbase.rest.PerformanceEvaluation"/>
</suppressions>

View File

@ -25,7 +25,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class HBaseRESTTestingUtility {
private static final Logger LOG = LoggerFactory.getLogger(HBaseRESTTestingUtility.class);
private RESTServer server;
@ -52,7 +51,8 @@ public class HBaseRESTTestingUtility {
}
public void shutdownServletContainer() {
if (server != null) try {
if (server != null) {
try {
server.stop();
server = null;
RESTServlet.stop();
@ -61,3 +61,4 @@ public class HBaseRESTTestingUtility {
}
}
}
}

View File

@ -75,6 +75,7 @@ import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.Hash;
import org.apache.hadoop.hbase.util.MurmurHash;
import org.apache.hadoop.hbase.util.Pair;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
@ -91,6 +92,7 @@ import org.apache.hadoop.mapreduce.lib.reduce.LongSumReducer;
import org.apache.hadoop.util.LineReader;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -204,8 +206,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
protected void addCommandDescriptor(Class<? extends Test> cmdClass,
String name, String description) {
CmdDescriptor cmdDescriptor =
new CmdDescriptor(cmdClass, name, description);
CmdDescriptor cmdDescriptor = new CmdDescriptor(cmdClass, name, description);
commands.put(name, cmdDescriptor);
}
@ -708,33 +709,32 @@ public class PerformanceEvaluation extends Configured implements Tool {
FileSystem fs = FileSystem.get(c);
fs.mkdirs(inputDir);
Path inputFile = new Path(inputDir, "input.txt");
PrintStream out = new PrintStream(fs.create(inputFile));
// Make input random.
try (PrintStream out = new PrintStream(fs.create(inputFile))) {
Map<Integer, String> m = new TreeMap<>();
Hash h = MurmurHash.getInstance();
int perClientRows = (this.R / this.N);
try {
for (int i = 0; i < 10; i++) {
for (int j = 0; j < N; j++) {
String s = "tableName=" + this.tableName +
", startRow=" + ((j * perClientRows) + (i * (perClientRows/10))) +
", perClientRunRows=" + (perClientRows / 10) +
", totalRows=" + this.R +
", clients=" + this.N +
", flushCommits=" + this.flushCommits +
", writeToWAL=" + this.writeToWAL +
", useTags=" + this.useTags +
", noOfTags=" + this.noOfTags;
byte[] b = Bytes.toBytes(s);
StringBuilder s = new StringBuilder();
s.append("tableName=").append(tableName);
s.append(", startRow=").append((j * perClientRows) + (i * (perClientRows / 10)));
s.append(", perClientRunRows=").append(perClientRows / 10);
s.append(", totalRows=").append(R);
s.append(", clients=").append(N);
s.append(", flushCommits=").append(flushCommits);
s.append(", writeToWAL=").append(writeToWAL);
s.append(", useTags=").append(useTags);
s.append(", noOfTags=").append(noOfTags);
byte[] b = Bytes.toBytes(s.toString());
int hash = h.hash(new ByteArrayHashKey(b, 0, b.length), -1);
m.put(hash, s);
m.put(hash, s.toString());
}
}
for (Map.Entry<Integer, String> e : m.entrySet()) {
out.println(e.getValue());
}
} finally {
out.close();
}
return inputDir;
}
@ -1198,15 +1198,9 @@ public class PerformanceEvaluation extends Configured implements Tool {
void testRow(int i) throws IOException {
byte[] value = generateValue(this.rand);
Scan scan = constructScan(value);
ResultScanner scanner = null;
try {
scanner = this.table.getScanner(scan);
try (ResultScanner scanner = this.table.getScanner(scan)) {
while (scanner.next() != null) {
}
} finally {
if (scanner != null) {
scanner.close();
}
}
}

View File

@ -19,6 +19,9 @@ package org.apache.hadoop.hbase.rest;
import static org.junit.Assert.assertEquals;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.StringWriter;
@ -31,8 +34,6 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.TableName;
@ -53,7 +54,6 @@ import org.junit.Before;
import org.junit.BeforeClass;
public class RowResourceBase {
protected static final String TABLE = "TestRowResource";
protected static final TableName TABLE_NAME = TableName.valueOf(TABLE);
@ -84,7 +84,6 @@ public class RowResourceBase {
protected static Configuration conf;
protected static ObjectMapper jsonMapper;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
conf = TEST_UTIL.getConfiguration();
@ -184,8 +183,8 @@ public class RowResourceBase {
assertEquals(Bytes.toString(cell.getValue()), value);
}
protected static void checkIncrementValueXML(String table, String row, String column,
long value) throws IOException, JAXBException {
protected static void checkIncrementValueXML(String table, String row, String column, long value)
throws IOException, JAXBException {
Response response1 = getValueXML(table, row, column);
assertEquals(200, response1.getCode());
assertEquals(Constants.MIMETYPE_XML, response1.getHeader("content-type"));
@ -267,8 +266,8 @@ public class RowResourceBase {
assertEquals(Bytes.toLong(cell.getValue()), value);
}
protected static Response checkAndPutValuePB(String url, String table,
String row, String column, String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
protected static Response checkAndPutValuePB(String url, String table, String row, String column,
String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
throws IOException {
RowModel rowModel = new RowModel(row);
rowModel.addCell(new CellModel(Bytes.toBytes(column),
@ -276,7 +275,8 @@ public class RowResourceBase {
if (otherCells != null) {
for (Map.Entry<String,String> entry : otherCells.entrySet()) {
rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()), Bytes.toBytes(entry.getValue())));
rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
Bytes.toBytes(entry.getValue())));
}
}
@ -296,8 +296,10 @@ public class RowResourceBase {
String column, String valueToCheck, String valueToPut) throws IOException {
return checkAndPutValuePB(table,row,column,valueToCheck,valueToPut,null);
}
protected static Response checkAndPutValuePB(String table, String row,
String column, String valueToCheck, String valueToPut, HashMap<String,String> otherCells) throws IOException {
protected static Response checkAndPutValuePB(String table, String row, String column,
String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
throws IOException {
StringBuilder path = new StringBuilder();
path.append('/');
path.append(table);
@ -308,8 +310,8 @@ public class RowResourceBase {
valueToCheck, valueToPut, otherCells);
}
protected static Response checkAndPutValueXML(String url, String table,
String row, String column, String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
protected static Response checkAndPutValueXML(String url, String table, String row, String column,
String valueToCheck, String valueToPut, HashMap<String,String> otherCells)
throws IOException, JAXBException {
RowModel rowModel = new RowModel(row);
rowModel.addCell(new CellModel(Bytes.toBytes(column),
@ -317,7 +319,8 @@ public class RowResourceBase {
if (otherCells != null) {
for (Map.Entry<String,String> entry : otherCells.entrySet()) {
rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()), Bytes.toBytes(entry.getValue())));
rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
Bytes.toBytes(entry.getValue())));
}
}
@ -334,9 +337,8 @@ public class RowResourceBase {
return response;
}
protected static Response checkAndPutValueXML(String table, String row,
String column, String valueToCheck, String valueToPut)
throws IOException, JAXBException {
protected static Response checkAndPutValueXML(String table, String row, String column,
String valueToCheck, String valueToPut) throws IOException, JAXBException {
return checkAndPutValueXML(table,row,column,valueToCheck,valueToPut, null);
}
@ -360,7 +362,8 @@ public class RowResourceBase {
if (cellsToDelete != null) {
for (Map.Entry<String,String> entry : cellsToDelete.entrySet()) {
rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()), Bytes.toBytes(entry.getValue())));
rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
Bytes.toBytes(entry.getValue())));
}
}
// Add this at the end
@ -380,8 +383,10 @@ public class RowResourceBase {
String column, String valueToCheck) throws IOException, JAXBException {
return checkAndDeleteXML(table, row, column, valueToCheck, null);
}
protected static Response checkAndDeleteXML(String table, String row,
String column, String valueToCheck, HashMap<String,String> cellsToDelete) throws IOException, JAXBException {
String column, String valueToCheck, HashMap<String,String> cellsToDelete)
throws IOException, JAXBException {
StringBuilder path = new StringBuilder();
path.append('/');
path.append(table);
@ -392,12 +397,13 @@ public class RowResourceBase {
}
protected static Response checkAndDeleteJson(String table, String row,
String column, String valueToCheck) throws IOException, JAXBException {
String column, String valueToCheck) throws IOException {
return checkAndDeleteJson(table, row, column, valueToCheck, null);
}
protected static Response checkAndDeleteJson(String table, String row,
String column, String valueToCheck, HashMap<String,String> cellsToDelete) throws IOException, JAXBException {
String column, String valueToCheck, HashMap<String,String> cellsToDelete)
throws IOException {
StringBuilder path = new StringBuilder();
path.append('/');
path.append(table);
@ -409,12 +415,13 @@ public class RowResourceBase {
protected static Response checkAndDeleteJson(String url, String table,
String row, String column, String valueToCheck, HashMap<String,String> cellsToDelete)
throws IOException, JAXBException {
throws IOException {
RowModel rowModel = new RowModel(row);
if (cellsToDelete != null) {
for (Map.Entry<String,String> entry : cellsToDelete.entrySet()) {
rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()), Bytes.toBytes(entry.getValue())));
rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
Bytes.toBytes(entry.getValue())));
}
}
// Add this at the end
@ -429,9 +436,8 @@ public class RowResourceBase {
return response;
}
protected static Response checkAndDeletePB(String table, String row,
String column, String value) throws IOException {
protected static Response checkAndDeletePB(String table, String row, String column, String value)
throws IOException {
return checkAndDeletePB(table, row, column, value, null);
}
@ -452,7 +458,8 @@ public class RowResourceBase {
if (cellsToDelete != null) {
for (Map.Entry<String,String> entry : cellsToDelete.entrySet()) {
rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()), Bytes.toBytes(entry.getValue())));
rowModel.addCell(new CellModel(Bytes.toBytes(entry.getKey()),
Bytes.toBytes(entry.getValue())));
}
}
// Add this at the end
@ -541,12 +548,12 @@ public class RowResourceBase {
}
protected static void checkValueJSON(String table, String row, String column,
String value) throws IOException, JAXBException {
String value) throws IOException {
Response response = getValueJson(table, row, column);
assertEquals(200, response.getCode());
assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
ObjectMapper mapper = new JacksonJaxbJsonProvider()
.locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
ObjectMapper mapper = new JacksonJaxbJsonProvider().locateMapper(CellSetModel.class,
MediaType.APPLICATION_JSON_TYPE);
CellSetModel cellSet = mapper.readValue(response.getBody(), CellSetModel.class);
RowModel rowModel = cellSet.getRows().get(0);
CellModel cell = rowModel.getCells().get(0);
@ -555,7 +562,7 @@ public class RowResourceBase {
}
protected static void checkIncrementValueJSON(String table, String row, String column,
long value) throws IOException, JAXBException {
long value) throws IOException {
Response response = getValueJson(table, row, column);
assertEquals(200, response.getCode());
assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
@ -569,7 +576,7 @@ public class RowResourceBase {
}
protected static Response putValueJson(String table, String row, String column,
String value) throws IOException, JAXBException {
String value) throws IOException {
StringBuilder path = new StringBuilder();
path.append('/');
path.append(table);
@ -581,7 +588,7 @@ public class RowResourceBase {
}
protected static Response putValueJson(String url, String table, String row, String column,
String value) throws IOException, JAXBException {
String value) throws IOException {
RowModel rowModel = new RowModel(row);
rowModel.addCell(new CellModel(Bytes.toBytes(column),
Bytes.toBytes(value)));
@ -606,7 +613,7 @@ public class RowResourceBase {
}
protected static Response appendValuePB(String table, String row, String column,
String value) throws IOException, JAXBException {
String value) throws IOException {
StringBuilder path = new StringBuilder();
path.append('/');
path.append(table);
@ -639,7 +646,7 @@ public class RowResourceBase {
}
protected static Response incrementValuePB(String table, String row, String column,
String value) throws IOException, JAXBException {
String value) throws IOException {
StringBuilder path = new StringBuilder();
path.append('/');
path.append(table);

View File

@ -21,13 +21,14 @@ import static org.junit.Assert.assertEquals;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import java.io.IOException;
import java.util.Collection;
import javax.ws.rs.core.MediaType;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseCommonTestingUtility;
@ -46,8 +47,10 @@ import org.apache.hadoop.hbase.rest.model.RowModel;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.testclassification.RestTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.http.Header;
import org.apache.http.message.BasicHeader;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
@ -59,7 +62,6 @@ import org.junit.runners.Parameterized;
@Category({RestTests.class, MediumTests.class})
@RunWith(Parameterized.class)
public class TestMultiRowResource {
@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestMultiRowResource.class);
@ -74,7 +76,6 @@ public class TestMultiRowResource {
private static final String ROW_2 = "testrow6";
private static final String VALUE_2 = "testvalue6";
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private static final HBaseRESTTestingUtility REST_TEST_UTIL = new HBaseRESTTestingUtility();
@ -96,7 +97,6 @@ public class TestMultiRowResource {
csrfEnabled = csrf;
}
@BeforeClass
public static void setUpBeforeClass() throws Exception {
conf = TEST_UTIL.getConfiguration();
@ -135,13 +135,11 @@ public class TestMultiRowResource {
TEST_UTIL.shutdownMiniCluster();
}
@Test
public void testMultiCellGetJSON() throws IOException, JAXBException {
public void testMultiCellGetJSON() throws IOException {
String row_5_url = "/" + TABLE + "/" + ROW_1 + "/" + COLUMN_1;
String row_6_url = "/" + TABLE + "/" + ROW_2 + "/" + COLUMN_2;
StringBuilder path = new StringBuilder();
path.append("/");
path.append(TABLE);
@ -158,22 +156,19 @@ public class TestMultiRowResource {
client.post(row_5_url, Constants.MIMETYPE_BINARY, Bytes.toBytes(VALUE_1), extraHdr);
client.post(row_6_url, Constants.MIMETYPE_BINARY, Bytes.toBytes(VALUE_2), extraHdr);
Response response = client.get(path.toString(), Constants.MIMETYPE_JSON);
assertEquals(200, response.getCode());
assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
client.delete(row_5_url, extraHdr);
client.delete(row_6_url, extraHdr);
}
@Test
public void testMultiCellGetXML() throws IOException, JAXBException {
public void testMultiCellGetXML() throws IOException {
String row_5_url = "/" + TABLE + "/" + ROW_1 + "/" + COLUMN_1;
String row_6_url = "/" + TABLE + "/" + ROW_2 + "/" + COLUMN_2;
StringBuilder path = new StringBuilder();
path.append("/");
path.append(TABLE);
@ -185,18 +180,16 @@ public class TestMultiRowResource {
client.post(row_5_url, Constants.MIMETYPE_BINARY, Bytes.toBytes(VALUE_1), extraHdr);
client.post(row_6_url, Constants.MIMETYPE_BINARY, Bytes.toBytes(VALUE_2), extraHdr);
Response response = client.get(path.toString(), Constants.MIMETYPE_XML);
assertEquals(200, response.getCode());
assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type"));
client.delete(row_5_url, extraHdr);
client.delete(row_6_url, extraHdr);
}
@Test
public void testMultiCellGetWithColsJSON() throws IOException, JAXBException {
public void testMultiCellGetWithColsJSON() throws IOException {
String row_5_url = "/" + TABLE + "/" + ROW_1 + "/" + COLUMN_1;
String row_6_url = "/" + TABLE + "/" + ROW_2 + "/" + COLUMN_2;
@ -215,8 +208,8 @@ public class TestMultiRowResource {
Response response = client.get(path.toString(), Constants.MIMETYPE_JSON);
assertEquals(200, response.getCode());
ObjectMapper mapper =
new JacksonJaxbJsonProvider().locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
ObjectMapper mapper = new JacksonJaxbJsonProvider().locateMapper(CellSetModel.class,
MediaType.APPLICATION_JSON_TYPE);
CellSetModel cellSet = mapper.readValue(response.getBody(), CellSetModel.class);
assertEquals(2, cellSet.getRows().size());
assertEquals(ROW_1, Bytes.toString(cellSet.getRows().get(0).getKey()));
@ -226,11 +219,10 @@ public class TestMultiRowResource {
client.delete(row_5_url, extraHdr);
client.delete(row_6_url, extraHdr);
}
@Test
public void testMultiCellGetJSONNotFound() throws IOException, JAXBException {
public void testMultiCellGetJSONNotFound() throws IOException {
String row_5_url = "/" + TABLE + "/" + ROW_1 + "/" + COLUMN_1;
StringBuilder path = new StringBuilder();
@ -254,7 +246,7 @@ public class TestMultiRowResource {
}
@Test
public void testMultiCellGetWithColsInQueryPathJSON() throws IOException, JAXBException {
public void testMultiCellGetWithColsInQueryPathJSON() throws IOException {
String row_5_url = "/" + TABLE + "/" + ROW_1 + "/" + COLUMN_1;
String row_6_url = "/" + TABLE + "/" + ROW_2 + "/" + COLUMN_2;
@ -286,4 +278,3 @@ public class TestMultiRowResource {
client.delete(row_6_url, extraHdr);
}
}

View File

@ -79,7 +79,6 @@ import org.slf4j.LoggerFactory;
@Category({RestTests.class, MediumTests.class})
public class TestScannersWithFilters {
@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestScannersWithFilters.class);
@ -243,8 +242,8 @@ public class TestScannersWithFilters {
unmarshaller.unmarshal(new ByteArrayInputStream(response.getBody()));
int rows = cells.getRows().size();
assertTrue("Scanned too many rows! Only expected " + expectedRows +
" total but scanned " + rows, expectedRows == rows);
assertEquals("Scanned too many rows! Only expected " + expectedRows +
" total but scanned " + rows, expectedRows, rows);
for (RowModel row : cells.getRows()) {
int count = row.getCells().size();
assertEquals("Expected " + expectedKeys + " keys per row but " +
@ -256,8 +255,7 @@ public class TestScannersWithFilters {
assertEquals(200, response.getCode());
}
private static void verifyScanFull(Scan s, KeyValue [] kvs)
throws Exception {
private static void verifyScanFull(Scan s, KeyValue [] kvs) throws Exception {
ScannerModel model = ScannerModel.fromScan(s);
model.setBatch(Integer.MAX_VALUE); // fetch it all at once
StringWriter writer = new StringWriter();
@ -286,10 +284,16 @@ public class TestScannersWithFilters {
Iterator<RowModel> i = cellSet.getRows().iterator();
for (boolean done = true; done; row++) {
done = i.hasNext();
if (!done) break;
if (!done) {
break;
}
RowModel rowModel = i.next();
List<CellModel> cells = rowModel.getCells();
if (cells.isEmpty()) break;
if (cells.isEmpty()) {
break;
}
assertTrue("Scanned too many keys! Only expected " + kvs.length +
" total but already scanned " + (cells.size() + idx),
kvs.length >= idx + cells.size());
@ -339,10 +343,16 @@ public class TestScannersWithFilters {
int j = 0;
for (boolean done = true; done; j++) {
done = i.hasNext();
if (!done) break;
if (!done) {
break;
}
RowModel rowModel = i.next();
List<CellModel> cells = rowModel.getCells();
if (cells.isEmpty()) break;
if (cells.isEmpty()) {
break;
}
assertTrue("Scanned too many rows! Only expected " + expectedRows +
" total but already scanned " + (j+1), expectedRows > j);
assertEquals("Expected " + expectedKeys + " keys per row but " +
@ -517,8 +527,7 @@ public class TestScannersWithFilters {
s.setFilter(f);
verifyScanNoEarlyOut(s, expectedRows, expectedKeys);
// Match keys less than or equal
// Expect four keys (two from each family) in half the rows
// Match keys less than or equal. Expect four keys (two from each family) in half the rows
expectedRows = numRows / 2;
expectedKeys = 4;
f = new QualifierFilter(CompareOperator.LESS_OR_EQUAL,
@ -527,8 +536,7 @@ public class TestScannersWithFilters {
s.setFilter(f);
verifyScanNoEarlyOut(s, expectedRows, expectedKeys);
// Match keys not equal
// Expect four keys (two from each family)
// Match keys not equal. Expect four keys (two from each family)
// Only look in first group of rows
expectedRows = numRows / 2;
expectedKeys = 4;
@ -538,8 +546,7 @@ public class TestScannersWithFilters {
s.setFilter(f);
verifyScanNoEarlyOut(s, expectedRows, expectedKeys);
// Match keys greater or equal
// Expect four keys (two from each family)
// Match keys greater or equal. Expect four keys (two from each family)
// Only look in first group of rows
expectedRows = numRows / 2;
expectedKeys = 4;
@ -549,8 +556,7 @@ public class TestScannersWithFilters {
s.setFilter(f);
verifyScanNoEarlyOut(s, expectedRows, expectedKeys);
// Match keys greater
// Expect two keys (one from each family)
// Match keys greater. Expect two keys (one from each family)
// Only look in first group of rows
expectedRows = numRows / 2;
expectedKeys = 2;
@ -560,10 +566,8 @@ public class TestScannersWithFilters {
s.setFilter(f);
verifyScanNoEarlyOut(s, expectedRows, expectedKeys);
// Match keys not equal to
// Look across rows and fully validate the keys and ordering
// Expect varied numbers of keys, 4 per row in group one, 6 per row in
// group two
// Match keys not equal to. Look across rows and fully validate the keys and ordering
// Expect varied numbers of keys, 4 per row in group one, 6 per row in group two
f = new QualifierFilter(CompareOperator.NOT_EQUAL,
new BinaryComparator(QUALIFIERS_ONE[2]));
s = new Scan();
@ -609,8 +613,7 @@ public class TestScannersWithFilters {
};
verifyScanFull(s, kvs);
// Test across rows and groups with a regex
// Filter out "test*-2"
// Test across rows and groups with a regex. Filter out "test*-2"
// Expect 4 keys per row across both groups
f = new QualifierFilter(CompareOperator.NOT_EQUAL,
new RegexStringComparator("test.+-2"));