@Override public BatchScanner createBatchScanner(String tableName, Authorizations authorizations) throws TableNotFoundException { Integer numQueryThreads = ClientProperty.BATCH_SCANNER_NUM_QUERY_THREADS .getInteger(getProperties()); Objects.requireNonNull(numQueryThreads); ensureOpen(); return createBatchScanner(tableName, authorizations, numQueryThreads); }
@Override public Scanner createScanner(String tableName, Authorizations authorizations) throws TableNotFoundException { checkArgument(tableName != null, "tableName is null"); checkArgument(authorizations != null, "authorizations is null"); ensureOpen(); Scanner scanner = new ScannerImpl(this, getTableId(tableName), authorizations); Integer batchSize = ClientProperty.SCANNER_BATCH_SIZE.getInteger(getProperties()); if (batchSize != null) { scanner.setBatchSize(batchSize); } return scanner; }
/** * Gets the {@link BatchWriterConfig} settings that were stored with ClientInfo */ public static BatchWriterConfig getBatchWriterOptions(Class<?> implementingClass, Configuration conf) { BatchWriterConfig bwConfig = new BatchWriterConfig(); Properties props = getClientProperties(implementingClass, conf); String property = props.getProperty(BATCH_WRITER_DURABILITY.getKey()); if (property != null) bwConfig.setDurability(DurabilityImpl.fromString(property)); Long value = BATCH_WRITER_LATENCY_MAX.getTimeInMillis(props); if (value != null) bwConfig.setMaxLatency(value, TimeUnit.MILLISECONDS); value = BATCH_WRITER_MEMORY_MAX.getBytes(props); if (value != null) bwConfig.setMaxMemory(value); value = BATCH_WRITER_TIMEOUT_MAX.getTimeInMillis(props); if (value != null) bwConfig.setTimeout(value, TimeUnit.MILLISECONDS); Integer intValue = BATCH_WRITER_THREADS_MAX.getInteger(props); if (intValue != null) bwConfig.setMaxWriteThreads(intValue); return bwConfig; }