Fix Avro filename with spring data hadoop

148 Views Asked by At

My goal is to write a directory on HDFS. For that I use:

  • spring-data-hadoop:2.4.0.RELEASE
  • spring-data-hadoop-store:2.4.0.RELEASE

In my config class I define a bean

@Bean
public DataStoreWriter<File> dataStoreWriter() {
        return new AvroPojoDatasetStoreWriter<File>(File.class, datasetRepositoryFactory(), fileInfoDatasetDefinition());
}

In my service I can use this bean to write what I want :

File myDirectory = new File(myDirectoryPath);
dataStoreWriter.write(myDirectory);

It works fine, on HDFS I have an avro file. The name is generated and I can't find a solution to apply a file name strategy on it.

How could I fix the name or get the bean?

0

There are 0 best solutions below