AbstractFileInputOperator implements InputOperator, Partitioner<AbstractFileInputOperator<T>>, StatsListener,
    Operator.CheckpointListener, Operator.CheckpointNotificationListener { public void setPartitionCount(int requiredPartitions) { this.partitionCount = requiredPartitions; }  String getDirectory(); void setDirectory(String directory); DirectoryScanner getScanner(); void setScanner(DirectoryScanner scanner); int getScanIntervalMillis(); void setScanIntervalMillis(int scanIntervalMillis); int getEmitBatchSize(); void setEmitBatchSize(int emitBatchSize); void setWindowDataManager(WindowDataManager windowDataManager); WindowDataManager getWindowDataManager(); int getPartitionCount(); void setPartitionCount(int requiredPartitions); int getCurrentPartitions(); @Override void setup(OperatorContext context); @Override void teardown(); @Override void beginWindow(long windowId); @Override void endWindow(); @Override void emitTuples(); @Override Collection<Partition<AbstractFileInputOperator<T>>> definePartitions(Collection<Partition<AbstractFileInputOperator<T>>> partitions, PartitioningContext context); @Override void partitioned(Map<Integer, Partition<AbstractFileInputOperator<T>>> partitions); @Override void beforeCheckpoint(long windowId); @Override void checkpointed(long windowId); @Override void committed(long windowId); @Override Response processStats(BatchedOperatorStats batchedOperatorStats); int getMaxRetryCount(); void setMaxRetryCount(int maxRetryCount);  }
@Test public void testCustomScanner() { MyScanner scanner = new MyScanner(); scanner.setPartitionCount(2); scanner.setPartitionIndex(1); boolean accepted = scanner.acceptFile("1_file"); Assert.assertTrue("File should be accepted by this partition ", accepted); scanner.setPartitionIndex(0); accepted = scanner.acceptFile("1_file"); Assert.assertFalse("File should not be accepted by this partition ", accepted); }