Esempio n. 1
0
 public static Rasterizer getRasterizer(Configuration job) {
   try {
     Class<? extends Rasterizer> rasterizerClass =
         job.getClass(RasterizerClass, null, Rasterizer.class);
     if (rasterizerClass == null) throw new RuntimeException("Rasterizer class not set in job");
     Rasterizer rasterizer = rasterizerClass.newInstance();
     rasterizer.configure(job);
     return rasterizer;
   } catch (InstantiationException e) {
     throw new RuntimeException("Error creating rasterizer", e);
   } catch (IllegalAccessException e) {
     throw new RuntimeException("Error constructing rasterizer", e);
   }
 }