Repository: phoenix Updated Branches: refs/heads/master bebb5cedf -> fedbca8bf
http://git-wip-us.apache.org/repos/asf/phoenix/blob/fedbca8b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java index 9b87361..ef3ac39 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java @@ -37,6 +37,7 @@ import static org.apache.phoenix.query.QueryServices.GLOBAL_METRICS_ENABLED; import static org.apache.phoenix.query.QueryServices.GROUPBY_MAX_CACHE_SIZE_ATTRIB; import static org.apache.phoenix.query.QueryServices.GROUPBY_SPILLABLE_ATTRIB; import static org.apache.phoenix.query.QueryServices.GROUPBY_SPILL_FILES_ATTRIB; +import static org.apache.phoenix.query.QueryServices.HBASE_CLIENT_SCANNER_TIMEOUT_ATTRIB; import static org.apache.phoenix.query.QueryServices.IMMUTABLE_ROWS_ATTRIB; import static org.apache.phoenix.query.QueryServices.INDEX_MUTATE_BATCH_SIZE_THRESHOLD_ATTRIB; import static org.apache.phoenix.query.QueryServices.INDEX_POPULATION_SLEEP_TIME; @@ -59,7 +60,6 @@ import static org.apache.phoenix.query.QueryServices.MUTATE_BATCH_SIZE_ATTRIB; import static org.apache.phoenix.query.QueryServices.NUM_RETRIES_FOR_SCHEMA_UPDATE_CHECK; import static org.apache.phoenix.query.QueryServices.QUEUE_SIZE_ATTRIB; import static org.apache.phoenix.query.QueryServices.REGIONSERVER_INFO_PORT_ATTRIB; -import static org.apache.phoenix.query.QueryServices.HBASE_CLIENT_SCANNER_TIMEOUT_ATTRIB; import static org.apache.phoenix.query.QueryServices.RENEW_LEASE_ENABLED; import static org.apache.phoenix.query.QueryServices.RENEW_LEASE_THREAD_POOL_SIZE; import static org.apache.phoenix.query.QueryServices.RENEW_LEASE_THRESHOLD_MILLISECONDS; @@ -78,6 +78,7 @@ import static org.apache.phoenix.query.QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB import static org.apache.phoenix.query.QueryServices.STATS_USE_CURRENT_TIME_ATTRIB; import static org.apache.phoenix.query.QueryServices.THREAD_POOL_SIZE_ATTRIB; import static org.apache.phoenix.query.QueryServices.THREAD_TIMEOUT_MS_ATTRIB; +import static org.apache.phoenix.query.QueryServices.TRANSACTIONS_ENABLED; import static org.apache.phoenix.query.QueryServices.USE_BYTE_BASED_REGEX_ATTRIB; import static org.apache.phoenix.query.QueryServices.USE_INDEXES_ATTRIB; @@ -598,6 +599,11 @@ public class QueryServicesOptions { return this; } + public QueryServicesOptions setTransactionsEnabled(boolean transactionsEnabled) { + config.setBoolean(TRANSACTIONS_ENABLED, transactionsEnabled); + return this; + } + public QueryServicesOptions setExplainRowCount(boolean showRowCount) { config.setBoolean(EXPLAIN_ROW_COUNT_ATTRIB, showRowCount); return this; http://git-wip-us.apache.org/repos/asf/phoenix/blob/fedbca8b/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java index bab52a4..58fb151 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java @@ -382,7 +382,7 @@ public final class QueryUtil { HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT); String url = getUrl(server, port, znodeParent, principal); // Mainly for testing to tack on the test=true part to ensure driver is found on server - String extraArgs = conf.get(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); + String extraArgs = props.getProperty(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, conf.get(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS)); if (extraArgs.length() > 0) { url += extraArgs + PhoenixRuntime.JDBC_PROTOCOL_TERMINATOR; } http://git-wip-us.apache.org/repos/asf/phoenix/blob/fedbca8b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixDriverTest.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixDriverTest.java b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixDriverTest.java index fde70d0..4ab75a9 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixDriverTest.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixDriverTest.java @@ -34,6 +34,7 @@ import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.PropertiesUtil; import org.apache.phoenix.util.TestUtil; +import org.junit.Ignore; import org.junit.Test; public class PhoenixDriverTest extends BaseConnectionlessQueryTest { @@ -89,6 +90,7 @@ public class PhoenixDriverTest extends BaseConnectionlessQueryTest { } } + @Ignore @Test public void testDisallowIsolationLevel() throws SQLException { Connection conn = DriverManager.getConnection(getUrl()); http://git-wip-us.apache.org/repos/asf/phoenix/blob/fedbca8b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java index 7008911..3de0b77 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java @@ -536,9 +536,7 @@ public abstract class BaseTest { } private static void checkTxManagerInitialized(ReadOnlyProps clientProps) throws SQLException, IOException { - if (txService == null - && clientProps.getBoolean(QueryServices.TRANSACTIONS_ENABLED, - QueryServicesOptions.DEFAULT_TRANSACTIONS_ENABLED)) { + if (txService == null) { setupTxManager(); } } http://git-wip-us.apache.org/repos/asf/phoenix/blob/fedbca8b/phoenix-core/src/test/java/org/apache/phoenix/query/QueryServicesTestImpl.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/test/java/org/apache/phoenix/query/QueryServicesTestImpl.java b/phoenix-core/src/test/java/org/apache/phoenix/query/QueryServicesTestImpl.java index f2b1519..d1d50d5 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/query/QueryServicesTestImpl.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/query/QueryServicesTestImpl.java @@ -63,6 +63,7 @@ public final class QueryServicesTestImpl extends BaseQueryServicesImpl { public static final int DEFAULT_HCONNECTION_POOL_MAX_SIZE = 10; public static final int DEFAULT_HTABLE_MAX_THREADS = 10; public static final long DEFAULT_INDEX_POPULATION_WAIT_TIME = 0; + public static final boolean DEFAULT_TRANSACTIONS_ENABLED = true; /** @@ -79,6 +80,7 @@ public final class QueryServicesTestImpl extends BaseQueryServicesImpl { private static QueryServicesOptions getDefaultServicesOptions() { return withDefaults() + .setTransactionsEnabled(DEFAULT_TRANSACTIONS_ENABLED) .setExplainChunkCount(DEFAULT_EXPLAIN_CHUNK_COUNT) .setExplainRowCount(DEFAULT_EXPLAIN_ROW_COUNT) .setSequenceSaltBuckets(DEFAULT_SEQUENCE_TABLE_SALT_BUCKETS)