mirror of https://github.com/apache/druid.git
fix defaults
This commit is contained in:
parent
98d05e63bf
commit
8cbd21af90
|
@ -29,7 +29,13 @@ public class MetadataStorageConnectorConfig
|
|||
private boolean createTables = true;
|
||||
|
||||
@JsonProperty
|
||||
private String connectURI = "jdbc:derby://localhost:1527/druid;create=true";
|
||||
private String host = "localhost";
|
||||
|
||||
@JsonProperty
|
||||
private int port = 1527;
|
||||
|
||||
@JsonProperty
|
||||
private String connectURI;
|
||||
|
||||
@JsonProperty
|
||||
private String user = null;
|
||||
|
@ -45,8 +51,22 @@ public class MetadataStorageConnectorConfig
|
|||
return createTables;
|
||||
}
|
||||
|
||||
public String getHost()
|
||||
{
|
||||
return host;
|
||||
}
|
||||
|
||||
public int getPort()
|
||||
{
|
||||
return port;
|
||||
}
|
||||
|
||||
public String getConnectURI()
|
||||
{
|
||||
if (connectURI == null) {
|
||||
return String.format("jdbc:derby://%s:%s/druid;create=true", host, port);
|
||||
}
|
||||
|
||||
return connectURI;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package io.druid.metadata;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.inject.Inject;
|
||||
import com.metamx.common.lifecycle.LifecycleStart;
|
||||
import com.metamx.common.lifecycle.LifecycleStop;
|
||||
import org.apache.derby.drda.NetworkServerControl;
|
||||
|
@ -32,10 +33,11 @@ public class DerbyMetadataStorage extends MetadataStorage
|
|||
{
|
||||
private final NetworkServerControl server;
|
||||
|
||||
public DerbyMetadataStorage()
|
||||
@Inject
|
||||
public DerbyMetadataStorage(MetadataStorageConnectorConfig config)
|
||||
{
|
||||
try {
|
||||
this.server = new NetworkServerControl(InetAddress.getByName("localhost"), 1527);
|
||||
this.server = new NetworkServerControl(InetAddress.getByName(config.getHost()), config.getPort());
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw Throwables.propagate(e);
|
||||
|
|
Loading…
Reference in New Issue