protected void setupSampling(final String tableName, final CommandLine cl, final Shell shellState, ScannerBase scanner) throws TableNotFoundException, AccumuloException, AccumuloSecurityException { if (getUseSample(cl)) { SamplerConfiguration samplerConfig = shellState.getAccumuloClient().tableOperations() .getSamplerConfiguration(tableName); if (samplerConfig == null) { throw new SampleNotPresentException( "Table " + tableName + " does not have sampling configured"); } Shell.log.debug("Using sampling configuration : " + samplerConfig); scanner.setSamplerConfiguration(samplerConfig); } }
private void setSamplerConfig(SamplerConfiguration sc, ScannerBase... scanners) { for (ScannerBase s : scanners) { s.setSamplerConfiguration(sc); } }
scannerBase.setSamplerConfiguration(samplerConfig);
scannerBase.setSamplerConfiguration(samplerConfig);
@Override public void setSamplerConfiguration(SamplerConfiguration samplerConfig) { delegate.setSamplerConfiguration(samplerConfig); }
private void assertSampleNotPresent(SamplerConfiguration sc, ScannerBase... scanners) { for (ScannerBase scanner : scanners) { SamplerConfiguration csc = scanner.getSamplerConfiguration(); scanner.setSamplerConfiguration(sc); try { for (Iterator<Entry<Key,Value>> i = scanner.iterator(); i.hasNext();) { Entry<Key,Value> entry = i.next(); entry.getKey(); } Assert.fail("Expected SampleNotPresentException, but it did not happen : " + scanner.getClass().getSimpleName()); } catch (SampleNotPresentException e) { } scanner.clearSamplerConfiguration(); for (Iterator<Entry<Key,Value>> i = scanner.iterator(); i.hasNext();) { Entry<Key,Value> entry = i.next(); entry.getKey(); } if (csc == null) { scanner.clearSamplerConfiguration(); } else { scanner.setSamplerConfiguration(csc); } } }
protected void setupSampling(final String tableName, final CommandLine cl, final Shell shellState, ScannerBase scanner) throws TableNotFoundException, AccumuloException, AccumuloSecurityException { if (getUseSample(cl)) { SamplerConfiguration samplerConfig = shellState.getConnector().tableOperations() .getSamplerConfiguration(tableName); if (samplerConfig == null) { throw new SampleNotPresentException( "Table " + tableName + " does not have sampling configured"); } Shell.log.debug("Using sampling configuration : " + samplerConfig); scanner.setSamplerConfiguration(samplerConfig); } }
sb.clearSamplerConfiguration(); Assert.assertEquals(20000, Iterables.size(sb)); sb.setSamplerConfiguration(SC1);
scannerBase.setSamplerConfiguration(samplerConfig);
scannerBase.setSamplerConfiguration(samplerConfig);
scannerBase.setSamplerConfiguration(samplerConfig);
scannerBase.setSamplerConfiguration(samplerConfig);
scannerBase.setSamplerConfiguration(samplerConfig);
scannerBase.setSamplerConfiguration(samplerConfig);