Package org.grouplens.lenskit.util.io

Examples of org.grouplens.lenskit.util.io.StagedWrite


            logger.info("{} is up to date", outFile);
            return source;
        }

        logger.info("packing {} to {}", data, outFile);
        StagedWrite stage = StagedWrite.begin(outFile);
        try {
            BinaryRatingPacker packer = BinaryRatingPacker.open(stage.getStagingFile(), binaryFlags);
            try {
                Cursor<Rating> ratings = data.getEventDAO().streamEvents(Rating.class);
                try {
                    packer.writeRatings(ratings);
                } finally {
                    ratings.close();
                }
            } finally {
                packer.close();
            }
            stage.commit();
        } catch (IOException ex) {
            logger.error("error packing {}: {}", outFile, ex);
            throw new TaskExecutionException("error packing " + outFile, ex);
        } finally {
            stage.close();
        }

        return source;
    }
View Full Code Here

TOP

Related Classes of org.grouplens.lenskit.util.io.StagedWrite

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.