SolrIO { public static Read read() { return new AutoValue_SolrIO_Read.Builder().setBatchSize(1000).setQuery("*:*").build(); } private  SolrIO(); static Read read(); static ReadAll readAll(); static Write write();  }
@Test public void testRead() throws Exception { SolrIOTestUtils.insertTestDocuments(SOLR_COLLECTION, NUM_DOCS, solrClient); PCollection<SolrDocument> output = pipeline.apply( SolrIO.read() .withConnectionConfiguration(connectionConfiguration) .from(SOLR_COLLECTION) .withBatchSize(101)); PAssert.thatSingleton(output.apply("Count", Count.globally())).isEqualTo(NUM_DOCS); pipeline.run(); }
@Test public void testReadWithQuery() throws Exception { SolrIOTestUtils.insertTestDocuments(SOLR_COLLECTION, NUM_DOCS, solrClient); PCollection<SolrDocument> output = pipeline.apply( SolrIO.read() .withConnectionConfiguration(connectionConfiguration) .from(SOLR_COLLECTION) .withQuery("scientist:Franklin")); PAssert.thatSingleton(output.apply("Count", Count.globally())) .isEqualTo(NUM_DOCS / NUM_SCIENTISTS); pipeline.run(); }