@Test public void getNextRecord100Records10Percent() throws Exception { samplingBitSet.set(5, 15); recordsLimit = 100; when(mockContext.getStatsSampleRatio()).thenReturn((float) 0.1); readSamplingBridge = new ReadSamplingBridge(mockContext, mockAccessorFactory, mockResolverFactory); for (int i = 0; i < 10; i++) { result = readSamplingBridge.getNext(); assertEquals("" + (i + 5), result.toString()); } 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();  }