Support configuring a connectUrl on the leveldb store in case your running in a system like OpenShift where clients connect to a different ip:port from the one that the sever binds.

This commit is contained in:
Hiram Chirino 2014-08-26 17:04:25 -04:00
parent b9696ac80b
commit b76d8318d7
1 changed files with 11 additions and 3 deletions

View File

@ -78,6 +78,10 @@ class ElectingLevelDBStore extends ProxyLevelDBStore {
@BeanProperty @BeanProperty
var hostname: String = _ var hostname: String = _
@BeanProperty
var connectUrl: String = _
@BeanProperty @BeanProperty
var bind = "tcp://0.0.0.0:61619" var bind = "tcp://0.0.0.0:61619"
@ -371,10 +375,14 @@ class ElectingLevelDBStore extends ProxyLevelDBStore {
} }
def address(port: Int) = { def address(port: Int) = {
if( connectUrl==null ) {
if (hostname == null) { if (hostname == null) {
hostname = machine_hostname hostname = machine_hostname
} }
"tcp://" + hostname + ":" + port "tcp://" + hostname + ":" + port
} else {
connectUrl;
}
} }
override def size: Long = { override def size: Long = {