Package org.apache.accumulo.core.conf

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


  }

  @Test
  public void testGetProperties_ParentFilter() {
    Map<String,String> props = new java.util.HashMap<String,String>();
    AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
    PropertyFilter filter = createMock(PropertyFilter.class);
    PropertyFilter parentFilter = createMock(PropertyFilter.class);
    parent.getProperties(props, parentFilter);
    replay(parent);
    expect(zc.getChildren(PATH)).andReturn(null);
    replay(zc);

    a.getProperties(props, PATH, filter, parent, parentFilter);
View Full Code Here


    return instance.getConfiguration();
  }
 
  public static AccumuloConfiguration convertClientConfig(final AccumuloConfiguration base, final Configuration config) {

    return new AccumuloConfiguration() {
      @Override
      public String get(Property property) {
        final String key = property.getKey();

        // Attempt to load sensitive properties from a CredentialProvider, if configured
View Full Code Here

 
  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();

    for (SortedKeyValueIterator<Key,Value> reader : readers) {
      ((FileSKVIterator) reader).close();
    }
   
    readers.clear();
   
    // TODO need to close files - ACCUMULO-1303
    for (String file : absFiles) {
      FileSystem fs = VolumeConfiguration.getVolume(file, conf, config).getFileSystem();
      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

    final VolumeManager fs = VolumeManagerImpl.get();
    Accumulo.init(fs, conf, "gc");
    Opts opts = new Opts();
    opts.parseArgs("gc", args);
    SimpleGarbageCollector gc = new SimpleGarbageCollector(opts);
    AccumuloConfiguration config = conf.getConfiguration();

    gc.init(fs, instance, SystemCredentials.get(), config);
    Accumulo.enableTracing(opts.getAddress(), "gc");
    gc.run();
  }
View Full Code Here

*
*/
public class LoginProperties {
 
  public static void main(String[] args) throws Exception {
    AccumuloConfiguration config = ServerConfiguration.getSystemConfiguration(HdfsZooInstance.getInstance());
    Authenticator authenticator = AccumuloVFSClassLoader.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

   * @return reader/writer
   */
  public IZooReaderWriter getInstance() {
    synchronized (ZooReaderWriterFactory.class) {
      if (instance == null) {
        AccumuloConfiguration conf = ServerConfiguration.getSiteConfiguration();
        instance = getZooReaderWriter(conf.get(Property.INSTANCE_ZK_HOST), (int) conf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT),
            conf.get(Property.INSTANCE_SECRET));
      }
      return instance;
    }
  }
View Full Code Here

      return true;
    }
  }
 
  private int removeFiles(Map<String,Path> nameToFileMap, Map<String,ArrayList<Path>> serverToFileMap, Map<String, Path> sortedWALogs, final GCStatus status) {
    AccumuloConfiguration conf = ServerConfiguration.getSystemConfiguration(instance);
    for (Entry<String,ArrayList<Path>> entry : serverToFileMap.entrySet()) {
      if (entry.getKey().isEmpty()) {
        // old-style log entry, just remove it
        for (Path path : entry.getValue()) {
          log.debug("Removing old-style WAL " + path);
View Full Code Here

  }

  @Override
  public String get(Property property) {
    String key = property.getKey();
    AccumuloConfiguration getParent;
    if (!(namespaceId.equals(Namespaces.ACCUMULO_NAMESPACE_ID) && isIteratorOrConstraint(key))) {
      getParent = parent;
    } else {
      // ignore iterators from parent if system namespace
      getParent = null;
View Full Code Here

    assertSame(opts, gc.getOpts());
    assertNotNull(gc.getStatus(createMock(TInfo.class), createMock(TCredentials.class)));
  }

  private AccumuloConfiguration mockSystemConfig() {
    AccumuloConfiguration systemConfig = createMock(AccumuloConfiguration.class);
    expect(systemConfig.getTimeInMillis(Property.GC_CYCLE_START)).andReturn(1000L);
    expect(systemConfig.getTimeInMillis(Property.GC_CYCLE_DELAY)).andReturn(20000L);
    expect(systemConfig.getCount(Property.GC_DELETE_THREADS)).andReturn(2).times(2);
    expect(systemConfig.getBoolean(Property.GC_TRASH_IGNORE)).andReturn(false);
    replay(systemConfig);
    return systemConfig;
  }
View Full Code Here

    verify(volMgr);
  }

  @Test
  public void testMoveToTrash_NotUsingTrash() throws Exception {
    AccumuloConfiguration systemConfig = createMock(AccumuloConfiguration.class);
    expect(systemConfig.getTimeInMillis(Property.GC_CYCLE_START)).andReturn(1000L);
    expect(systemConfig.getTimeInMillis(Property.GC_CYCLE_DELAY)).andReturn(20000L);
    expect(systemConfig.getCount(Property.GC_DELETE_THREADS)).andReturn(2);
    expect(systemConfig.getBoolean(Property.GC_TRASH_IGNORE)).andReturn(true);
    replay(systemConfig);
    gc.init(volMgr, instance, credentials, systemConfig);
    Path path = createMock(Path.class);
    assertFalse(gc.moveToTrash(path));
  }
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.