Class MutationWriter (0.27.1)

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
NameDescription
sessionStateSessionState
transactionModeMutationWriter.CopyTransactionMode
connectionConnection
qualifiedTableNameString
tableColumnsMap<String,com.google.cloud.spanner.Type>
indexedColumnsCountint
copyFormatCopyStatement.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.