Skip to content

Instantly share code, notes, and snippets.

@gilfernandes
Created April 25, 2013 19:46
Show Gist options
  • Save gilfernandes/5462570 to your computer and use it in GitHub Desktop.
Save gilfernandes/5462570 to your computer and use it in GitHub Desktop.
Main prototype java class for Spring Hadoop
/*
* Copyright 2011-2012 the original author or authors.
*
* Licensed 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 ${groupId};
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* Base implementation for Spring Hadoop MapReduce jobs.
*
* @author training
*/
public class Starter {
/**
* Logging object.
*/
private static final Log LOG = LogFactory.getLog(Starter.class);
/**
* The main entry point for this application.
* @param args List of command line arguments.
* @throws Exception In case the application cannot start.
*/
public static void main(String[] args) throws Exception {
AbstractApplicationContext context = new ClassPathXmlApplicationContext(
"/META-INF/spring/application-context.xml", Starter.class);
LOG.info("Wordcount with HDFS copy Application Running");
context.registerShutdownHook();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment