@Override public int getMaxInstances() { return cConf.getInt(Constants.MessagingSystem.MAX_INSTANCES); } }
@Override public int getMaxInstances() { return cConf.getInt(Constants.MessagingSystem.MAX_INSTANCES); } }
/** * Constructor only takes the configuration to determine the maximal allowed length for a key. */ public MetadataValidator(CConfiguration cConf) { maxCharacters = cConf.getInt(Constants.Metadata.MAX_CHARS_ALLOWED); }
@Inject public LevelDBDatasetMetricsReporter(MetricsCollectionService metricsService, LevelDBTableService ldbService, DatasetFramework dsFramework, CConfiguration conf) { this.metricsService = metricsService; this.ldbService = ldbService; this.reportIntervalInSec = conf.getInt(Constants.Metrics.Dataset.LEVELDB_STATS_REPORT_INTERVAL); this.dsFramework = dsFramework; }
@Inject public HBaseDatasetMetricsReporter(MetricsCollectionService metricsService, HBaseTableUtil hBaseTableUtil, Configuration hConf, CConfiguration conf, DatasetFramework dsFramework) { this.metricsService = metricsService; this.hBaseTableUtil = hBaseTableUtil; this.hConf = hConf; this.reportIntervalInSec = conf.getInt(Constants.Metrics.Dataset.HBASE_STATS_REPORT_INTERVAL); this.dsFramework = dsFramework; }
@Inject public HBaseDatasetMetricsReporter(MetricsCollectionService metricsService, HBaseTableUtil hBaseTableUtil, Configuration hConf, CConfiguration conf, DatasetFramework dsFramework) { this.metricsService = metricsService; this.hBaseTableUtil = hBaseTableUtil; this.hConf = hConf; this.reportIntervalInSec = conf.getInt(Constants.Metrics.Dataset.HBASE_STATS_REPORT_INTERVAL); this.dsFramework = dsFramework; }
private int getRollTime(int resolution) { String key = Constants.Metrics.TIME_SERIES_TABLE_ROLL_TIME + "." + resolution; String value = cConf.get(key); if (value != null) { return cConf.getInt(key, Constants.Metrics.DEFAULT_TIME_SERIES_TABLE_ROLL_TIME); } return cConf.getInt(Constants.Metrics.TIME_SERIES_TABLE_ROLL_TIME, Constants.Metrics.DEFAULT_TIME_SERIES_TABLE_ROLL_TIME); } }
@Inject public StringPartitioner(CConfiguration cConf) { this.numPartitions = cConf.getInt(Constants.Logging.NUM_PARTITIONS); Preconditions.checkArgument(this.numPartitions > 0, "numPartitions should be greater than 0. Got numPartitions=%s", this.numPartitions); }
private int getRollTime(int resolution) { String key = Constants.Metrics.TIME_SERIES_TABLE_ROLL_TIME + "." + resolution; String value = cConf.get(key); if (value != null) { return cConf.getInt(key, Constants.Metrics.DEFAULT_TIME_SERIES_TABLE_ROLL_TIME); } return cConf.getInt(Constants.Metrics.TIME_SERIES_TABLE_ROLL_TIME, Constants.Metrics.DEFAULT_TIME_SERIES_TABLE_ROLL_TIME); } }
@Inject public MRJobClient(CConfiguration cConf, Configuration hConf) { int numRetries = cConf.getInt(Constants.AppFabric.MAPREDUCE_JOB_CLIENT_CONNECT_MAX_RETRIES); this.hConf = new Configuration(hConf); // Override a cloned hConf's configuration of IPC Client max retries based upon value in CConf to avoid longer // amounts of retrying (this is helpful especially when the Job History Server is not installed) this.hConf.setInt(CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, numRetries); }
@Inject public ExploreFacade(ExploreClient exploreClient, CConfiguration cConf) { this.exploreClient = exploreClient; this.exploreEnabled = cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED); if (!exploreEnabled) { LOG.warn("Explore functionality for datasets is disabled. All calls to enable explore will be no-ops"); } this.httpTimeout = cConf.getInt(Constants.Explore.HTTP_TIMEOUT); }
/** * An AbstractKeyManager that has common functionality of all keymanagers. * @param conf */ public AbstractKeyManager(CConfiguration conf) { this(conf.get(Constants.Security.TOKEN_DIGEST_ALGO), conf.getInt(Constants.Security.TOKEN_DIGEST_KEY_LENGTH)); }
ProgramStatusEventSubscriberService() { // Fetch transactionally since publishing from AppMetadataStore is transactional. super("scheduler.program.event", cConf.get(Constants.AppFabric.PROGRAM_STATUS_RECORD_EVENT_TOPIC), cConf.getInt(Constants.Scheduler.PROGRAM_STATUS_EVENT_FETCH_SIZE), true); }
@Inject LocalMetricsCollectionService(CConfiguration cConf, MetricStore metricStore) { super(TimeUnit.SECONDS.toMillis(cConf.getInt(Constants.Metrics.METRICS_MINIMUM_RESOLUTION_SECONDS))); this.cConf = cConf; this.metricStore = metricStore; metricStore.setMetricsContext(this.getContext(METRICS_PROCESSOR_CONTEXT)); }
@Inject TMSLogAppender(CConfiguration cConf, MessagingService messagingService) { setName(APPENDER_NAME); int queueSize = cConf.getInt(Constants.Logging.TMS_APPENDER_QUEUE_SIZE); this.tmsLogPublisher = new TMSLogPublisher(cConf, messagingService, queueSize); }
/** * For guice injecting configuration object to this singleton. */ @Inject public void setConfiguration(CConfiguration config) { basePath = config.get(Constants.CFG_DATA_LEVELDB_DIR); Preconditions.checkNotNull(basePath, "No base directory configured for LevelDB."); blockSize = config.getInt(Constants.CFG_DATA_LEVELDB_BLOCKSIZE, Constants.DEFAULT_DATA_LEVELDB_BLOCKSIZE); cacheSize = config.getLong(Constants.CFG_DATA_LEVELDB_CACHESIZE, Constants.DEFAULT_DATA_LEVELDB_CACHESIZE); writeOptions = new WriteOptions().sync( config.getBoolean(Constants.CFG_DATA_LEVELDB_FSYNC, Constants.DEFAULT_DATA_LEVELDB_FSYNC)); }
/** * Returns the base URI for making REST calls to the standalone instance. */ public URI getBaseURI() { return URI.create(String.format("http://%s:%d/", getConfiguration().get(Constants.Router.ADDRESS), getConfiguration().getInt(Constants.Router.ROUTER_PORT))); }
@BeforeClass public static void setup() throws Exception { Injector injector = Guice.createInjector(new IOModule() , new ConfigModule(), new FileBasedSecurityModule(), new InMemoryDiscoveryModule()); CConfiguration conf = injector.getInstance(CConfiguration.class); keyIdentifierCodec = injector.getInstance(KeyIdentifierCodec.class); keyLength = conf.getInt(Constants.Security.TOKEN_DIGEST_KEY_LENGTH); keyAlgo = conf.get(Constants.Security.TOKEN_DIGEST_ALGO); keyGenerator = KeyGenerator.getInstance(keyAlgo); keyGenerator.init(keyLength); }
@Test(expected = IllegalArgumentException.class) public void testDefaultExceedsMax() throws Exception { CConfiguration cConfiguration = CConfiguration.create(); cConfiguration.setInt(TxConstants.Manager.CFG_TX_TIMEOUT, cConfiguration.getInt(TxConstants.Manager.CFG_TX_MAX_TIMEOUT) + 5); run(cConfiguration); } }