Package com.netflix.genie.common.model

Examples of com.netflix.genie.common.model.FileAttachment


        final File query = File.createTempFile("hive", ".q");
        try (PrintWriter pw = new PrintWriter(query, "UTF-8")) {
            pw.println("select count(*) from counters where dateint=20120430 and hour=10;");
        }
        final Set<FileAttachment> attachments = new HashSet<>();
        final FileAttachment attachment = new FileAttachment();
        attachment.setName("hive.q");

        FileInputStream fin = null;
        ByteArrayOutputStream bos = null;
        try {
            fin = new FileInputStream(query);
            bos = new ByteArrayOutputStream();
            final byte[] buf = new byte[4096];
            int read;
            while ((read = fin.read(buf)) != -1) {
                bos.write(buf, 0, read);
            }
            attachment.setData(bos.toByteArray());
        } finally {
            if (fin != null) {
                fin.close();
            }
            if (bos != null) {
View Full Code Here

TOP

Related Classes of com.netflix.genie.common.model.FileAttachment

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.