@Override
 public void configure(JobConf job) {
   super.configure(job);
   this.localDir = job.get("mapred.child.tmp");
   try {
     FileAndWriter faw = openFileWriter(localDir, 1);
     s1File = faw.file;
     s1FileWriter = faw.writer;
     faw = openFileWriter(localDir, 2);
     s2File = faw.file;
     s2FileWriter = faw.writer;
   } catch (IOException e) {
     e.printStackTrace();
   }
 }
Exemple #2
0
 @Override
 public void configure(JobConf job) {
   super.configure(job);
   try {
     String queryShapeClassName = job.get(QUERY_SHAPE_CLASS);
     Class<? extends Shape> queryShapeClass =
         Class.forName(queryShapeClassName).asSubclass(Shape.class);
     queryShape = queryShapeClass.newInstance();
     queryShape.fromText(new Text(job.get(QUERY_SHAPE)));
     queryMbr = queryShape.getMBR();
     queryField = job.get(QUERY_FIELD);
   } catch (ClassNotFoundException e) {
     e.printStackTrace();
   } catch (InstantiationException e) {
     e.printStackTrace();
   } catch (IllegalAccessException e) {
     e.printStackTrace();
   }
 }
 @Override
 public void close() throws IOException {
   super.close();
   if (s1FileWriter != null) s1FileWriter.close();
   if (s2FileWriter != null) s2FileWriter.close();
 }
Exemple #4
0
 @Override
 public void configure(JobConf job) {
   super.configure(job);
 }
 public void configure(JobConf jobConf) {
   keyword = jobConf.get("keywords").split(",");
   super.configure(jobConf);
 }
 @Override
 public void configure(JobConf jobConf) {
   super.configure(jobConf);
   this.conf = jobConf;
   init();
 }