Examples of rethrow()


Examples of com.google.common.io.Closer.rethrow()

            }
            throw new BuildException(message.toString());
        }
      }
    } catch (Throwable t) {
      throw closer.rethrow(t);
    } finally {
      try {
        closer.close();
      } finally {
        Files.asByteSource(classNamesDynamic).copyTo(Files.asByteSink(classNamesFile, FileWriteMode.APPEND));
View Full Code Here

Examples of com.google.common.io.Closer.rethrow()

                            writer.print(ts);
                        }
                        writer.println();
                    }
                } catch (Throwable th) {
                    throw closer.rethrow(th);
                } finally {
                    closer.close();
                }
            } catch (IOException e) {
                throw new RuntimeException("Error creating ratings file", e);
View Full Code Here

Examples of com.google.common.io.Closer.rethrow()

                    LongIterator iter = ids.iterator();
                    while (iter.hasNext()) {
                        writer.println(iter.nextLong());
                    }
                } catch (Throwable th) {
                    throw closer.rethrow(th);
                } finally {
                    closer.close();
                }
            } catch (IOException e) {
                throw new RuntimeException("Error creating ratings file", e);
View Full Code Here

Examples of com.google.common.io.Closer.rethrow()

                    OutputStream out = closer.register(stage.openOutputStream());
                    OutputStream gzOut = closer.register(new GZIPOutputStream(out));
                    ObjectOutputStream objOut = closer.register(new ObjectOutputStream(gzOut));
                    objOut.writeObject(obj);
                } catch (Throwable th) {
                    throw closer.rethrow(th);
                } finally {
                    closer.close();
                }
                stage.commit();
            } finally {
View Full Code Here

Examples of com.google.common.io.Closer.rethrow()

                    InputStream in = closer.register(new FileInputStream(cacheFile));
                    InputStream gzin = closer.register(new GZIPInputStream(in));
                    ObjectInputStream oin = closer.register(new CustomClassLoaderObjectInputStream(gzin, classLoader));
                    return type.cast(oin.readObject());
                } catch (Throwable th) {
                    throw closer.rethrow(th);
                } finally {
                    closer.close();
                }
            } catch (IOException ex) {
                logger.warn("ignoring cache file {} due to read error: {}",
View Full Code Here

Examples of com.google.common.io.Closer.rethrow()

            Closer closer = Closer.create();
            RatingWriter subsampleWriter = closer.register(RatingWriters.csv(subsampleFile));
            try {
                mode.doSample(source, subsampleWriter, subsampleFraction, getProject().getRandom());
            } catch (Throwable th) {
                throw closer.rethrow(th);
            } finally {
                closer.close();
            }
        } catch (IOException e) {
            throw new TaskExecutionException("Error writing output file", e);
View Full Code Here

Examples of com.google.common.io.Closer.rethrow()

                registerTaskListener(jobGraph);

                // tell all metrics to get started
                runEvaluations(jobGraph);
            } catch (Throwable th) {
                throw closer.rethrow(th, TaskExecutionException.class, InterruptedException.class);
            } finally {
                closer.close();
            }

            logger.info("evaluation {} completed", getName());
View Full Code Here

Examples of com.google.common.io.Closer.rethrow()

        try {
            OutputStream stream = closer.register(new FileOutputStream(output));
            stream = closer.register(comp.wrapOutput(stream));
            engine.write(stream);
        } catch (Throwable th) {
            throw closer.rethrow(th);
        } finally {
            closer.close();
        }
    }
View Full Code Here

Examples of com.google.common.io.Closer.rethrow()

            BinaryRatingPacker packer = closer.register(BinaryRatingPacker.open(getOutputFile(), flags));
            Cursor<Rating> ratings = closer.register(dao.streamEvents(Rating.class));
            packer.writeRatings(ratings);
            logger.info("packed {} ratings", packer.getRatingCount());
        } catch (Throwable th) {
            throw closer.rethrow(th);
        } finally {
            closer.close();
        }
    }
View Full Code Here

Examples of com.google.common.io.Closer.rethrow()

                try {
                    BinaryRatingPacker packer = closer.register(BinaryRatingPacker.open(file, flags));
                    Cursor<Rating> ratings = closer.register(dao.streamEvents(Rating.class, order));
                    packer.writeRatings(ratings);
                } catch (Throwable th) {
                    throw closer.rethrow(th);
                } finally {
                    closer.close();
                }
                BinaryRatingDAO result = BinaryRatingDAO.open(file);
                // try to delete the file early, helps keep things clean on Unix
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.