congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Join (org.hibernate.mapping)
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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