getUniqueName(job, "part") + "." + extension); final int visCacheSize = FileOutputConfigurator.getVisibilityCacheSize(conf);
@Override public RecordWriter<Key,Value> getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException { // get the path of the temporary output file final Configuration conf = job; final AccumuloConfiguration acuConf = FileOutputConfigurator.getAccumuloConfiguration(CLASS, job); final String extension = acuConf.get(Property.TABLE_FILE_TYPE); final Path file = new Path(getWorkOutputPath(job), getUniqueName(job, "part") + "." + extension); final int visCacheSize = ConfiguratorBase.getVisibilityCacheSize(conf); return new RecordWriter<Key,Value>() { RFileWriter out = null; @Override public void close(Reporter reporter) throws IOException { if (out != null) out.close(); } @Override public void write(Key key, Value value) throws IOException { if (out == null) { out = RFile.newWriter().to(file.toString()).withFileSystem(file.getFileSystem(conf)) .withTableProperties(acuConf).withVisibilityCacheSize(visCacheSize).build(); out.startDefaultLocalityGroup(); } out.append(key, value); } }; }
@Override public RecordWriter<Key,Value> getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException { // get the path of the temporary output file final Configuration conf = job; final AccumuloConfiguration acuConf = FileOutputConfigurator.getAccumuloConfiguration(CLASS, job); final String extension = acuConf.get(Property.TABLE_FILE_TYPE); final Path file = new Path(getWorkOutputPath(job), getUniqueName(job, "part") + "." + extension); final int visCacheSize = ConfiguratorBase.getVisibilityCacheSize(conf); return new RecordWriter<Key,Value>() { RFileWriter out = null; @Override public void close(Reporter reporter) throws IOException { if (out != null) out.close(); } @Override public void write(Key key, Value value) throws IOException { if (out == null) { out = RFile.newWriter().to(file.toString()).withFileSystem(file.getFileSystem(conf)) .withTableProperties(acuConf).withVisibilityCacheSize(visCacheSize).build(); out.startDefaultLocalityGroup(); } out.append(key, value); } }; }