本文整理汇总了Java中com.cloudera.sqoop.mapreduce.db.TextSplitter.split方法的典型用法代码示例。如果您正苦于以下问题:Java TextSplitter.split方法的具体用法?Java TextSplitter.split怎么用?Java TextSplitter.split使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.cloudera.sqoop.mapreduce.db.TextSplitter
的用法示例。
在下文中一共展示了TextSplitter.split方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAlphabetSplit
import com.cloudera.sqoop.mapreduce.db.TextSplitter; //导入方法依赖的package包/类
public void testAlphabetSplit() throws SQLException, ValidationException {
// This should give us 25 splits, one per letter.
TextSplitter splitter = new TextSplitter();
List<String> splits = splitter.split(25, "A", "Z", "");
String [] expected = { "A", "B", "C", "D", "E", "F", "G", "H", "I",
"J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U",
"V", "W", "X", "Y", "Z", };
assertArrayEquals(expected, splits.toArray(new String [0]));
}
示例2: testAlphabetSplitWhenMinStringGreaterThanMaxString
import com.cloudera.sqoop.mapreduce.db.TextSplitter; //导入方法依赖的package包/类
public void testAlphabetSplitWhenMinStringGreaterThanMaxString() throws SQLException {
TextSplitter splitter = new TextSplitter();
try {
splitter.split(4, "Z", "A", "");
fail();
} catch (ValidationException e) {
// expected
assertTrue(true);
}
}
示例3: testCommonPrefix
import com.cloudera.sqoop.mapreduce.db.TextSplitter; //导入方法依赖的package包/类
public void testCommonPrefix() throws SQLException, ValidationException {
// Splits between 'Hand' and 'Hardy'
TextSplitter splitter = new TextSplitter();
List<String> splits = splitter.split(5, "nd", "rdy", "Ha");
// Don't check for exact values in the middle, because the splitter
// generates some ugly Unicode-isms. But do check that we get multiple
// splits and that it starts and ends on the correct points.
assertEquals("Hand", splits.get(0));
assertEquals("Hardy", splits.get(splits.size() -1));
assertEquals(6, splits.size());
}
示例4: testAlphabetSplit
import com.cloudera.sqoop.mapreduce.db.TextSplitter; //导入方法依赖的package包/类
public void testAlphabetSplit() throws SQLException {
// This should give us 25 splits, one per letter.
TextSplitter splitter = new TextSplitter();
List<String> splits = splitter.split(25, "A", "Z", "");
String [] expected = { "A", "B", "C", "D", "E", "F", "G", "H", "I",
"J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U",
"V", "W", "X", "Y", "Z", };
assertArrayEquals(expected, splits.toArray(new String [0]));
}
示例5: testCommonPrefix
import com.cloudera.sqoop.mapreduce.db.TextSplitter; //导入方法依赖的package包/类
public void testCommonPrefix() throws SQLException {
// Splits between 'Hand' and 'Hardy'
TextSplitter splitter = new TextSplitter();
List<String> splits = splitter.split(5, "nd", "rdy", "Ha");
// Don't check for exact values in the middle, because the splitter
// generates some ugly Unicode-isms. But do check that we get multiple
// splits and that it starts and ends on the correct points.
assertEquals("Hand", splits.get(0));
assertEquals("Hardy", splits.get(splits.size() -1));
assertEquals(6, splits.size());
}