@Test public void testModelRowWithMultipleCell() { FlatRow simpleRow = FlatRow.newBuilder() .withRowKey(toByteString("key")) .addCell("family1", toByteString("column"), 500, toByteString("value"), null) .addCell("family1", toByteString("column2"), 500, toByteString("value"), null) .addCell("family1", toByteString("column2"), 400, toByteString("value"), null) .addCell("family2", toByteString("column"), 500, toByteString("value"), null) .build(); List<RowCell> rowCells = new ArrayList<>(); for (FlatRow.Cell cell : simpleRow.getCells()) { rowCells.add( RowCell.create( cell.getFamily(), cell.getQualifier(), cell.getTimestamp(), cell.getLabels(), cell.getValue())); } com.google.cloud.bigtable.data.v2.models.Row row = com.google.cloud.bigtable.data.v2.models.Row.create( ByteString.copyFromUtf8("key"), rowCells); Assert.assertEquals(row, FlatRowConverter.convertToModelRow(simpleRow)); }
public static com.google.cloud.bigtable.data.v2.models.Row convertToModelRow(FlatRow row) { if (row == null || row.getCells() == null) { return null; } ImmutableList.Builder<RowCell> rowCellList = ImmutableList.builderWithExpectedSize(row.getCells().size()); for (FlatRow.Cell cell : row.getCells()) { rowCellList.add(toRowCell(cell)); } return com.google.cloud.bigtable.data.v2.models.Row.create( row.getRowKey(), rowCellList.build()); }
FlatRowConverter { public static com.google.cloud.bigtable.data.v2.models.Row convertToModelRow(FlatRow row) { if (row == null || row.getCells() == null) { return null; } ImmutableList.Builder<RowCell> rowCellList = ImmutableList.builderWithExpectedSize(row.getCells().size()); for (FlatRow.Cell cell : row.getCells()) { rowCellList.add(toRowCell(cell)); } return com.google.cloud.bigtable.data.v2.models.Row.create( row.getRowKey(), rowCellList.build()); } }
FlatRowConverter { public static com.google.cloud.bigtable.data.v2.models.Row convertToModelRow(FlatRow row) { if (row == null || row.getCells() == null) { return null; } ImmutableList.Builder<RowCell> rowCellList = ImmutableList.builderWithExpectedSize(row.getCells().size()); for (FlatRow.Cell cell : row.getCells()) { rowCellList.add(toRowCell(cell)); } return com.google.cloud.bigtable.data.v2.models.Row.create( row.getRowKey(), rowCellList.build()); }  }
FlatRowConverter { public static com.google.cloud.bigtable.data.v2.models.Row convertToModelRow(FlatRow row) { if (row == null || row.getCells() == null) { return null; } ImmutableList.Builder<RowCell> rowCellList = ImmutableList.builderWithExpectedSize(row.getCells().size()); for (FlatRow.Cell cell : row.getCells()) { rowCellList.add(toRowCell(cell)); } return com.google.cloud.bigtable.data.v2.models.Row.create( row.getRowKey(), rowCellList.build()); }  static Row convert(FlatRow row); static com.google.cloud.bigtable.data.v2.models.Row convertToModelRow(FlatRow row); }
FlatRowConverter { public static com.google.cloud.bigtable.data.v2.models.Row convertToModelRow(FlatRow row) { if (row == null || row.getCells() == null) { return null; } ImmutableList.Builder<RowCell> rowCellList = ImmutableList.builderWithExpectedSize(row.getCells().size()); for (FlatRow.Cell cell : row.getCells()) { rowCellList.add(toRowCell(cell)); } return com.google.cloud.bigtable.data.v2.models.Row.create( row.getRowKey(), rowCellList.build()); }  static Row convert(FlatRow row); static com.google.cloud.bigtable.data.v2.models.Row convertToModelRow(FlatRow row);  }