deleted dbSegmentPublisher

This commit is contained in:
jisookim0513 2014-10-10 12:41:35 -07:00
parent 0e50852985
commit 66277ddf2b
8 changed files with 17 additions and 47 deletions

View File

@ -48,7 +48,7 @@ import io.druid.indexer.SQLMetadataStorageUpdaterJobHandler;
import io.druid.indexing.overlord.IndexerMetadataStorageCoordinator;
import io.druid.indexing.overlord.MetadataStorageActionHandler;
import io.druid.initialization.DruidModule;
import io.druid.segment.realtime.DbSegmentPublisher;
import io.druid.segment.realtime.SegmentPublisher;
import org.skife.jdbi.v2.IDBI;
import java.util.List;
@ -100,7 +100,7 @@ public class MySQLMetadataStorageModule implements DruidModule
.to(SQLMetadataRuleManagerProvider.class)
.in(LazySingleton.class);
PolyBind.optionBinder(binder, Key.get(DbSegmentPublisher.class))
PolyBind.optionBinder(binder, Key.get(SegmentPublisher.class))
.addBinding("mysql")
.to(SQLMetadataSegmentPublisher.class)
.in(LazySingleton.class);

View File

@ -48,7 +48,7 @@ import io.druid.indexer.SQLMetadataStorageUpdaterJobHandler;
import io.druid.indexing.overlord.IndexerMetadataStorageCoordinator;
import io.druid.indexing.overlord.MetadataStorageActionHandler;
import io.druid.initialization.DruidModule;
import io.druid.segment.realtime.DbSegmentPublisher;
import io.druid.segment.realtime.SegmentPublisher;
import org.skife.jdbi.v2.IDBI;
import java.util.List;
@ -100,7 +100,7 @@ public class PostgresMetadataStorageModule implements DruidModule
.to(SQLMetadataRuleManagerProvider.class)
.in(LazySingleton.class);
PolyBind.optionBinder(binder, Key.get(DbSegmentPublisher.class))
PolyBind.optionBinder(binder, Key.get(SegmentPublisher.class))
.addBinding("postgresql")
.to(SQLMetadataSegmentPublisher.class)
.in(LazySingleton.class);

View File

@ -24,7 +24,7 @@ package io.druid.db;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.inject.Inject;
import com.metamx.common.logger.Logger;
import io.druid.segment.realtime.DbSegmentPublisher;
import io.druid.segment.realtime.SegmentPublisher;
import io.druid.timeline.DataSegment;
import io.druid.timeline.partition.NoneShardSpec;
import org.joda.time.DateTime;
@ -36,7 +36,7 @@ import java.io.IOException;
import java.util.List;
import java.util.Map;
public class SQLMetadataSegmentPublisher implements DbSegmentPublisher
public class SQLMetadataSegmentPublisher implements SegmentPublisher
{
private static final Logger log = new Logger(SQLMetadataSegmentPublisher.class);

View File

@ -42,7 +42,7 @@ import io.druid.indexer.SQLMetadataStorageUpdaterJobHandler;
import io.druid.indexer.MetadataStorageUpdaterJobHandler;
import io.druid.indexing.overlord.IndexerMetadataStorageCoordinator;
import io.druid.indexing.overlord.MetadataStorageActionHandler;
import io.druid.segment.realtime.DbSegmentPublisher;
import io.druid.segment.realtime.SegmentPublisher;
import org.skife.jdbi.v2.IDBI;
public class DerbyMetadataStorageDruidModule implements Module
@ -68,7 +68,7 @@ public class DerbyMetadataStorageDruidModule implements Module
binder, "druid.db.type", Key.get(MetadataRuleManagerProvider.class), Key.get(DerbyMetadataRuleManagerProvider.class)
);
PolyBind.createChoice(
binder, "druid.db.type", Key.get(DbSegmentPublisher.class), Key.get(SQLMetadataSegmentPublisher.class)
binder, "druid.db.type", Key.get(SegmentPublisher.class), Key.get(SQLMetadataSegmentPublisher.class)
);
PolyBind.createChoice(
binder, "druid.db.type", Key.get(MetadataSegmentPublisherProvider.class), Key.get(SQLMetadataSegmentPublisherProvider.class)
@ -112,7 +112,7 @@ public class DerbyMetadataStorageDruidModule implements Module
.to(DerbyMetadataRuleManagerProvider.class)
.in(LazySingleton.class);
PolyBind.optionBinder(binder, Key.get(DbSegmentPublisher.class))
PolyBind.optionBinder(binder, Key.get(SegmentPublisher.class))
.addBinding("derby")
.to(SQLMetadataSegmentPublisher.class)
.in(LazySingleton.class);

View File

@ -1,29 +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.segment.realtime;
import io.druid.timeline.DataSegment;
import java.io.IOException;
public interface DbSegmentPublisher extends SegmentPublisher
{
public void publishSegment(final DataSegment segment) throws IOException;
}

View File

@ -27,7 +27,7 @@ import io.druid.client.ServerView;
import io.druid.concurrent.Execs;
import io.druid.db.MetadataSegmentManager;
import io.druid.segment.loading.SegmentLoaderConfig;
import io.druid.segment.realtime.DbSegmentPublisher;
import io.druid.segment.realtime.SegmentPublisher;
import io.druid.server.coordination.BaseZkCoordinator;
import io.druid.server.coordination.DataSegmentChangeCallback;
import io.druid.server.coordination.DataSegmentChangeHandler;
@ -44,7 +44,7 @@ public class BridgeZkCoordinator extends BaseZkCoordinator
{
private static final Logger log = new Logger(BaseZkCoordinator.class);
private final DbSegmentPublisher dbSegmentPublisher;
private final SegmentPublisher dbSegmentPublisher;
private final MetadataSegmentManager databaseSegmentManager;
private final ServerView serverView;
@ -57,7 +57,7 @@ public class BridgeZkCoordinator extends BaseZkCoordinator
SegmentLoaderConfig config,
DruidServerMetadata me,
@Bridge CuratorFramework curator,
DbSegmentPublisher dbSegmentPublisher,
SegmentPublisher dbSegmentPublisher,
MetadataSegmentManager databaseSegmentManager,
ServerView serverView
)

View File

@ -32,7 +32,7 @@ import io.druid.curator.announcement.Announcer;
import io.druid.db.MetadataSegmentManager;
import io.druid.jackson.DefaultObjectMapper;
import io.druid.segment.loading.SegmentLoaderConfig;
import io.druid.segment.realtime.DbSegmentPublisher;
import io.druid.segment.realtime.SegmentPublisher;
import io.druid.server.DruidNode;
import io.druid.server.coordination.BatchDataSegmentAnnouncer;
import io.druid.server.coordination.DruidServerMetadata;
@ -147,7 +147,7 @@ public class DruidClusterBridgeTest
DruidServer.DEFAULT_TIER,
0
);
DbSegmentPublisher dbSegmentPublisher = EasyMock.createMock(DbSegmentPublisher.class);
SegmentPublisher dbSegmentPublisher = EasyMock.createMock(SegmentPublisher.class);
EasyMock.replay(dbSegmentPublisher);
MetadataSegmentManager databaseSegmentManager = EasyMock.createMock(MetadataSegmentManager.class);
EasyMock.replay(databaseSegmentManager);

View File

@ -26,11 +26,10 @@ import com.google.inject.TypeLiteral;
import com.google.inject.multibindings.MapBinder;
import io.druid.cli.QueryJettyServerInitializer;
import io.druid.query.QuerySegmentWalker;
import io.druid.segment.realtime.DbSegmentPublisher;
import io.druid.segment.realtime.SegmentPublisher;
import io.druid.segment.realtime.FireDepartment;
import io.druid.segment.realtime.NoopSegmentPublisher;
import io.druid.segment.realtime.RealtimeManager;
import io.druid.segment.realtime.SegmentPublisher;
import io.druid.segment.realtime.firehose.ChatHandlerProvider;
import io.druid.segment.realtime.firehose.ChatHandlerResource;
import io.druid.segment.realtime.firehose.NoopChatHandlerProvider;
@ -52,14 +51,14 @@ public class RealtimeModule implements Module
binder,
"druid.publish.type",
Key.get(SegmentPublisher.class),
Key.get(DbSegmentPublisher.class)
Key.get(SegmentPublisher.class)
);
final MapBinder<String, SegmentPublisher> publisherBinder = PolyBind.optionBinder(
binder,
Key.get(SegmentPublisher.class)
);
publisherBinder.addBinding("noop").to(NoopSegmentPublisher.class);
binder.bind(DbSegmentPublisher.class).in(LazySingleton.class);
binder.bind(SegmentPublisher.class).in(LazySingleton.class);
PolyBind.createChoice(
binder,