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

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

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

Jedis.shutdown介绍

暂无

代码示例

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

@Override
public void shutdown() {
  try {
    if (isPipelined()) {
      pipeline(connection.newStatusResult(connection.getRequiredPipeline().shutdown()));
      return;
    }
    if (isQueueing()) {
      transaction(connection.newStatusResult(connection.getRequiredTransaction().shutdown()));
      return;
    }
    connection.getJedis().shutdown();
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

private String shutdown0(Jedis j, boolean save) {
  return j.shutdown();
}

代码示例来源:origin: penggle/jedis-ms-sentinel

public String shutdown() {
  return master.shutdown();
}

代码示例来源:origin: dataArtisans/yahoo-streaming-benchmark

public void shutdown() {
    this.running = false;
    this.interrupt();
    this.jedis.shutdown();
  }
}

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

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

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

default String shutdown() {
 return this.run((jedis, serializer) -> jedis.shutdown());
}

代码示例来源:origin: dataArtisans/yahoo-streaming-benchmark

@Override
public void run() {
  while (running) {
    try {
      CampaignAndWindow next = queue.take();
      // we do not use hincr here, because this is not applicable for most types
      // of state and statistics
      String jedisEntry = jedis.hget(next.campaign, next.windowTimestamp);
      long count = (jedisEntry == null || jedisEntry.length() == 0) ? 1L : Long.parseLong(jedisEntry) + 1;
      jedis.hset(next.campaign, next.windowTimestamp, String.valueOf(count));
    }
    catch (InterruptedException ignored) {}
    catch (Throwable t) {
      running = false;
      errorReporter.setAsyncException(t);
    }
  }
  jedis.shutdown();
}

代码示例来源:origin: com.gitee.l0km/facelog-local

/** 中止本地 redis 服务器*/
private static void  shutdownLocalServer(){
  if(localServerStarted){
    logger.info("shutdown redis server(关闭redis服务器)");
    HashMap<PropName, Object> param = JedisPoolLazy.initParameters(parameters);
    Jedis jedis = new Jedis(JedisUtils.getCanonicalURI(param));
    try{
      // shutdown前清除全局变量避免持久化
      jedis.del(KEY_CMD_SN);
      jedis.del(KEY_ACK_SN);
      jedis.del(KEY_CMD_CHANNEL);
      jedis.del(KEY_LOG_MONITOR_CHANNEL);
      jedis.del(KEY_HB_MONITOR_CHANNEL);
      jedis.shutdown();
    }finally{
      jedis.close();
    }
  }
}
/** 返回redis访问参数 */

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

/**
 * Synchronously save the DB on disk, then shutdown the server.
 * <p>
 * Stop all the clients, save the DB, then quit the server. This commands makes sure that the DB
 * is switched off without the lost of any data. This is not guaranteed if the client uses simply
 * {@link #save() SAVE} and then {@link #quit() QUIT} because other clients may alter the DB data
 * between the two commands.
 *
 * @return Status code reply on error. On success nothing is returned since the server quits and
 * the connection is closed.
 */
public String shutdown() {
  Jedis jedis = getJedis();
  try {
    return jedis.shutdown();
  } finally {Streams.safeClose(jedis);}
}

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

@Override
public void shutdown() {
  try {
    if (isPipelined()) {
      pipeline(connection.newStatusResult(connection.getRequiredPipeline().shutdown()));
      return;
    }
    if (isQueueing()) {
      transaction(connection.newStatusResult(connection.getRequiredTransaction().shutdown()));
      return;
    }
    connection.getJedis().shutdown();
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public void shutdown() {
  try {
    if (isPipelined()) {
      pipeline(connection.newStatusResult(connection.getRequiredPipeline().shutdown()));
      return;
    }
    if (isQueueing()) {
      transaction(connection.newStatusResult(connection.getRequiredTransaction().shutdown()));
      return;
    }
    connection.getJedis().shutdown();
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

相关文章

微信公众号

最新文章

更多

Jedis类方法