@Test public void getNextRecord100Percent() throws Exception { samplingBitSet.set(0, 100); recordsLimit = 100; when(mockContext.getStatsSampleRatio()).thenReturn((float) 1.0); readSamplingBridge = new ReadSamplingBridge(mockContext, mockAccessorFactory, mockResolverFactory); result = readSamplingBridge.getNext(); assertEquals("0", result.toString()); result = readSamplingBridge.getNext(); assertEquals("1", result.toString()); when(mockBridge.getNext()).thenReturn(null); result = readSamplingBridge.getNext(); assertNull(result); }
@Override public Writable getNext() throws Exception { Writable output = super.getNext(); while (!sampleBitSet.get(curIndex)) { if (output == null) { break; } incIndex(); output = super.getNext(); } incIndex(); return output; }
ReadSamplingBridge extends ReadBridge { @Override public Writable getNext() throws Exception { Writable output = super.getNext(); while (!sampleBitSet.get(curIndex)) { if (output == null) { break; } incIndex(); output = super.getNext(); } incIndex(); return output; } }
ReadSamplingBridge extends ReadBridge { @Override public Writable getNext() throws Exception { Writable output = super.getNext(); while (!sampleBitSet.get(curIndex)) { if (output == null) { break; } incIndex(); output = super.getNext(); } incIndex(); return output; } ReadSamplingBridge(RequestContext context);   ReadSamplingBridge(RequestContext context, AccessorFactory accessorFactory, ResolverFactory resolverFactory); }
ReadSamplingBridge extends ReadBridge { @Override public Writable getNext() throws Exception { Writable output = super.getNext(); while (!sampleBitSet.get(curIndex)) { if (output == null) { break; } incIndex(); output = super.getNext(); } incIndex(); return output; } ReadSamplingBridge(RequestContext context);   ReadSamplingBridge(RequestContext context, AccessorFactory accessorFactory, ResolverFactory resolverFactory); @Override Writable getNext(); }
ReadSamplingBridge extends ReadBridge { @Override public Writable getNext() throws Exception { Writable output = super.getNext(); while (!sampleBitSet.get(curIndex)) { if (output == null) { break; } incIndex(); output = super.getNext(); } incIndex(); return output; } ReadSamplingBridge(RequestContext context);   ReadSamplingBridge(RequestContext context, AccessorFactory accessorFactory, ResolverFactory resolverFactory); @Override Writable getNext();  }