@Test public void documentWithChildDocumentsShouldBeRowWithRecords() { SolrInputDocument doc = new SolrInputDocument(); doc.addField("rowid", "1"); List<SolrInputDocument> children = Lists.newArrayList(); for (int i = 0; i < 10; i++) { SolrInputDocument child = new SolrInputDocument(); child.addField("recordid", i); child.addField("fam.key", "value" + i); children.add(child); } doc.addChildDocuments(children); RowMutation mutate = RowMutationHelper.from(doc, "foo"); assertEquals("Children should turn into records.", 10, mutate.getRecordMutationsSize()); assertEquals("Should get a simple value back.", "value0", getRecordValue("key", mutate)); assertEquals("Should properly figure our family.", "fam", getFirstRecord(mutate).getFamily()); }
public static List<RowMutation> from(Collection<SolrInputDocument> docs, String table) { List<RowMutation> mutations = Lists.newArrayList(); for (SolrInputDocument d : docs) { mutations.add(from(d, table)); } return mutations; }
RowMutationHelper { public static List<RowMutation> from(Collection<SolrInputDocument> docs, String table) { List<RowMutation> mutations = Lists.newArrayList(); for (SolrInputDocument d : docs) { mutations.add(from(d, table)); } return mutations; } }
RowMutationHelper { public static List<RowMutation> from(Collection<SolrInputDocument> docs, String table) { List<RowMutation> mutations = Lists.newArrayList(); for (SolrInputDocument d : docs) { mutations.add(from(d, table)); } return mutations; }  }
RowMutationHelper { public static List<RowMutation> from(Collection<SolrInputDocument> docs, String table) { List<RowMutation> mutations = Lists.newArrayList(); for (SolrInputDocument d : docs) { mutations.add(from(d, table)); } return mutations; }  static List<RowMutation> from(Collection<SolrInputDocument> docs, String table); static RowMutation from(SolrInputDocument doc, String table); }
RowMutationHelper { public static List<RowMutation> from(Collection<SolrInputDocument> docs, String table) { List<RowMutation> mutations = Lists.newArrayList(); for (SolrInputDocument d : docs) { mutations.add(from(d, table)); } return mutations; }  static List<RowMutation> from(Collection<SolrInputDocument> docs, String table); static RowMutation from(SolrInputDocument doc, String table);  }