public MetricsFactory(AccumuloConfiguration conf) { this(conf.getBoolean(Property.GENERAL_LEGACY_METRICS)); }
public TabletServerMetricsFactory(AccumuloConfiguration conf) { requireNonNull(conf); useOldMetrics = conf.getBoolean(Property.GENERAL_LEGACY_METRICS); if (useOldMetrics) { metricsSystem = null; } else { metricsSystem = MetricsSystemHelper.getInstance(); } }
@Override boolean canSuspendTablets() { // Allow metadata tablets to enter suspended state only if so configured. Generally // we'll want metadata tablets to // be immediately reassigned, even if there's a global table.suspension.duration // setting. return getConfiguration().getBoolean(Property.MASTER_METADATA_SUSPENDABLE); } });
public static SaslConnectionParams from(AccumuloConfiguration config, AuthenticationToken token) { if (!config.getBoolean(Property.INSTANCE_RPC_SASL_ENABLED)) { return null; } return new SaslConnectionParams(config, token); }
public MasterMetricsFactory(AccumuloConfiguration conf, Master master) { requireNonNull(conf); useOldMetrics = conf.getBoolean(Property.GENERAL_LEGACY_METRICS); this.master = master; if (useOldMetrics) { metricsSystem = null; } else { metricsSystem = MetricsSystemHelper.getInstance(); } }
/** * Checks if the volume manager should move files to the trash rather than delete them. * * @return true if trash is used */ boolean isUsingTrash() { return !getConfiguration().getBoolean(Property.GC_TRASH_IGNORE); }
public static void start(AccumuloConfiguration conf, Property prop) { if (conf.getBoolean(prop)) { if (new File(PROC_MOUNTS).exists()) { try { new FileSystemMonitor(PROC_MOUNTS, 60000); log.info("Filesystem monitor started"); } catch (IOException e) { log.error("Failed to initialize file system monitor", e); } } else { log.info("Not monitoring filesystems, " + PROC_MOUNTS + " does not exists"); } } } }
/** * Determine the type of Thrift server to instantiate given the server's configuration. * * @return A {@link ThriftServerType} value to denote the type of Thrift server to construct */ public ThriftServerType getThriftServerType() { AccumuloConfiguration conf = getConfiguration(); if (conf.getBoolean(Property.INSTANCE_RPC_SSL_ENABLED)) { if (conf.getBoolean(Property.INSTANCE_RPC_SASL_ENABLED)) { throw new IllegalStateException( "Cannot create a Thrift server capable of both SASL and SSL"); } return ThriftServerType.SSL; } else if (conf.getBoolean(Property.INSTANCE_RPC_SASL_ENABLED)) { if (conf.getBoolean(Property.INSTANCE_RPC_SSL_ENABLED)) { throw new IllegalStateException( "Cannot create a Thrift server capable of both SASL and SSL"); } return ThriftServerType.SASL; } else { // Lets us control the type of Thrift server created, primarily for benchmarking purposes String serverTypeName = conf.get(Property.GENERAL_RPC_SERVER_TYPE); return ThriftServerType.get(serverTypeName); } }
public static void finishReplacement(AccumuloConfiguration acuTableConf, VolumeManager fs, Path location, Set<FileRef> oldDatafiles, String compactName) throws IOException { // start deleting files, if we do not finish they will be cleaned // up later for (FileRef ref : oldDatafiles) { Path path = ref.path(); Path deleteFile = new Path(location + "/delete+" + compactName + "+" + path.getName()); if (acuTableConf.getBoolean(Property.GC_TRASH_IGNORE) || !fs.moveToTrash(deleteFile)) fs.deleteRecursively(deleteFile); } }
/** * Determines if the replication is enabled for the given {@link KeyExtent} * * @param extent * The {@link KeyExtent} for the Tablet in question * @param conf * The {@link AccumuloConfiguration} for that Tablet (table or namespace) * @return True if this extent is a candidate for replication at the given point in time. */ public static boolean isEnabled(KeyExtent extent, AccumuloConfiguration conf) { if (extent.isMeta() || extent.isRootTablet()) { return false; } return conf.getBoolean(Property.TABLE_REPLICATION); }
/** Execute the operation, constructing the specified file reader. */ public FileSKVIterator build() throws IOException { /** * If the table configuration disallows caching, rewrite the options object to not pass the * caches. */ if (!getTableConfiguration().getBoolean(Property.TABLE_INDEXCACHE_ENABLED)) { withIndexCache(null); } if (!getTableConfiguration().getBoolean(Property.TABLE_BLOCKCACHE_ENABLED)) { withDataCache(null); } return openReader( toReaderBuilderOptions(dataCache, indexCache, fileLenCache, seekToBeginning)); } }
public static SslConnectionParams forConfig(AccumuloConfiguration conf, boolean server) { if (!conf.getBoolean(Property.INSTANCE_RPC_SSL_ENABLED)) return null; boolean requireClientAuth = conf.getBoolean(Property.INSTANCE_RPC_SSL_CLIENT_AUTH); if (server) { result.setClientAuth(requireClientAuth); if (conf.getBoolean(Property.RPC_USE_JSSE)) { result.setUseJsse(true); return result;
final File keytab; final String password; if (localConf.getBoolean(Property.INSTANCE_RPC_SASL_ENABLED)) { String keytabPath = getKeytab(localConf, target); keytab = new File(keytabPath);
@Override public SaslServerConnectionParams getSaslParams() { AccumuloConfiguration conf = getServerConfFactory().getSiteConfiguration(); if (!conf.getBoolean(Property.INSTANCE_RPC_SASL_ENABLED)) { return null; } return new SaslServerConnectionParams(conf, getCredentials().getToken(), secretManager); }
@Override protected FileSKVIterator openReader(FileOptions options) throws IOException { FileSKVIterator iter = findFileFactory(options).openReader(options); if (options.getTableConfiguration().getBoolean(Property.TABLE_BLOOM_ENABLED)) { return new BloomFilterLayer.Reader(iter, options.getTableConfiguration()); } else { return iter; } }
public InMemoryMap(AccumuloConfiguration config, ServerContext serverContext, Table.ID tableId) { boolean useNativeMap = config.getBoolean(Property.TSERV_NATIVEMAP_ENABLED); this.memDumpDir = config.get(Property.TSERV_MEMDUMP_DIR); this.lggroups = LocalityGroupUtil.getLocalityGroupsIgnoringErrors(config, tableId); this.config = config; this.context = serverContext; SimpleMap allMap; SimpleMap sampleMap; if (lggroups.size() == 0) { allMap = newMap(useNativeMap); sampleMap = newMap(useNativeMap); mapType = useNativeMap ? TYPE_NATIVE_MAP_WRAPPER : TYPE_DEFAULT_MAP; } else { allMap = new LocalityGroupMap(lggroups, useNativeMap); sampleMap = new LocalityGroupMap(lggroups, useNativeMap); mapType = useNativeMap ? TYPE_LOCALITY_GROUP_MAP_NATIVE : TYPE_LOCALITY_GROUP_MAP; } map = new SampleMap(allMap, sampleMap); }
replication = fs.getDefaultReplication(new Path(logPath)); long blockSize = getWalBlockSize(conf.getConfiguration()); if (conf.getConfiguration().getBoolean(Property.TSERV_WAL_SYNC)) logFile = fs.createSyncable(new Path(logPath), 0, replication, blockSize); else
@Override protected FileSKVWriter openWriter(FileOptions options) throws IOException { FileOperations fileOps = new RFileOperations(); FileSKVWriter writer = fileOps.openWriter(options); if (options.getTableConfiguration().getBoolean(Property.TABLE_BLOOM_ENABLED)) { writer = new BloomFilterLayer.Writer(writer, options.getTableConfiguration(), options.isAccumuloStartEnabled()); } return SummaryWriter.wrap(writer, options.getTableConfiguration(), options.isAccumuloStartEnabled()); }
.equals(Property.TRACE_TOKEN_TYPE.getDefaultValue()); String principal = conf.get(Property.TRACE_USER); if (conf.getBoolean(Property.INSTANCE_RPC_SASL_ENABLED)) {
if (getConfiguration().getBoolean(Property.INSTANCE_RPC_SASL_ENABLED)) {