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
NameDescription
transactionModeMutationWriter.CopyTransactionMode
connectionConnection
tableNameString
tableColumnsMap<String,com.google.spanner.v1.TypeCode>
indexedColumnsCountint
formatorg.apache.commons.csv.CSVFormat
hasHeaderboolean

Methods

addCopyData(byte[] payload)

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

call()

public Long call()
Returns
TypeDescription
Long
Exceptions
TypeDescription
Exception

close()

public void close()
Exceptions
TypeDescription
IOException

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.