Package org.apache.accumulo.server.conf

Examples of org.apache.accumulo.server.conf.ServerConfiguration


 
  public static void main(String[] args) {
    Opts opts = new Opts();
    opts.parseArgs(WrongTabletTest.class.getName(), args);
   
    ServerConfiguration conf = new ServerConfiguration(opts.getInstance());
    try {
      TabletClientService.Iface client = ThriftUtil.getTServerClient(opts.location, conf.getConfiguration());
     
      Mutation mutation = new Mutation(new Text("row_0003750001"));
      mutation.putDelete(new Text("colf"), new Text("colq"));
      client.update(Tracer.traceInfo(), CredentialHelper.create(opts.principal, opts.getToken(), opts.instance), new KeyExtent(new Text("!!"), null, new Text("row_0003750000")).toThrift(), mutation.toThrift());
    } catch (Exception e) {
View Full Code Here


 
  @Override
  public Map<String,String> getConfiguration(TInfo tinfo, TCredentials credentials, ConfigurationType type) throws TException {
    switch (type) {
      case CURRENT:
        return conf(credentials, new ServerConfiguration(instance).getConfiguration());
      case SITE:
        return conf(credentials, ServerConfiguration.getSiteConfiguration());
      case DEFAULT:
        return conf(credentials, AccumuloConfiguration.getDefaultConfiguration());
    }
View Full Code Here

  }
 
  @Override
  public Map<String,String> getTableConfiguration(TInfo tinfo, TCredentials credentials, String tableName) throws TException, ThriftTableOperationException {
    String tableId = checkTableId(tableName, null);
    return conf(credentials, new ServerConfiguration(instance).getTableConfiguration(tableId));
  }
View Full Code Here

      if (!security.hasSystemPermission(credentials, credentials.getPrincipal(), SystemPermission.SYSTEM))
        throw new AccumuloSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
      return transactionWatcher.run(Constants.BULK_ARBITRATOR_TYPE, tid, new Callable<List<String>>() {
        @Override
        public List<String> call() throws Exception {
          return BulkImporter.bulkLoad(new ServerConfiguration(instance).getConfiguration(), instance, credentials, tid, tableId, files, errorDir, setTime);
        }
      });
    } catch (AccumuloSecurityException e) {
      throw e.asThriftException();
    } catch (Exception ex) {
View Full Code Here

    ClassLoader loader = getClass().getClassLoader();
    Class shouldMatch;
    try {
      shouldMatch = loader.loadClass(interfaceMatch);
     
      new ServerConfiguration(instance).getTableConfiguration(tableId);
     
      String context = new ServerConfiguration(instance).getTableConfiguration(tableId).get(Property.TABLE_CLASSPATH);
     
      ClassLoader currentLoader;
     
      if (context != null && !context.equals("")) {
        currentLoader = AccumuloVFSClassLoader.getContextManager().getClassLoader(context);
View Full Code Here

 
  public static void main(String[] args) throws UnknownHostException, IOException {
    SecurityUtil.serverLogin();
   
    Instance instance = HdfsZooInstance.getInstance();
    ServerConfiguration serverConf = new ServerConfiguration(instance);
    final FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), serverConf.getConfiguration());
    Accumulo.init(fs, serverConf, "gc");
    String address = "localhost";
    SimpleGarbageCollector gc = new SimpleGarbageCollector();
    Opts opts = new Opts();
    opts.parseArgs(SimpleGarbageCollector.class.getName(), args);
   
    if (opts.safeMode)
      gc.setSafeMode();
    if (opts.offline)
      gc.setOffline();
    if (opts.verbose)
      gc.setVerbose();
    if (opts.address != null)
      gc.useAddress(address);
   
    gc.init(fs, instance, SecurityConstants.getSystemCredentials(), serverConf.getConfiguration().getBoolean(Property.GC_TRASH_IGNORE));
    Accumulo.enableTracing(address, "gc");
    gc.run();
  }
View Full Code Here

  }
 
  public static void main(String[] args) throws Exception {
    SecurityUtil.serverLogin();
    Instance instance = HdfsZooInstance.getInstance();
    ServerConfiguration conf = new ServerConfiguration(instance);
    FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), conf.getConfiguration());
    Accumulo.init(fs, conf, "tracer");
    String hostname = Accumulo.getLocalAddress(args);
    TraceServer server = new TraceServer(conf, hostname);
    Accumulo.enableTracing(hostname, "tserver");
    server.run();
View Full Code Here

    try {
      SecurityUtil.serverLogin();
      FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), ServerConfiguration.getSiteConfiguration());
      String hostname = Accumulo.getLocalAddress(args);
      Instance instance = HdfsZooInstance.getInstance();
      ServerConfiguration conf = new ServerConfiguration(instance);
      Accumulo.init(fs, conf, "tserver");
      ensureHdfsSyncIsEnabled(fs);
      recoverLocalWriteAheadLogs(fs, conf);
      TabletServer server = new TabletServer(conf, fs);
      server.config(hostname);
View Full Code Here

    SecurityUtil.serverLogin();
   
    FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), ServerConfiguration.getSiteConfiguration());
    String hostname = Accumulo.getLocalAddress(args);
    instance = HdfsZooInstance.getInstance();
    config = new ServerConfiguration(instance);
    Accumulo.init(fs, config, "monitor");
    Monitor monitor = new Monitor();
    Accumulo.enableTracing(hostname, "monitor");
    monitor.run(hostname);
  }
View Full Code Here

    final String columns[] = columnsTmp;
   
    final FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());

    Instance instance = opts.getInstance();
    final ServerConfiguration sconf = new ServerConfiguration(instance);
   
    String tableId = Tables.getNameToIdMap(instance).get(opts.tableName);
    if (tableId == null) {
      log.error("Unable to find table named " + opts.tableName);
      System.exit(-1);
    }
   
    Map<KeyExtent,String> locations = new HashMap<KeyExtent,String>();
    List<KeyExtent> candidates = findTablets(!opts.selectFarTablets, CredentialHelper.create(opts.principal, opts.getToken(), opts.instance), opts.tableName, instance, locations);
   
    if (candidates.size() < opts.numThreads) {
      System.err.println("ERROR : Unable to find " + opts.numThreads + " " + (opts.selectFarTablets ? "far" : "local") + " tablets");
      System.exit(-1);
    }
   
    List<KeyExtent> tabletsToTest = selectRandomTablets(opts.numThreads, candidates);
   
    Map<KeyExtent,List<String>> tabletFiles = new HashMap<KeyExtent,List<String>>();
   
    for (KeyExtent ke : tabletsToTest) {
      List<String> files = getTabletFiles(CredentialHelper.create(opts.principal, opts.getToken(), opts.instance), opts.getInstance(), tableId, ke);
      tabletFiles.put(ke, files);
    }
   
    System.out.println();
    System.out.println("run location      : " + InetAddress.getLocalHost().getHostName() + "/" + InetAddress.getLocalHost().getHostAddress());
    System.out.println("num threads       : " + opts.numThreads);
    System.out.println("table             : " + opts.tableName);
    System.out.println("table id          : " + tableId);
   
    for (KeyExtent ke : tabletsToTest) {
      System.out.println("\t *** Information about tablet " + ke.getUUID() + " *** ");
      System.out.println("\t\t# files in tablet : " + tabletFiles.get(ke).size());
      System.out.println("\t\ttablet location   : " + locations.get(ke));
      reportHdfsBlockLocations(tabletFiles.get(ke));
    }
   
    System.out.println("%n*** RUNNING TEST ***%n");
   
    ExecutorService threadPool = Executors.newFixedThreadPool(opts.numThreads);
   
    for (int i = 0; i < opts.iterations; i++) {
     
      ArrayList<Test> tests = new ArrayList<Test>();
     
      for (final KeyExtent ke : tabletsToTest) {
        final List<String> files = tabletFiles.get(ke);
        Test test = new Test(ke) {
          public int runTest() throws Exception {
            return readFiles(fs, sconf.getConfiguration(), files, ke, columns);
          }
         
        };
       
        tests.add(test);
View Full Code Here

TOP

Related Classes of org.apache.accumulo.server.conf.ServerConfiguration

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.