redis.clients.jedis.Jedis.info()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(190)

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

Jedis.info介绍

暂无

代码示例

代码示例来源:origin: caoxinyu/RedisClient

@Override
protected void command() {
  String info = jedis.info();
  String[] tabs = info.split("#");
  
  for(String tab: tabs){
    if(tab.length() > 0){
      String[] keys = tab.split("\r\n");
      String[] values = new String[keys.length-1];
      for(int i = 1; i < keys.length; i ++) {
        values[i-1] = keys[i];
      }
      serverInfo.put(keys[0], values);
    }
  }
}

代码示例来源:origin: caoxinyu/RedisClient

protected RedisVersion getRedisVersion(){
  String info = jedis.info();
  String[] infos = info.split("\r\n");
  String version = null;

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Properties info(RedisClusterNode node, String section) {
  Assert.notNull(section, "Section must not be null!");
  return JedisConverters.toProperties(executeCommandOnSingleNode(client -> client.info(section), node).getValue());
}

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Properties info(String section) {
  Assert.notNull(section, "Section must not be null!");
  Properties infos = new Properties();
  List<NodeResult<Properties>> nodeResults = connection.getClusterCommandExecutor()
      .executeCommandOnAllNodes(
          (JedisClusterCommandCallback<Properties>) client -> JedisConverters.toProperties(client.info(section)))
      .getResults();
  for (NodeResult<Properties> nodeProperties : nodeResults) {
    for (Entry<Object, Object> entry : nodeProperties.getValue().entrySet()) {
      infos.put(nodeProperties.getNode().asString() + "." + entry.getKey(), entry.getValue());
    }
  }
  return infos;
}

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Properties info(String section) {
  Assert.notNull(section, "Section must not be null!");
  if (isPipelined() || isQueueing()) {
    throw new UnsupportedOperationException();
  }
  try {
    return JedisConverters.toProperties(connection.getJedis().info(section));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Properties info() {
  Properties infos = new Properties();
  List<NodeResult<Properties>> nodeResults = connection.getClusterCommandExecutor()
      .executeCommandOnAllNodes(
          (JedisClusterCommandCallback<Properties>) client -> JedisConverters.toProperties(client.info()))
      .getResults();
  for (NodeResult<Properties> nodeProperties : nodeResults) {
    for (Entry<Object, Object> entry : nodeProperties.getValue().entrySet()) {
      infos.put(nodeProperties.getNode().asString() + "." + entry.getKey(), entry.getValue());
    }
  }
  return infos;
}

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Properties info() {
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().info(), JedisConverters.stringToProps()));
      return null;
    }
    if (isQueueing()) {
      transaction(
          connection.newJedisResult(connection.getRequiredTransaction().info(), JedisConverters.stringToProps()));
      return null;
    }
    return JedisConverters.toProperties(connection.getJedis().info());
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: uber/chaperone

@Override
 public void run() {
  try {
   String memoryStats = jedis.info("Memory");
   loadMetrics(memoryStats);
   String keyStats = jedis.info("Keyspace");
   loadMetrics(keyStats);
   String stats = jedis.info("Stats");
   loadMetrics(stats);
  } catch (Exception e) {
   logger.warn("RedisMonitor got exception to get info from Redis server. Reconnect next time.", e);
   // disconnect so that next time the jedis can reconnect
   jedis.disconnect();
  } catch (Throwable t) {
   logger.error("RedisMonitor got error to get info from Redis server", t);
   throw t;
  }
 }
}, checkIntervalInSec, checkIntervalInSec, TimeUnit.SECONDS);

代码示例来源:origin: io.leopard/leopard-redis

@Override
  public Object execute(Jedis jedis) {
    return jedis.info();
  }
});

代码示例来源:origin: mindwind/craft-atom

private String info0(Jedis j, String section) {
  if (section == null) {
    return j.info();
  } else {
    return j.info(section);
  }
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public String info(String section) {
 String command = "info";
 return instrumented(command, () -> delegated.info(section));
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public String info() {
 String command = "info";
 return instrumented(command, () -> delegated.info());
}

代码示例来源:origin: jetoile/hadoop-unit

public void runRedisStuff(int port) {
    Jedis jedis = new Jedis("127.0.0.1", port);
    System.out.println(jedis.info());
    jedis.close();
  }
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

public String info(String section) {
  Jedis jedis = getJedis();
  try {
    return jedis.info(section);
  } finally {Streams.safeClose(jedis);}
}

代码示例来源:origin: com.github.dimovelev/metrics-sampler-extension-redis

protected void fetchMetricsFromInfo(final long timestamp, final Metrics result) {
  final String info = jedis.info();
  for (final LineIterator lines = IOUtils.lineIterator(new StringReader(info)); lines.hasNext(); ) {
    final String line = lines.next();
    final String[] cols = line.split(":", 2);
    if (cols.length == 2) {
      result.add(cols[0], timestamp, cols[1]);
    } else {
      logger.debug("Failed to parse line \"{}\"", line);
    }
  }
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public Properties info(RedisClusterNode node, String section) {
  Assert.notNull(section, "Section must not be null!");
  return JedisConverters.toProperties(executeCommandOnSingleNode(client -> client.info(section), node).getValue());
}

代码示例来源:origin: dimovelev/metrics-sampler

protected void fetchMetricsFromInfo(final long timestamp, final Metrics result) {
  final String info = jedis.info();
  for (final LineIterator lines = IOUtils.lineIterator(new StringReader(info)); lines.hasNext(); ) {
    final String line = lines.next();
    final String[] cols = line.split(":", 2);
    if (cols.length == 2) {
      result.add(cols[0], timestamp, cols[1]);
    } else {
      logger.debug("Failed to parse line \"{}\"", line);
    }
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public Properties info(RedisClusterNode node, String section) {
  Assert.notNull(section, "Section must not be null!");
  return JedisConverters.toProperties(executeCommandOnSingleNode(client -> client.info(section), node).getValue());
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public Properties info(String section) {
  Assert.notNull(section, "Section must not be null!");
  if (isPipelined() || isQueueing()) {
    throw new UnsupportedOperationException();
  }
  try {
    return JedisConverters.toProperties(connection.getJedis().info(section));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public Properties info(String section) {
  Assert.notNull(section, "Section must not be null!");
  if (isPipelined() || isQueueing()) {
    throw new UnsupportedOperationException();
  }
  try {
    return JedisConverters.toProperties(connection.getJedis().info(section));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

相关文章

Jedis类方法