mirror of https://github.com/apache/druid.git
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:
commit
d8b8826c2e
|
@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import io.druid.indexing.common.TaskStatus;
|
import io.druid.indexing.common.TaskStatus;
|
||||||
import io.druid.indexing.common.TaskToolbox;
|
import io.druid.indexing.common.TaskToolbox;
|
||||||
import io.druid.indexing.common.actions.TaskActionClient;
|
import io.druid.indexing.common.actions.TaskActionClient;
|
||||||
import io.druid.indexing.firehose.ReIngestTask;
|
|
||||||
import io.druid.query.Query;
|
import io.druid.query.Query;
|
||||||
import io.druid.query.QueryRunner;
|
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 = "index_realtime", value = RealtimeIndexTask.class),
|
||||||
@JsonSubTypes.Type(name = "noop", value = NoopTask.class),
|
@JsonSubTypes.Type(name = "noop", value = NoopTask.class),
|
||||||
@JsonSubTypes.Type(name = "version_converter", value = VersionConverterTask.class),
|
@JsonSubTypes.Type(name = "version_converter", value = VersionConverterTask.class),
|
||||||
@JsonSubTypes.Type(name = "version_converter_sub", value = VersionConverterTask.SubTask.class),
|
@JsonSubTypes.Type(name = "version_converter_sub", value = VersionConverterTask.SubTask.class)
|
||||||
@JsonSubTypes.Type(name = "reingest", value = ReIngestTask.class)
|
|
||||||
})
|
})
|
||||||
public interface Task
|
public interface Task
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,6 +45,7 @@ import io.druid.granularity.QueryGranularity;
|
||||||
import io.druid.indexing.common.TaskToolbox;
|
import io.druid.indexing.common.TaskToolbox;
|
||||||
import io.druid.indexing.common.TaskToolboxFactory;
|
import io.druid.indexing.common.TaskToolboxFactory;
|
||||||
import io.druid.indexing.common.actions.SegmentListUsedAction;
|
import io.druid.indexing.common.actions.SegmentListUsedAction;
|
||||||
|
import io.druid.indexing.common.task.NoopTask;
|
||||||
import io.druid.query.filter.DimFilter;
|
import io.druid.query.filter.DimFilter;
|
||||||
import io.druid.query.select.EventHolder;
|
import io.druid.query.select.EventHolder;
|
||||||
import io.druid.segment.Cursor;
|
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);
|
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.
|
// 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(
|
final TaskToolbox toolbox = injector.getInstance(TaskToolboxFactory.class).build(
|
||||||
new ReIngestTask("Ingest-Task-Id", dataSource)
|
new NoopTask("reingest", 0, 0, null, null)
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -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());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -83,12 +83,6 @@ public class CombiningFirehoseFactoryTest
|
||||||
return new DateTime(timestamp);
|
return new DateTime(timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int compareTo(Row o)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getDimension(String dimension)
|
public List<String> getDimension(String dimension)
|
||||||
{
|
{
|
||||||
|
@ -107,6 +101,11 @@ public class CombiningFirehoseFactoryTest
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Row o)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue