private String getDefaultConfigValue(String key) { if (key == null) return null; String defaultValue = null; try { Property p = Property.getPropertyByKey(key); if (p == null) return defaultValue; defaultValue = defaultConfig.get(p); } catch (IllegalArgumentException e) { // ignore } return defaultValue; }
private static void exportConfig(ServerContext context, Table.ID tableID, ZipOutputStream zipOut, DataOutputStream dataOut) throws AccumuloException, AccumuloSecurityException, IOException { DefaultConfiguration defaultConfig = DefaultConfiguration.getInstance(); Map<String,String> siteConfig = context.instanceOperations().getSiteConfiguration(); Map<String,String> systemConfig = context.instanceOperations().getSystemConfiguration(); TableConfiguration tableConfig = context.getServerConfFactory().getTableConfiguration(tableID); OutputStreamWriter osw = new OutputStreamWriter(dataOut, UTF_8); // only put props that are different than defaults and higher level configurations zipOut.putNextEntry(new ZipEntry(Constants.EXPORT_TABLE_CONFIG_FILE)); for (Entry<String,String> prop : tableConfig) { if (prop.getKey().startsWith(Property.TABLE_PREFIX.getKey())) { Property key = Property.getPropertyByKey(prop.getKey()); if (key == null || !defaultConfig.get(key).equals(prop.getValue())) { if (!prop.getValue().equals(siteConfig.get(prop.getKey())) && !prop.getValue().equals(systemConfig.get(prop.getKey()))) { osw.append(prop.getKey() + "=" + prop.getValue() + "\n"); } } } } osw.flush(); } }
@Override public String get(Property property) { String value = xml.get(property.getKey()); if (value != null) return value; return DefaultConfiguration.getInstance().get(property); } };
private String getDefaultConfigValue(String key) { if (null == key) return null; String defaultValue = null; try { Property p = Property.getPropertyByKey(key); if (null == p) return defaultValue; defaultValue = defaultConfig.get(p); } catch (IllegalArgumentException e) { // ignore } return defaultValue; }
@Override public String get(Property property) { String value = xml.get(property.getKey()); if (value != null) return value; return DefaultConfiguration.getInstance().get(property); }
private static void exportConfig(Connector conn, String tableID, ZipOutputStream zipOut, DataOutputStream dataOut) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, IOException { DefaultConfiguration defaultConfig = AccumuloConfiguration.getDefaultConfiguration(); Map<String,String> siteConfig = conn.instanceOperations().getSiteConfiguration(); Map<String,String> systemConfig = conn.instanceOperations().getSystemConfiguration(); TableConfiguration tableConfig = ServerConfiguration.getTableConfiguration(conn.getInstance(), tableID); OutputStreamWriter osw = new OutputStreamWriter(dataOut, UTF_8); // only put props that are different than defaults and higher level configurations zipOut.putNextEntry(new ZipEntry(Constants.EXPORT_TABLE_CONFIG_FILE)); for (Entry<String,String> prop : tableConfig) { if (prop.getKey().startsWith(Property.TABLE_PREFIX.getKey())) { Property key = Property.getPropertyByKey(prop.getKey()); if (key == null || !defaultConfig.get(key).equals(prop.getValue())) { if (!prop.getValue().equals(siteConfig.get(prop.getKey())) && !prop.getValue().equals(systemConfig.get(prop.getKey()))) { osw.append(prop.getKey() + "=" + prop.getValue() + "\n"); } } } } osw.flush(); } }
getCluster().getConfig().getSiteConfig().get(Property.INSTANCE_ZK_TIMEOUT.getKey())); IZooReaderWriter zrw = new ZooReaderWriterFactory().getZooReaderWriter( getCluster().getZooKeepers(), (int) zkTimeout, defaultConfig.get(Property.INSTANCE_SECRET)); final String zInstanceRoot = Constants.ZROOT + "/" + conn.getInstance().getInstanceID(); while (!AccumuloStatus.isAccumuloOffline(zrw, zInstanceRoot)) {
Property key = Property.getPropertyByKey(prop.getKey()); if (key == null || !defaultConfig.get(key).equals(prop.getValue())) { if (!prop.getValue().equals(siteConfig.get(prop.getKey())) && !prop.getValue().equals(systemConfig.get(prop.getKey()))) {
cryptoModuleName = AccumuloConfiguration.getDefaultConfiguration().get(Property.CRYPTO_MODULE_CLASS);