@Test public void shouldNotLogWarningWhenIndexingSmallVariableValue() { final String variableValue = "x".repeat(configuration.index.ignoreVariablesAbove); final Record<VariableRecordValue> recordMock = mock(Record.class); when(recordMock.getPartitionId()).thenReturn(1); when(recordMock.getKey()).thenReturn(RECORD_KEY); when(recordMock.getValueType()).thenReturn(ValueType.VARIABLE); when(recordMock.toJson()).thenReturn("{}"); final VariableRecordValue value = mock(VariableRecordValue.class); when(value.getValue()).thenReturn(variableValue); when(recordMock.getValue()).thenReturn(value); client.index(recordMock); verify(logSpy, never()).warn(anyString(), ArgumentMatchers.<Object[]>any()); }
public void index(final Record<?> record) { if (metrics == null) { metrics = new ElasticsearchMetrics(record.getPartitionId()); } checkRecord(record); bulk(newIndexCommand(record), record); }
ElasticsearchClient { public void index(final Record<?> record) { if (metrics == null) { metrics = new ElasticsearchMetrics(record.getPartitionId()); } checkRecord(record); bulk(newIndexCommand(record), record); } }
ElasticsearchClient { public void index(final Record<?> record) { if (metrics == null) { metrics = new ElasticsearchMetrics(record.getPartitionId()); } checkRecord(record); bulk(newIndexCommand(record), record); } ElasticsearchClient(
      final ElasticsearchExporterConfiguration configuration, final Logger log);   ElasticsearchClient(
      final ElasticsearchExporterConfiguration configuration,
      final Logger log,
      final List<String> bulkRequest); }
ElasticsearchClient { public void index(final Record<?> record) { if (metrics == null) { metrics = new ElasticsearchMetrics(record.getPartitionId()); } checkRecord(record); bulk(newIndexCommand(record), record); } ElasticsearchClient(
      final ElasticsearchExporterConfiguration configuration, final Logger log);   ElasticsearchClient(
      final ElasticsearchExporterConfiguration configuration,
      final Logger log,
      final List<String> bulkRequest); void close(); void index(final Record<?> record); void bulk(final Map<String, Object> command, final Record<?> record); void flush(); boolean shouldFlush(); boolean putIndexTemplate(final ValueType valueType); boolean putIndexTemplate(
      final String templateName, final String aliasName, final String filename); }
ElasticsearchClient { public void index(final Record<?> record) { if (metrics == null) { metrics = new ElasticsearchMetrics(record.getPartitionId()); } checkRecord(record); bulk(newIndexCommand(record), record); } ElasticsearchClient(
      final ElasticsearchExporterConfiguration configuration, final Logger log);   ElasticsearchClient(
      final ElasticsearchExporterConfiguration configuration,
      final Logger log,
      final List<String> bulkRequest); void close(); void index(final Record<?> record); void bulk(final Map<String, Object> command, final Record<?> record); void flush(); boolean shouldFlush(); boolean putIndexTemplate(final ValueType valueType); boolean putIndexTemplate(
      final String templateName, final String aliasName, final String filename); static final String INDEX_TEMPLATE_FILENAME_PATTERN; static final String INDEX_DELIMITER; static final String ALIAS_DELIMITER; }