mirror of https://github.com/apache/druid.git
Merge remote-tracking branch 'origin/druid-0.7.x' into druid-0.7.x-fastTopN-rebase
This commit is contained in:
commit
e75ef7cb5d
|
@ -68,7 +68,7 @@ public class RemoteTaskRunnerFactory implements TaskRunnerFactory
|
|||
curator,
|
||||
new SimplePathChildrenCacheFactory
|
||||
.Builder()
|
||||
.withCompressed(remoteTaskRunnerConfig.isCompressZnodes())
|
||||
.withCompressed(true)
|
||||
.build(),
|
||||
httpClient,
|
||||
strategy
|
||||
|
|
|
@ -33,9 +33,6 @@ public class RemoteTaskRunnerConfig
|
|||
@NotNull
|
||||
private Period taskAssignmentTimeout = new Period("PT5M");
|
||||
|
||||
@JsonProperty
|
||||
private boolean compressZnodes = false;
|
||||
|
||||
@JsonProperty
|
||||
private String minWorkerVersion = "0";
|
||||
|
||||
|
@ -48,11 +45,6 @@ public class RemoteTaskRunnerConfig
|
|||
return taskAssignmentTimeout;
|
||||
}
|
||||
|
||||
public boolean isCompressZnodes()
|
||||
{
|
||||
return compressZnodes;
|
||||
}
|
||||
|
||||
public String getMinWorkerVersion()
|
||||
{
|
||||
return minWorkerVersion;
|
||||
|
|
|
@ -26,12 +26,6 @@ import org.joda.time.Period;
|
|||
*/
|
||||
public class TestRemoteTaskRunnerConfig extends RemoteTaskRunnerConfig
|
||||
{
|
||||
@Override
|
||||
public boolean isCompressZnodes()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Period getTaskAssignmentTimeout()
|
||||
{
|
||||
|
|
|
@ -25,8 +25,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
*/
|
||||
public class IndexingServiceSelectorConfig
|
||||
{
|
||||
public static final String DEFAULT_SERVICE_NAME = "druid/overlord";
|
||||
|
||||
@JsonProperty
|
||||
private String serviceName = null;
|
||||
private String serviceName = DEFAULT_SERVICE_NAME;
|
||||
|
||||
public String getServiceName()
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ public class CuratorServiceAnnouncer implements ServiceAnnouncer
|
|||
@Override
|
||||
public void announce(DruidNode service)
|
||||
{
|
||||
final String serviceName = getServiceName(service);
|
||||
final String serviceName = CuratorServiceUtils.makeCanonicalServiceName(service.getServiceName());
|
||||
|
||||
final ServiceInstance<Void> instance;
|
||||
synchronized (monitor) {
|
||||
|
@ -89,7 +89,7 @@ public class CuratorServiceAnnouncer implements ServiceAnnouncer
|
|||
@Override
|
||||
public void unannounce(DruidNode service)
|
||||
{
|
||||
final String serviceName = getServiceName(service);
|
||||
final String serviceName = CuratorServiceUtils.makeCanonicalServiceName(service.getServiceName());
|
||||
final ServiceInstance<Void> instance;
|
||||
|
||||
synchronized (monitor) {
|
||||
|
@ -115,8 +115,4 @@ public class CuratorServiceAnnouncer implements ServiceAnnouncer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getServiceName(DruidNode service) {
|
||||
return service.getServiceName().replaceAll("/", ":");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Druid - a distributed column store.
|
||||
* Copyright (C) 2014 Metamarkets Group Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package io.druid.curator.discovery;
|
||||
|
||||
public class CuratorServiceUtils
|
||||
{
|
||||
public static String makeCanonicalServiceName(String serviceName) {
|
||||
return serviceName.replaceAll("/", ":");
|
||||
}
|
||||
}
|
|
@ -29,12 +29,10 @@ public class NoopServiceAnnouncer implements ServiceAnnouncer
|
|||
@Override
|
||||
public void announce(DruidNode node)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unannounce(DruidNode node)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,9 @@ public class ServerDiscoveryFactory
|
|||
private final ServiceDiscovery<Void> serviceDiscovery;
|
||||
|
||||
@Inject
|
||||
public ServerDiscoveryFactory(ServiceDiscovery<Void> serviceDiscovery)
|
||||
public ServerDiscoveryFactory(
|
||||
ServiceDiscovery<Void> serviceDiscovery
|
||||
)
|
||||
{
|
||||
this.serviceDiscovery = serviceDiscovery;
|
||||
}
|
||||
|
@ -45,7 +47,10 @@ public class ServerDiscoveryFactory
|
|||
return new ServerDiscoverySelector(new NoopServiceProvider());
|
||||
}
|
||||
|
||||
final ServiceProvider serviceProvider = serviceDiscovery.serviceProviderBuilder().serviceName(serviceName).build();
|
||||
final ServiceProvider serviceProvider = serviceDiscovery
|
||||
.serviceProviderBuilder()
|
||||
.serviceName(CuratorServiceUtils.makeCanonicalServiceName(serviceName))
|
||||
.build();
|
||||
return new ServerDiscoverySelector(serviceProvider);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ import com.google.inject.servlet.GuiceFilter;
|
|||
import com.google.inject.util.Providers;
|
||||
import com.metamx.common.logger.Logger;
|
||||
import io.airlift.command.Command;
|
||||
import io.druid.client.indexing.IndexingServiceSelectorConfig;
|
||||
import io.druid.guice.IndexingServiceFirehoseModule;
|
||||
import io.druid.guice.IndexingServiceModuleHelper;
|
||||
import io.druid.guice.IndexingServiceTaskLogsModule;
|
||||
|
@ -117,7 +118,7 @@ public class CliOverlord extends ServerRunnable
|
|||
@Override
|
||||
public void configure(Binder binder)
|
||||
{
|
||||
binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/overlord");
|
||||
binder.bindConstant().annotatedWith(Names.named("serviceName")).to(IndexingServiceSelectorConfig.DEFAULT_SERVICE_NAME);
|
||||
binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8090);
|
||||
|
||||
JsonConfigProvider.bind(binder, "druid.indexer.queue", TaskQueueConfig.class);
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.google.inject.Injector;
|
|||
import com.google.inject.Key;
|
||||
import com.google.inject.Module;
|
||||
import com.google.inject.multibindings.MapBinder;
|
||||
import com.google.inject.name.Names;
|
||||
import com.metamx.common.lifecycle.Lifecycle;
|
||||
import com.metamx.common.logger.Logger;
|
||||
import io.airlift.command.Arguments;
|
||||
|
@ -107,6 +108,9 @@ public class CliPeon extends GuiceRunnable
|
|||
@Override
|
||||
public void configure(Binder binder)
|
||||
{
|
||||
binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/peon");
|
||||
binder.bindConstant().annotatedWith(Names.named("servicePort")).to(-1);
|
||||
|
||||
PolyBind.createChoice(
|
||||
binder,
|
||||
"druid.indexer.task.chathandler.type",
|
||||
|
|
Loading…
Reference in New Issue