Skip to content

Commit

Permalink
Make SSL port configurable by Priam and use the same for configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vijay2win committed May 31, 2012
1 parent 1f1f4b5 commit b759ee7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/netflix/priam/IConfiguration.java
Expand Up @@ -103,6 +103,8 @@ public interface IConfiguration
* @return
*/
public int getStoragePort();

public int getSSLStoragePort();

/**
* @return Cassandra's thrift port
Expand Down
Expand Up @@ -69,7 +69,7 @@ public void execute()
}
if (add.size() > 0)
{
int port = config.getStoragePort();
int port = config.getSSLStoragePort();
membership.addACL(add, port, port);
firstTimeUpdated = true;
}
Expand All @@ -89,7 +89,7 @@ public void execute()
remove.add(acl);
if (remove.size() > 0)
{
int port = config.getStoragePort();
int port = config.getSSLStoragePort();
membership.removeACL(remove, port, port);
firstTimeUpdated = true;
}
Expand Down
Expand Up @@ -53,6 +53,7 @@ public class PriamConfiguration implements IConfiguration
private static final String CONFIG_DIRECT_MAX_HEAP_SIZE = PRIAM_PRE + ".direct.memory.size.";
private static final String CONFIG_THRIFT_LISTERN_PORT_NAME = PRIAM_PRE + ".thrift.port";
private static final String CONFIG_STORAGE_LISTERN_PORT_NAME = PRIAM_PRE + ".storage.port";
private static final String CONFIG_SSL_STORAGE_LISTERN_PORT_NAME = PRIAM_PRE + ".ssl.storage.port";
private static final String CONFIG_CL_BK_LOCATION = PRIAM_PRE + ".backup.commitlog.location";
private static final String CONFIG_THROTTLE_UPLOAD_PER_SECOND = PRIAM_PRE + ".upload.throttle";
private static final String CONFIG_IN_MEMORY_COMPACTION_LIMIT = PRIAM_PRE + ".memory.compaction.limit";
Expand Down Expand Up @@ -113,7 +114,8 @@ public class PriamConfiguration implements IConfiguration
private final String DEFAULT_MAX_NEWGEN_HEAP = "2G";
private final int DEFAULT_JMX_PORT = 7199;
private final int DEFAULT_THRIFT_PORT = 9160;
private final int DEFAULT_STORAGE_PORT = 7000;
private final int DEFAULT_STORAGE_PORT = 7101;
private final int DEFAULT_SSL_STORAGE_PORT = 7101;
private final int DEFAULT_BACKUP_HOUR = 12;
private final int DEFAULT_BACKUP_THREADS = 2;
private final int DEFAULT_RESTORE_THREADS = 8;
Expand Down Expand Up @@ -367,6 +369,12 @@ public int getStoragePort()
return config.getInteger(CONFIG_STORAGE_LISTERN_PORT_NAME, DEFAULT_STORAGE_PORT);
}

@Override
public int getSSLStoragePort()
{
return config.getInteger(CONFIG_SSL_STORAGE_LISTERN_PORT_NAME, DEFAULT_SSL_STORAGE_PORT);
}

@Override
public String getSnitch()
{
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/netflix/priam/utils/TuneCassandra.java
Expand Up @@ -49,10 +49,11 @@ public static void updateYaml(IConfiguration config, String yamlLocation, String
Map map = (Map) yaml.load(new FileInputStream(yamlFile));
map.put("cluster_name", config.getAppName());
map.put("storage_port", config.getStoragePort());
map.put("ssl_storage_port", config.getSSLStoragePort());
map.put("rpc_port", config.getThriftPort());
map.put("listen_address", hostname);
map.put("rpc_address", hostname);
//Dont bootstrap in restore mode
//Dont bootstrap in restore mode
map.put("auto_bootstrap", !Restore.isRestoreEnabled(config));
map.put("saved_caches_directory", config.getCacheLocation());
map.put("commitlog_directory", config.getCommitLogLocation());
Expand Down
9 changes: 8 additions & 1 deletion src/test/java/com/netflix/priam/FakeConfiguration.java
Expand Up @@ -307,7 +307,7 @@ public String getCassStopScript()
@Override
public int getStoragePort()
{
return 7000;
return 7101;
}

@Override
Expand Down Expand Up @@ -358,4 +358,11 @@ public boolean getMultithreadedCompaction()
return false;
}

@Override
public int getSSLStoragePort()
{
// TODO Auto-generated method stub
return 7103;
}

}

0 comments on commit b759ee7

Please sign in to comment.