PHOENIX-2748 Disable auto-commit during bulk load
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/5d33fba6 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5d33fba6 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5d33fba6 Branch: refs/heads/calcite Commit: 5d33fba633bdc5b2cbc31fa1736f56dce1e17ac6 Parents: 5977e1f Author: Gabriel Reid <gabri...@ngdata.com> Authored: Fri Mar 11 15:13:58 2016 +0100 Committer: Gabriel Reid <gabri...@ngdata.com> Committed: Fri Mar 11 20:46:04 2016 +0100 ---------------------------------------------------------------------- .../org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java | 3 +++ 1 file changed, 3 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d33fba6/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java index 2c9b6d9..1211b83 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapper.java @@ -126,6 +126,9 @@ public abstract class FormatToBytesWritableMapper<RECORD> extends Mapper<LongWri try { conn = (PhoenixConnection) QueryUtil.getConnection(clientInfos, conf); + // We are dependent on rolling back before performing commits, so we need to be sure + // that auto-commit is not turned on + conn.setAutoCommit(false); final String tableNamesConf = conf.get(TABLE_NAMES_CONFKEY); final String logicalNamesConf = conf.get(LOGICAL_NAMES_CONFKEY);