@Test(expectedExceptions = SqoopException.class) public void testSuccessfulLoader() throws Throwable { SqoopLoader executor = new SqoopLoader(jobContextMock, GoodLoader.class.getName(), getIDF(), getMatcher()); RecordWriter<Text, NullWritable> writer = executor .getRecordWriter(); IntermediateDataFormat<?> dataFormat = MRJobTestUtil.getTestIDF(); StringBuilder builder = new StringBuilder(); for (int count = 0; count < 100; count++) { builder.append(String.valueOf(count)); if (count != 99) { builder.append(","); } } dataFormat.setCSVTextData(builder.toString()); writer.write(new Text(dataFormat.getCSVTextData()), null); TimeUnit.SECONDS.sleep(5); writer.close(null); verify(jobContextMock, times(1)).getConfiguration(); verify(jobContextMock, times(1)).getCounter(SqoopCounters.ROWS_WRITTEN); }
public RecordWriter<Text, NullWritable> getRecordWriter() { consumerFuture = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat ("OutputFormatLoader-consumer").build()).submit( new ConsumerThread(context)); return writer; }
SqoopLoader { public RecordWriter<Text, NullWritable> getRecordWriter() { consumerFuture = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat ("OutputFormatLoader-consumer").build()).submit( new ConsumerThread(context)); return writer; } }
SqoopLoader { public RecordWriter<Text, NullWritable> getRecordWriter() { consumerFuture = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat ("OutputFormatLoader-consumer").build()).submit( new ConsumerThread(context)); return writer; } SqoopLoader(JobContext jobctx, String loaderName, IntermediateDataFormat<?> toDataFormat, Matcher matcher);  SqoopLoader(JobContext jobctx); }
SqoopLoader { public RecordWriter<Text, NullWritable> getRecordWriter() { consumerFuture = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat ("OutputFormatLoader-consumer").build()).submit( new ConsumerThread(context)); return writer; } SqoopLoader(JobContext jobctx, String loaderName, IntermediateDataFormat<?> toDataFormat, Matcher matcher);  SqoopLoader(JobContext jobctx); RecordWriter<Text, NullWritable> getRecordWriter(); }
SqoopLoader { public RecordWriter<Text, NullWritable> getRecordWriter() { consumerFuture = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat ("OutputFormatLoader-consumer").build()).submit( new ConsumerThread(context)); return writer; } SqoopLoader(JobContext jobctx, String loaderName, IntermediateDataFormat<?> toDataFormat, Matcher matcher);  SqoopLoader(JobContext jobctx); RecordWriter<Text, NullWritable> getRecordWriter(); static final Logger LOG; }