Create an array of tuple bags with specified size created by splitting the input array of primitive types @param input Array of primitive types @param bagSize The number of tuples to be split and copied into each bag @return an array of tuple bags with each bag containing bagSize tuples split from
(T[] input, int bagSize)
| 189 | * @return an array of tuple bags with each bag containing bagSize tuples split from the input |
| 190 | */ |
| 191 | static public <T> Tuple[] splitCreateBagOfTuples(T[] input, int bagSize) |
| 192 | throws ExecException { |
| 193 | List<Tuple> result = new ArrayList<Tuple>(); |
| 194 | for (int from = 0; from < input.length; from += bagSize) { |
| 195 | Tuple t = TupleFactory.getInstance().newTuple(1); |
| 196 | int to = from + bagSize < input.length ? from + bagSize |
| 197 | : input.length; |
| 198 | T[] array = Arrays.copyOfRange(input, from, to); |
| 199 | result.add(loadNestTuple(t, array)); |
| 200 | } |
| 201 | return result.toArray(new Tuple[0]); |
| 202 | } |
| 203 | |
| 204 | static public <T>void addToTuple(Tuple t, T[] b) |
| 205 | { |
no test coverage detected