Class MutationWriter (0.15.0)

public class MutationWriter implements Callable<StatementResult>, Closeable

Inheritance

java.lang.Object > MutationWriter

Constructors

MutationWriter(SessionState sessionState, MutationWriter.CopyTransactionMode transactionMode, Connection connection, String qualifiedTableName, Map<String,Type> tableColumns, int indexedColumnsCount, CopyStatement.Format copyFormat, CSVFormat format, boolean hasHeader)

public MutationWriter(SessionState sessionState, MutationWriter.CopyTransactionMode transactionMode, Connection connection, String qualifiedTableName, Map<String,Type> tableColumns, int indexedColumnsCount, CopyStatement.Format copyFormat, CSVFormat format, boolean hasHeader)
Parameters
Name Description
sessionState SessionState
transactionMode MutationWriter.CopyTransactionMode
connection Connection
qualifiedTableName String
tableColumns Map<String,com.google.cloud.spanner.Type>
indexedColumnsCount int
copyFormat CopyStatement.Format
format org.apache.commons.csv.CSVFormat
hasHeader boolean

Methods

addCopyData(byte[] payload)

public void addCopyData(byte[] payload)
Parameter
Name Description
payload byte[]

call()

public StatementResult call()
Returns
Type Description
StatementResult
Exceptions
Type Description
Exception

close()

public void close()
Exceptions
Type Description
IOException

commit()

public void commit()

Indicate that this mutation writer should commit.

getRowCount()

public long getRowCount()
Returns
Type Description
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.