public Map<String,String> getTableProperties() { return tableConfig.getAllPropertiesWithPrefix(Property.TABLE_PREFIX); }
@Override public Map<String,String> getVfsContextClasspathProperties() { return getConfiguration() .getAllPropertiesWithPrefix(Property.VFS_CONTEXT_CLASSPATH_PROPERTY); } });
protected String getPeerType(String peerName) { // Find the configured replication peer so we know how to replicate to it Map<String,String> configuredPeers = conf .getAllPropertiesWithPrefix(Property.REPLICATION_PEERS); String peerType = configuredPeers.get(Property.REPLICATION_PEERS.getKey() + peerName); if (peerType == null) { String msg = "Cannot process replication for unknown peer: " + peerName; log.warn(msg); throw new IllegalArgumentException(msg); } return peerType; }
@Override public Map<String,String> getVfsContextClasspathProperties() { return getConfiguration() .getAllPropertiesWithPrefix(Property.VFS_CONTEXT_CLASSPATH_PROPERTY); } });
public static List<SummarizerConfiguration> getSummarizerConfigs(AccumuloConfiguration aconf) { Map<String,String> sprops = aconf.getAllPropertiesWithPrefix(Property.TABLE_SUMMARIZER_PREFIX); return getSummarizerConfigsFiltered(new TreeMap<>(sprops)); }
public static SamplerConfigurationImpl newSamplerConfig(AccumuloConfiguration acuconf) { String className = acuconf.get(Property.TABLE_SAMPLER); if (className == null || className.equals("")) { return null; } Map<String,String> rawOptions = acuconf.getAllPropertiesWithPrefix(Property.TABLE_SAMPLER_OPTS); Map<String,String> options = new HashMap<>(); for (Entry<String,String> entry : rawOptions.entrySet()) { String key = entry.getKey().substring(Property.TABLE_SAMPLER_OPTS.getKey().length()); options.put(key, entry.getValue()); } return new SamplerConfigurationImpl(className, options); }
protected String getPassword(AccumuloConfiguration localConf, ReplicationTarget target) { requireNonNull(localConf); requireNonNull(target); Map<String,String> peerPasswords = localConf .getAllPropertiesWithPrefix(Property.REPLICATION_PEER_PASSWORD); String password = peerPasswords .get(Property.REPLICATION_PEER_PASSWORD.getKey() + target.getPeerName()); if (password == null) { throw new IllegalArgumentException("Cannot get password for " + target.getPeerName()); } return password; }
/** * Collects together properties from the given configuration pertaining to compaction strategies. * The relevant properties all begin with the prefix in {@link #TABLE_COMPACTION_STRATEGY_PREFIX}. * In the returned map, the prefix is removed from each property's key. * * @param tableConf * configuration * @return map of compaction strategy property keys and values, with the detection prefix removed * from each key */ public static Map<String,String> getCompactionStrategyOptions(AccumuloConfiguration tableConf) { Map<String,String> longNames = tableConf .getAllPropertiesWithPrefix(Property.TABLE_COMPACTION_STRATEGY_PREFIX); Map<String,String> result = new HashMap<>(); for (Entry<String,String> entry : longNames.entrySet()) { result.put( entry.getKey().substring(Property.TABLE_COMPACTION_STRATEGY_PREFIX.getKey().length()), entry.getValue()); } return result; }
/** * Re-reads the max threads from the configuration that created this class */ public int getCurrentMaxThreads() { Integer depThreads = getDeprecatedScanThreads(name); if (depThreads != null) { return depThreads; } String prop = Property.TSERV_SCAN_EXECUTORS_PREFIX.getKey() + name + "." + SCAN_EXEC_THREADS; String val = getAllPropertiesWithPrefix(Property.TSERV_SCAN_EXECUTORS_PREFIX).get(prop); return Integer.parseInt(val); } }
protected String getPrincipal(AccumuloConfiguration localConf, ReplicationTarget target) { requireNonNull(localConf); requireNonNull(target); String peerName = target.getPeerName(); String userKey = Property.REPLICATION_PEER_USER.getKey() + peerName; Map<String,String> peerUsers = localConf .getAllPropertiesWithPrefix(Property.REPLICATION_PEER_USER); String user = peerUsers.get(userKey); if (user == null) { throw new IllegalArgumentException("Cannot get user for " + target.getPeerName()); } return user; }
protected String getKeytab(AccumuloConfiguration localConf, ReplicationTarget target) { requireNonNull(localConf); requireNonNull(target); Map<String,String> peerKeytabs = localConf .getAllPropertiesWithPrefix(Property.REPLICATION_PEER_KEYTAB); String keytab = peerKeytabs .get(Property.REPLICATION_PEER_KEYTAB.getKey() + target.getPeerName()); if (keytab == null) { throw new IllegalArgumentException("Cannot get keytab for " + target.getPeerName()); } return keytab; }
public static void parseIterConf(IteratorScope scope, List<IterInfo> iters, Map<String,Map<String,String>> allOptions, AccumuloConfiguration conf) { final Property scopeProperty = getProperty(scope); final String scopePropertyKey = scopeProperty.getKey(); for (Entry<String,String> entry : conf.getAllPropertiesWithPrefix(scopeProperty).entrySet()) { String suffix = entry.getKey().substring(scopePropertyKey.length()); String suffixSplit[] = suffix.split("\\.", 3); if (suffixSplit.length == 1) { String sa[] = entry.getValue().split(","); int prio = Integer.parseInt(sa[0]); String className = sa[1]; iters.add(new IterInfo(prio, className, suffixSplit[0])); } else if (suffixSplit.length == 3 && suffixSplit[1].equals("opt")) { String iterName = suffixSplit[0]; String optName = suffixSplit[2]; Map<String,String> options = allOptions.get(iterName); if (options == null) { options = new HashMap<>(); allOptions.put(iterName, options); } options.put(optName, entry.getValue()); } else { throw new IllegalArgumentException("Invalid iterator format: " + entry.getKey()); } } Collections.sort(iters, ITER_INFO_COMPARATOR); }
@Override public void run() { Set<String> contextProperties = context.getServerConfFactory().getSystemConfiguration() .getAllPropertiesWithPrefix(Property.VFS_CONTEXT_CLASSPATH_PROPERTY).keySet(); Set<String> configuredContexts = new HashSet<>(); for (String prop : contextProperties) { configuredContexts .add(prop.substring(Property.VFS_CONTEXT_CLASSPATH_PROPERTY.name().length())); } try { AccumuloVFSClassLoader.getContextManager().removeUnusedContexts(configuredContexts); } catch (IOException e) { log.warn("{}", e.getMessage(), e); } } };
/** * Extract replication peers from system configuration * * @return Configured replication peers */ public Map<String,String> getPeers() { Map<String,String> peers = new HashMap<>(); // Get the defined peers and what ReplicaSystem impl they're using for (Entry<String,String> property : context.getConfiguration() .getAllPropertiesWithPrefix(Property.REPLICATION_PEERS).entrySet()) { String key = property.getKey(); // Filter out cruft that we don't want if (!key.startsWith(Property.REPLICATION_PEER_USER.getKey()) && !key.startsWith(Property.REPLICATION_PEER_PASSWORD.getKey()) && !key.startsWith(Property.REPLICATION_PEER_KEYTAB.getKey())) { String peerName = property.getKey().substring(Property.REPLICATION_PEERS.getKey().length()); Entry<String,String> entry; try { entry = factory.parseReplicaSystemConfiguration(property.getValue()); } catch (Exception e) { log.warn("Could not instantiate ReplicaSystem for {} with configuration {}", property.getKey(), property.getValue(), e); continue; } peers.put(peerName, entry.getKey()); } } return peers; }
for (Entry<String,String> entry : getAllPropertiesWithPrefix( Property.TSERV_SCAN_EXECUTORS_PREFIX).entrySet()) {
public static CryptoService newInstance(AccumuloConfiguration conf, ClassloaderType ct) { CryptoService newCryptoService; if (ct == ClassloaderType.ACCUMULO) { newCryptoService = Property.createInstanceFromPropertyName(conf, Property.INSTANCE_CRYPTO_SERVICE, CryptoService.class, new NoCryptoService()); } else if (ct == ClassloaderType.JAVA) { String clazzName = conf.get(Property.INSTANCE_CRYPTO_SERVICE); if (clazzName == null || clazzName.trim().isEmpty()) { newCryptoService = new NoCryptoService(); } else { try { newCryptoService = CryptoServiceFactory.class.getClassLoader().loadClass(clazzName) .asSubclass(CryptoService.class).newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new RuntimeException(e); } } } else { throw new IllegalArgumentException(); } newCryptoService.init(conf.getAllPropertiesWithPrefix(Property.INSTANCE_CRYPTO_PREFIX)); return newCryptoService; }
.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX); String keyTab = loginMap.get(Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey() + "keytab"); if (keyTab == null || keyTab.length() == 0) {
public BlockCacheConfiguration(AccumuloConfiguration conf) { genProps = conf.getAllPropertiesWithPrefix(Property.TSERV_PREFIX); this.indexMaxSize = conf.getAsBytes(Property.TSERV_INDEXCACHE_SIZE); this.dataMaxSize = conf.getAsBytes(Property.TSERV_DATACACHE_SIZE); this.summaryMaxSize = conf.getAsBytes(Property.TSERV_SUMMARYCACHE_SIZE); this.blockSize = conf.getAsBytes(Property.TSERV_DEFAULT_BLOCKSIZE); }
/** * Enable tracing by setting up SpanReceivers for the current process. If host name is null, it * will be determined. If service name is null, the simple name of the class will be used. */ public static void enable(String hostname, String service, AccumuloConfiguration conf) { String spanReceivers = conf.get(Property.TRACE_SPAN_RECEIVERS); String zookeepers = conf.get(Property.INSTANCE_ZK_HOST); long timeout = conf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT); String zkPath = conf.get(Property.TRACE_ZK_PATH); Map<String,String> properties = conf .getAllPropertiesWithPrefix(Property.TRACE_SPAN_RECEIVER_PREFIX); enableTracing(hostname, service, spanReceivers, zookeepers, timeout, zkPath, properties); }
.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX); if (loginMap.isEmpty() && isDefaultTokenType) {