/** * This should be called after the binary search is finished and before the linear scan begins * @throws IOException */ private void beginLinearSearch() throws IOException { sync(rangeStart); this.getIOContext().setBinarySearching(false); this.wasUsingSortedSearch = false; }
/** * This should be called after the binary search is finished and before the linear scan begins * @throws IOException */ private void beginLinearSearch() throws IOException { sync(rangeStart); this.getIOContext().setBinarySearching(false); this.wasUsingSortedSearch = false; }
public void testGreaterThanOrEqualOpClass() throws Exception { init(); ioContext.setGenericUDFClassName(GenericUDFOPEqualOrGreaterThan.class.getName()); Assert.assertTrue(ioContext.isBinarySearching()); Assert.assertTrue(executeDoNext(hbsReader)); ioContext.setBinarySearching(false); ioContext.setComparison(-1); Assert.assertTrue(executeDoNext(hbsReader)); ioContext.setComparison(0); Assert.assertTrue(executeDoNext(hbsReader)); ioContext.setComparison(1); Assert.assertTrue(executeDoNext(hbsReader)); }
public void testEqualOpClass() throws Exception { init(); ioContext.setGenericUDFClassName(GenericUDFOPEqual.class.getName()); Assert.assertTrue(ioContext.isBinarySearching()); Assert.assertTrue(executeDoNext(hbsReader)); ioContext.setBinarySearching(false); ioContext.setComparison(-1); Assert.assertTrue(executeDoNext(hbsReader)); ioContext.setComparison(0); Assert.assertTrue(executeDoNext(hbsReader)); ioContext.setComparison(1); Assert.assertFalse(executeDoNext(hbsReader)); }
public void testGreaterThanOpClass() throws Exception { init(); ioContext.setGenericUDFClassName(GenericUDFOPGreaterThan.class.getName()); Assert.assertTrue(ioContext.isBinarySearching()); Assert.assertTrue(executeDoNext(hbsReader)); ioContext.setBinarySearching(false); ioContext.setComparison(-1); Assert.assertTrue(executeDoNext(hbsReader)); ioContext.setComparison(0); Assert.assertTrue(executeDoNext(hbsReader)); ioContext.setComparison(1); Assert.assertTrue(executeDoNext(hbsReader)); }
private void resetIOContext() { conf.set(Utilities.INPUT_NAME, "TestHiveBinarySearchRecordReader"); ioContext = IOContextMap.get(conf); ioContext.setUseSorted(false); ioContext.setBinarySearching(false); ioContext.setEndBinarySearch(false); ioContext.setComparison(null); ioContext.setGenericUDFClassName(null); }
public void initIOContextSortedProps(FileSplit split, RecordReader recordReader, JobConf job) { this.jobConf = job; this.getIOContext().resetSortingValues(); this.isSorted = jobConf.getBoolean("hive.input.format.sorted", false); this.rangeStart = split.getStart(); this.rangeEnd = split.getStart() + split.getLength(); this.splitEnd = rangeEnd; if (recordReader instanceof RCFileRecordReader && rangeEnd != 0 && this.isSorted) { // Binary search only works if we know the size of the split, and the recordReader is an // RCFileRecordReader this.getIOContext().setUseSorted(true); this.getIOContext().setBinarySearching(true); this.wasUsingSortedSearch = true; } else { // Use the defalut methods for next in the child class this.isSorted = false; } }
public void initIOContextSortedProps(FileSplit split, RecordReader recordReader, JobConf job) { this.jobConf = job; this.getIOContext().resetSortingValues(); this.isSorted = jobConf.getBoolean("hive.input.format.sorted", false); this.rangeStart = split.getStart(); this.rangeEnd = split.getStart() + split.getLength(); this.splitEnd = rangeEnd; if (recordReader instanceof RCFileRecordReader && rangeEnd != 0 && this.isSorted) { // Binary search only works if we know the size of the split, and the recordReader is an // RCFileRecordReader this.getIOContext().setUseSorted(true); this.getIOContext().setBinarySearching(true); this.wasUsingSortedSearch = true; } else { // Use the defalut methods for next in the child class this.isSorted = false; } }
this.getIOContext().setBinarySearching(false); sync(rangeStart);
this.getIOContext().setBinarySearching(false); sync(rangeStart);
/** * This should be called after the binary search is finished and before the linear scan begins * @throws IOException */ private void beginLinearSearch() throws IOException { sync(rangeStart); this.getIOContext().setBinarySearching(false); this.wasUsingSortedSearch = false; }
public void initIOContextSortedProps(FileSplit split, RecordReader recordReader, JobConf job) { this.jobConf = job; this.getIOContext().resetSortingValues(); this.isSorted = jobConf.getBoolean("hive.input.format.sorted", false); this.rangeStart = split.getStart(); this.rangeEnd = split.getStart() + split.getLength(); this.splitEnd = rangeEnd; if (recordReader instanceof RCFileRecordReader && rangeEnd != 0 && this.isSorted) { // Binary search only works if we know the size of the split, and the recordReader is an // RCFileRecordReader this.getIOContext().setUseSorted(true); this.getIOContext().setBinarySearching(true); this.wasUsingSortedSearch = true; } else { // Use the defalut methods for next in the child class this.isSorted = false; } }
this.getIOContext().setBinarySearching(false); sync(rangeStart);