T - 待写入数据的数据类型public class DbWriter<T> extends Object
| 构造器和说明 |
|---|
DbWriter(Class<T> type,
File dbfile)
构造一个向avro文件中以新建方式写入指定类型数据的Writer
|
DbWriter(Class<T> type,
File dbfile,
boolean append)
构造一个向avro文件中写入指定类型数据的Writer
|
DbWriter(Class<T> type,
String dbpath)
构造一个向avro文件中以新建方式写入指定类型数据的Writer
|
DbWriter(Class<T> type,
String dbpath,
boolean append)
构造一个向avro文件中写入指定类型数据的Writer
|
public DbWriter(Class<T> type, File dbfile, boolean append) throws IOException
type - 指定的数据类型dbfile - avro文件append - 是否追加IOExceptionpublic DbWriter(Class<T> type, String dbpath, boolean append) throws IOException
type - 指定的数据类型dbpath - avro文件路径append - 是否追加IOExceptionpublic DbWriter(Class<T> type, String dbpath) throws IOException
type - 指定的数据类型dbpath - avro文件路径IOExceptionpublic DbWriter(Class<T> type, File dbfile) throws IOException
type - 指定的数据类型dbfile - avro文件IOExceptionpublic void flush()
throws IOException
IOExceptionpublic void write(T data) throws IOException
data - 要写入的数据IOExceptionpublic void close()
throws IOException
IOExceptionCopyright © 2014. All Rights Reserved.