Search in sources :

Example 1 with FileIntegrityChecker

use of water.util.FileIntegrityChecker in project h2o-3 by h2oai.

the class ParseProgressTest method testCovtype.

// Attempt a multi-jvm parse of covtype.
// Silently exits if it cannot find covtype.
@Test
public void testCovtype() {
    String[] covtype_locations = new String[] { "../datasets/UCI/UCI-large/covtype/covtype.data", "../../datasets/UCI/UCI-large/covtype/covtype.data", "../datasets/UCI/UCI-large/covtype/covtype.data.gz", "../demo/UCI-large/covtype/covtype.data" };
    File f = null;
    for (String covtype_location : covtype_locations) {
        f = FileUtils.locateFile(covtype_location);
        if (f != null && f.exists())
            break;
    }
    if (f == null || !f.exists()) {
        System.out.println("Could not find covtype.data, skipping ParseProgressTest.testCovtype()");
        return;
    }
    FileIntegrityChecker c = FileIntegrityChecker.check(f);
    // Exactly 1 file
    Assert.assertEquals(1, c.size());
    Key k = c.syncDirectory(null, null, null, null);
    Assert.assertEquals(true, k != null);
    Frame fr = ParseDataset.parse(Key.make(), k);
    Assert.assertEquals(55, fr.numCols());
    Assert.assertEquals(581012, fr.numRows());
    fr.delete();
}
Also used : Frame(water.fvec.Frame) File(java.io.File) Key(water.Key) FileIntegrityChecker(water.util.FileIntegrityChecker)

Aggregations

File (java.io.File)1 Key (water.Key)1 Frame (water.fvec.Frame)1 FileIntegrityChecker (water.util.FileIntegrityChecker)1