blob: b31c481190a0170144434e00a5b91a0dc5f30407 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.samoa.tasks;
import org.apache.samoa.topology.ComponentFactory;
import org.apache.samoa.topology.Topology;
/**
* Task interface, the mother of all SAMOA tasks!
*/
public interface Task {
/**
* Initialize this SAMOA task, i.e. create and connect ProcessingItems and Streams and initialize the topology
*/
public void init();
/**
* Return the final topology object to be executed in the cluster
*
* @return topology object to be submitted to be executed in the cluster
*/
public Topology getTopology();
// /**
// * Return the entrance processor to start SAMOA topology
// * The logic to start the topology should be implemented here
// * @return entrance processor to start the topology
// */
// public TopologyStarter getTopologyStarter();
/**
* Sets the factory. TODO: propose to hide factory from task, i.e. Task will only see TopologyBuilder, and factory
* creation will be handled by TopologyBuilder
*
* @param factory
* the new factory
*/
public void setFactory(ComponentFactory factory);
}