Search in sources :

Example 1 with VocabularyWritable

use of edu.umd.hooka.VocabularyWritable in project Cloud9 by lintool.

the class HadoopAlign method loadVocab.

public static Vocab loadVocab(Path path, Configuration job) throws IOException {
    org.apache.hadoop.conf.Configuration conf = new org.apache.hadoop.conf.Configuration(job);
    FileSystem fileSys = FileSystem.get(conf);
    DataInput in = new DataInputStream(new BufferedInputStream(fileSys.open(path)));
    VocabularyWritable at = new VocabularyWritable();
    at.readFields(in);
    return at;
}
Also used : DataInput(java.io.DataInput) Configuration(org.apache.hadoop.conf.Configuration) BufferedInputStream(java.io.BufferedInputStream) Configuration(org.apache.hadoop.conf.Configuration) FileSystem(org.apache.hadoop.fs.FileSystem) VocabularyWritable(edu.umd.hooka.VocabularyWritable) DataInputStream(java.io.DataInputStream)

Example 2 with VocabularyWritable

use of edu.umd.hooka.VocabularyWritable in project Cloud9 by lintool.

the class HadoopAlign method loadVocab.

public static Vocab loadVocab(Path path, FileSystem fileSys) throws IOException {
    DataInput in = new DataInputStream(new BufferedInputStream(fileSys.open(path)));
    VocabularyWritable at = new VocabularyWritable();
    at.readFields(in);
    return at;
}
Also used : DataInput(java.io.DataInput) BufferedInputStream(java.io.BufferedInputStream) VocabularyWritable(edu.umd.hooka.VocabularyWritable) DataInputStream(java.io.DataInputStream)

Aggregations

VocabularyWritable (edu.umd.hooka.VocabularyWritable)2 BufferedInputStream (java.io.BufferedInputStream)2 DataInput (java.io.DataInput)2 DataInputStream (java.io.DataInputStream)2 Configuration (org.apache.hadoop.conf.Configuration)1 FileSystem (org.apache.hadoop.fs.FileSystem)1