Search code examples
javaeclipsemahout

Issues of using "SequenceFilesFromDirectory" in my code


I am trying to write a sample program that can call use the main method of "SequenceFilesFromDirectory", which aims to convert a set of files into sequence file format.

public class TestSequenceFileConverter {
public static void main(String args[]){   
String inputDir = "inputDir";   
String outputDir = "outoutDir";
SequenceFilesFromDirectory.main(new String[] {"--input",
        inputDir.toString(), "--output", outputDir.toString(), "--chunkSize",
        "64", "--charset",Charsets.UTF_8.name()});
}
}

But the Eclipse tells me that what I did was wrong with the following error message

Multiple markers at this line - Syntax error on token "main", = expected after this token - Syntax error on token(s), misplaced construct(s) - SequenceFilesFromDirectory cannot be resolved

I think I did not use this method correctly, but I don't know how to fix it? Thanks a lot.

The following is how the SequenceFilesFromDirectory defines. The API link for SequenceFilesFromDirectory is http://search-lucene.com/jd/mahout/utils/org/apache/mahout/text/SequenceFilesFromDirectory.html


Solution

  • My guess is that you're missing an import line from the first section of your file:

    import org.apache.mahout.text.SequenceFilesFromDirectory;