Class MutationWriter (0.6.0)

public class MutationWriter implements Callable<StatementResult>, Closeable

Inheritance

java.lang.Object > MutationWriter

Constructors

MutationWriter(MutationWriter.CopyTransactionMode transactionMode, Connection connection, String tableName, Map<String,Type> tableColumns, int indexedColumnsCount, CopyTreeParser.CopyOptions.Format copyFormat, CSVFormat format, boolean hasHeader)

public MutationWriter(MutationWriter.CopyTransactionMode transactionMode, Connection connection, String tableName, Map<String,Type> tableColumns, int indexedColumnsCount, CopyTreeParser.CopyOptions.Format copyFormat, CSVFormat format, boolean hasHeader)
Parameters
NameDescription
transactionModeMutationWriter.CopyTransactionMode
connectionConnection
tableNameString
tableColumnsMap<String,com.google.cloud.spanner.Type>
indexedColumnsCountint
copyFormatCopyTreeParser.CopyOptions.Format
formatorg.apache.commons.csv.CSVFormat
hasHeaderboolean

Methods

addCopyData(byte[] payload)

public void addCopyData(byte[] payload)
Parameter
NameDescription
payloadbyte[]

call()

public StatementResult call()
Returns
TypeDescription
StatementResult
Exceptions
TypeDescription
Exception

close()

public void close()
Exceptions
TypeDescription
IOException

commit()

public void commit()

Indicate that this mutation writer should commit.

getRowCount()

public long getRowCount()
Returns
TypeDescription
long

number of rows copied into Spanner

rollback()

public void rollback()

Indicate that this mutation writer should be rolled back. This will not rollback any changes that have already been committed if the mutation writer is running in CopyTransactionMode#ImplicitNonAtomic.