Merge branch 'cleanup-ingest' of github.com:metamx/druid into cleanup-ingest

Conflicts:
	server/src/test/java/io/druid/realtime/firehose/CombiningFirehoseFactoryTest.java
This commit is contained in:
fjy 2014-07-17 20:26:11 -07:00
commit d8b8826c2e
4 changed files with 9 additions and 65 deletions

View File

@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.druid.indexing.common.TaskStatus;
import io.druid.indexing.common.TaskToolbox;
import io.druid.indexing.common.actions.TaskActionClient;
import io.druid.indexing.firehose.ReIngestTask;
import io.druid.query.Query;
import io.druid.query.QueryRunner;
@ -54,8 +53,7 @@ import io.druid.query.QueryRunner;
@JsonSubTypes.Type(name = "index_realtime", value = RealtimeIndexTask.class),
@JsonSubTypes.Type(name = "noop", value = NoopTask.class),
@JsonSubTypes.Type(name = "version_converter", value = VersionConverterTask.class),
@JsonSubTypes.Type(name = "version_converter_sub", value = VersionConverterTask.SubTask.class),
@JsonSubTypes.Type(name = "reingest", value = ReIngestTask.class)
@JsonSubTypes.Type(name = "version_converter_sub", value = VersionConverterTask.SubTask.class)
})
public interface Task
{

View File

@ -45,6 +45,7 @@ import io.druid.granularity.QueryGranularity;
import io.druid.indexing.common.TaskToolbox;
import io.druid.indexing.common.TaskToolboxFactory;
import io.druid.indexing.common.actions.SegmentListUsedAction;
import io.druid.indexing.common.task.NoopTask;
import io.druid.query.filter.DimFilter;
import io.druid.query.select.EventHolder;
import io.druid.segment.Cursor;
@ -138,8 +139,9 @@ public class IngestSegmentFirehoseFactory implements FirehoseFactory<InputRowPar
{
log.info("Connecting firehose: dataSource[%s], interval[%s]", dataSource, interval);
// better way to achieve this is to pass toolbox to Firehose, The instance is initialized Lazily on connect method.
// Noop Task is just used to create the toolbox and list segments.
final TaskToolbox toolbox = injector.getInstance(TaskToolboxFactory.class).build(
new ReIngestTask("Ingest-Task-Id", dataSource)
new NoopTask("reingest", 0, 0, null, null)
);
try {

View File

@ -1,55 +0,0 @@
/*
* Druid - a distributed column store.
* Copyright (C) 2012, 2013, 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.indexing.firehose;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.druid.indexing.common.TaskStatus;
import io.druid.indexing.common.TaskToolbox;
import io.druid.indexing.common.actions.TaskActionClient;
import io.druid.indexing.common.task.AbstractTask;
public class ReIngestTask extends AbstractTask
{
public ReIngestTask(
@JsonProperty("id") final String id,
@JsonProperty("dataSource") final String dataSource
)
{
super(id, dataSource);
}
@Override
public String getType()
{
return "reingest";
}
@Override
public boolean isReady(TaskActionClient taskActionClient) throws Exception
{
return true;
}
@Override
public TaskStatus run(TaskToolbox toolbox) throws Exception
{
return TaskStatus.success(getId());
}
}

View File

@ -83,12 +83,6 @@ public class CombiningFirehoseFactoryTest
return new DateTime(timestamp);
}
@Override
public int compareTo(Row o)
{
return 0;
}
@Override
public List<String> getDimension(String dimension)
{
@ -107,6 +101,11 @@ public class CombiningFirehoseFactoryTest
return null;
}
@Override
public int compareTo(Row o)
{
return 0;
}
};
}