test_class.file: proxy/src/test/java/com/wavefront/agent/data/LineDelimitedDataSubmissionTaskTest.java
test_class.identifier: LineDelimitedDataSubmissionTaskTest
test_case.body: @Test
    public void testSplitTask() {
      LineDelimitedDataSubmissionTask task = new LineDelimitedDataSubmissionTask(null, null, null,
          null, "graphite_v2", ReportableEntityType.POINT, "2878",
          ImmutableList.of("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K"), null);
  
      List<LineDelimitedDataSubmissionTask> split;
  
      // don't split if task is smaller than min split size
      split = task.splitTask(11, 4);
      assertEquals(1, split.size());
      assertSame(split.get(0), task);
  
      // split in 2
      split = task.splitTask(10, 11);
      assertEquals(2, split.size());
      assertArrayEquals(new String[] {"A", "B", "C", "D", "E", "F"}, split.get(0).payload.toArray());
      assertArrayEquals(new String[] {"G", "H", "I", "J", "K"}, split.get(1).payload.toArray());
  
      split = task.splitTask(10, 6);
      assertEquals(2, split.size());
      assertArrayEquals(new String[] {"A", "B", "C", "D", "E", "F"}, split.get(0).payload.toArray());
      assertArrayEquals(new String[] {"G", "H", "I", "J", "K"}, split.get(1).payload.toArray());
  
      // split in 3
      split = task.splitTask(10, 5);
      assertEquals(3, split.size());
      assertArrayEquals(new String[] {"A", "B", "C", "D", "E"}, split.get(0).payload.toArray());
      assertArrayEquals(new String[] {"F", "G", "H", "I", "J"}, split.get(1).payload.toArray());
      assertArrayEquals(new String[] {"K"}, split.get(2).payload.toArray());
  
      split = task.splitTask(7, 4);
      assertEquals(3, split.size());
      assertArrayEquals(new String[] {"A", "B", "C", "D"}, split.get(0).payload.toArray());
      assertArrayEquals(new String[] {"E", "F", "G", "H"}, split.get(1).payload.toArray());
      assertArrayEquals(new String[] {"I", "J", "K"}, split.get(2).payload.toArray());
  
      // split in 4
      split = task.splitTask(7, 3);
      assertEquals(4, split.size());
      assertArrayEquals(new String[] {"A", "B", "C"}, split.get(0).payload.toArray());
      assertArrayEquals(new String[] {"D", "E", "F"}, split.get(1).payload.toArray());
      assertArrayEquals(new String[] {"G", "H", "I"}, split.get(2).payload.toArray());
      assertArrayEquals(new String[] {"J", "K"}, split.get(3).payload.toArray());
  
      // split in 6
      split = task.splitTask(7, 2);
      assertEquals(6, split.size());
      assertArrayEquals(new String[] {"A", "B"}, split.get(0).payload.toArray());
      assertArrayEquals(new String[] {"C", "D"}, split.get(1).payload.toArray());
      assertArrayEquals(new String[] {"E", "F"}, split.get(2).payload.toArray());
      assertArrayEquals(new String[] {"G", "H"}, split.get(3).payload.toArray());
      assertArrayEquals(new String[] {"I", "J"}, split.get(4).payload.toArray());
      assertArrayEquals(new String[] {"K"}, split.get(5).payload.toArray());
    }
test_case.class_method_signature: LineDelimitedDataSubmissionTaskTest.testSplitTask()
test_case.full_signature: @Test public void testSplitTask()
test_case.identifier: testSplitTask
test_case.invocations: of splitTask assertEquals size assertSame get splitTask assertEquals size assertArrayEquals toArray get assertArrayEquals toArray get splitTask assertEquals size assertArrayEquals toArray get assertArrayEquals toArray get splitTask assertEquals size assertArrayEquals toArray get assertArrayEquals toArray get assertArrayEquals toArray get splitTask assertEquals size assertArrayEquals toArray get assertArrayEquals toArray get assertArrayEquals toArray get splitTask assertEquals size assertArrayEquals toArray get assertArrayEquals toArray get assertArrayEquals toArray get assertArrayEquals toArray get splitTask assertEquals size assertArrayEquals toArray get assertArrayEquals toArray get assertArrayEquals toArray get assertArrayEquals toArray get assertArrayEquals toArray get assertArrayEquals toArray get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSplitTask()
focal_class.declarator: api
focal_class.modifier: private transient
focal_class.original_string: private transient ProxyV2API api;
focal_class.type: ProxyV2API
focal_class.var_name: api
focal_class.declarator: proxyId
focal_class.modifier: private transient
focal_class.original_string: private transient UUID proxyId;
focal_class.type: UUID
focal_class.var_name: proxyId
focal_class.declarator: format
focal_class.modifier: @JsonProperty
    private
focal_class.original_string: @JsonProperty
    private String format;
focal_class.type: String
focal_class.var_name: format
focal_class.declarator: payload
focal_class.modifier: @VisibleForTesting
    @JsonProperty
    protected
focal_class.original_string: @VisibleForTesting
    @JsonProperty
    protected List<String> payload;
focal_class.type: List<String>
focal_class.var_name: payload
focal_class.file: proxy/src/main/java/com/wavefront/agent/data/LineDelimitedDataSubmissionTask.java
focal_class.identifier: LineDelimitedDataSubmissionTask
focal_class.class_method_signature: LineDelimitedDataSubmissionTask.LineDelimitedDataSubmissionTask()
focal_class.full_signature: @SuppressWarnings("unused")  LineDelimitedDataSubmissionTask()
focal_class.identifier: LineDelimitedDataSubmissionTask
focal_class.modifiers: @SuppressWarnings("unused")
focal_class.parameters: ()
focal_class.signature:  LineDelimitedDataSubmissionTask()
focal_class.class_method_signature: LineDelimitedDataSubmissionTask.LineDelimitedDataSubmissionTask(ProxyV2API api, UUID proxyId, EntityProperties properties,
                                           TaskQueue<LineDelimitedDataSubmissionTask> backlog,
                                           String format, ReportableEntityType entityType,
                                           String handle, @Nonnull List<String> payload,
                                           @Nullable Supplier<Long> timeProvider)
focal_class.full_signature: public  LineDelimitedDataSubmissionTask(ProxyV2API api, UUID proxyId, EntityProperties properties,
                                           TaskQueue<LineDelimitedDataSubmissionTask> backlog,
                                           String format, ReportableEntityType entityType,
                                           String handle, @Nonnull List<String> payload,
                                           @Nullable Supplier<Long> timeProvider)
focal_class.identifier: LineDelimitedDataSubmissionTask
focal_class.modifiers: public
focal_class.parameters: (ProxyV2API api, UUID proxyId, EntityProperties properties,
                                           TaskQueue<LineDelimitedDataSubmissionTask> backlog,
                                           String format, ReportableEntityType entityType,
                                           String handle, @Nonnull List<String> payload,
                                           @Nullable Supplier<Long> timeProvider)
focal_class.signature:  LineDelimitedDataSubmissionTask(ProxyV2API api, UUID proxyId, EntityProperties properties,
                                           TaskQueue<LineDelimitedDataSubmissionTask> backlog,
                                           String format, ReportableEntityType entityType,
                                           String handle, @Nonnull List<String> payload,
                                           @Nullable Supplier<Long> timeProvider)
focal_class.class_method_signature: LineDelimitedDataSubmissionTask.doExecute()
focal_class.full_signature: @Override Response doExecute()
focal_class.identifier: doExecute
focal_class.modifiers: @Override
focal_class.parameters: ()
focal_class.return: Response
focal_class.signature: Response doExecute()
focal_class.class_method_signature: LineDelimitedDataSubmissionTask.weight()
focal_class.full_signature: @Override public int weight()
focal_class.identifier: weight
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int weight()
focal_class.class_method_signature: LineDelimitedDataSubmissionTask.splitTask(int minSplitSize, int maxSplitSize)
focal_class.full_signature: @Override public List<LineDelimitedDataSubmissionTask> splitTask(int minSplitSize, int maxSplitSize)
focal_class.identifier: splitTask
focal_class.modifiers: @Override public
focal_class.parameters: (int minSplitSize, int maxSplitSize)
focal_class.return: List<LineDelimitedDataSubmissionTask>
focal_class.signature: List<LineDelimitedDataSubmissionTask> splitTask(int minSplitSize, int maxSplitSize)
focal_class.class_method_signature: LineDelimitedDataSubmissionTask.payload()
focal_class.full_signature: public List<String> payload()
focal_class.identifier: payload
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<String>
focal_class.signature: List<String> payload()
focal_class.class_method_signature: LineDelimitedDataSubmissionTask.injectMembers(ProxyV2API api, UUID proxyId, EntityProperties properties,
                              TaskQueue<LineDelimitedDataSubmissionTask> backlog)
focal_class.full_signature: public void injectMembers(ProxyV2API api, UUID proxyId, EntityProperties properties,
                              TaskQueue<LineDelimitedDataSubmissionTask> backlog)
focal_class.identifier: injectMembers
focal_class.modifiers: public
focal_class.parameters: (ProxyV2API api, UUID proxyId, EntityProperties properties,
                              TaskQueue<LineDelimitedDataSubmissionTask> backlog)
focal_class.return: void
focal_class.signature: void injectMembers(ProxyV2API api, UUID proxyId, EntityProperties properties,
                              TaskQueue<LineDelimitedDataSubmissionTask> backlog)
focal_class.superclass: extends AbstractDataSubmissionTask<LineDelimitedDataSubmissionTask>
focal_method.body: @Override
    public List<LineDelimitedDataSubmissionTask> splitTask(int minSplitSize, int maxSplitSize) {
      if (payload.size() > Math.max(1, minSplitSize)) {
        List<LineDelimitedDataSubmissionTask> result = new ArrayList<>();
        int stride = Math.min(maxSplitSize, (int) Math.ceil((float) payload.size() / 2.0));
        int endingIndex = 0;
        for (int startingIndex = 0; endingIndex < payload.size() - 1; startingIndex += stride) {
          endingIndex = Math.min(payload.size(), startingIndex + stride) - 1;
          result.add(new LineDelimitedDataSubmissionTask(api, proxyId, properties, backlog, format,
              getEntityType(), handle, payload.subList(startingIndex, endingIndex + 1),
              timeProvider));
        }
        return result;
      }
      return ImmutableList.of(this);
    }
focal_method.class_method_signature: LineDelimitedDataSubmissionTask.splitTask(int minSplitSize, int maxSplitSize)
focal_method.full_signature: @Override public List<LineDelimitedDataSubmissionTask> splitTask(int minSplitSize, int maxSplitSize)
focal_method.identifier: splitTask
focal_method.invocations: size max min ceil size size min size add getEntityType subList of
focal_method.modifiers: @Override public
focal_method.parameters: (int minSplitSize, int maxSplitSize)
focal_method.return: List<LineDelimitedDataSubmissionTask>
focal_method.signature: List<LineDelimitedDataSubmissionTask> splitTask(int minSplitSize, int maxSplitSize)