Tabnine Logo
RedisClusterConnection.migrate
Code IndexAdd Tabnine to your IDE (free)

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

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

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: 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: 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;
  });
}
org.springframework.data.redis.connectionRedisClusterConnectionmigrate

Popular methods of RedisClusterConnection

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

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Menu (java.awt)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • JTable (javax.swing)
  • Github Copilot 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