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

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

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

Jedis.clientSetname介绍

暂无

代码示例

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

@Override
public void setClientName(byte[] name) {
  Assert.notNull(name, "Name must not be null!");
  if (isPipelined() || isQueueing()) {
    throw new UnsupportedOperationException("'CLIENT SETNAME' is not suppored in transacton / pipeline mode.");
  }
  connection.getJedis().clientSetname(name);
}

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

protected Jedis getJedis(RedisNode node) {
  Jedis jedis = new Jedis(node.getHost(), node.getPort());
  if (StringUtils.hasText(clientName)) {
    jedis.clientSetname(clientName);
  }
  return jedis;
}

代码示例来源:origin: sohutv/cachecloud

@Override
public PooledObject<Jedis> makeObject() throws Exception {
 final HostAndPort hostAndPort = this.hostAndPort.get();
 final Jedis jedis = new Jedis(hostAndPort.getHost(), hostAndPort.getPort(), connectionTimeout,
   soTimeout);
 try {
  jedis.connect();
  if (null != this.password) {
   jedis.auth(this.password);
  }
  if (database != 0) {
   jedis.select(database);
  }
  if (clientName != null) {
   jedis.clientSetname(clientName);
  }
 } catch (JedisException je) {
  jedis.close();
  throw je;
 }
 return new DefaultPooledObject<Jedis>(jedis);
}

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

@Override
public String clientSetname(byte[] name) {
  return jedis.clientSetname(name);
}

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

@Override
public String clientSetname(String name) {
  return jedis.clientSetname(name);
}

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

@Override
public String clientSetname(String name) {
  return jedis.clientSetname(name);
}

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

private String clientsetname0(Jedis j, String connectionname) {
  return j.clientSetname(connectionname);
}

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

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

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

@Override
public String clientSetname(byte[] name) {
 String command = "clientSetname";
 return instrumented(command, () -> delegated.clientSetname(name));
}

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

default String clientsetname(final String name) {
 return this.run((jedis, serializer) -> jedis.clientSetname(name));
}

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

@Override
public void setClientName(byte[] name) {
  Assert.notNull(name, "Name must not be null!");
  if (isPipelined() || isQueueing()) {
    throw new UnsupportedOperationException("'CLIENT SETNAME' is not suppored in transacton / pipeline mode.");
  }
  connection.getJedis().clientSetname(name);
}

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

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

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

public String clientSetname(byte[] name) {
  Jedis jedis = getJedis();
  try {
    return jedis.clientSetname(name);
  } finally {Streams.safeClose(jedis);}
}

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

@Override
public void setClientName(byte[] name) {
  Assert.notNull(name, "Name must not be null!");
  if (isPipelined() || isQueueing()) {
    throw new UnsupportedOperationException("'CLIENT SETNAME' is not suppored in transacton / pipeline mode.");
  }
  connection.getJedis().clientSetname(name);
}

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

protected Jedis getJedis(RedisNode node) {
  Jedis jedis = new Jedis(node.getHost(), node.getPort());
  if (StringUtils.hasText(clientName)) {
    jedis.clientSetname(clientName);
  }
  return jedis;
}

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

protected Jedis getJedis(RedisNode node) {
  Jedis jedis = new Jedis(node.getHost(), node.getPort());
  if (StringUtils.hasText(clientName)) {
    jedis.clientSetname(clientName);
  }
  return jedis;
}

代码示例来源:origin: tangyanbo/springmore

@Override
public PooledObject<Jedis> makeObject() throws Exception {
  final Jedis jedis = new Jedis(this.host, this.port, this.timeout);
  jedis.connect();
  if (null != this.password) {
    jedis.auth(this.password);
  }
  if (database != 0) {
    jedis.select(database);
  }
  if (clientName != null) {
    jedis.clientSetname(clientName);
  }
  return new DefaultPooledObject<Jedis>(jedis);
}

代码示例来源:origin: yamingd/QPush

@Override
public PooledObject<BinaryJedis> makeObject() throws Exception {
  final HostAndPort hostAndPort = this.hostAndPort.get();
  final Jedis jedis = new Jedis(hostAndPort.getHost(), hostAndPort.getPort(), this.timeout);
  jedis.connect();
  if (null != this.password) {
    jedis.auth(this.password);
  }
  if (database != 0) {
    jedis.select(database);
  }
  if (clientName != null) {
    jedis.clientSetname(clientName);
  }
  return new DefaultPooledObject<BinaryJedis>(jedis);
}

代码示例来源:origin: DarkPhoenixs/connection-pool-client

@Override
public Jedis createConnection() throws Exception {
  HostAndPort hostAndPort = (HostAndPort) this.hostAndPort.get();
  Jedis jedis = new Jedis(hostAndPort.getHost(), hostAndPort.getPort(),
      this.connectionTimeout, this.soTimeout);
  try {
    jedis.connect();
    if (null != this.password) {
      jedis.auth(this.password);
    }
    if (this.database != 0) {
      jedis.select(this.database);
    }
    if (this.clientName != null) {
      jedis.clientSetname(this.clientName);
    }
  } catch (Exception je) {
    jedis.close();
    throw je;
  }
  return jedis;
}

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

@Override
public PooledObject<Jedis> makeObject() throws Exception {
  final HostAndPort hostAndPort = this.hostAndPorts.get(getIndex());
  logger.info("makeObject Jedis host: {}, port: {}, timeout {}.",
      new Object[] { hostAndPort.getHost(), hostAndPort.getPort(), timeout });
  final Jedis jedis = new Jedis(hostAndPort.getHost(), hostAndPort.getPort(), this.timeout);
  jedis.connect();
  if (this.password != null) {
    jedis.auth(this.password);
  }
  if (database != 0) {
    jedis.select(database);
  }
  if (clientName != null) {
    jedis.clientSetname(clientName);
  }
  return new DefaultPooledObject<Jedis>(jedis);
}

相关文章

Jedis类方法