public static String getNewFileExtension(AccumuloConfiguration acuconf) { return acuconf.get(Property.TABLE_FILE_TYPE); }
/** * 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); }
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); }
/** * This method is for logging a server in kerberos. If this is used in client code, it will fail * unless run as the accumulo keytab's owner. Instead, use {@link #login(String, String)} */ public static void serverLogin(AccumuloConfiguration acuConf) { serverLogin(acuConf, acuConf.getPath(Property.GENERAL_KERBEROS_KEYTAB), acuConf.get(Property.GENERAL_KERBEROS_PRINCIPAL)); }
public void setKeyStoreFromConf(AccumuloConfiguration conf) throws FileNotFoundException { keyStoreSet = true; keyStorePath = storePathFromConf(conf, Property.RPC_SSL_KEYSTORE_PATH); keyStorePass = passwordFromConf(conf, conf.get(Property.INSTANCE_SECRET), Property.RPC_SSL_KEYSTORE_PASSWORD); keyStoreType = conf.get(Property.RPC_SSL_KEYSTORE_TYPE); }
public static Behavior getBehavior(AccumuloConfiguration conf) { return DeletingIterator.Behavior .valueOf(conf.get(Property.TABLE_DELETE_BEHAVIOR).toUpperCase()); } }
private HostAndPort startServer(AccumuloConfiguration conf, String address, Property portHint, TProcessor processor, String threadName) throws UnknownHostException { Property maxMessageSizeProperty = (conf.get(Property.TSERV_MAX_MESSAGE_SIZE) != null ? Property.TSERV_MAX_MESSAGE_SIZE : Property.GENERAL_MAX_MESSAGE_SIZE); ServerAddress sp = TServerUtils.startServer(context, address, portHint, processor, this.getClass().getSimpleName(), threadName, Property.TSERV_PORTSEARCH, Property.TSERV_MINTHREADS, Property.TSERV_THREADCHECK, maxMessageSizeProperty); this.server = sp.server; return sp.address; }
private static String passwordFromConf(AccumuloConfiguration conf, String defaultPassword, Property passwordOverrideProperty) { String keystorePassword = conf.get(passwordOverrideProperty); if (!keystorePassword.isEmpty()) { if (log.isTraceEnabled()) log.trace("Using explicit SSL private key password from {}", passwordOverrideProperty.getKey()); } else { keystorePassword = defaultPassword; } return keystorePassword; }
/** * Gets a property of type {@link PropertyType#COUNT}, interpreting the value properly (as an * integer). * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type */ public int getCount(Property property) { checkType(property, PropertyType.COUNT); String countString = get(property); return Integer.parseInt(countString); }
public String getTableConfig(String key) { Property property = Property.getPropertyByKey(key); if (property == null || property.isSensitive()) throw new RuntimeException("Unable to access the configuration value " + key); return tableConfig.get(property); }
public int getMaxReplicationThreads(MasterMonitorInfo mmi) { int activeTservers = mmi.getTServerInfoSize(); // The number of threads each tserver will use at most to replicate data int replicationThreadsPerServer = Integer .parseInt(context.getConfiguration().get(Property.REPLICATION_WORKER_THREADS)); // The total number of "slots" we have to replicate data return activeTservers * replicationThreadsPerServer; }
public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators( // @formatter:on IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, IteratorEnvironment env, boolean useAccumuloClassLoader, String classLoaderContext) throws IOException { return loadIteratorsHelper(scope, source, conf, ssiList, ssio, env, useAccumuloClassLoader, classLoaderContext); }
/** * Gets a property of type {@link PropertyType#FRACTION}, interpreting the value properly. * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type */ public double getFraction(Property property) { checkType(property, PropertyType.FRACTION); return ConfigurationTypeHelper.getFraction(get(property)); }
public void setTrustStoreFromConf(AccumuloConfiguration conf) throws FileNotFoundException { trustStoreSet = true; trustStorePath = storePathFromConf(conf, Property.RPC_SSL_TRUSTSTORE_PATH); trustStorePass = passwordFromConf(conf, "", Property.RPC_SSL_TRUSTSTORE_PASSWORD); trustStoreType = conf.get(Property.RPC_SSL_TRUSTSTORE_TYPE); }
/** * Create a Volume with the given FileSystem that writes to the default path * * @param fs * A FileSystem to write to * @return A Volume instance writing to the given FileSystem in the default path */ @SuppressWarnings("deprecation") public static <T extends FileSystem> Volume create(T fs, AccumuloConfiguration acuconf) { String dfsDir = acuconf.get(Property.INSTANCE_DFS_DIR); return new VolumeImpl(fs, dfsDir == null ? Property.INSTANCE_DFS_DIR.getDefaultValue() : dfsDir); }
/** * Gets a property of type {@link PropertyType#TIMEDURATION}, interpreting the value properly. * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type */ public long getTimeInMillis(Property property) { checkType(property, PropertyType.TIMEDURATION); return ConfigurationTypeHelper.getTimeInMillis(get(property)); }
@Override public String get(Property property) { String value = config.get(property.getKey()); if (value == null || !property.getType().isValidFormat(value)) { if (value != null) { log.error("Using default value for {} due to improperly formatted {}: {}", property.getKey(), property.getType(), value); } value = parent.get(property); } return value; }
private String _get(Property property) { String key = property.getKey(); String value = null; if (Property.isValidZooPropertyKey(key)) { value = getRaw(key); } if (value == null || !property.getType().isValidFormat(value)) { if (value != null) log.error("Using parent value for {} due to improperly formatted {}: {}", key, property.getType(), value); value = parent.get(property); } return value; }
private Scanner getScanner(AccumuloClient client) throws AccumuloException { try { AccumuloConfiguration conf = Monitor.getContext().getConfiguration(); final String table = conf.get(Property.TRACE_TABLE); if (!client.tableOperations().exists(table)) { return null; } return client.createScanner(table); } catch (AccumuloSecurityException | TableNotFoundException ex) { return null; } }