Package org.apache.accumulo.core.conf

Examples of org.apache.accumulo.core.conf.AccumuloConfiguration


 
  private SortedKeyValueIterator<Key,Value> createIterator(KeyExtent extent, List<String> absFiles) throws TableNotFoundException, AccumuloException,
      IOException {
   
    // TODO share code w/ tablet - ACCUMULO-1303
    AccumuloConfiguration acuTableConf = AccumuloConfiguration.getTableConfiguration(conn, tableId);
   
    Configuration conf = CachedConfiguration.getInstance();

    FileSystem fs = FileUtil.getFileSystem(conf, config);

    for (SortedKeyValueIterator<Key,Value> reader : readers) {
      ((FileSKVIterator) reader).close();
    }
   
    readers.clear();
   
    // TODO need to close files - ACCUMULO-1303
    for (String file : absFiles) {
      FileSKVIterator reader = FileOperations.getInstance().openReader(file, false, fs, conf, acuTableConf, null, null);
      readers.add(reader);
    }
   
    MultiIterator multiIter = new MultiIterator(readers, extent);
   
    OfflineIteratorEnvironment iterEnv = new OfflineIteratorEnvironment();
   
    DeletingIterator delIter = new DeletingIterator(multiIter, false);
   
    ColumnFamilySkippingIterator cfsi = new ColumnFamilySkippingIterator(delIter);
   
    ColumnQualifierFilter colFilter = new ColumnQualifierFilter(cfsi, new HashSet<Column>(options.fetchedColumns));
   
    byte[] defaultSecurityLabel;
   
    ColumnVisibility cv = new ColumnVisibility(acuTableConf.get(Property.TABLE_DEFAULT_SCANTIME_VISIBILITY));
    defaultSecurityLabel = cv.getExpression();
   
    VisibilityFilter visFilter = new VisibilityFilter(colFilter, authorizations, defaultSecurityLabel);
   
    return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, visFilter, extent, acuTableConf, options.serverSideIteratorList,
View Full Code Here


   * @throws TableNotFoundException
   *           if the table does not exist
   */
  @Override
  public Map<String,Set<Text>> getLocalityGroups(String tableName) throws AccumuloException, TableNotFoundException {
    AccumuloConfiguration conf = new ConfigurationCopy(this.getProperties(tableName));
    Map<String,Set<ByteSequence>> groups = LocalityGroupUtil.getLocalityGroups(conf);

    Map<String,Set<Text>> groups2 = new HashMap<String,Set<Text>>();
    for (Entry<String,Set<ByteSequence>> entry : groups.entrySet()) {

View Full Code Here

    if (cachedInstance != null)
      return cachedInstance;
    if (mock)
      return cachedInstance = new MockInstance(instance);
    if (siteFile != null) {
      AccumuloConfiguration config = new AccumuloConfiguration() {
        Configuration xml = new Configuration();
        {
          xml.addResource(new Path(siteFile));
        }
       
        @Override
        public Iterator<Entry<String,String>> iterator() {
          TreeMap<String,String> map = new TreeMap<String,String>();
          for (Entry<String,String> props : DefaultConfiguration.getInstance())
            map.put(props.getKey(), props.getValue());
          for (Entry<String,String> props : xml)
            map.put(props.getKey(), props.getValue());
          return map.entrySet().iterator();
        }
       
        @Override
        public String get(Property property) {
          String value = xml.get(property.getKey());
          if (value != null)
            return value;
          return DefaultConfiguration.getInstance().get(property);
        }
      };
      this.zookeepers = config.get(Property.INSTANCE_ZK_HOST);
      Path instanceDir = new Path(config.get(Property.INSTANCE_DFS_DIR), "instance_id");
      @SuppressWarnings("deprecation")
      String instanceIDFromFile = ZooKeeperInstance.getInstanceIDFromHdfs(instanceDir);
      return cachedInstance = new ZooKeeperInstance(UUID.fromString(instanceIDFromFile), zookeepers);
    }
    return cachedInstance = new ZooKeeperInstance(this.instance, this.zookeepers);
View Full Code Here

    return addEs(name, new ThreadPoolExecutor(min, max, timeout, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new NamingThreadFactory(name)));
  }
 
  public TabletServerResourceManager(Instance instance, FileSystem fs) {
    this.conf = new ServerConfiguration(instance);
    final AccumuloConfiguration acuConf = conf.getConfiguration();
   
    long maxMemory = acuConf.getMemoryInBytes(Property.TSERV_MAXMEM);
    boolean usingNativeMap = acuConf.getBoolean(Property.TSERV_NATIVEMAP_ENABLED) && NativeMap.loadedNativeLibraries();
   
    long blockSize = acuConf.getMemoryInBytes(Property.TSERV_DEFAULT_BLOCKSIZE);
    long dCacheSize = acuConf.getMemoryInBytes(Property.TSERV_DATACACHE_SIZE);
    long iCacheSize = acuConf.getMemoryInBytes(Property.TSERV_INDEXCACHE_SIZE);
   
    _iCache = new LruBlockCache(iCacheSize, blockSize);
    _dCache = new LruBlockCache(dCacheSize, blockSize);
   
    Runtime runtime = Runtime.getRuntime();
    if (!usingNativeMap && maxMemory + dCacheSize + iCacheSize > runtime.maxMemory()) {
      throw new IllegalArgumentException(String.format(
          "Maximum tablet server map memory %,d and block cache sizes %,d is too large for this JVM configuration %,d", maxMemory, dCacheSize + iCacheSize,
          runtime.maxMemory()));
    }
    runtime.gc();

    // totalMemory - freeMemory = memory in use
    // maxMemory - memory in use = max available memory
    if (!usingNativeMap && maxMemory > runtime.maxMemory() - (runtime.totalMemory() - runtime.freeMemory())) {
      log.warn("In-memory map may not fit into local memory space.");
    }
   
    minorCompactionThreadPool = createEs(Property.TSERV_MINC_MAXCONCURRENT, "minor compactor");
   
    // make this thread pool have a priority queue... and execute tablets with the most
    // files first!
    majorCompactionThreadPool = createEs(Property.TSERV_MAJC_MAXCONCURRENT, "major compactor", new CompactionQueue());
    rootMajorCompactionThreadPool = createEs(0, 1, 300, "md root major compactor");
    defaultMajorCompactionThreadPool = createEs(0, 1, 300, "md major compactor");
   
    splitThreadPool = createEs(1, "splitter");
    defaultSplitThreadPool = createEs(0, 1, 60, "md splitter");
   
    defaultMigrationPool = createEs(0, 1, 60, "metadata tablet migration");
    migrationPool = createEs(Property.TSERV_MIGRATE_MAXCONCURRENT, "tablet migration");
   
    // not sure if concurrent assignments can run safely... even if they could there is probably no benefit at startup because
    // individual tablet servers are already running assignments concurrently... having each individual tablet server run
    // concurrent assignments would put more load on the metadata table at startup
    assignmentPool = createEs(1, "tablet assignment");
   
    assignMetaDataPool = createEs(0, 1, 60, "metadata tablet assignment");
   
    readAheadThreadPool = createEs(Property.TSERV_READ_AHEAD_MAXCONCURRENT, "tablet read ahead");
    defaultReadAheadThreadPool = createEs(Property.TSERV_METADATA_READ_AHEAD_MAXCONCURRENT, "metadata tablets read ahead");
   
    tabletResources = new HashSet<TabletResourceManager>();
   
    int maxOpenFiles = acuConf.getCount(Property.TSERV_SCAN_MAX_OPENFILES);
   
    fileManager = new FileManager(conf, fs, maxOpenFiles, _dCache, _iCache);
   
    try {
      Class<? extends MemoryManager> clazz = AccumuloVFSClassLoader.loadClass(acuConf.get(Property.TSERV_MEM_MGMT), MemoryManager.class);
      memoryManager = clazz.newInstance();
      memoryManager.init(conf);
      log.debug("Loaded memory manager : " + memoryManager.getClass().getName());
    } catch (Exception e) {
      log.error("Failed to find memory manger in config, using default", e);
View Full Code Here

      // If the Master has not yet signaled a finish to upgrading, we need to make sure we can rollback in the
      // event of outstanding transactions in Fate from the previous version.
      Accumulo.abortIfFateTransactions();
    }
    FileSystem localfs = FileSystem.getLocal(fs.getConf()).getRawFileSystem();
    AccumuloConfiguration conf = serverConf.getConfiguration();
    String localWalDirectories = conf.get(Property.LOGGER_DIR);
    for (String localWalDirectory : localWalDirectories.split(",")) {
      if (!localWalDirectory.startsWith("/")) {
        localWalDirectory = System.getenv("ACCUMULO_HOME") + "/" + localWalDirectory;
      }
     
View Full Code Here

  }
 
  private final AtomicInteger logIdGenerator = new AtomicInteger();
 
  public int createLogId(KeyExtent tablet) {
    AccumuloConfiguration acuTableConf = getTableConfiguration(tablet);
    if (acuTableConf.getBoolean(Property.TABLE_WALOG_ENABLED)) {
      return logIdGenerator.incrementAndGet();
    }
    return -1;
  }
View Full Code Here

    this.serverConfig = config;
    this.instance = config.getInstance();
    this.fs = TraceFileSystem.wrap(fs);
    this.hostname = hostname;
   
    AccumuloConfiguration aconf = serverConfig.getConfiguration();
   
    log.info("Version " + Constants.VERSION);
    log.info("Instance " + instance.getInstanceID());
    ThriftTransportPool.getInstance().setIdleTime(aconf.getTimeInMillis(Property.GENERAL_RPC_TIMEOUT));
    security = AuditedSecurityOperation.getInstance();
    tserverSet = new LiveTServerSet(instance, config.getConfiguration(), this);
    this.tabletBalancer = createInstanceFromPropertyName(aconf, Property.MASTER_TABLET_BALANCER, TabletBalancer.class, new DefaultLoadBalancer());
    this.tabletBalancer.init(serverConfig);
  }
View Full Code Here

    File importDir = folder.newFolder("import");
    String even = new File(importDir, "even.rf").toString();
    String odd = new File(importDir, "odd.rf").toString();
    File errorsDir = folder.newFolder("errors");
    fs.mkdirs(new Path(errorsDir.toString()));
    AccumuloConfiguration aconf = AccumuloConfiguration.getDefaultConfiguration();
    FileSKVWriter evenWriter = FileOperations.getInstance().openWriter(even, fs, conf, aconf);
    evenWriter.startDefaultLocalityGroup();
    FileSKVWriter oddWriter = FileOperations.getInstance().openWriter(odd, fs, conf, aconf);
    oddWriter.startDefaultLocalityGroup();
    long ts = System.currentTimeMillis();
View Full Code Here

      return true;
    }
  }

  private int removeFiles(Map<String,ArrayList<String>> serverToFileMap, Set<String> sortedWALogs, final GCStatus status) {
    AccumuloConfiguration conf = instance.getConfiguration();
    for (Entry<String,ArrayList<String>> entry : serverToFileMap.entrySet()) {
      if (entry.getKey().length() == 0) {
        // old-style log entry, just remove it
        for (String filename : entry.getValue()) {
          log.debug("Removing old-style WAL " + entry.getValue());
View Full Code Here

    }
    return count;
  }
 
  private int scanServers(Map<String,String> fileToServerMap) throws Exception {
    AccumuloConfiguration conf = instance.getConfiguration();
    Path walRoot = new Path(Constants.getWalDirectory(conf));
    for (FileStatus status : fs.listStatus(walRoot)) {
      String name = status.getPath().getName();
      if (status.isDir()) {
        for (FileStatus file : fs.listStatus(new Path(walRoot, name))) {
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.conf.AccumuloConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.