/** * Create a new reader from the split, and match the edits against the passed columns. */ private void testSplit(InputSplit split, byte[]... columns) throws Exception { final WALRecordReader reader = getReader(); reader.initialize(split, MapReduceTestUtil.createDummyMapTaskAttemptContext(conf)); for (byte[] column : columns) { assertTrue(reader.nextKeyValue()); Cell cell = reader.getCurrentValue().getCells().get(0); if (!Bytes.equals(column, cell.getQualifier())) { assertTrue("expected [" + Bytes.toString(column) + "], actual [" + Bytes.toString(cell.getQualifier()) + "]", false); } } assertFalse(reader.nextKeyValue()); reader.close(); }
/** * Create a new reader from the split, and match the edits against the passed columns. */ private void testSplit(InputSplit split, byte[]... columns) throws Exception { WALRecordReader<WALKey> reader = getReader(); reader.initialize(split, MapReduceTestUtil.createDummyMapTaskAttemptContext(conf)); for (byte[] column : columns) { assertTrue(reader.nextKeyValue()); Cell cell = reader.getCurrentValue().getCells().get(0); if (!Bytes.equals(column, 0, column.length, cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength())) { assertTrue( "expected [" + Bytes.toString(column) + "], actual [" + Bytes.toString( cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()) + "]", false); } } assertFalse(reader.nextKeyValue()); reader.close(); }
@Override protected WALRecordReader getReader() { return new HLogKeyRecordReader(); }
protected WALRecordReader getReader() { return new WALKeyRecordReader(); }
private WALRecordReader<WALKey> getReader() { return new WALKeyRecordReader(); }