mirror of https://github.com/apache/druid.git
1) Remove last TODO related to segment lifetime. Don't think we care about that anymore.
This commit is contained in:
parent
a001c1d32a
commit
044e43d231
|
@ -63,7 +63,7 @@ public abstract class ServerInventoryView<InventoryType> implements ServerView,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.log = log;
|
this.log = log;
|
||||||
this.inventoryManager = new CuratorInventoryManager<DruidServer, InventoryType>(
|
this.inventoryManager = new CuratorInventoryManager<>(
|
||||||
curator,
|
curator,
|
||||||
new InventoryManagerConfig()
|
new InventoryManagerConfig()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
/*
|
|
||||||
* Druid - a distributed column store.
|
|
||||||
* Copyright (C) 2012, 2013 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.client;
|
|
||||||
|
|
||||||
import org.skife.config.Config;
|
|
||||||
import org.skife.config.Default;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public abstract class ServerInventoryViewConfig
|
|
||||||
{
|
|
||||||
@Config("druid.master.removedSegmentLifetime")
|
|
||||||
@Default("1")
|
|
||||||
public abstract int getRemovedSegmentLifetime();
|
|
||||||
|
|
||||||
@Config("druid.announcer.type")
|
|
||||||
@Default("legacy")
|
|
||||||
public abstract String getAnnouncerType();
|
|
||||||
}
|
|
|
@ -24,7 +24,6 @@ import com.google.inject.Binder;
|
||||||
import com.google.inject.Module;
|
import com.google.inject.Module;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import com.metamx.common.concurrent.ScheduledExecutorFactory;
|
import com.metamx.common.concurrent.ScheduledExecutorFactory;
|
||||||
import io.druid.client.ServerInventoryViewConfig;
|
|
||||||
import io.druid.client.indexing.IndexingServiceClient;
|
import io.druid.client.indexing.IndexingServiceClient;
|
||||||
import io.druid.db.DatabaseRuleManager;
|
import io.druid.db.DatabaseRuleManager;
|
||||||
import io.druid.db.DatabaseRuleManagerConfig;
|
import io.druid.db.DatabaseRuleManagerConfig;
|
||||||
|
@ -49,7 +48,6 @@ public class CoordinatorModule implements Module
|
||||||
public void configure(Binder binder)
|
public void configure(Binder binder)
|
||||||
{
|
{
|
||||||
ConfigProvider.bind(binder, DruidMasterConfig.class);
|
ConfigProvider.bind(binder, DruidMasterConfig.class);
|
||||||
ConfigProvider.bind(binder, ServerInventoryViewConfig.class);
|
|
||||||
|
|
||||||
JsonConfigProvider.bind(binder, "druid.manager.segment", DatabaseSegmentManagerConfig.class);
|
JsonConfigProvider.bind(binder, "druid.manager.segment", DatabaseSegmentManagerConfig.class);
|
||||||
JsonConfigProvider.bind(binder, "druid.manager.rules", DatabaseRuleManagerConfig.class);
|
JsonConfigProvider.bind(binder, "druid.manager.rules", DatabaseRuleManagerConfig.class);
|
||||||
|
|
|
@ -160,8 +160,8 @@ public class DruidMaster
|
||||||
|
|
||||||
this.exec = scheduledExecutorFactory.create(1, "Master-Exec--%d");
|
this.exec = scheduledExecutorFactory.create(1, "Master-Exec--%d");
|
||||||
|
|
||||||
this.leaderLatch = new AtomicReference<LeaderLatch>(null);
|
this.leaderLatch = new AtomicReference<>(null);
|
||||||
this.segmentSettingsAtomicReference= new AtomicReference<MasterSegmentSettings>(null);
|
this.segmentSettingsAtomicReference= new AtomicReference<>(null);
|
||||||
this.loadManagementPeons = loadQueuePeonMap;
|
this.loadManagementPeons = loadQueuePeonMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -731,29 +731,16 @@ public class DruidMaster
|
||||||
SegmentReplicantLookup segmentReplicantLookup = SegmentReplicantLookup.make(cluster);
|
SegmentReplicantLookup segmentReplicantLookup = SegmentReplicantLookup.make(cluster);
|
||||||
|
|
||||||
// Stop peons for servers that aren't there anymore.
|
// Stop peons for servers that aren't there anymore.
|
||||||
for (String name : Sets.difference(
|
final Set<String> disdappearedServers = Sets.newHashSet(loadManagementPeons.keySet());
|
||||||
loadManagementPeons.keySet(),
|
for (DruidServer server : servers) {
|
||||||
Sets.newHashSet(
|
disdappearedServers.remove(server.getName());
|
||||||
Iterables.transform(
|
|
||||||
servers,
|
|
||||||
new Function<DruidServer, String>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public String apply(@Nullable DruidServer input)
|
|
||||||
{
|
|
||||||
return input.getName();
|
|
||||||
}
|
}
|
||||||
}
|
for (String name : disdappearedServers) {
|
||||||
)
|
|
||||||
)
|
|
||||||
)) {
|
|
||||||
log.info("Removing listener for server[%s] which is no longer there.", name);
|
log.info("Removing listener for server[%s] which is no longer there.", name);
|
||||||
LoadQueuePeon peon = loadManagementPeons.remove(name);
|
LoadQueuePeon peon = loadManagementPeons.remove(name);
|
||||||
peon.stop();
|
peon.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: decrementRemovedSegmentsLifetime();
|
|
||||||
|
|
||||||
return params.buildFromExisting()
|
return params.buildFromExisting()
|
||||||
.withDruidCluster(cluster)
|
.withDruidCluster(cluster)
|
||||||
.withDatabaseRuleManager(databaseRuleManager)
|
.withDatabaseRuleManager(databaseRuleManager)
|
||||||
|
|
Loading…
Reference in New Issue