static int numUpdateThreads = 1; static int maxItersPerDoc = 1; static int numReduceTasks = 10; static boolean backfillPerplexity = false; static String subFix = ""; static ArrayList<String> topics = new ArrayList<String>(); static ArrayList<String> topWords = new ArrayList<String>(); static String avroSchemaFile = "lda.avsc"; static String avroOutFile = "lda.avro"; static String avroInFile = ""; static String avroSchemaInFile = ""; static String hdfsFolder = "lda-optimized"; public static void main(String[] args) throws Exception { if(args.length >= 4){ Configuration conf = new Configuration(); HadoopUtil.delete(conf, output); //set arguments numTopics = Integer.parseInt(args[0]); maxIter = Integer.parseInt(args[1]); subFix = args[2]; hdfsFolder = args[3]; if(args.length > 4){ avroSchemaFile = args[4]; avroOutFile = "avro_" + subFix + ".avro"; avroInFile = args[5]; avroSchemaInFile = args[6]; } String[] ldaArgs = { "-DbaseFileLocation=" + baseFileLocation }; ToolRunner.run(new LDAJob(), ldaArgs); System.out.println("done"); } else{ System.out.println("Usage\n\thadoop jar lda.jar LDAJob " + "<number of topics> <number of iterations> " + “ + "<output subfix> <HDFS working directory> + + "[<schema file: lda.avsc> <avro input file> " + + "<avro schema input file>]"); } } public int run(String[] arg0) throws Exception {
static int numUpdateThreads = 1; static int maxItersPerDoc = 1; static int numReduceTasks = 10; static boolean backfillPerplexity = false; static String subFix = ""; static ArrayList<String> topics = new ArrayList<String>(); static ArrayList<String> topWords = new ArrayList<String>(); static String avroSchemaFile = "lda.avsc"; static String avroOutFile = "lda.avro"; static String avroInFile = ""; static String avroSchemaInFile = ""; static String hdfsFolder = "lda-optimized"; public static void main(String[] args) throws Exception { if(args.length >= 4){ Configuration conf = new Configuration(); HadoopUtil.delete(conf, output); //set arguments numTopics = Integer.parseInt(args[0]); maxIter = Integer.parseInt(args[1]); subFix = args[2]; hdfsFolder = args[3]; if(args.length > 4){ avroSchemaFile = args[4]; avroOutFile = "avro_" + subFix + ".avro"; avroInFile = args[5]; avroSchemaInFile = args[6]; } String[] ldaArgs = { "-DbaseFileLocation=" + baseFileLocation }; ToolRunner.run(new LDAJob(), ldaArgs); System.out.println("done"); } else{ System.out.println("Usage\n\thadoop jar lda.jar LDAJob " + "<number of topics> <number of iterations> " + + "<output subfix> <HDFS working directory> “ + + "[<schema file: lda.avsc> <avro input file> " + + "<avro schema input file>]"); } } public int run(String[] arg0) throws Exception {