HBASE-21157 Split TableInputFormatScan to individual tests
This commit is contained in:
parent
5a672b9da9
commit
855f4bbb28
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.LargeTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, LargeTests.class })
|
||||
public class TestTableInputFormatScan extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScan.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific number of mappers. The test table has 26 regions,
|
||||
*/
|
||||
@Test
|
||||
public void testGetSplits() throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testNumOfSplits(1, 26);
|
||||
testNumOfSplits(3, 78);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs a MR to test TIF using specific number of mappers. The test table has 26 regions,
|
||||
*/
|
||||
@Test
|
||||
public void testSpecifiedNumOfMappersMR()
|
||||
throws InterruptedException, IOException, ClassNotFoundException {
|
||||
testNumOfSplitsMR(2, 52);
|
||||
testNumOfSplitsMR(4, 104);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if autoBalance create correct splits
|
||||
*/
|
||||
@Test
|
||||
public void testAutoBalanceSplits() throws IOException {
|
||||
testAutobalanceNumOfSplit();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScanFromConfiguration()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScanFromConfiguration("bba", "bbd", "bbc");
|
||||
}
|
||||
}
|
|
@ -1,139 +0,0 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.LargeTests;
|
||||
import org.apache.hadoop.hbase.testclassification.VerySlowMapReduceTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
/**
|
||||
* TestTableInputFormatScan part 1.
|
||||
* @see TestTableInputFormatScanBase
|
||||
*/
|
||||
@Category({VerySlowMapReduceTests.class, LargeTests.class})
|
||||
public class TestTableInputFormatScan1 extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScan1.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanEmptyToEmpty()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan(null, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanEmptyToAPP()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan(null, "app", "apo");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanEmptyToBBA()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan(null, "bba", "baz");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanEmptyToBBB()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan(null, "bbb", "bba");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanEmptyToOPP()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan(null, "opp", "opo");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific number of mappers. The test table has 26 regions,
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testGetSplits() throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testNumOfSplits(1, 26);
|
||||
testNumOfSplits(3, 78);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs a MR to test TIF using specific number of mappers. The test table has 26 regions,
|
||||
* @throws InterruptedException
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
@Test
|
||||
public void testSpecifiedNumOfMappersMR()
|
||||
throws InterruptedException, IOException, ClassNotFoundException {
|
||||
testNumOfSplitsMR(2, 52);
|
||||
testNumOfSplitsMR(4, 104);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if autoBalance create correct splits
|
||||
* @throws IOException
|
||||
*/
|
||||
@Test
|
||||
public void testAutoBalanceSplits() throws IOException {
|
||||
testAutobalanceNumOfSplit();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.LargeTests;
|
||||
import org.apache.hadoop.hbase.testclassification.VerySlowMapReduceTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
/**
|
||||
* TestTableInputFormatScan part 2.
|
||||
* @see TestTableInputFormatScanBase
|
||||
*/
|
||||
@Category({VerySlowMapReduceTests.class, LargeTests.class})
|
||||
public class TestTableInputFormatScan2 extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScan2.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanOBBToOPP()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("obb", "opp", "opo");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanOBBToQPP()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("obb", "qpp", "qpo");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanOPPToEmpty()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("opp", null, "zzz");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanYYXToEmpty()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("yyx", null, "zzz");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanYYYToEmpty()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("yyy", null, "zzz");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void testScanYZYToEmpty()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("yzy", null, "zzz");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScanFromConfiguration()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScanFromConfiguration("bba", "bbd", "bbc");
|
||||
}
|
||||
}
|
|
@ -23,8 +23,11 @@ import static org.junit.Assert.assertNotEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.NavigableMap;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
||||
|
@ -50,15 +53,8 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Tests various scan start and stop row scenarios. This is set in a scan and
|
||||
* tested in a MapReduce job to see if that is handed over and done properly
|
||||
* too.
|
||||
* </p>
|
||||
* <p>
|
||||
* This test is broken into two parts in order to side-step the test timeout
|
||||
* period of 900, as documented in HBASE-8326.
|
||||
* </p>
|
||||
* Tests various scan start and stop row scenarios. This is set in a scan and tested in a MapReduce
|
||||
* job to see if that is handed over and done properly too.
|
||||
*/
|
||||
public abstract class TestTableInputFormatScanBase {
|
||||
|
||||
|
@ -173,19 +169,15 @@ public abstract class TestTableInputFormatScanBase {
|
|||
|
||||
/**
|
||||
* Tests an MR Scan initialized from properties set in the Configuration.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
protected void testScanFromConfiguration(String start, String stop, String last)
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
String jobName = "ScanFromConfig" + (start != null ? start.toUpperCase(Locale.ROOT) : "Empty") +
|
||||
"To" + (stop != null ? stop.toUpperCase(Locale.ROOT) : "Empty");
|
||||
Configuration c = new Configuration(TEST_UTIL.getConfiguration());
|
||||
c.set(TableInputFormat.INPUT_TABLE, TABLE_NAME.getNameAsString());
|
||||
c.set(TableInputFormat.SCAN_COLUMN_FAMILY, Bytes.toString(INPUT_FAMILYS[0]) + ", "
|
||||
+ Bytes.toString(INPUT_FAMILYS[1]));
|
||||
c.set(TableInputFormat.SCAN_COLUMN_FAMILY,
|
||||
Bytes.toString(INPUT_FAMILYS[0]) + ", " + Bytes.toString(INPUT_FAMILYS[1]));
|
||||
c.set(KEY_STARTROW, start != null ? start : "");
|
||||
c.set(KEY_LASTROW, last != null ? last : "");
|
||||
|
||||
|
@ -197,7 +189,7 @@ public abstract class TestTableInputFormatScanBase {
|
|||
c.set(TableInputFormat.SCAN_ROW_STOP, stop);
|
||||
}
|
||||
|
||||
Job job = new Job(c, jobName);
|
||||
Job job = Job.getInstance(c, jobName);
|
||||
job.setMapperClass(ScanMapper.class);
|
||||
job.setReducerClass(ScanReducer.class);
|
||||
job.setMapOutputKeyClass(ImmutableBytesWritable.class);
|
||||
|
@ -211,32 +203,27 @@ public abstract class TestTableInputFormatScanBase {
|
|||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
protected void testScan(String start, String stop, String last)
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
String jobName = "Scan" + (start != null ? start.toUpperCase(Locale.ROOT) : "Empty") +
|
||||
"To" + (stop != null ? stop.toUpperCase(Locale.ROOT) : "Empty");
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
String jobName = "Scan" + (start != null ? start.toUpperCase(Locale.ROOT) : "Empty") + "To" +
|
||||
(stop != null ? stop.toUpperCase(Locale.ROOT) : "Empty");
|
||||
LOG.info("Before map/reduce startup - job " + jobName);
|
||||
Configuration c = new Configuration(TEST_UTIL.getConfiguration());
|
||||
Scan scan = new Scan();
|
||||
scan.addFamily(INPUT_FAMILYS[0]);
|
||||
scan.addFamily(INPUT_FAMILYS[1]);
|
||||
if (start != null) {
|
||||
scan.setStartRow(Bytes.toBytes(start));
|
||||
scan.withStartRow(Bytes.toBytes(start));
|
||||
}
|
||||
c.set(KEY_STARTROW, start != null ? start : "");
|
||||
if (stop != null) {
|
||||
scan.setStopRow(Bytes.toBytes(stop));
|
||||
scan.withStopRow(Bytes.toBytes(stop));
|
||||
}
|
||||
c.set(KEY_LASTROW, last != null ? last : "");
|
||||
LOG.info("scan before: " + scan);
|
||||
Job job = new Job(c, jobName);
|
||||
TableMapReduceUtil.initTableMapperJob(
|
||||
TABLE_NAME, scan, ScanMapper.class,
|
||||
Job job = Job.getInstance(c, jobName);
|
||||
TableMapReduceUtil.initTableMapperJob(TABLE_NAME, scan, ScanMapper.class,
|
||||
ImmutableBytesWritable.class, ImmutableBytesWritable.class, job);
|
||||
job.setReducerClass(ScanReducer.class);
|
||||
job.setNumReduceTasks(1); // one to get final "first" and "last" key
|
||||
|
@ -250,14 +237,9 @@ public abstract class TestTableInputFormatScanBase {
|
|||
/**
|
||||
* Tests Number of inputSplits for MR job when specify number of mappers for TableInputFormatXXX
|
||||
* This test does not run MR job
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void testNumOfSplits(int splitsPerRegion, int expectedNumOfSplits) throws IOException,
|
||||
InterruptedException,
|
||||
ClassNotFoundException {
|
||||
protected void testNumOfSplits(int splitsPerRegion, int expectedNumOfSplits)
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
String jobName = "TestJobForNumOfSplits";
|
||||
LOG.info("Before map/reduce startup - job " + jobName);
|
||||
Configuration c = new Configuration(TEST_UTIL.getConfiguration());
|
||||
|
@ -267,9 +249,9 @@ public abstract class TestTableInputFormatScanBase {
|
|||
c.setInt("hbase.mapreduce.tableinput.mappers.per.region", splitsPerRegion);
|
||||
c.set(KEY_STARTROW, "");
|
||||
c.set(KEY_LASTROW, "");
|
||||
Job job = new Job(c, jobName);
|
||||
Job job = Job.getInstance(c, jobName);
|
||||
TableMapReduceUtil.initTableMapperJob(TABLE_NAME.getNameAsString(), scan, ScanMapper.class,
|
||||
ImmutableBytesWritable.class, ImmutableBytesWritable.class, job);
|
||||
ImmutableBytesWritable.class, ImmutableBytesWritable.class, job);
|
||||
TableInputFormat tif = new TableInputFormat();
|
||||
tif.setConf(job.getConfiguration());
|
||||
Assert.assertEquals(TABLE_NAME, table.getName());
|
||||
|
@ -279,13 +261,9 @@ public abstract class TestTableInputFormatScanBase {
|
|||
|
||||
/**
|
||||
* Run MR job to check the number of mapper = expectedNumOfSplits
|
||||
* @throws IOException
|
||||
* @throws InterruptedException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
public void testNumOfSplitsMR(int splitsPerRegion, int expectedNumOfSplits) throws IOException,
|
||||
InterruptedException,
|
||||
ClassNotFoundException {
|
||||
protected void testNumOfSplitsMR(int splitsPerRegion, int expectedNumOfSplits)
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
String jobName = "TestJobForNumOfSplits-MR";
|
||||
LOG.info("Before map/reduce startup - job " + jobName);
|
||||
JobConf c = new JobConf(TEST_UTIL.getConfiguration());
|
||||
|
@ -297,7 +275,7 @@ public abstract class TestTableInputFormatScanBase {
|
|||
c.set(KEY_LASTROW, "");
|
||||
Job job = Job.getInstance(c, jobName);
|
||||
TableMapReduceUtil.initTableMapperJob(TABLE_NAME.getNameAsString(), scan, ScanMapper.class,
|
||||
ImmutableBytesWritable.class, ImmutableBytesWritable.class, job);
|
||||
ImmutableBytesWritable.class, ImmutableBytesWritable.class, job);
|
||||
job.setReducerClass(ScanReducer.class);
|
||||
job.setNumReduceTasks(1);
|
||||
job.setOutputFormatClass(NullOutputFormat.class);
|
||||
|
@ -305,20 +283,20 @@ public abstract class TestTableInputFormatScanBase {
|
|||
// for some reason, hbase does not expose JobCounter.TOTAL_LAUNCHED_MAPS,
|
||||
// we use TaskCounter.SHUFFLED_MAPS to get total launched maps
|
||||
assertEquals("Saw the wrong count of mappers per region", expectedNumOfSplits,
|
||||
job.getCounters().findCounter(TaskCounter.SHUFFLED_MAPS).getValue());
|
||||
job.getCounters().findCounter(TaskCounter.SHUFFLED_MAPS).getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Run MR job to test autobalance for setting number of mappers for TIF
|
||||
* This does not run real MR job
|
||||
* Run MR job to test autobalance for setting number of mappers for TIF This does not run real MR
|
||||
* job
|
||||
*/
|
||||
public void testAutobalanceNumOfSplit() throws IOException {
|
||||
protected void testAutobalanceNumOfSplit() throws IOException {
|
||||
// set up splits for testing
|
||||
List<InputSplit> splits = new ArrayList<>(5);
|
||||
int[] regionLen = {10, 20, 20, 40, 60};
|
||||
int[] regionLen = { 10, 20, 20, 40, 60 };
|
||||
for (int i = 0; i < 5; i++) {
|
||||
InputSplit split = new TableSplit(TABLE_NAME, new Scan(),
|
||||
Bytes.toBytes(i), Bytes.toBytes(i + 1), "", "", regionLen[i] * 1048576);
|
||||
InputSplit split = new TableSplit(TABLE_NAME, new Scan(), Bytes.toBytes(i),
|
||||
Bytes.toBytes(i + 1), "", "", regionLen[i] * 1048576);
|
||||
splits.add(split);
|
||||
}
|
||||
TableInputFormat tif = new TableInputFormat();
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanEmptyToAPP extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanEmptyToAPP.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanEmptyToAPP()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan(null, "app", "apo");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanEmptyToBBA extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanEmptyToBBA.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanEmptyToBBA()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan(null, "bba", "baz");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanEmptyToBBB extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanEmptyToBBB.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanEmptyToBBB()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan(null, "bbb", "bba");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanEmptyToEmpty extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanEmptyToEmpty.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanEmptyToEmpty()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan(null, null, null);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanEmptyToOPP extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanEmptyToOPP.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanEmptyToOPP()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan(null, "opp", "opo");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanOBBToOPP extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanOBBToOPP.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanOBBToOPP() throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("obb", "opp", "opo");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanOBBToQPP extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanOBBToQPP.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanOBBToQPP() throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("obb", "qpp", "qpo");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanOPPToEmpty extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanOPPToEmpty.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanOPPToEmpty()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("opp", null, "zzz");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanYYXToEmpty extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanYYXToEmpty.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanYYXToEmpty()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("yyx", null, "zzz");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanYYYToEmpty extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanYYYToEmpty.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanYYYToEmpty()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("yyy", null, "zzz");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.mapreduce;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.hadoop.hbase.HBaseClassTestRule;
|
||||
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
|
||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category({ MapReduceTests.class, MediumTests.class })
|
||||
public class TestTableInputFormatScanYZYToEmpty extends TestTableInputFormatScanBase {
|
||||
|
||||
@ClassRule
|
||||
public static final HBaseClassTestRule CLASS_RULE =
|
||||
HBaseClassTestRule.forClass(TestTableInputFormatScanYZYToEmpty.class);
|
||||
|
||||
/**
|
||||
* Tests a MR scan using specific start and stop rows.
|
||||
*/
|
||||
@Test
|
||||
public void testScanYZYToEmpty()
|
||||
throws IOException, InterruptedException, ClassNotFoundException {
|
||||
testScan("yzy", null, "zzz");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue