|
40 | 40 | import com.google.common.annotations.VisibleForTesting; |
41 | 41 | import com.google.common.base.Function; |
42 | 42 | import com.google.common.base.Supplier; |
| 43 | +import com.google.common.collect.FluentIterable; |
43 | 44 | import com.google.common.collect.ImmutableList; |
44 | 45 | import com.google.common.collect.Iterables; |
45 | | -import com.google.common.collect.Lists; |
46 | 46 | import com.google.common.collect.Maps; |
47 | 47 | import java.util.List; |
48 | 48 | import java.util.Map; |
@@ -468,13 +468,15 @@ public InsertAllResponse insertAll(InsertAllRequest request) { |
468 | 468 | // Using an array of size 1 here to have a mutable boolean variable, which can be modified in |
469 | 469 | // an anonymous inner class. |
470 | 470 | final boolean[] allInsertIdsSet = {true}; |
471 | | - List<Rows> rowsPb = Lists.transform(request.getRows(), new Function<RowToInsert, Rows>() { |
472 | | - @Override |
473 | | - public Rows apply(RowToInsert rowToInsert) { |
474 | | - allInsertIdsSet[0] &= rowToInsert.getId() != null; |
475 | | - return new Rows().setInsertId(rowToInsert.getId()).setJson(rowToInsert.getContent()); |
476 | | - } |
477 | | - }); |
| 471 | + List<Rows> rowsPb = FluentIterable.from(request.getRows()) |
| 472 | + .transform(new Function<RowToInsert, Rows>() { |
| 473 | + @Override |
| 474 | + public Rows apply(RowToInsert rowToInsert) { |
| 475 | + allInsertIdsSet[0] &= rowToInsert.getId() != null; |
| 476 | + return new Rows().setInsertId(rowToInsert.getId()).setJson(rowToInsert.getContent()); |
| 477 | + } |
| 478 | + }) |
| 479 | + .toList(); |
478 | 480 | requestPb.setRows(rowsPb); |
479 | 481 |
|
480 | 482 | TableDataInsertAllResponse responsePb; |
|
0 commit comments