Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ public RedisStoreConfig getRedisConfig() {
return new RedisStoreConfig(
this.config.get("host"),
Integer.valueOf(this.config.get("port")),
Boolean.valueOf(this.config.getOrDefault("ssl", "false")));
Boolean.valueOf(this.config.getOrDefault("ssl", "false")),
this.config.getOrDefault("password", ""));
}

public BigTableStoreConfig getBigtableConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public static RedisClientAdapter create(RedisStoreConfig config) {
if (config.getSsl()) {
uri.setSsl(true);
}

if (!config.getPassword().isEmpty()) {
uri.setPassword(config.getPassword());
}

StatefulRedisConnection<byte[], byte[]> connection =
io.lettuce.core.RedisClient.create(uri).connect(new ByteArrayCodec());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ public class RedisStoreConfig {
private final String host;
private final Integer port;
private final Boolean ssl;
private final String password;

public RedisStoreConfig(String host, Integer port, Boolean ssl) {
public RedisStoreConfig(String host, Integer port, Boolean ssl, String password) {
this.host = host;
this.port = port;
this.ssl = ssl;
this.password = password;
}

public String getHost() {
Expand All @@ -38,4 +40,8 @@ public Integer getPort() {
public Boolean getSsl() {
return this.ssl;
}

public String getPassword() {
return this.password;
}
}