private void poll() { for (Map.Entry<String, ConfigHolder> entry : watchedConfigs.entrySet()) { try { if (entry.getValue().swapIfNew(dbConnector.lookup(configTable, "name", "payload", entry.getKey()))) { log.info("New value for key[%s] seen.", entry.getKey()); } } catch (Exception e) { log.warn(e, "Exception when checking property[%s]", entry.getKey()); } } }
@Override public byte[] getCurrentUserMapBytes(String prefix) { return connector.lookup( connectorConfig.getConfigTable(), MetadataStorageConnector.CONFIG_TABLE_KEY_COLUMN, MetadataStorageConnector.CONFIG_TABLE_VALUE_COLUMN, getPrefixedKeyColumn(prefix, USERS) ); }
@Override public byte[] getCurrentRoleMapBytes(String prefix) { return connector.lookup( connectorConfig.getConfigTable(), MetadataStorageConnector.CONFIG_TABLE_KEY_COLUMN, MetadataStorageConnector.CONFIG_TABLE_VALUE_COLUMN, getPrefixedKeyColumn(prefix, ROLES) ); }
@Override public byte[] getCurrentUserMapBytes(String prefix) { return connector.lookup( connectorConfig.getConfigTable(), MetadataStorageConnector.CONFIG_TABLE_KEY_COLUMN, MetadataStorageConnector.CONFIG_TABLE_VALUE_COLUMN, getPrefixedKeyColumn(prefix, USERS) ); }
@Override @SuppressWarnings("unchecked") public ConfigHolder<T> call() { if (!started) { watchedConfigs.put(key, new ConfigHolder<T>(null, serde)); } else { try { // Multiple of these callables can be submitted at the same time, but the callables themselves // are executed serially, so double check that it hasn't already been populated. if (!watchedConfigs.containsKey(key)) { byte[] value = dbConnector.lookup(configTable, "name", "payload", key); ConfigHolder<T> holder = new ConfigHolder<T>(value, serde); watchedConfigs.put(key, holder); } } catch (Exception e) { log.warn(e, "Failed loading config for key[%s]", key); watchedConfigs.put(key, new ConfigHolder<T>(null, serde)); } } return watchedConfigs.get(key); } }
private void poll() { for (Map.Entry<String, ConfigHolder> entry : watchedConfigs.entrySet()) { try { if (entry.getValue().swapIfNew(dbConnector.lookup(configTable, "name", "payload", entry.getKey()))) { log.info("New value for key[%s] seen.", entry.getKey()); } } catch (Exception e) { log.warn(e, "Exception when checking property[%s]", entry.getKey()); } } }
@Override public byte[] getCurrentRoleMapBytes(String prefix) { return connector.lookup( connectorConfig.getConfigTable(), MetadataStorageConnector.CONFIG_TABLE_KEY_COLUMN, MetadataStorageConnector.CONFIG_TABLE_VALUE_COLUMN, getPrefixedKeyColumn(prefix, ROLES) ); }
@Override public byte[] getCurrentUserMapBytes(String prefix) { return connector.lookup( connectorConfig.getConfigTable(), MetadataStorageConnector.CONFIG_TABLE_KEY_COLUMN, MetadataStorageConnector.CONFIG_TABLE_VALUE_COLUMN, getPrefixedKeyColumn(prefix, USERS) ); }
@Override public byte[] getCurrentUserMapBytes(String prefix) { return connector.lookup( connectorConfig.getConfigTable(), MetadataStorageConnector.CONFIG_TABLE_KEY_COLUMN, MetadataStorageConnector.CONFIG_TABLE_VALUE_COLUMN, getPrefixedKeyColumn(prefix, USERS) ); }
@Override @SuppressWarnings("unchecked") public ConfigHolder<T> call() { if (!started) { watchedConfigs.put(key, new ConfigHolder<T>(null, serde)); } else { try { // Multiple of these callables can be submitted at the same time, but the callables themselves // are executed serially, so double check that it hasn't already been populated. if (!watchedConfigs.containsKey(key)) { byte[] value = dbConnector.lookup(configTable, "name", "payload", key); ConfigHolder<T> holder = new ConfigHolder<T>(value, serde); watchedConfigs.put(key, holder); } } catch (Exception e) { log.warn(e, "Failed loading config for key[%s]", key); watchedConfigs.put(key, new ConfigHolder<T>(null, serde)); } } return watchedConfigs.get(key); } }