org.influxdb.dto.Query.getCommand()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(78)

本文整理了Java中org.influxdb.dto.Query.getCommand方法的一些代码示例,展示了Query.getCommand的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getCommand方法的具体详情如下:
包路径:org.influxdb.dto.Query
类名称:Query
方法名:getCommand

Query.getCommand介绍

暂无

代码示例

代码示例来源:origin: inspectIT/inspectIT

@Test
public void executeQuery() {
  influxDao.active = true;
  influxDao.propertiesUpdated();
  influxDao.query("myQuery");
  assertThat(influxDao.isConnected(), is(true));
  assertThat(influxDao.getServiceStatus(), is(ExternalServiceStatus.CONNECTED));
  ArgumentCaptor<Query> queryCaptor = ArgumentCaptor.forClass(Query.class);
  verify(influxDb, times(2)).query(queryCaptor.capture());
  assertThat(queryCaptor.getValue().getCommand(), equalTo("myQuery"));
  verify(influxDb).ping();
  verify(influxDb).write(any(String.class), any(String.class), any(Point.class));
  verify(influxDb).isBatchEnabled();
  verify(influxDb).enableBatch(InfluxDBDao.BATCH_BUFFER_SIZE, InfluxDBDao.BATCH_FLUSH_TIMER, TimeUnit.SECONDS);
  verify(executor).submit(any(Runnable.class));
  verify(availabilityChecker).deactivate();
  verify(availabilityChecker).setInflux(influxDb);
  verify(availabilityChecker).activate();
  verify(clientFactory).createClient();
  verifyNoMoreInteractions(clientFactory, availabilityChecker, executor, influxDb);
  verifyZeroInteractions(future);
}

代码示例来源:origin: sitewhere/sitewhere

/**
 * Search for of events of a given type associated with one or more entities for
 * a given index.
 * 
 * @param index
 * @param entityIds
 * @param type
 * @param criteria
 * @param client
 * @param clazz
 * @return
 * @throws SiteWhereException
 */
public static <T> SearchResults<T> searchByIndex(DeviceEventIndex index, List<UUID> entityIds, DeviceEventType type,
  ISearchCriteria criteria, InfluxDbClient client, Class<T> clazz) throws SiteWhereException {
Query query = InfluxDbDeviceEvent.queryEventsOfTypeForIndex(index, type, entityIds, criteria,
  client.getDatabase().getValue());
LOGGER.debug("Query: " + query.getCommand());
QueryResult response = client.getInflux().query(query, TimeUnit.MILLISECONDS);
List<T> results = InfluxDbDeviceEvent.eventsOfType(response, clazz);
Query countQuery = InfluxDbDeviceEvent.queryEventsOfTypeForIndexCount(index, type, entityIds, criteria,
  client.getDatabase().getValue());
LOGGER.debug("Count: " + countQuery.getCommand());
QueryResult countResponse = client.getInflux().query(countQuery);
long count = parseCount(countResponse);
return new SearchResults<T>(results, count);
}

相关文章