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