Package org.apache.accumulo.core.conf

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


    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


    }
    try {
      FileOperations fileOperations = FileOperations.getInstance();
      Configuration conf = new Configuration();
      FileSystem fs = FileSystem.getLocal(conf);
      AccumuloConfiguration acuconf = AccumuloConfiguration.getDefaultConfiguration();
      writer = fileOperations.openWriter(filename, fs, conf, acuconf);
      writer.close();
    } catch (Exception ex) {
      caughtException = true;
    } finally {
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);
    Connector connector = null;
    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(Constants.UTF8));
        } 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);
          IteratorSetting setting = new IteratorSetting(10, "ageoff", AgeOffFilter.class.getName());
          AgeOffFilter.setTTL(setting, 7 * 24 * 60 * 60 * 1000l);
          connector.tableOperations().attachIterator(table, setting);
        }
        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);
      }
    }
    this.connector = connector;
    // make sure we refer to the final variable from now on.
    connector = null;
   
    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

  }
 
  @Override
  public void run() throws Exception {
    Configuration conf = new Configuration();
    AccumuloConfiguration aconf = ServerConfiguration.getDefaultConfiguration();
    FileSystem fs = TraceFileSystem.wrap(FileUtil.getFileSystem(conf, aconf));
   
    String dir = "/tmp/bulk_test_diff_files_89723987592";
   
    fs.delete(new Path(dir), true);
View Full Code Here

    int randomMax = 4;
    // Number of threads
    int numThreads = 2;
    // Number of iterations per thread
    int iterations = 100000;
    AccumuloConfiguration tableConf = new TableConfiguration(inst.getInstanceID(), inst, table, defaultConf);
   
    long start = System.currentTimeMillis();
    ExecutorService svc = Executors.newFixedThreadPool(numThreads);
    CountDownLatch countDown = new CountDownLatch(numThreads);
    ArrayList<Future<Exception>> futures = new ArrayList<Future<Exception>>(numThreads);
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

  /**
   * 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() {
    @SuppressWarnings("deprecation")
    AccumuloConfiguration acuConf = AccumuloConfiguration.getSiteConfiguration();
    String keyTab = acuConf.get(Property.GENERAL_KERBEROS_KEYTAB);
    if (keyTab == null || keyTab.length() == 0)
      return;
    if (keyTab.contains("$" + ACCUMULO_HOME) && System.getenv(ACCUMULO_HOME) != null)
      keyTab = keyTab.replace("$" + ACCUMULO_HOME, System.getenv(ACCUMULO_HOME));
   
    if (keyTab.contains("$" + ACCUMULO_CONF_DIR) && System.getenv(ACCUMULO_CONF_DIR) != null)
      keyTab = keyTab.replace("$" + ACCUMULO_CONF_DIR, System.getenv(ACCUMULO_CONF_DIR));
   
    String principalConfig = acuConf.get(Property.GENERAL_KERBEROS_PRINCIPAL);
    if (principalConfig == null || principalConfig.length() == 0)
      return;
   
    if (login(principalConfig, keyTab)) {
      try {
View Full Code Here

   */
  private SortedKeyValueIterator<Key,Value> createIterator(KeyExtent extent, List<String> absFiles) throws TableNotFoundException, AccumuloException,
      IOException {

    // TODO share code w/ tablet
    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
    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

   *           if a general error occurs
   * @throws TableNotFoundException
   *           if the table does not exist
   */
  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

   
    CompactionStats majCStats = new CompactionStats();
   
    try {
      FileOperations fileFactory = FileOperations.getInstance();
      AccumuloConfiguration tableConf = ServerConfiguration.getTableConfiguration(extent.getTableId().toString());
      mfw = fileFactory.openWriter(outputFile, fs, conf, tableConf);
     
      Map<String,Set<ByteSequence>> lGroups;
      try {
        lGroups = LocalityGroupUtil.getLocalityGroups(tableConf);
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.