/** * 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 MetricsFactory(AccumuloConfiguration conf) { this(conf.getBoolean(Property.GENERAL_LEGACY_METRICS)); }
private synchronized void initBloomFilter(AccumuloConfiguration acuconf, boolean useAccumuloStart) { numKeys = acuconf.getCount(Property.TABLE_BLOOM_SIZE); double errorRate = acuconf.getFraction(Property.TABLE_BLOOM_ERRORRATE); vectorSize = (int) Math .ceil(-HASH_COUNT * numKeys / Math.log(1.0 - Math.pow(errorRate, 1.0 / HASH_COUNT))); bloomFilter = new DynamicBloomFilter(vectorSize, HASH_COUNT, Hash.parseHashType(acuconf.get(Property.TABLE_BLOOM_HASHTYPE)), numKeys); String context = acuconf.get(Property.TABLE_CLASSPATH); String classname = acuconf.get(Property.TABLE_BLOOM_KEY_FUNCTOR); Class<? extends KeyFunctor> clazz; if (!useAccumuloStart) LOG.error("Failed to find KeyFunctor: " + acuconf.get(Property.TABLE_BLOOM_KEY_FUNCTOR), e); throw new IllegalArgumentException( "Failed to find KeyFunctor: " + acuconf.get(Property.TABLE_BLOOM_KEY_FUNCTOR));
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); }
public ZooReaderWriter(AccumuloConfiguration conf) { this(conf.get(Property.INSTANCE_ZK_HOST), (int) conf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT), conf.get(Property.INSTANCE_SECRET)); }
@Override public AccumuloConfiguration getConfig() { return AccumuloConfiguration.getDefaultConfiguration(); }
public static Behavior getBehavior(AccumuloConfiguration conf) { return DeletingIterator.Behavior .valueOf(conf.get(Property.TABLE_DELETE_BEHAVIOR).toUpperCase()); } }
final AccumuloConfiguration config = service.getConfiguration(); final int[] portHint = config.getPort(portHintProperty); minThreads = config.getCount(minThreadProperty); timeBetweenThreadChecks = config.getTimeInMillis(timeBetweenThreadChecksProperty); maxMessageSize = config.getAsBytes(maxMessageSizeProperty); portSearch = config.getBoolean(portSearchProperty); .getCount(Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE); final ThriftServerType serverType = service.getThriftServerType();
private DfsLogger(ServerContext context, ServerResources conf) { this.context = context; this.conf = conf; this.slowFlushMillis = conf.getConfiguration() .getTimeInMillis(Property.TSERV_SLOW_FLUSH_MILLIS); }
final ClientContext peerContext, final UserGroupInformation accumuloUgi) { try { double tracePercent = localConf.getFraction(Property.REPLICATION_TRACE_PERCENT); ProbabilitySampler sampler = TraceSamplers.probabilitySampler(tracePercent); Trace.on("AccumuloReplicaSystem", sampler); int numAttempts = localConf.getCount(Property.REPLICATION_WORK_ATTEMPTS); for (int i = 0; i < numAttempts; i++) { log.debug("Attempt {}", i); final long timeout = localConf.getTimeInMillis(Property.REPLICATION_RPC_TIMEOUT); final long sizeLimit = conf.getAsBytes(Property.REPLICATION_MAX_UNIT_SIZE); try { if (p.getName().endsWith(RFILE_SUFFIX)) {
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); }
/** * Gets a property of type {@link PropertyType#MEMORY}, interpreting the value properly. * * @param property * property to get * @return property value * @throws IllegalArgumentException * if the property is of the wrong type * @see #getMemoryInBytes(String) */ public long getMemoryInBytes(Property property) { checkType(property, PropertyType.MEMORY); String memString = get(property); return getMemoryInBytes(memString); }
/** * 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)); }
@Override public void run() { ProbabilitySampler sampler = TraceSamplers .probabilitySampler(conf.getFraction(Property.REPLICATION_TRACE_PERCENT)); long millisToWait = conf.getTimeInMillis(Property.REPLICATION_DRIVER_DELAY); log.debug("Waiting {}ms before starting main replication loop", millisToWait); UtilWaitThread.sleep(millisToWait); long sleepMillis = conf.getTimeInMillis(Property.MASTER_REPLICATION_SCAN_INTERVAL); log.debug("Sleeping for {}ms before re-running", sleepMillis); try {
@Override public Long convert(String value) { return AccumuloConfiguration.getMemoryInBytes(value); } }
log.info("Instance {}", context.getInstanceID()); AccumuloConfiguration conf = serverConfiguration.getSystemConfiguration(); tableName = conf.get(Property.TRACE_TABLE); accumuloClient = ensureTraceTableExists(conf); int ports[] = conf.getPort(Property.TRACE_PORT); ServerSocket sock = null; for (int port : ports) { server = new TThreadPoolServer(options); registerInZooKeeper(sock.getInetAddress().getHostAddress() + ":" + sock.getLocalPort(), conf.get(Property.TRACE_ZK_PATH)); writer = new AtomicReference<>(this.accumuloClient.createBatchWriter(tableName, new BatchWriterConfig().setMaxLatency(BATCH_WRITER_MAX_LATENCY, TimeUnit.SECONDS)));
private HostAndPort startStatsService() throws UnknownHostException { Iface rpcProxy = RpcWrapper.service(this, new Processor<Iface>(this)); final Processor<Iface> processor; if (ThriftServerType.SASL == getThriftServerType()) { Iface tcProxy = TCredentialsUpdatingWrapper.service(rpcProxy, getClass(), getConfiguration()); processor = new Processor<>(tcProxy); } else { processor = new Processor<>(rpcProxy); } int port[] = getConfiguration().getPort(Property.GC_PORT); HostAndPort[] addresses = TServerUtils.getHostAndPorts(this.opts.getAddress(), port); long maxMessageSize = getConfiguration().getMemoryInBytes(Property.GENERAL_MAX_MESSAGE_SIZE); try { ServerAddress server = TServerUtils.startTServer(getConfiguration(), getThriftServerType(), processor, this.getClass().getSimpleName(), "GC Monitor Service", 2, getConfiguration().getCount(Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE), 1000, maxMessageSize, getServerSslParams(), getSaslParams(), 0, addresses); log.debug("Starting garbage collector listening on " + server.address); return server.address; } catch (Exception ex) { // ACCUMULO-3651 Level changed to error and FATAL added to message for slf4j compatibility log.error("FATAL:", ex); throw new RuntimeException(ex); } }
public Map<String,String> getTableProperties() { return tableConfig.getAllPropertiesWithPrefix(Property.TABLE_PREFIX); }
@Override public void init(ServerConfiguration conf) { this.config = conf; maxMemory = conf.getConfiguration().getMemoryInBytes(Property.TSERV_MAXMEM); maxConcurrentMincs = conf.getConfiguration().getCount(Property.TSERV_MINC_MAXCONCURRENT); numWaitingMultiplier = TSERV_MINC_MAXCONCURRENT_NUMWAITING_MULTIPLIER; }
/** * 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 * @see #getFraction(String) */ public double getFraction(Property property) { checkType(property, PropertyType.FRACTION); return getFraction(get(property)); }