use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.
the class RenewLeaseIT method doSetup.
@BeforeClass
public static void doSetup() throws Exception {
Map<String, String> serverProps = Maps.newHashMapWithExpectedSize(1);
serverProps.put("hbase.coprocessor.region.classes", SleepingRegionObserver.class.getName());
Map<String, String> clientProps = Maps.newHashMapWithExpectedSize(1);
// Must update config before starting server
serverProps.put(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, Long.toString(SCANNER_LEASE_TIMEOUT));
setUpTestDriver(new ReadOnlyProps(serverProps.entrySet().iterator()), new ReadOnlyProps(clientProps.entrySet().iterator()));
}
use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.
the class ReadOnlyPropertiesTest method testDefaultProperties.
@Test
public void testDefaultProperties() {
ReadOnlyProps defaultProps = new ReadOnlyProps(DEFAULT_PROPS_MAP);
ReadOnlyProps readOnlyProps = new ReadOnlyProps(defaultProps, EMPTY_OVERRIDE_MAP.entrySet().iterator());
assertEquals(DEFAULT_VALUE_1, readOnlyProps.get(PROPERTY_NAME_1));
assertEquals(DEFAULT_VALUE_2, readOnlyProps.get(PROPERTY_NAME_2));
}
use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.
the class ReadOnlyPropertiesTest method testAddAllOverrideProperties.
@Test
public void testAddAllOverrideProperties() {
ReadOnlyProps defaultProps = new ReadOnlyProps(DEFAULT_PROPS_MAP);
Properties overrideProps = new Properties();
overrideProps.setProperty(PROPERTY_NAME_1, OVERRIDEN_VALUE_1);
ReadOnlyProps newProps = defaultProps.addAll(overrideProps);
assertEquals(OVERRIDEN_VALUE_1, newProps.get(PROPERTY_NAME_1));
assertEquals(DEFAULT_VALUE_2, newProps.get(PROPERTY_NAME_2));
}
use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.
the class ReadOnlyPropertiesTest method testOverridingNonDefaultProperties.
@Test
public void testOverridingNonDefaultProperties() {
ReadOnlyProps defaultProps = new ReadOnlyProps(DEFAULT_PROPS_MAP);
Properties props = new Properties();
props.setProperty(PROPERTY_NAME_1, OVERRIDEN_VALUE_1);
ReadOnlyProps nonDefaultProps = defaultProps.addAll(props);
Properties overrideProps = new Properties();
overrideProps.setProperty(PROPERTY_NAME_1, OVERRIDEN_VALUE_2);
ReadOnlyProps newProps = nonDefaultProps.addAll(overrideProps);
assertEquals(OVERRIDEN_VALUE_2, newProps.get(PROPERTY_NAME_1));
assertEquals(DEFAULT_VALUE_2, newProps.get(PROPERTY_NAME_2));
}
use of org.apache.phoenix.util.ReadOnlyProps in project phoenix by apache.
the class RebuildIndexConnectionPropsIT method doSetup.
@BeforeClass
public static void doSetup() throws Exception {
Configuration conf = HBaseConfiguration.create();
hbaseTestUtil = new HBaseTestingUtility(conf);
Map<String, String> serverProps = new HashMap<>();
serverProps.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS);
// need at least one retry otherwise test fails
serverProps.put(QueryServices.INDEX_REBUILD_RPC_RETRIES_COUNTER, Long.toString(NUM_RPC_RETRIES));
setUpConfigForMiniCluster(conf, new ReadOnlyProps(serverProps.entrySet().iterator()));
hbaseTestUtil.startMiniCluster();
// establish url and quorum. Need to use PhoenixDriver and not PhoenixTestDriver
zkQuorum = "localhost:" + hbaseTestUtil.getZkCluster().getClientPort();
url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum;
Properties driverProps = PropertiesUtil.deepCopy(TEST_PROPERTIES);
DriverManager.registerDriver(PhoenixDriver.INSTANCE);
try (PhoenixConnection phxConn = DriverManager.getConnection(url, driverProps).unwrap(PhoenixConnection.class)) {
}
}
Aggregations