001/* A DDP director to run Hadoop jobs. 002 * 003 * Copyright (c) 2013 The Regents of the University of California. 004 * All rights reserved. 005 * 006 * '$Author: crawl $' 007 * '$Date: 2013-10-30 18:03:11 +0000 (Wed, 30 Oct 2013) $' 008 * '$Revision: 32529 $' 009 * 010 * Permission is hereby granted, without written agreement and without 011 * license or royalty fees, to use, copy, modify, and distribute this 012 * software and its documentation for any purpose, provided that the above 013 * copyright notice and the following two paragraphs appear in all copies 014 * of this software. 015 * 016 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 017 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 018 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 019 * THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 020 * SUCH DAMAGE. 021 * 022 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 023 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 024 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 025 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 026 * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 027 * ENHANCEMENTS, OR MODIFICATIONS. 028 * 029 */ 030package org.kepler.hadoop.director; 031 032import org.kepler.ddp.director.DDPDirector; 033 034import ptolemy.kernel.CompositeEntity; 035import ptolemy.kernel.util.IllegalActionException; 036import ptolemy.kernel.util.NameDuplicationException; 037import ptolemy.kernel.util.Workspace; 038 039/** A DDP director that uses the Hadoop engine to convert DDP pattern 040 * actors (Map, Reduce, Cross, CoGroup, and Match) and I/O actors 041 * (DDPDataSink and DDPDataSource) into a Hadoop job and runs it on 042 * the server. 043 * <p> 044 * <b>NOTE:</b> Only DDP pattern and I/O actors may be present in the 045 * workflow. Other actors must placed inside the composite pattern actors 046 * or in a different sub-workflow. 047 * </p> 048 * 049 * @author Daniel Crawl 050 * @version $Id: HadoopDirector.java 32529 2013-10-30 18:03:11Z crawl $ 051 * 052 */ 053public class HadoopDirector extends DDPDirector { 054 055 /** Create a new HadoopDirector in a container with a specific name. */ 056 public HadoopDirector(CompositeEntity container, String name) 057 throws IllegalActionException, NameDuplicationException { 058 super(container, name); 059 engine.setToken("Hadoop"); 060 } 061 062 /** Create a new HadoopDirector for a workspace. */ 063 public HadoopDirector(Workspace workspace) throws IllegalActionException, 064 NameDuplicationException { 065 super(workspace); 066 engine.setToken("Hadoop"); 067 } 068}