Class MutationWriter (0.27.1)

publicclass MutationWriterimplementsCallable<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)

publicMutationWriter(SessionStatesessionState,MutationWriter.CopyTransactionModetransactionMode,Connectionconnection,StringqualifiedTableName,Map<String,Type>tableColumns,intindexedColumnsCount,CopyStatement.FormatcopyFormat,CSVFormatformat,booleanhasHeader)
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)

publicvoidaddCopyData(byte[]payload)
Parameter
Name Description
payload byte[]

call()

publicStatementResultcall()
Returns
Type Description
StatementResult
Exceptions
Type Description
Exception

close()

publicvoidclose()
Exceptions
Type Description
IOException

commit()

publicvoidcommit()

Indicate that this mutation writer should commit.

getRowCount()

publiclonggetRowCount()
Returns
Type Description
long

number of rows copied into Spanner

rollback()

publicvoidrollback()

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.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.