public static class BasicTable.Writer
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
BasicTable.Writer(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
Reopen an already created BasicTable for writing.
|
BasicTable.Writer(org.apache.hadoop.fs.Path path,
java.lang.String btSchemaString,
java.lang.String btStorageString,
org.apache.hadoop.conf.Configuration conf)
a wrapper to support backward compatible constructor
|
BasicTable.Writer(org.apache.hadoop.fs.Path path,
java.lang.String btSchemaString,
java.lang.String btStorageString,
java.lang.String sortColumns,
java.lang.String comparator,
org.apache.hadoop.conf.Configuration conf)
Create a BasicTable writer.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the BasicTable for writing.
|
java.io.DataOutputStream |
createMetaBlock(java.lang.String name)
Obtain an output stream for creating a Meta Block with the specific name.
|
void |
finish()
Release resources used by the object.
|
TableInserter |
getInserter(java.lang.String name,
boolean finishWriter)
Get a inserter with a given name.
|
TableInserter |
getInserter(java.lang.String name,
boolean finishWriter,
boolean checkType)
Get a inserter with a given name.
|
Schema |
getSchema()
Get the schema of the table.
|
SortInfo |
getSortInfo()
Get the list of sorted columns.
|
boolean |
isSorted() |
public BasicTable.Writer(org.apache.hadoop.fs.Path path, java.lang.String btSchemaString, java.lang.String btStorageString, java.lang.String sortColumns, java.lang.String comparator, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
path
- The path to the Basic Table, either not existent or must be a
directory.btSchemaString
- The schema of the Basic Table. For this version of
implementation, the schema of a table is a comma or
semicolon-separated list of column names, such as
"FirstName, LastName; Sex, Department".sortColumns
- String of comma-separated sorted columns: null for unsorted tablescomparator
- Name of the comparator used in sorted tablesconf
- Optional Configuration objects.java.io.IOException
Schema
public BasicTable.Writer(org.apache.hadoop.fs.Path path, java.lang.String btSchemaString, java.lang.String btStorageString, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
java.io.IOException
public BasicTable.Writer(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
java.io.IOException
public void finish() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public Schema getSchema()
public boolean isSorted()
public SortInfo getSortInfo()
public TableInserter getInserter(java.lang.String name, boolean finishWriter) throws java.io.IOException
name
- the name of the inserter. If multiple calls to getInserter with
the same name has been called, we expect they are the result of
speculative execution and at most one of them will succeed.finishWriter
- finish the underlying Writer object upon the close of the
Inserter. Should be set to true if there is only one inserter
operate on the table, so we should call finish() after the
Inserter is closed.java.io.IOException
public TableInserter getInserter(java.lang.String name, boolean finishWriter, boolean checkType) throws java.io.IOException
name
- the name of the inserter. If multiple calls to getInserter with
the same name has been called, we expect they are the result of
speculative execution and at most one of them will succeed.finishWriter
- finish the underlying Writer object upon the close of the
Inserter. Should be set to true if there is only one inserter
operate on the table, so we should call finish() after the
Inserter is closed.checktype
- whether or not do type check.java.io.IOException
public java.io.DataOutputStream createMetaBlock(java.lang.String name) throws MetaBlockAlreadyExists, java.io.IOException
name
- The name of the Meta Blockjava.io.IOException
MetaBlockAlreadyExists
Copyright © 2007-2012 The Apache Software Foundation