FSSliceReader extends AbstractFSBlockReader<Slice> { @Override public void setup(Context.OperatorContext context) { super.setup(context); if (basePath != null && this.readerContext instanceof ReaderContext.FixedBytesReaderContext) { ((ReaderContext.FixedBytesReaderContext)this.readerContext).setLength((int)fs.getDefaultBlockSize(new Path(basePath))); } } FSSliceReader(); @Override void setup(Context.OperatorContext context);  }
@Test public void testBlockSize() throws IOException { long blockSize = 1000; Path path = new Path(testMeta.output); when(fileSystem.getDefaultBlockSize(path)).thenReturn(blockSize); Attribute.AttributeMap.DefaultAttributeMap readerAttr = new Attribute.AttributeMap.DefaultAttributeMap(); readerAttr.put(DAG.APPLICATION_ID, Long.toHexString(System.currentTimeMillis())); readerAttr.put(Context.OperatorContext.SPIN_MILLIS, 10); FSTestReader reader = new FSTestReader(); reader.setBasePath(testMeta.output); reader.setup(mockOperatorContext(1, readerAttr)); Assert.assertEquals("Block Size", blockSize, (long)((ReaderContext.FixedBytesReaderContext)reader.getReaderContext()).getLength()); }