Search in sources :

Example 6 with ReadOnlyProps

use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.

the class QueryTimeoutIT method testSetRPCTimeOnConnection.

@Test
public void testSetRPCTimeOnConnection() throws Exception {
    Properties overriddenProps = PropertiesUtil.deepCopy(TEST_PROPERTIES);
    overriddenProps.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS);
    overriddenProps.setProperty("hbase.rpc.timeout", Long.toString(100));
    String url = QueryUtil.getConnectionUrl(overriddenProps, config, "longRunning");
    Connection conn1 = DriverManager.getConnection(url, overriddenProps);
    ConnectionQueryServices s1 = conn1.unwrap(PhoenixConnection.class).getQueryServices();
    ReadOnlyProps configProps = s1.getProps();
    assertEquals("100", configProps.get("hbase.rpc.timeout"));
    Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
    props.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS);
    Connection conn2 = DriverManager.getConnection(getUrl(), props);
    ConnectionQueryServices s2 = conn2.unwrap(PhoenixConnection.class).getQueryServices();
    assertFalse(s1 == s2);
    Connection conn3 = DriverManager.getConnection(getUrl(), props);
    ConnectionQueryServices s3 = conn3.unwrap(PhoenixConnection.class).getQueryServices();
    assertTrue(s2 == s3);
    Connection conn4 = DriverManager.getConnection(url, overriddenProps);
    ConnectionQueryServices s4 = conn4.unwrap(PhoenixConnection.class).getQueryServices();
    assertTrue(s1 == s4);
}
Also used : ReadOnlyProps(org.apache.phoenix.util.ReadOnlyProps) PhoenixConnection(org.apache.phoenix.jdbc.PhoenixConnection) Connection(java.sql.Connection) PhoenixConnection(org.apache.phoenix.jdbc.PhoenixConnection) Properties(java.util.Properties) ConnectionQueryServices(org.apache.phoenix.query.ConnectionQueryServices) Test(org.junit.Test)

Example 7 with ReadOnlyProps

use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.

the class QueryWithLimitIT method doSetup.

@BeforeClass
public static void doSetup() throws Exception {
    Map<String, String> props = Maps.newHashMapWithExpectedSize(3);
    // Must update config before starting server
    props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(50));
    props.put(QueryServices.QUEUE_SIZE_ATTRIB, Integer.toString(1));
    props.put(QueryServices.DROP_METADATA_ATTRIB, Boolean.TRUE.toString());
    // Prevents RejectedExecutionException when deleting sequences
    props.put(QueryServices.SEQUENCE_SALT_BUCKETS_ATTRIB, Integer.toString(0));
    props.put(QueryServices.THREAD_POOL_SIZE_ATTRIB, Integer.toString(4));
    setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
Also used : ReadOnlyProps(org.apache.phoenix.util.ReadOnlyProps) BeforeClass(org.junit.BeforeClass)

Example 8 with ReadOnlyProps

use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.

the class SequenceBulkAllocationIT method doSetup.

@BeforeClass
@Shadower(classBeingShadowed = BaseClientManagedTimeIT.class)
public static void doSetup() throws Exception {
    Map<String, String> props = getDefaultProps();
    // Must update config before starting server
    props.put(QueryServices.SEQUENCE_CACHE_SIZE_ATTRIB, Long.toString(BATCH_SIZE));
    setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
Also used : ReadOnlyProps(org.apache.phoenix.util.ReadOnlyProps) BeforeClass(org.junit.BeforeClass)

Example 9 with ReadOnlyProps

use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.

the class ExplainPlanWithStatsEnabledIT method doSetup.

@BeforeClass
public static void doSetup() throws Exception {
    Map<String, String> props = Maps.newHashMapWithExpectedSize(1);
    props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(20));
    setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
    tableA = generateUniqueName();
    initDataAndStats(tableA);
    tableB = generateUniqueName();
    initDataAndStats(tableB);
}
Also used : ReadOnlyProps(org.apache.phoenix.util.ReadOnlyProps) BeforeClass(org.junit.BeforeClass)

Example 10 with ReadOnlyProps

use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.

the class SkipScanBigFilterTest method doSetup.

@BeforeClass
@Shadower(classBeingShadowed = BaseConnectionlessQueryTest.class)
public static void doSetup() throws Exception {
    Map<String, String> props = Maps.newHashMapWithExpectedSize(1);
    // enables manual splitting on salted tables
    props.put(QueryServices.FORCE_ROW_KEY_ORDER_ATTRIB, Boolean.toString(false));
    initDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
Also used : ReadOnlyProps(org.apache.phoenix.util.ReadOnlyProps) BeforeClass(org.junit.BeforeClass) Shadower(org.apache.phoenix.end2end.Shadower)

Aggregations

ReadOnlyProps (org.apache.phoenix.util.ReadOnlyProps)72 BeforeClass (org.junit.BeforeClass)43 Test (org.junit.Test)14 IOException (java.io.IOException)6 Properties (java.util.Properties)6 PhoenixIOException (org.apache.phoenix.exception.PhoenixIOException)6 ResultSet (java.sql.ResultSet)5 Configuration (org.apache.hadoop.conf.Configuration)5 HBaseAdmin (org.apache.hadoop.hbase.client.HBaseAdmin)5 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)4 HBaseTestingUtility (org.apache.hadoop.hbase.HBaseTestingUtility)4 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)4 PhoenixConnection (org.apache.phoenix.jdbc.PhoenixConnection)4 Connection (java.sql.Connection)3 Mutation (org.apache.hadoop.hbase.client.Mutation)3 Batch (org.apache.hadoop.hbase.client.coprocessor.Batch)3 BlockingRpcCallback (org.apache.hadoop.hbase.ipc.BlockingRpcCallback)3 ServerRpcController (org.apache.hadoop.hbase.ipc.ServerRpcController)3 MutationProto (org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto)3 MetaDataMutationResult (org.apache.phoenix.coprocessor.MetaDataProtocol.MetaDataMutationResult)3