joshua-decoder / joshua

Joshua Statistical Machine Translation Toolkit
http://joshua-decoder.org/
121 stars 56 forks source link

Fix deprecation in Hadoop 2.5.2 API usage #215

Closed lewismc closed 9 years ago

lewismc commented 9 years ago

Right now when I build Joshua I get the following

    [javac] Compiling 176 source files to /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/bin
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/lib/hadoop-common-2.5.2.jar(org/apache/hadoop/fs/Path.class): warning: Cannot find annotation method 'value()' in type 'LimitedPrivate': class file for org.apache.hadoop.classification.InterfaceAudience not found
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/lib/hadoop-common-2.5.2.jar(org/apache/hadoop/fs/FileSystem.class): warning: Cannot find annotation method 'value()' in type 'LimitedPrivate'
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/lib/hadoop-common-2.5.2.jar(org/apache/hadoop/fs/FileSystem.class): warning: Cannot find annotation method 'value()' in type 'LimitedPrivate'
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/lib/hadoop-common-2.5.2.jar(org/apache/hadoop/fs/FileSystem.class): warning: Cannot find annotation method 'value()' in type 'LimitedPrivate'
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/distributional/ContextPhraseExtractor.java:160: warning: [rawtypes] found raw type: ArrayList
    [javac]         govern = new ArrayList[size];
    [javac]                      ^
    [javac]   missing type arguments for generic class ArrayList<E>
    [javac]   where E is a type-variable:
    [javac]     E extends Object declared in class ArrayList
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/distributional/ContextPhraseExtractor.java:160: warning: [unchecked] unchecked conversion
    [javac]         govern = new ArrayList[size];
    [javac]                  ^
    [javac]   required: ArrayList<ContextPhraseExtractor.Dependency>[]
    [javac]   found:    ArrayList[]
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/distributional/ContextPhraseExtractor.java:166: warning: [rawtypes] found raw type: ArrayList
    [javac]         c_govern = new ArrayList[size];
    [javac]                        ^
    [javac]   missing type arguments for generic class ArrayList<E>
    [javac]   where E is a type-variable:
    [javac]     E extends Object declared in class ArrayList
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/distributional/ContextPhraseExtractor.java:166: warning: [unchecked] unchecked conversion
    [javac]         c_govern = new ArrayList[size];
    [javac]                    ^
    [javac]   required: ArrayList<ContextPhraseExtractor.Dependency>[]
    [javac]   found:    ArrayList[]
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/distributional/ContextPhraseExtractor.java:172: warning: [rawtypes] found raw type: ArrayList
    [javac]         cp_govern = new ArrayList[size];
    [javac]                         ^
    [javac]   missing type arguments for generic class ArrayList<E>
    [javac]   where E is a type-variable:
    [javac]     E extends Object declared in class ArrayList
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/distributional/ContextPhraseExtractor.java:172: warning: [unchecked] unchecked conversion
    [javac]         cp_govern = new ArrayList[size];
    [javac]                     ^
    [javac]   required: ArrayList<ContextPhraseExtractor.Dependency>[]
    [javac]   found:    ArrayList[]
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/features/annotation/AnnotationFeatureJob.java:50: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(conf, name);
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/lexprob/SequenceFileLexprobTable.java:69: warning: [deprecation] Reader(FileSystem,Path,Configuration) in Reader has been deprecated
    [javac]           if (reader == null) reader = new SequenceFile.Reader(fs, theFiles[0].getPath(), theConf);
    [javac]                                        ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/lexprob/SequenceFileLexprobTable.java:82: warning: [deprecation] Reader(FileSystem,Path,Configuration) in Reader has been deprecated
    [javac]           reader = new SequenceFile.Reader(fs, theFiles[fileIndex].getPath(), theConf);
    [javac]                    ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/features/mapred/MapReduceFeature.java:50: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(conf, name);
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/jobs/DistributionalContextExtractionJob.java:25: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(conf, "distributional");
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/jobs/DistributionalContextSortingJob.java:27: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(conf, "sorting");
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/jobs/ExtractionJob.java:30: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(conf, "extraction");
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/jobs/FeatureCollectionJob.java:45: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(conf, "collect");
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/jobs/OutputJob.java:42: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(conf, "collect");
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/jobs/ParaphraseAggregationJob.java:29: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(conf, "aggregate");
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/jobs/ParaphrasePivotingJob.java:35: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(conf, "pivoting");
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/jobs/WordLexprobJob.java:36: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(theConf, getName());
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/jobs/VocabularyJob.java:31: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]     Job job = new Job(conf, "vocabulary");
    [javac]               ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/tools/ExtractionTool.java:47: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]         Job job = new Job(conf, "thrax");
    [javac]                   ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/tools/FeatureTool.java:51: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]         Job job = new Job(conf, String.format("thrax-%s", featureName));
    [javac]                   ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/tools/OutputTool.java:48: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]         Job job = new Job(conf, "thrax-collect");
    [javac]                   ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/tools/SourceWordGivenTargetWordProbabilityTool.java:52: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]         Job job = new Job(conf, "thrax-sgt-word-lexprob");
    [javac]                   ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/hadoop/tools/TargetWordGivenSourceWordProbabilityTool.java:52: warning: [deprecation] Job(Configuration,String) in Job has been deprecated
    [javac]         Job job = new Job(conf, "thrax-tgs-word-lexprob");
    [javac]                   ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/tools/SequenceToGrammar.java:54: warning: [deprecation] Reader(FileSystem,Path,Configuration) in Reader has been deprecated
    [javac]     SequenceFile.Reader reader = new SequenceFile.Reader(FileSystem.getLocal(config), path, config);
    [javac]                                  ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/lib/hadoop-common-2.5.2.jar(org/apache/hadoop/io/DataOutputBuffer.class): warning: Cannot find annotation method 'value()' in type 'LimitedPrivate'
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/tools/SequenceToSignatures.java:78: warning: [deprecation] Reader(FileSystem,Path,Configuration) in Reader has been deprecated
    [javac]       reader = new SequenceFile.Reader(FileSystem.getLocal(config), path, config);
    [javac]                ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/tools/SequenceToSignatures.java:84: warning: [deprecation] Reader(FileSystem,Path,Configuration) in Reader has been deprecated
    [javac]       reader = new SequenceFile.Reader(file_system, path, config);
    [javac]                ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/util/SequenceFileCreator.java:24: warning: [deprecation] createWriter(FileSystem,Configuration,Path,Class,Class) in SequenceFile has been deprecated
    [javac]         SequenceFile.Writer writer = SequenceFile.createWriter(fs, conf, path, LongWritable.class, Text.class);
    [javac]                                                  ^
    [javac] /private/tmp/joshua-v20150930-1764-18p6qwk/thrax/src/edu/jhu/thrax/util/Vocabulary.java:168: warning: [deprecation] Reader(FileSystem,Path,Configuration) in Reader has been deprecated
    [javac]         SequenceFile.Reader reader = new SequenceFile.Reader(file_system, file.getPath(), conf);
    [javac]                                      ^
    [javac] 34 warnings

This is all post upgrade to Hadoop 2.5.2, we should fix this.

mjpost commented 9 years ago

What version of Java are you using?

lewismc commented 9 years ago

@mjpost

lmcgibbn@LMC-032857 /usr/local/joshua(eclipse_target) $ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
lewismc commented 9 years ago

This is not an issue it seems to have been the result of previous versions of Hadoop being present on the classpath.