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, instance.getConfiguration());
   
    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


      super(string);
    }
  }
 
  private HdfsZooInstance() {
    AccumuloConfiguration acuConf = ServerConfiguration.getSiteConfiguration();
    zooCache = new ZooCache(acuConf.get(Property.INSTANCE_ZK_HOST), (int) acuConf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT));
  }
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

 
  /**
   * @param args
   */
  public static void main(String[] args) throws Exception {
    AccumuloConfiguration config = ServerConfiguration.getSystemConfiguration(HdfsZooInstance.getInstance());
    Authenticator authenticator = AccumuloClassLoader.getClassLoader().loadClass(config.get(Property.INSTANCE_SECURITY_AUTHENTICATOR))
        .asSubclass(Authenticator.class).newInstance();
   
    List<Set<TokenProperty>> tokenProps = new ArrayList<Set<TokenProperty>>();
   
    for (Class<? extends AuthenticationToken> tokenType : authenticator.getSupportedTokenTypes()) {
View Full Code Here

   
  }
 
  public TraceServer(ServerConfiguration serverConfiguration, String hostname) throws Exception {
    this.serverConfiguration = serverConfiguration;
    AccumuloConfiguration conf = serverConfiguration.getConfiguration();
    table = conf.get(Property.TRACE_TABLE);
    while (true) {
      try {
        String principal = conf.get(Property.TRACE_USER);
        AuthenticationToken at;
        Map<String,String> loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX);
        if (loginMap.isEmpty()) {
          Property p = Property.TRACE_PASSWORD;
          at = new PasswordToken(conf.get(p).getBytes());
        } else {
          Properties props = new Properties();
          AuthenticationToken token = AccumuloClassLoader.getClassLoader().loadClass(conf.get(Property.TRACE_TOKEN_TYPE)).asSubclass(AuthenticationToken.class)
              .newInstance();

          int prefixLength = Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey().length() + 1;
          for (Entry<String,String> entry : loginMap.entrySet()) {
            props.put(entry.getKey().substring(prefixLength), entry.getValue());
          }

          token.init(props);
         
          at = token;
        }
       
        connector = serverConfiguration.getInstance().getConnector(principal, at);
        if (!connector.tableOperations().exists(table)) {
          connector.tableOperations().create(table);
        }
        connector.tableOperations().setProperty(table, Property.TABLE_FORMATTER_CLASS.getKey(), TraceFormatter.class.getName());
        break;
      } catch (Exception ex) {
        log.info("waiting to checking/create the trace table: " + ex);
        UtilWaitThread.sleep(1000);
      }
    }
   
    int port = conf.getPort(Property.TRACE_PORT);
    final ServerSocket sock = ServerSocketChannel.open().socket();
    sock.setReuseAddress(true);
    sock.bind(new InetSocketAddress(port));
    final TServerTransport transport = new TServerSocket(sock);
    TThreadPoolServer.Args options = new TThreadPoolServer.Args(transport);
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

    int count = 0;
    return count;
  }
 
  private Set<String> getSortedWALogs() throws IOException {
    AccumuloConfiguration conf = instance.getConfiguration();
    Path recoveryDir = new Path(Constants.getRecoveryDir(conf));
   
    Set<String> sortedWALogs = new HashSet<String>();

    if (fs.exists(recoveryDir)) {
View Full Code Here

    super(string, timeInMillis, SCHEME, (USER + ":" + secret).getBytes());
  }
 
  public static synchronized ZooReaderWriter getInstance() {
    if (instance == null) {
      AccumuloConfiguration conf = ServerConfiguration.getSiteConfiguration();
      instance = new ZooReaderWriter(conf.get(Property.INSTANCE_ZK_HOST), (int) conf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT),
          conf.get(Property.INSTANCE_SECRET));
    }
    return instance;
  }
View Full Code Here

        }
       
        recoveryNeeded = true;
        synchronized (this) {
          if (!closeTasksQueued.contains(filename) && !sortsQueued.contains(filename)) {
            AccumuloConfiguration aconf = master.getConfiguration().getConfiguration();
            LogCloser closer = Master.createInstanceFromPropertyName(aconf, Property.MASTER_WALOG_CLOSER_IMPLEMETATION, LogCloser.class,
                new HadoopLogCloser());
            Long delay = recoveryDelay.get(filename);
            if (delay == null) {
              delay = master.getSystemConfiguration().getTimeInMillis(Property.MASTER_RECOVERY_DELAY);
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.