Class MutationWriter (0.5.1)

public class MutationWriter implements Callable<Long>, Closeable

Inheritance

java.lang.Object > MutationWriter

Constructors

MutationWriter(MutationWriter.CopyTransactionMode transactionMode, Connection connection, String tableName, Map<String,TypeCode> tableColumns, int indexedColumnsCount, CSVFormat format, boolean hasHeader)

public MutationWriter(MutationWriter.CopyTransactionMode transactionMode, Connection connection, String tableName, Map<String,TypeCode> tableColumns, int indexedColumnsCount, CSVFormat format, boolean hasHeader)
Parameters
Name Description
transactionMode MutationWriter.CopyTransactionMode
connection Connection
tableName String
tableColumns Map<String,com.google.spanner.v1.TypeCode>
indexedColumnsCount int
format org.apache.commons.csv.CSVFormat
hasHeader boolean

Methods

addCopyData(byte[] payload)

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

call()

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

close()

public void close()
Exceptions
Type Description
IOException

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.