@Override public String get(String name) { String[] prefixes = new String[]{DRIVER_PFX + driverType + ".", DRIVER_PFX + driverClassType + ".", DRIVER_PFX, }; for (String prefix : prefixes) { if (name.startsWith(prefix)) { return getInternal(name.substring(prefix.length())); } } return getInternal(name); }
@Test(dataProvider = "keyData") public void testSetAndGet(String keyToSet, String keyToGet) { DriverConfiguration conf = new DriverConfiguration(DRIVER_TYPE, MockDriver.class); conf.set(keyToSet, VALUE); assertEquals(conf.get(keyToGet), VALUE); } }
@Override public void configure(Configuration conf, String driverType, String driverName) throws LensException { if (StringUtils.isBlank(driverType) || StringUtils.isBlank(driverName)) { throw new LensException("Driver Type and Name can not be null or empty"); } fullyQualifiedName = driverType + SEPARATOR + driverName; this.conf = new DriverConfiguration(conf, driverType, getClass()); this.conf.addResource(getClass().getSimpleName().toLowerCase() + "-default.xml"); this.conf.addResource(getDriverResourcePath(getClass().getSimpleName().toLowerCase() + "-site.xml")); this.queryConstraints = getImplementations(QUERY_LAUNCHING_CONSTRAINT_FACTORIES_SFX, getConf()); this.waitingQuerySelectionPolicies = getImplementations(WAITING_QUERIES_SELECTION_POLICY_FACTORIES_SFX, getConf()); loadRetryPolicyDecider(); loadQueryHook(); }
@Override public void configure(Configuration conf, String driverType, String driverName) throws LensException { if (StringUtils.isBlank(driverType) || StringUtils.isBlank(driverName)) { throw new LensException("Driver Type and Name can not be null or empty"); } fullyQualifiedName = driverType + SEPARATOR + driverName; this.conf = new DriverConfiguration(conf, driverType, getClass()); this.conf.addResource(getClass().getSimpleName().toLowerCase() + "-default.xml"); this.conf.addResource(getDriverResourcePath(getClass().getSimpleName().toLowerCase() + "-site.xml")); this.queryConstraints = getImplementations(QUERY_LAUNCHING_CONSTRAINT_FACTORIES_SFX, getConf()); this.waitingQuerySelectionPolicies = getImplementations(WAITING_QUERIES_SELECTION_POLICY_FACTORIES_SFX, getConf()); loadRetryPolicyDecider(); loadQueryHook(); }
@Override public String get(String name) { String[] prefixes = new String[]{DRIVER_PFX + driverType + ".", DRIVER_PFX + driverClassType + ".", DRIVER_PFX, }; for (String prefix : prefixes) { if (name.startsWith(prefix)) { return getInternal(name.substring(prefix.length())); } } return getInternal(name); }