congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RedisClusterConnection
Code IndexAdd Tabnine to your IDE (free)

How to use
RedisClusterConnection
in
org.springframework.data.redis.connection

Best Java code snippets using org.springframework.data.redis.connection.RedisClusterConnection (Showing top 20 results out of 315)

Refine searchRefine arrow

  • DefaultClusterOperations
  • Assert
origin: spring-projects/spring-data-redis

@Override
public void bgReWriteAof(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.bgReWriteAof(node);
    return null;
  });
}
origin: spring-projects/spring-data-redis

@Override
public void bgSave(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.bgSave(node);
    return null;
  });
}
origin: spring-projects/spring-data-redis

  /**
   * Executed wrapped command upon {@link RedisClusterConnection}.
   *
   * @param callback must not be {@literal null}.
   * @return execution result. Can be {@literal null}.
   */
  @Nullable
  public <T> T execute(RedisClusterCallback<T> callback) {

    Assert.notNull(callback, "ClusterCallback must not be null!");

    RedisClusterConnection connection = template.getConnectionFactory().getClusterConnection();

    try {
      return callback.doInRedis(connection);
    } finally {
      connection.close();
    }
  }
}
origin: spring-projects/spring-data-redis

@Override
public void reshard(final RedisClusterNode source, final int slot, final RedisClusterNode target) {
  Assert.notNull(source, "Source node must not be null.");
  Assert.notNull(target, "Target node must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.clusterSetSlot(target, slot, AddSlots.IMPORTING);
    connection.clusterSetSlot(source, slot, AddSlots.MIGRATING);
    List<byte[]> keys = connection.clusterGetKeysInSlot(slot, Integer.MAX_VALUE);
    for (byte[] key : keys) {
      connection.migrate(key, source, 0, MigrateOption.COPY);
    }
    connection.clusterSetSlot(target, slot, AddSlots.NODE);
    return null;
  });
}
origin: spring-projects/spring-data-redis

@Override
public void forget(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.clusterForget(node);
    return null;
  });
}
origin: spring-projects/spring-data-redis

@Override
public Collection<RedisClusterNode> getSlaves(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  return execute(connection -> connection.clusterGetSlaves(node));
}
origin: spring-projects/spring-data-redis

@Override
public void meet(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.clusterMeet(node);
    return null;
  });
}
origin: spring-projects/spring-data-redis

@Override
public void flushDb(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.flushDb(node);
    return null;
  });
}
origin: spring-projects/spring-data-redis

@Override
public void addSlots(final RedisClusterNode node, final int... slots) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.clusterAddSlots(node, slots);
    return null;
  });
}
origin: apache/servicemix-bundles

@Override
public void reshard(final RedisClusterNode source, final int slot, final RedisClusterNode target) {
  Assert.notNull(source, "Source node must not be null.");
  Assert.notNull(target, "Target node must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.clusterSetSlot(target, slot, AddSlots.IMPORTING);
    connection.clusterSetSlot(source, slot, AddSlots.MIGRATING);
    List<byte[]> keys = connection.clusterGetKeysInSlot(slot, Integer.MAX_VALUE);
    for (byte[] key : keys) {
      connection.migrate(key, source, 0, MigrateOption.COPY);
    }
    connection.clusterSetSlot(target, slot, AddSlots.NODE);
    return null;
  });
}
origin: apache/servicemix-bundles

@Override
public void forget(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.clusterForget(node);
    return null;
  });
}
origin: org.springframework.data/spring-data-redis

@Override
public Collection<RedisClusterNode> getSlaves(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  return execute(connection -> connection.clusterGetSlaves(node));
}
origin: org.springframework.data/spring-data-redis

@Override
public void meet(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.clusterMeet(node);
    return null;
  });
}
origin: org.springframework.data/spring-data-redis

@Override
public void flushDb(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.flushDb(node);
    return null;
  });
}
origin: org.springframework.data/spring-data-redis

@Override
public void addSlots(final RedisClusterNode node, final int... slots) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.clusterAddSlots(node, slots);
    return null;
  });
}
origin: org.springframework.data/spring-data-redis

@Override
public void reshard(final RedisClusterNode source, final int slot, final RedisClusterNode target) {
  Assert.notNull(source, "Source node must not be null.");
  Assert.notNull(target, "Target node must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.clusterSetSlot(target, slot, AddSlots.IMPORTING);
    connection.clusterSetSlot(source, slot, AddSlots.MIGRATING);
    List<byte[]> keys = connection.clusterGetKeysInSlot(slot, Integer.MAX_VALUE);
    for (byte[] key : keys) {
      connection.migrate(key, source, 0, MigrateOption.COPY);
    }
    connection.clusterSetSlot(target, slot, AddSlots.NODE);
    return null;
  });
}
origin: org.springframework.data/spring-data-redis

@Override
public void bgSave(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.bgSave(node);
    return null;
  });
}
origin: org.springframework.data/spring-data-redis

@Override
public void forget(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.clusterForget(node);
    return null;
  });
}
origin: apache/servicemix-bundles

@Override
public Collection<RedisClusterNode> getSlaves(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  return execute(connection -> connection.clusterGetSlaves(node));
}
origin: org.springframework.data/spring-data-redis

@Override
public void bgReWriteAof(final RedisClusterNode node) {
  Assert.notNull(node, "ClusterNode must not be null.");
  execute((RedisClusterCallback<Void>) connection -> {
    connection.bgReWriteAof(node);
    return null;
  });
}
org.springframework.data.redis.connectionRedisClusterConnection

Javadoc

RedisClusterConnection allows sending commands to dedicated nodes within the cluster. A RedisClusterNode can be obtained from #clusterGetNodes() or it can be constructed using either RedisClusterNode#getHost() and RedisClusterNode#getPort() or the RedisClusterNode#getId().

Most used methods

  • bgReWriteAof
  • bgSave
  • close
  • clusterAddSlots
  • clusterForget
  • clusterGetKeysInSlot
  • clusterGetSlaves
  • clusterMeet
  • clusterSetSlot
  • flushDb
  • getNativeConnection
  • keys
  • getNativeConnection,
  • keys,
  • migrate,
  • ping,
  • randomKey,
  • save,
  • shutdown,
  • clusterGetClusterInfo,
  • stringCommands

Popular in Java

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • getContentResolver (Context)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • BoxLayout (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Option (scala)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now