@Test public void testManyFiles() throws IOException{ List<Document> documents = DataStoreExamples.getDocument(); createSingleFile(documents.subList(0, 3), new FileSystemPath(new File(tempDir, "doc0")), Document.SCHEMA$); createSingleFile(documents.subList(3, 4), new FileSystemPath(new File(tempDir, "doc1")), Document.SCHEMA$); TestsIOUtils.assertEqualSets(documents, new AvroDataStoreReader<Document>( new FileSystemPath(tempDir))); }
public static <T> DataFileWriter<T> createSingleFile( FileSystemPath path, Schema schema) throws IOException{ DatumWriter<T> datumWriter = new SpecificDatumWriter<T>(); DataFileWriter<T> writer = new DataFileWriter<T>(datumWriter); writer.create(schema, path.getFileSystem().create(path.getPath())); return writer; }
DataStore { public static <T> DataFileWriter<T> createSingleFile( FileSystemPath path, Schema schema) throws IOException{ DatumWriter<T> datumWriter = new SpecificDatumWriter<T>(); DataFileWriter<T> writer = new DataFileWriter<T>(datumWriter); writer.create(schema, path.getFileSystem().create(path.getPath())); return writer; } }
DataStore { public static <T> DataFileWriter<T> createSingleFile( FileSystemPath path, Schema schema) throws IOException{ DatumWriter<T> datumWriter = new SpecificDatumWriter<T>(); DataFileWriter<T> writer = new DataFileWriter<T>(datumWriter); writer.create(schema, path.getFileSystem().create(path.getPath())); return writer; } private  DataStore(); }
DataStore { public static <T> DataFileWriter<T> createSingleFile( FileSystemPath path, Schema schema) throws IOException{ DatumWriter<T> datumWriter = new SpecificDatumWriter<T>(); DataFileWriter<T> writer = new DataFileWriter<T>(datumWriter); writer.create(schema, path.getFileSystem().create(path.getPath())); return writer; } private  DataStore(); static DataFileWriter<T> create(
			FileSystemPath path, Schema schema); static DataFileWriter<T> create(
            FileSystemPath path, Schema schema, String dataStoreFileName); static CloseableIterator<T> getReader(FileSystemPath path); static CloseableIterator<T> getReader(
			FileSystemPath path, Schema readerSchema); static List<T> read(FileSystemPath path); static List<T> read(FileSystemPath path, Schema readerSchema); static void create(
			List<T> elements, FileSystemPath path); static void create(
			List<T> elements, FileSystemPath path, Schema schema); static DataFileWriter<T> createSingleFile(
			FileSystemPath path, Schema schema); static String generateFileName(int fileNo); }
DataStore { public static <T> DataFileWriter<T> createSingleFile( FileSystemPath path, Schema schema) throws IOException{ DatumWriter<T> datumWriter = new SpecificDatumWriter<T>(); DataFileWriter<T> writer = new DataFileWriter<T>(datumWriter); writer.create(schema, path.getFileSystem().create(path.getPath())); return writer; } private  DataStore(); static DataFileWriter<T> create(
			FileSystemPath path, Schema schema); static DataFileWriter<T> create(
            FileSystemPath path, Schema schema, String dataStoreFileName); static CloseableIterator<T> getReader(FileSystemPath path); static CloseableIterator<T> getReader(
			FileSystemPath path, Schema readerSchema); static List<T> read(FileSystemPath path); static List<T> read(FileSystemPath path, Schema readerSchema); static void create(
			List<T> elements, FileSystemPath path); static void create(
			List<T> elements, FileSystemPath path, Schema schema); static DataFileWriter<T> createSingleFile(
			FileSystemPath path, Schema schema); static String generateFileName(int fileNo); static final String AVRO_FILE_EXT; }